From 8c7a72a5e9eecf446592da521352558fa7629330 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Mar 2026 21:20:53 +0000 Subject: [PATCH 1/2] feat: publish client batch config schema feat: publish new error reasons docs: fix documentation formatting docs: update various comments docs: update license year PiperOrigin-RevId: 889289393 Source-Link: https://github.com/googleapis/googleapis/commit/94bc991b3f1df58bc841801631715894a7ac5e28 Source-Link: https://github.com/googleapis/googleapis-gen/commit/db7143a338a7c75839b4698cb3ea6f1013b4c3c7 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlcnZpY2VfY29udHJvbC12MS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlcnZpY2VfZGlyZWN0b3J5LXYxLy5Pd2xCb3QueWFtbCIsImgiOiJkYjcxNDNhMzM4YTdjNzU4MzliNDY5OGNiM2VhNmYxMDEzYjRjM2M3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlcnZpY2VfZGlyZWN0b3J5LXYxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlcnZpY2VfaGVhbHRoLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJkYjcxNDNhMzM4YTdjNzU4MzliNDY5OGNiM2VhNmYxMDEzYjRjM2M3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlcnZpY2VfbWFuYWdlbWVudC12MS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlcnZpY2VfdXNhZ2UtdjEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNoZWxsLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJkYjcxNDNhMzM4YTdjNzU4MzliNDY5OGNiM2VhNmYxMDEzYjRjM2M3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNwYW5uZXItYWRtaW4tZGF0YWJhc2UtdjEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNwYW5uZXItYWRtaW4taW5zdGFuY2UtdjEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNwYW5uZXItdjEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNwZWVjaC12MS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNwZWVjaC12MXAxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNwZWVjaC12Mi8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXN0b3JhZ2UtY29udHJvbC12Mi8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXN0b3JhZ2VfYmF0Y2hfb3BlcmF0aW9ucy12MS8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXN0b3JhZ2VfaW5zaWdodHMtdjEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXN0b3JhZ2VfdHJhbnNmZXItdjEvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXN1cHBvcnQtdjIvLk93bEJvdC55YW1sIiwiaCI6ImRiNzE0M2EzMzhhN2M3NTgzOWI0Njk4Y2IzZWE2ZjEwMTNiNGMzYzcifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXN1cHBvcnQtdjJiZXRhLy5Pd2xCb3QueWFtbCIsImgiOiJkYjcxNDNhMzM4YTdjNzU4MzliNDY5OGNiM2VhNmYxMDEzYjRjM2M3In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhbGVudC12NC8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 --- .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-service_control-v1/.toys.rb | 28 + .../google-cloud-service_control-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-service_control-v1/Gemfile | 14 + .../LICENSE.md | 201 + .../google-cloud-service_control-v1/README.md | 154 + .../google-cloud-service_control-v1/Rakefile | 169 + .../gapic_metadata.json | 42 + .../google-cloud-service_control-v1.gemspec | 28 + .../lib/google-cloud-service_control-v1.rb | 21 + .../api/servicecontrol/v1/check_error_pb.rb | 24 + .../api/servicecontrol/v1/distribution_pb.rb | 26 + .../api/servicecontrol/v1/http_request_pb.rb | 23 + .../api/servicecontrol/v1/log_entry_pb.rb | 29 + .../api/servicecontrol/v1/metric_value_pb.rb | 25 + .../api/servicecontrol/v1/operation_pb.rb | 27 + .../servicecontrol/v1/quota_controller_pb.rb | 31 + .../v1/quota_controller_services_pb.rb | 58 + .../v1/service_controller_pb.rb | 34 + .../v1/service_controller_services_pb.rb | 80 + .../lib/google/cloud/service_control/v1.rb | 46 + .../service_control/v1/quota_controller.rb | 57 + .../v1/quota_controller/client.rb | 494 +++ .../v1/quota_controller/credentials.rb | 52 + .../v1/quota_controller/rest.rb | 54 + .../v1/quota_controller/rest/client.rb | 444 ++ .../v1/quota_controller/rest/service_stub.rb | 143 + .../google/cloud/service_control/v1/rest.rb | 38 + .../service_control/v1/service_controller.rb | 57 + .../v1/service_controller/client.rb | 640 +++ .../v1/service_controller/credentials.rb | 52 + .../v1/service_controller/rest.rb | 54 + .../v1/service_controller/rest/client.rb | 583 +++ .../service_controller/rest/service_stub.rb | 205 + .../cloud/service_control/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/distribution.rb | 233 ++ .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../api/servicecontrol/v1/check_error.rb | 125 + .../api/servicecontrol/v1/distribution.rb | 157 + .../api/servicecontrol/v1/http_request.rb | 95 + .../google/api/servicecontrol/v1/log_entry.rb | 142 + .../api/servicecontrol/v1/metric_value.rb | 98 + .../google/api/servicecontrol/v1/operation.rb | 130 + .../api/servicecontrol/v1/quota_controller.rb | 232 ++ .../servicecontrol/v1/service_controller.rb | 217 + .../google/logging/type/log_severity.rb | 71 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + .../quota_controller/allocate_quota.rb | 47 + .../snippets/service_controller/check.rb | 47 + .../snippets/service_controller/report.rb | 47 + ...metadata_google.api.servicecontrol.v1.json | 135 + .../v1/quota_controller_rest_test.rb | 155 + .../v1/quota_controller_test.rb | 166 + .../v1/service_controller_rest_test.rb | 211 + .../v1/service_controller_test.rb | 228 + .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-service_directory-v1/Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 122 + .../google-cloud-service_directory-v1.gemspec | 30 + .../lib/google-cloud-service_directory-v1.rb | 21 + .../lib/google/cloud/service_directory/v1.rb | 46 + .../service_directory/v1/bindings_override.rb | 75 + .../service_directory/v1/lookup_service.rb | 55 + .../v1/lookup_service/client.rb | 538 +++ .../v1/lookup_service/credentials.rb | 51 + .../v1/lookup_service/paths.rb | 54 + .../v1/lookup_service/rest.rb | 53 + .../v1/lookup_service/rest/client.rb | 496 +++ .../v1/lookup_service/rest/service_stub.rb | 143 + .../v1/registration_service.rb | 69 + .../v1/registration_service/client.rb | 2297 +++++++++++ .../v1/registration_service/credentials.rb | 51 + .../v1/registration_service/paths.rb | 130 + .../v1/registration_service/rest.rb | 67 + .../v1/registration_service/rest/client.rb | 2136 ++++++++++ .../registration_service/rest/service_stub.rb | 1212 ++++++ .../google/cloud/service_directory/v1/rest.rb | 39 + .../cloud/service_directory/v1/version.rb | 28 + .../cloud/servicedirectory/v1/endpoint_pb.rb | 24 + .../servicedirectory/v1/lookup_service_pb.rb | 28 + .../v1/lookup_service_services_pb.rb | 47 + .../cloud/servicedirectory/v1/namespace_pb.rb | 24 + .../v1/registration_service_pb.rb | 50 + .../v1/registration_service_services_pb.rb | 95 + .../cloud/servicedirectory/v1/service_pb.rb | 25 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/servicedirectory/v1/endpoint.rb | 97 + .../servicedirectory/v1/lookup_service.rb | 89 + .../cloud/servicedirectory/v1/namespace.rb | 56 + .../v1/registration_service.rb | 425 ++ .../cloud/servicedirectory/v1/service.rb | 80 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 ++ .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../lookup_service/resolve_service.rb | 47 + .../registration_service/create_endpoint.rb | 47 + .../registration_service/create_namespace.rb | 47 + .../registration_service/create_service.rb | 47 + .../registration_service/delete_endpoint.rb | 47 + .../registration_service/delete_namespace.rb | 47 + .../registration_service/delete_service.rb | 47 + .../registration_service/get_endpoint.rb | 47 + .../registration_service/get_iam_policy.rb | 47 + .../registration_service/get_namespace.rb | 47 + .../registration_service/get_service.rb | 47 + .../registration_service/list_endpoints.rb | 51 + .../registration_service/list_namespaces.rb | 51 + .../registration_service/list_services.rb | 51 + .../registration_service/set_iam_policy.rb | 47 + .../test_iam_permissions.rb | 47 + .../registration_service/update_endpoint.rb | 47 + .../registration_service/update_namespace.rb | 47 + .../registration_service/update_service.rb | 47 + ...data_google.cloud.servicedirectory.v1.json | 775 ++++ .../v1/lookup_service_paths_test.rb | 55 + .../v1/lookup_service_rest_test.rb | 155 + .../v1/lookup_service_test.rb | 166 + .../v1/registration_service_paths_test.rb | 103 + .../v1/registration_service_rest_test.rb | 1096 +++++ .../v1/registration_service_test.rb | 1213 ++++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 122 + ...le-cloud-service_directory-v1beta1.gemspec | 30 + .../google-cloud-service_directory-v1beta1.rb | 21 + .../google/cloud/service_directory/v1beta1.rb | 46 + .../v1beta1/bindings_override.rb | 75 + .../v1beta1/lookup_service.rb | 55 + .../v1beta1/lookup_service/client.rb | 538 +++ .../v1beta1/lookup_service/credentials.rb | 51 + .../v1beta1/lookup_service/paths.rb | 54 + .../v1beta1/lookup_service/rest.rb | 53 + .../v1beta1/lookup_service/rest/client.rb | 496 +++ .../lookup_service/rest/service_stub.rb | 143 + .../v1beta1/registration_service.rb | 69 + .../v1beta1/registration_service/client.rb | 2305 +++++++++++ .../registration_service/credentials.rb | 51 + .../v1beta1/registration_service/paths.rb | 130 + .../v1beta1/registration_service/rest.rb | 67 + .../registration_service/rest/client.rb | 2144 ++++++++++ .../registration_service/rest/service_stub.rb | 1236 ++++++ .../cloud/service_directory/v1beta1/rest.rb | 39 + .../service_directory/v1beta1/version.rb | 28 + .../servicedirectory/v1beta1/endpoint_pb.rb | 25 + .../v1beta1/lookup_service_pb.rb | 28 + .../v1beta1/lookup_service_services_pb.rb | 47 + .../servicedirectory/v1beta1/namespace_pb.rb | 25 + .../v1beta1/registration_service_pb.rb | 50 + .../registration_service_services_pb.rb | 96 + .../servicedirectory/v1beta1/service_pb.rb | 26 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../servicedirectory/v1beta1/endpoint.rb | 103 + .../v1beta1/lookup_service.rb | 89 + .../servicedirectory/v1beta1/namespace.rb | 62 + .../v1beta1/registration_service.rb | 432 ++ .../cloud/servicedirectory/v1beta1/service.rb | 88 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 ++ .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../lookup_service/resolve_service.rb | 47 + .../registration_service/create_endpoint.rb | 47 + .../registration_service/create_namespace.rb | 47 + .../registration_service/create_service.rb | 47 + .../registration_service/delete_endpoint.rb | 47 + .../registration_service/delete_namespace.rb | 47 + .../registration_service/delete_service.rb | 47 + .../registration_service/get_endpoint.rb | 47 + .../registration_service/get_iam_policy.rb | 47 + .../registration_service/get_namespace.rb | 47 + .../registration_service/get_service.rb | 47 + .../registration_service/list_endpoints.rb | 51 + .../registration_service/list_namespaces.rb | 51 + .../registration_service/list_services.rb | 51 + .../registration_service/set_iam_policy.rb | 47 + .../test_iam_permissions.rb | 47 + .../registration_service/update_endpoint.rb | 47 + .../registration_service/update_namespace.rb | 47 + .../registration_service/update_service.rb | 47 + ...google.cloud.servicedirectory.v1beta1.json | 775 ++++ .../v1beta1/lookup_service_paths_test.rb | 55 + .../v1beta1/lookup_service_rest_test.rb | 155 + .../v1beta1/lookup_service_test.rb | 166 + .../registration_service_paths_test.rb | 103 + .../v1beta1/registration_service_rest_test.rb | 1096 +++++ .../v1beta1/registration_service_test.rb | 1213 ++++++ .../test/helper.rb | 26 + .../google-cloud-service_health-v1/.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-service_health-v1/.toys.rb | 28 + .../google-cloud-service_health-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-service_health-v1/Gemfile | 14 + .../google-cloud-service_health-v1/LICENSE.md | 201 + .../google-cloud-service_health-v1/README.md | 154 + .../google-cloud-service_health-v1/Rakefile | 169 + .../gapic_metadata.json | 48 + .../google-cloud-service_health-v1.gemspec | 29 + .../lib/google-cloud-service_health-v1.rb | 21 + .../lib/google/cloud/service_health/v1.rb | 45 + .../service_health/v1/bindings_override.rb | 75 + .../google/cloud/service_health/v1/rest.rb | 38 + .../cloud/service_health/v1/service_health.rb | 55 + .../v1/service_health/client.rb | 1142 +++++ .../v1/service_health/credentials.rb | 47 + .../service_health/v1/service_health/paths.rb | 124 + .../service_health/v1/service_health/rest.rb | 53 + .../v1/service_health/rest/client.rb | 1065 +++++ .../v1/service_health/rest/service_stub.rb | 447 ++ .../google/cloud/service_health/v1/version.rb | 28 + .../servicehealth/v1/event_resources_pb.rb | 52 + .../servicehealth/v1/event_service_pb.rb | 24 + .../v1/event_service_services_pb.rb | 58 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/servicehealth/v1/event_resources.rb | 718 ++++ .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../snippets/Gemfile | 32 + .../snippets/service_health/get_event.rb | 47 + .../service_health/get_organization_event.rb | 47 + .../service_health/get_organization_impact.rb | 47 + .../snippets/service_health/list_events.rb | 51 + .../list_organization_events.rb | 51 + .../list_organization_impacts.rb | 51 + ...etadata_google.cloud.servicehealth.v1.json | 255 ++ .../v1/service_health_paths_test.rb | 103 + .../v1/service_health_rest_test.rb | 434 ++ .../service_health/v1/service_health_test.rb | 489 +++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 153 + .../Rakefile | 169 + .../gapic_metadata.json | 83 + ...google-cloud-service_management-v1.gemspec | 29 + .../lib/google-cloud-service_management-v1.rb | 21 + .../api/servicemanagement/v1/resources_pb.rb | 39 + .../servicemanagement/v1/servicemanager_pb.rb | 50 + .../v1/servicemanager_services_pb.rb | 143 + .../lib/google/cloud/service_management/v1.rb | 45 + .../v1/bindings_override.rb | 110 + .../cloud/service_management/v1/rest.rb | 38 + .../service_management/v1/service_manager.rb | 56 + .../v1/service_manager/client.rb | 1809 ++++++++ .../v1/service_manager/credentials.rb | 54 + .../v1/service_manager/operations.rb | 833 ++++ .../v1/service_manager/rest.rb | 54 + .../v1/service_manager/rest/client.rb | 1701 ++++++++ .../v1/service_manager/rest/operations.rb | 923 +++++ .../v1/service_manager/rest/service_stub.rb | 882 ++++ .../cloud/service_management/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/auth.rb | 259 ++ .../proto_docs/google/api/backend.rb | 199 + .../proto_docs/google/api/billing.rb | 82 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/config_change.rb | 89 + .../proto_docs/google/api/context.rb | 97 + .../proto_docs/google/api/control.rb | 41 + .../proto_docs/google/api/documentation.rb | 176 + .../proto_docs/google/api/endpoint.rb | 71 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/label.rb | 49 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/log.rb | 54 + .../proto_docs/google/api/logging.rb | 86 + .../proto_docs/google/api/metric.rb | 299 ++ .../google/api/monitored_resource.rb | 150 + .../proto_docs/google/api/monitoring.rb | 112 + .../proto_docs/google/api/policy.rb | 75 + .../proto_docs/google/api/quota.rb | 208 + .../proto_docs/google/api/resource.rb | 227 + .../proto_docs/google/api/service.rb | 170 + .../api/servicemanagement/v1/resources.rb | 332 ++ .../servicemanagement/v1/servicemanager.rb | 334 ++ .../proto_docs/google/api/source_info.rb | 31 + .../proto_docs/google/api/system_parameter.rb | 104 + .../proto_docs/google/api/usage.rb | 81 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/api.rb | 194 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../google/protobuf/source_context.rb | 33 + .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/type.rb | 232 ++ .../proto_docs/google/protobuf/wrappers.rb | 148 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../service_manager/create_service.rb | 54 + .../service_manager/create_service_config.rb | 47 + .../service_manager/create_service_rollout.rb | 54 + .../service_manager/delete_service.rb | 54 + .../service_manager/generate_config_report.rb | 47 + .../snippets/service_manager/get_service.rb | 47 + .../service_manager/get_service_config.rb | 47 + .../service_manager/get_service_rollout.rb | 47 + .../service_manager/list_service_configs.rb | 51 + .../service_manager/list_service_rollouts.rb | 51 + .../snippets/service_manager/list_services.rb | 51 + .../service_manager/submit_config_source.rb | 54 + .../service_manager/undelete_service.rb | 54 + ...adata_google.api.servicemanagement.v1.json | 535 +++ .../v1/service_manager_operations_test.rb | 400 ++ .../v1/service_manager_rest_test.rb | 817 ++++ .../v1/service_manager_test.rb | 944 +++++ .../test/helper.rb | 26 + .../google-cloud-service_usage-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-service_usage-v1/.toys.rb | 28 + .../google-cloud-service_usage-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-service_usage-v1/Gemfile | 14 + .../google-cloud-service_usage-v1/LICENSE.md | 201 + .../google-cloud-service_usage-v1/README.md | 154 + .../google-cloud-service_usage-v1/Rakefile | 169 + .../gapic_metadata.json | 48 + .../google-cloud-service_usage-v1.gemspec | 28 + .../lib/google-cloud-service_usage-v1.rb | 21 + .../api/serviceusage/v1/resources_pb.rb | 34 + .../api/serviceusage/v1/serviceusage_pb.rb | 38 + .../v1/serviceusage_services_pb.rb | 80 + .../lib/google/cloud/service_usage/v1.rb | 45 + .../lib/google/cloud/service_usage/v1/rest.rb | 37 + .../cloud/service_usage/v1/service_usage.rb | 59 + .../service_usage/v1/service_usage/client.rb | 1075 +++++ .../v1/service_usage/credentials.rb | 53 + .../v1/service_usage/operations.rb | 833 ++++ .../service_usage/v1/service_usage/rest.rb | 56 + .../v1/service_usage/rest/client.rb | 990 +++++ .../v1/service_usage/rest/operations.rb | 923 +++++ .../v1/service_usage/rest/service_stub.rb | 450 ++ .../google/cloud/service_usage/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/auth.rb | 259 ++ .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/documentation.rb | 176 + .../proto_docs/google/api/endpoint.rb | 71 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/label.rb | 49 + .../proto_docs/google/api/launch_stage.rb | 71 + .../google/api/monitored_resource.rb | 150 + .../proto_docs/google/api/monitoring.rb | 112 + .../proto_docs/google/api/quota.rb | 208 + .../proto_docs/google/api/resource.rb | 227 + .../google/api/serviceusage/v1/resources.rb | 123 + .../api/serviceusage/v1/serviceusage.rb | 242 ++ .../proto_docs/google/api/usage.rb | 81 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/api.rb | 194 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../google/protobuf/source_context.rb | 33 + .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/type.rb | 232 ++ .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + .../service_usage/batch_enable_services.rb | 54 + .../service_usage/batch_get_services.rb | 47 + .../snippets/service_usage/disable_service.rb | 54 + .../snippets/service_usage/enable_service.rb | 54 + .../snippets/service_usage/get_service.rb | 47 + .../snippets/service_usage/list_services.rb | 51 + ...t_metadata_google.api.serviceusage.v1.json | 255 ++ .../v1/service_usage_operations_test.rb | 400 ++ .../v1/service_usage_rest_test.rb | 430 ++ .../service_usage/v1/service_usage_test.rb | 500 +++ .../test/helper.rb | 26 + .../google-cloud-shell-v1/.gitignore | 22 + .../google-cloud-shell-v1/.repo-metadata.json | 18 + .../google-cloud-shell-v1/.rubocop.yml | 33 + .../google-cloud-shell-v1/.toys.rb | 28 + .../google-cloud-shell-v1/.yardopts | 12 + .../google-cloud-shell-v1/AUTHENTICATION.md | 122 + .../google-cloud-shell-v1/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-shell-v1/Gemfile | 14 + .../google-cloud-shell-v1/LICENSE.md | 201 + .../google-cloud-shell-v1/README.md | 154 + .../google-cloud-shell-v1/Rakefile | 169 + .../google-cloud-shell-v1/gapic_metadata.json | 43 + .../google-cloud-shell-v1.gemspec | 28 + .../lib/google-cloud-shell-v1.rb | 21 + .../lib/google/cloud/shell/v1.rb | 45 + .../cloud/shell/v1/cloud_shell_service.rb | 62 + .../shell/v1/cloud_shell_service/client.rb | 954 +++++ .../v1/cloud_shell_service/credentials.rb | 51 + .../v1/cloud_shell_service/operations.rb | 841 ++++ .../shell/v1/cloud_shell_service/paths.rb | 50 + .../shell/v1/cloud_shell_service/rest.rb | 59 + .../v1/cloud_shell_service/rest/client.rb | 876 ++++ .../v1/cloud_shell_service/rest/operations.rb | 925 +++++ .../cloud_shell_service/rest/service_stub.rb | 390 ++ .../google/cloud/shell/v1/cloudshell_pb.rb | 47 + .../cloud/shell/v1/cloudshell_services_pb.rb | 72 + .../lib/google/cloud/shell/v1/rest.rb | 37 + .../lib/google/cloud/shell/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/shell/v1/cloudshell.rb | 331 ++ .../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/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../google-cloud-shell-v1/snippets/Gemfile | 32 + .../cloud_shell_service/add_public_key.rb | 54 + .../authorize_environment.rb | 54 + .../cloud_shell_service/get_environment.rb | 47 + .../cloud_shell_service/remove_public_key.rb | 54 + .../cloud_shell_service/start_environment.rb | 54 + ...nippet_metadata_google.cloud.shell.v1.json | 215 + .../v1/cloud_shell_service_operations_test.rb | 400 ++ .../v1/cloud_shell_service_paths_test.rb | 55 + .../shell/v1/cloud_shell_service_rest_test.rb | 376 ++ .../shell/v1/cloud_shell_service_test.rb | 442 ++ .../google-cloud-shell-v1/test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 153 + .../Rakefile | 169 + .../gapic_metadata.json | 153 + ...le-cloud-spanner-admin-database-v1.gemspec | 29 + .../google-cloud-spanner-admin-database-v1.rb | 21 + .../google/cloud/spanner/admin/database/v1.rb | 49 + .../admin/database/v1/database_admin.rb | 66 + .../database/v1/database_admin/client.rb | 3658 +++++++++++++++++ .../database/v1/database_admin/credentials.rb | 56 + .../database/v1/database_admin/operations.rb | 845 ++++ .../admin/database/v1/database_admin/paths.rb | 176 + .../admin/database/v1/database_admin/rest.rb | 63 + .../database/v1/database_admin/rest/client.rb | 3338 +++++++++++++++ .../v1/database_admin/rest/operations.rb | 1012 +++++ .../v1/database_admin/rest/service_stub.rb | 1740 ++++++++ .../cloud/spanner/admin/database/v1/rest.rb | 41 + .../spanner/admin/database/v1/version.rb | 32 + .../spanner/admin/database/v1/backup_pb.rb | 52 + .../admin/database/v1/backup_schedule_pb.rb | 40 + .../spanner/admin/database/v1/common_pb.rb | 34 + .../database/v1/spanner_database_admin_pb.rb | 73 + .../v1/spanner_database_admin_services_pb.rb | 245 ++ .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 ++ .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../spanner/admin/database/v1/backup.rb | 730 ++++ .../admin/database/v1/backup_schedule.rb | 220 + .../spanner/admin/database/v1/common.rb | 123 + .../database/v1/spanner_database_admin.rb | 834 ++++ .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../database_admin/add_split_points.rb | 47 + .../snippets/database_admin/copy_backup.rb | 54 + .../snippets/database_admin/create_backup.rb | 54 + .../database_admin/create_backup_schedule.rb | 47 + .../database_admin/create_database.rb | 54 + .../snippets/database_admin/delete_backup.rb | 47 + .../database_admin/delete_backup_schedule.rb | 47 + .../snippets/database_admin/drop_database.rb | 47 + .../snippets/database_admin/get_backup.rb | 47 + .../database_admin/get_backup_schedule.rb | 47 + .../snippets/database_admin/get_database.rb | 47 + .../database_admin/get_database_ddl.rb | 47 + .../snippets/database_admin/get_iam_policy.rb | 47 + .../internal_update_graph_operation.rb | 47 + .../database_admin/list_backup_operations.rb | 51 + .../database_admin/list_backup_schedules.rb | 51 + .../snippets/database_admin/list_backups.rb | 51 + .../list_database_operations.rb | 51 + .../database_admin/list_database_roles.rb | 51 + .../snippets/database_admin/list_databases.rb | 51 + .../database_admin/restore_database.rb | 54 + .../snippets/database_admin/set_iam_policy.rb | 47 + .../database_admin/test_iam_permissions.rb | 47 + .../snippets/database_admin/update_backup.rb | 47 + .../database_admin/update_backup_schedule.rb | 47 + .../database_admin/update_database.rb | 54 + .../database_admin/update_database_ddl.rb | 54 + ...data_google.spanner.admin.database.v1.json | 1095 +++++ .../v1/database_admin_operations_test.rb | 400 ++ .../database/v1/database_admin_paths_test.rb | 127 + .../database/v1/database_admin_rest_test.rb | 1548 +++++++ .../admin/database/v1/database_admin_test.rb | 1843 +++++++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 153 + .../Rakefile | 169 + .../gapic_metadata.json | 123 + ...le-cloud-spanner-admin-instance-v1.gemspec | 29 + .../google-cloud-spanner-admin-instance-v1.rb | 21 + .../google/cloud/spanner/admin/instance/v1.rb | 49 + .../admin/instance/v1/instance_admin.rb | 80 + .../instance/v1/instance_admin/client.rb | 3140 ++++++++++++++ .../instance/v1/instance_admin/credentials.rb | 56 + .../instance/v1/instance_admin/operations.rb | 845 ++++ .../admin/instance/v1/instance_admin/paths.rb | 104 + .../admin/instance/v1/instance_admin/rest.rb | 77 + .../instance/v1/instance_admin/rest/client.rb | 2948 +++++++++++++ .../v1/instance_admin/rest/operations.rb | 1068 +++++ .../v1/instance_admin/rest/service_stub.rb | 1376 +++++++ .../cloud/spanner/admin/instance/v1/rest.rb | 41 + .../spanner/admin/instance/v1/version.rb | 32 + .../spanner/admin/instance/v1/common_pb.rb | 31 + .../instance/v1/spanner_instance_admin_pb.rb | 89 + .../v1/spanner_instance_admin_services_pb.rb | 463 +++ .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 ++ .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../spanner/admin/instance/v1/common.rb | 71 + .../instance/v1/spanner_instance_admin.rb | 1561 +++++++ .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../instance_admin/create_instance.rb | 54 + .../instance_admin/create_instance_config.rb | 54 + .../create_instance_partition.rb | 54 + .../instance_admin/delete_instance.rb | 47 + .../instance_admin/delete_instance_config.rb | 47 + .../delete_instance_partition.rb | 47 + .../snippets/instance_admin/get_iam_policy.rb | 47 + .../snippets/instance_admin/get_instance.rb | 47 + .../instance_admin/get_instance_config.rb | 47 + .../instance_admin/get_instance_partition.rb | 47 + .../list_instance_config_operations.rb | 51 + .../instance_admin/list_instance_configs.rb | 51 + .../list_instance_partition_operations.rb | 51 + .../list_instance_partitions.rb | 51 + .../snippets/instance_admin/list_instances.rb | 51 + .../snippets/instance_admin/move_instance.rb | 54 + .../snippets/instance_admin/set_iam_policy.rb | 47 + .../instance_admin/test_iam_permissions.rb | 47 + .../instance_admin/update_instance.rb | 54 + .../instance_admin/update_instance_config.rb | 54 + .../update_instance_partition.rb | 54 + ...data_google.spanner.admin.instance.v1.json | 855 ++++ .../v1/instance_admin_operations_test.rb | 400 ++ .../instance/v1/instance_admin_paths_test.rb | 91 + .../instance/v1/instance_admin_rest_test.rb | 1269 ++++++ .../admin/instance/v1/instance_admin_test.rb | 1468 +++++++ .../test/helper.rb | 26 + .../google-cloud-spanner-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-spanner-v1/.rubocop.yml | 33 + .../google-cloud-spanner-v1/.toys.rb | 28 + .../google-cloud-spanner-v1/.yardopts | 12 + .../google-cloud-spanner-v1/AUTHENTICATION.md | 122 + .../google-cloud-spanner-v1/CHANGELOG.md | 2 + .../google-cloud-spanner-v1/Gemfile | 14 + .../google-cloud-spanner-v1/LICENSE.md | 201 + .../google-cloud-spanner-v1/README.md | 153 + .../google-cloud-spanner-v1/Rakefile | 169 + .../gapic_metadata.json | 98 + .../google-cloud-spanner-v1.gemspec | 28 + .../lib/google-cloud-spanner-v1.rb | 21 + .../lib/google/cloud/spanner/v1.rb | 40 + .../lib/google/cloud/spanner/v1/spanner.rb | 52 + .../google/cloud/spanner/v1/spanner/client.rb | 2636 ++++++++++++ .../cloud/spanner/v1/spanner/credentials.rb | 52 + .../google/cloud/spanner/v1/spanner/paths.rb | 73 + .../lib/google/cloud/spanner/v1/version.rb | 28 + .../lib/google/spanner/v1/change_stream_pb.rb | 37 + .../google/spanner/v1/commit_response_pb.rb | 27 + .../lib/google/spanner/v1/keys_pb.rb | 24 + .../lib/google/spanner/v1/location_pb.rb | 35 + .../lib/google/spanner/v1/mutation_pb.rb | 30 + .../lib/google/spanner/v1/query_plan_pb.rb | 30 + .../lib/google/spanner/v1/result_set_pb.rb | 31 + .../lib/google/spanner/v1/spanner_pb.rb | 73 + .../google/spanner/v1/spanner_services_pb.rb | 216 + .../lib/google/spanner/v1/transaction_pb.rb | 34 + .../lib/google/spanner/v1/type_pb.rb | 27 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../proto_docs/google/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 + .../google/spanner/v1/change_stream.rb | 488 +++ .../google/spanner/v1/commit_response.rb | 73 + .../proto_docs/google/spanner/v1/keys.rb | 170 + .../proto_docs/google/spanner/v1/location.rb | 417 ++ .../proto_docs/google/spanner/v1/mutation.rb | 178 + .../google/spanner/v1/query_plan.rb | 180 + .../google/spanner/v1/result_set.rb | 265 ++ .../proto_docs/google/spanner/v1/spanner.rb | 1203 ++++++ .../google/spanner/v1/transaction.rb | 357 ++ .../proto_docs/google/spanner/v1/type.rb | 222 + .../google-cloud-spanner-v1/snippets/Gemfile | 32 + .../snippet_metadata_google.spanner.v1.json | 655 +++ .../snippets/spanner/batch_create_sessions.rb | 47 + .../snippets/spanner/batch_write.rb | 50 + .../snippets/spanner/begin_transaction.rb | 47 + .../snippets/spanner/commit.rb | 47 + .../snippets/spanner/create_session.rb | 47 + .../snippets/spanner/delete_session.rb | 47 + .../snippets/spanner/execute_batch_dml.rb | 47 + .../snippets/spanner/execute_sql.rb | 47 + .../snippets/spanner/execute_streaming_sql.rb | 50 + .../snippets/spanner/get_session.rb | 47 + .../snippets/spanner/list_sessions.rb | 51 + .../snippets/spanner/partition_query.rb | 47 + .../snippets/spanner/partition_read.rb | 47 + .../snippets/spanner/read.rb | 47 + .../snippets/spanner/rollback.rb | 47 + .../snippets/spanner/streaming_read.rb | 50 + .../cloud/spanner/v1/spanner_paths_test.rb | 67 + .../google/cloud/spanner/v1/spanner_test.rb | 1269 ++++++ .../google-cloud-spanner-v1/test/helper.rb | 26 + .../google-cloud-speech-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-speech-v1/.rubocop.yml | 33 + .../google-cloud-speech-v1/.toys.rb | 28 + .../google-cloud-speech-v1/.yardopts | 12 + .../google-cloud-speech-v1/AUTHENTICATION.md | 122 + .../google-cloud-speech-v1/CHANGELOG.md | 2 + .../google-cloud-speech-v1/Gemfile | 14 + .../google-cloud-speech-v1/LICENSE.md | 201 + .../google-cloud-speech-v1/README.md | 154 + .../google-cloud-speech-v1/Rakefile | 169 + .../gapic_metadata.json | 92 + .../google-cloud-speech-v1.gemspec | 28 + .../lib/google-cloud-speech-v1.rb | 21 + .../lib/google/cloud/speech/v1.rb | 46 + .../lib/google/cloud/speech/v1/adaptation.rb | 55 + .../cloud/speech/v1/adaptation/client.rb | 1434 +++++++ .../cloud/speech/v1/adaptation/credentials.rb | 51 + .../cloud/speech/v1/adaptation/paths.rb | 88 + .../google/cloud/speech/v1/adaptation/rest.rb | 52 + .../cloud/speech/v1/adaptation/rest/client.rb | 1321 ++++++ .../speech/v1/adaptation/rest/service_stub.rb | 695 ++++ .../speech/v1/cloud_speech_adaptation_pb.rb | 40 + .../v1/cloud_speech_adaptation_services_pb.rb | 65 + .../google/cloud/speech/v1/cloud_speech_pb.rb | 56 + .../speech/v1/cloud_speech_services_pb.rb | 56 + .../lib/google/cloud/speech/v1/resource_pb.rb | 30 + .../lib/google/cloud/speech/v1/rest.rb | 38 + .../lib/google/cloud/speech/v1/speech.rb | 56 + .../google/cloud/speech/v1/speech/client.rb | 685 +++ .../cloud/speech/v1/speech/credentials.rb | 51 + .../cloud/speech/v1/speech/operations.rb | 833 ++++ .../google/cloud/speech/v1/speech/paths.rb | 71 + .../lib/google/cloud/speech/v1/speech/rest.rb | 53 + .../cloud/speech/v1/speech/rest/client.rb | 553 +++ .../cloud/speech/v1/speech/rest/operations.rb | 923 +++++ .../speech/v1/speech/rest/service_stub.rb | 201 + .../lib/google/cloud/speech/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/speech/v1/cloud_speech.rb | 1003 +++++ .../speech/v1/cloud_speech_adaptation.rb | 270 ++ .../google/cloud/speech/v1/resource.rb | 185 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 148 + .../proto_docs/google/rpc/status.rb | 48 + .../google-cloud-speech-v1/snippets/Gemfile | 32 + .../adaptation/create_custom_class.rb | 47 + .../snippets/adaptation/create_phrase_set.rb | 47 + .../adaptation/delete_custom_class.rb | 47 + .../snippets/adaptation/delete_phrase_set.rb | 47 + .../snippets/adaptation/get_custom_class.rb | 47 + .../snippets/adaptation/get_phrase_set.rb | 47 + .../adaptation/list_custom_classes.rb | 51 + .../snippets/adaptation/list_phrase_set.rb | 51 + .../adaptation/update_custom_class.rb | 47 + .../snippets/adaptation/update_phrase_set.rb | 47 + ...ippet_metadata_google.cloud.speech.v1.json | 535 +++ .../snippets/speech/long_running_recognize.rb | 54 + .../snippets/speech/recognize.rb | 47 + .../snippets/speech/streaming_recognize.rb | 56 + .../cloud/speech/v1/adaptation_paths_test.rb | 79 + .../cloud/speech/v1/adaptation_rest_test.rb | 649 +++ .../google/cloud/speech/v1/adaptation_test.rb | 714 ++++ .../cloud/speech/v1/speech_operations_test.rb | 400 ++ .../cloud/speech/v1/speech_paths_test.rb | 67 + .../cloud/speech/v1/speech_rest_test.rb | 210 + .../google/cloud/speech/v1/speech_test.rb | 334 ++ .../google-cloud-speech-v1/test/helper.rb | 26 + .../google-cloud-speech-v1p1beta1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-speech-v1p1beta1/.toys.rb | 28 + .../google-cloud-speech-v1p1beta1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-speech-v1p1beta1/Gemfile | 14 + .../google-cloud-speech-v1p1beta1/LICENSE.md | 201 + .../google-cloud-speech-v1p1beta1/README.md | 154 + .../google-cloud-speech-v1p1beta1/Rakefile | 169 + .../gapic_metadata.json | 92 + .../google-cloud-speech-v1p1beta1.gemspec | 28 + .../lib/google-cloud-speech-v1p1beta1.rb | 21 + .../lib/google/cloud/speech/v1p1beta1.rb | 46 + .../cloud/speech/v1p1beta1/adaptation.rb | 55 + .../speech/v1p1beta1/adaptation/client.rb | 1434 +++++++ .../v1p1beta1/adaptation/credentials.rb | 51 + .../speech/v1p1beta1/adaptation/paths.rb | 132 + .../cloud/speech/v1p1beta1/adaptation/rest.rb | 52 + .../v1p1beta1/adaptation/rest/client.rb | 1321 ++++++ .../v1p1beta1/adaptation/rest/service_stub.rb | 695 ++++ .../v1p1beta1/cloud_speech_adaptation_pb.rb | 40 + .../cloud_speech_adaptation_services_pb.rb | 65 + .../cloud/speech/v1p1beta1/cloud_speech_pb.rb | 56 + .../v1p1beta1/cloud_speech_services_pb.rb | 56 + .../cloud/speech/v1p1beta1/resource_pb.rb | 34 + .../lib/google/cloud/speech/v1p1beta1/rest.rb | 38 + .../google/cloud/speech/v1p1beta1/speech.rb | 56 + .../cloud/speech/v1p1beta1/speech/client.rb | 685 +++ .../speech/v1p1beta1/speech/credentials.rb | 51 + .../speech/v1p1beta1/speech/operations.rb | 833 ++++ .../cloud/speech/v1p1beta1/speech/paths.rb | 115 + .../cloud/speech/v1p1beta1/speech/rest.rb | 53 + .../speech/v1p1beta1/speech/rest/client.rb | 553 +++ .../v1p1beta1/speech/rest/operations.rb | 923 +++++ .../v1p1beta1/speech/rest/service_stub.rb | 201 + .../google/cloud/speech/v1p1beta1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/speech/v1p1beta1/cloud_speech.rb | 1033 +++++ .../v1p1beta1/cloud_speech_adaptation.rb | 270 ++ .../google/cloud/speech/v1p1beta1/resource.rb | 325 ++ .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 148 + .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + .../adaptation/create_custom_class.rb | 47 + .../snippets/adaptation/create_phrase_set.rb | 47 + .../adaptation/delete_custom_class.rb | 47 + .../snippets/adaptation/delete_phrase_set.rb | 47 + .../snippets/adaptation/get_custom_class.rb | 47 + .../snippets/adaptation/get_phrase_set.rb | 47 + .../adaptation/list_custom_classes.rb | 51 + .../snippets/adaptation/list_phrase_set.rb | 51 + .../adaptation/update_custom_class.rb | 47 + .../snippets/adaptation/update_phrase_set.rb | 47 + ...etadata_google.cloud.speech.v1p1beta1.json | 535 +++ .../snippets/speech/long_running_recognize.rb | 54 + .../snippets/speech/recognize.rb | 47 + .../snippets/speech/streaming_recognize.rb | 56 + .../speech/v1p1beta1/adaptation_paths_test.rb | 103 + .../speech/v1p1beta1/adaptation_rest_test.rb | 649 +++ .../cloud/speech/v1p1beta1/adaptation_test.rb | 714 ++++ .../v1p1beta1/speech_operations_test.rb | 400 ++ .../speech/v1p1beta1/speech_paths_test.rb | 91 + .../speech/v1p1beta1/speech_rest_test.rb | 210 + .../cloud/speech/v1p1beta1/speech_test.rb | 334 ++ .../test/helper.rb | 26 + .../google-cloud-speech-v2/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-speech-v2/.rubocop.yml | 33 + .../google-cloud-speech-v2/.toys.rb | 28 + .../google-cloud-speech-v2/.yardopts | 12 + .../google-cloud-speech-v2/AUTHENTICATION.md | 122 + .../google-cloud-speech-v2/CHANGELOG.md | 2 + .../google-cloud-speech-v2/Gemfile | 14 + .../google-cloud-speech-v2/LICENSE.md | 201 + .../google-cloud-speech-v2/README.md | 154 + .../google-cloud-speech-v2/Rakefile | 169 + .../gapic_metadata.json | 133 + .../google-cloud-speech-v2.gemspec | 29 + .../lib/google-cloud-speech-v2.rb | 21 + .../lib/google/cloud/speech/v2.rb | 45 + .../cloud/speech/v2/bindings_override.rb | 75 + .../google/cloud/speech/v2/cloud_speech_pb.rb | 109 + .../speech/v2/cloud_speech_services_pb.rb | 98 + .../cloud/speech/v2/locations_metadata_pb.rb | 27 + .../lib/google/cloud/speech/v2/rest.rb | 38 + .../lib/google/cloud/speech/v2/speech.rb | 56 + .../google/cloud/speech/v2/speech/client.rb | 2922 +++++++++++++ .../cloud/speech/v2/speech/credentials.rb | 51 + .../cloud/speech/v2/speech/operations.rb | 841 ++++ .../google/cloud/speech/v2/speech/paths.rb | 168 + .../lib/google/cloud/speech/v2/speech/rest.rb | 54 + .../cloud/speech/v2/speech/rest/client.rb | 2647 ++++++++++++ .../cloud/speech/v2/speech/rest/operations.rb | 925 +++++ .../speech/v2/speech/rest/service_stub.rb | 1435 +++++++ .../lib/google/cloud/speech/v2/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/speech/v2/cloud_speech.rb | 2086 ++++++++++ .../cloud/speech/v2/locations_metadata.rb | 120 + .../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 + .../google-cloud-speech-v2/snippets/Gemfile | 32 + ...ippet_metadata_google.cloud.speech.v2.json | 935 +++++ .../snippets/speech/batch_recognize.rb | 54 + .../snippets/speech/create_custom_class.rb | 54 + .../snippets/speech/create_phrase_set.rb | 54 + .../snippets/speech/create_recognizer.rb | 54 + .../snippets/speech/delete_custom_class.rb | 54 + .../snippets/speech/delete_phrase_set.rb | 54 + .../snippets/speech/delete_recognizer.rb | 54 + .../snippets/speech/get_config.rb | 47 + .../snippets/speech/get_custom_class.rb | 47 + .../snippets/speech/get_phrase_set.rb | 47 + .../snippets/speech/get_recognizer.rb | 47 + .../snippets/speech/list_custom_classes.rb | 51 + .../snippets/speech/list_phrase_sets.rb | 51 + .../snippets/speech/list_recognizers.rb | 51 + .../snippets/speech/recognize.rb | 47 + .../snippets/speech/streaming_recognize.rb | 56 + .../snippets/speech/undelete_custom_class.rb | 54 + .../snippets/speech/undelete_phrase_set.rb | 54 + .../snippets/speech/undelete_recognizer.rb | 54 + .../snippets/speech/update_config.rb | 47 + .../snippets/speech/update_custom_class.rb | 54 + .../snippets/speech/update_phrase_set.rb | 54 + .../snippets/speech/update_recognizer.rb | 54 + .../cloud/speech/v2/speech_operations_test.rb | 400 ++ .../cloud/speech/v2/speech_paths_test.rb | 127 + .../cloud/speech/v2/speech_rest_test.rb | 1335 ++++++ .../google/cloud/speech/v2/speech_test.rb | 1662 ++++++++ .../google-cloud-speech-v2/test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-storage-control-v2/.toys.rb | 28 + .../google-cloud-storage-control-v2/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-storage-control-v2/Gemfile | 14 + .../LICENSE.md | 201 + .../google-cloud-storage-control-v2/README.md | 154 + .../google-cloud-storage-control-v2/Rakefile | 169 + .../gapic_metadata.json | 153 + .../google-cloud-storage-control-v2.gemspec | 29 + .../lib/google-cloud-storage-control-v2.rb | 21 + .../lib/google/cloud/storage/control/v2.rb | 47 + .../google/cloud/storage/control/v2/rest.rb | 39 + .../storage/control/v2/storage_control.rb | 58 + .../control/v2/storage_control/client.rb | 3379 +++++++++++++++ .../control/v2/storage_control/credentials.rb | 53 + .../control/v2/storage_control/operations.rb | 843 ++++ .../control/v2/storage_control/paths.rb | 178 + .../control/v2/storage_control/rest.rb | 54 + .../control/v2/storage_control/rest/client.rb | 913 ++++ .../v2/storage_control/rest/service_stub.rb | 452 ++ .../cloud/storage/control/v2/version.rb | 30 + .../storage/control/v2/storage_control_pb.rb | 83 + .../control/v2/storage_control_services_pb.rb | 125 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../proto_docs/google/api/routing.rb | 463 +++ .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 ++ .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../storage/control/v2/storage_control.rb | 1026 +++++ .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + ...et_metadata_google.storage.control.v2.json | 1095 +++++ .../storage_control/create_anywhere_cache.rb | 54 + .../snippets/storage_control/create_folder.rb | 47 + .../storage_control/create_managed_folder.rb | 47 + .../snippets/storage_control/delete_folder.rb | 47 + .../delete_folder_recursive.rb | 54 + .../storage_control/delete_managed_folder.rb | 47 + .../storage_control/disable_anywhere_cache.rb | 47 + .../storage_control/get_anywhere_cache.rb | 47 + .../snippets/storage_control/get_folder.rb | 47 + .../get_folder_intelligence_config.rb | 47 + .../storage_control/get_iam_policy.rb | 47 + .../storage_control/get_managed_folder.rb | 47 + .../get_organization_intelligence_config.rb | 47 + .../get_project_intelligence_config.rb | 47 + .../storage_control/get_storage_layout.rb | 47 + .../storage_control/list_anywhere_caches.rb | 51 + .../snippets/storage_control/list_folders.rb | 51 + .../storage_control/list_managed_folders.rb | 51 + .../storage_control/pause_anywhere_cache.rb | 47 + .../snippets/storage_control/rename_folder.rb | 54 + .../storage_control/resume_anywhere_cache.rb | 47 + .../storage_control/set_iam_policy.rb | 47 + .../storage_control/test_iam_permissions.rb | 47 + .../storage_control/update_anywhere_cache.rb | 54 + .../update_folder_intelligence_config.rb | 47 + ...update_organization_intelligence_config.rb | 47 + .../update_project_intelligence_config.rb | 47 + .../v2/storage_control_operations_test.rb | 400 ++ .../control/v2/storage_control_paths_test.rb | 121 + .../control/v2/storage_control_rest_test.rb | 429 ++ .../control/v2/storage_control_test.rb | 1853 +++++++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 53 + ...-cloud-storage_batch_operations-v1.gemspec | 29 + ...oogle-cloud-storage_batch_operations-v1.rb | 21 + .../cloud/storage_batch_operations/v1.rb | 45 + .../v1/bindings_override.rb | 75 + .../cloud/storage_batch_operations/v1/rest.rb | 38 + .../v1/storage_batch_operations.rb | 59 + .../v1/storage_batch_operations/client.rb | 1150 ++++++ .../storage_batch_operations/credentials.rb | 47 + .../v1/storage_batch_operations/operations.rb | 841 ++++ .../v1/storage_batch_operations/paths.rb | 111 + .../v1/storage_batch_operations/rest.rb | 57 + .../storage_batch_operations/rest/client.rb | 1066 +++++ .../rest/operations.rb | 925 +++++ .../rest/service_stub.rb | 510 +++ .../storage_batch_operations/v1/version.rb | 28 + .../v1/storage_batch_operations_pb.rb | 41 + .../storage_batch_operations_services_pb.rb | 60 + .../v1/storage_batch_operations_types_pb.rb | 49 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../v1/storage_batch_operations.rb | 221 + .../v1/storage_batch_operations_types.rb | 564 +++ .../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/timestamp.rb | 127 + .../proto_docs/google/rpc/code.rb | 185 + .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + ...oogle.cloud.storagebatchoperations.v1.json | 295 ++ .../storage_batch_operations/cancel_job.rb | 47 + .../storage_batch_operations/create_job.rb | 54 + .../storage_batch_operations/delete_job.rb | 47 + .../get_bucket_operation.rb | 47 + .../storage_batch_operations/get_job.rb | 47 + .../list_bucket_operations.rb | 51 + .../storage_batch_operations/list_jobs.rb | 51 + ...torage_batch_operations_operations_test.rb | 400 ++ .../v1/storage_batch_operations_paths_test.rb | 91 + .../v1/storage_batch_operations_rest_test.rb | 491 +++ .../v1/storage_batch_operations_test.rb | 567 +++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-storage_insights-v1/.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-storage_insights-v1/Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 153 + .../google-cloud-storage_insights-v1/Rakefile | 169 + .../gapic_metadata.json | 88 + .../google-cloud-storage_insights-v1.gemspec | 29 + .../lib/google-cloud-storage_insights-v1.rb | 21 + .../lib/google/cloud/storage_insights/v1.rb | 45 + .../storage_insights/v1/bindings_override.rb | 75 + .../google/cloud/storage_insights/v1/rest.rb | 38 + .../storage_insights/v1/storage_insights.rb | 56 + .../v1/storage_insights/client.rb | 1944 +++++++++ .../v1/storage_insights/credentials.rb | 47 + .../v1/storage_insights/operations.rb | 841 ++++ .../v1/storage_insights/paths.rb | 109 + .../v1/storage_insights/rest.rb | 54 + .../v1/storage_insights/rest/client.rb | 1811 ++++++++ .../v1/storage_insights/rest/operations.rb | 925 +++++ .../v1/storage_insights/rest/service_stub.rb | 941 +++++ .../cloud/storage_insights/v1/version.rb | 28 + .../storageinsights/v1/storageinsights_pb.rb | 75 + .../v1/storageinsights_services_pb.rb | 72 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../storageinsights/v1/storageinsights.rb | 930 +++++ .../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/date.rb | 53 + .../proto_docs/google/type/datetime.rb | 103 + .../snippets/Gemfile | 32 + ...adata_google.cloud.storageinsights.v1.json | 575 +++ .../storage_insights/create_dataset_config.rb | 54 + .../storage_insights/create_report_config.rb | 47 + .../storage_insights/delete_dataset_config.rb | 54 + .../storage_insights/delete_report_config.rb | 47 + .../storage_insights/get_dataset_config.rb | 47 + .../storage_insights/get_report_config.rb | 47 + .../storage_insights/get_report_detail.rb | 47 + .../snippets/storage_insights/link_dataset.rb | 54 + .../storage_insights/list_dataset_configs.rb | 51 + .../storage_insights/list_report_configs.rb | 51 + .../storage_insights/list_report_details.rb | 51 + .../storage_insights/unlink_dataset.rb | 54 + .../storage_insights/update_dataset_config.rb | 54 + .../storage_insights/update_report_config.rb | 47 + .../v1/storage_insights_operations_test.rb | 400 ++ .../v1/storage_insights_paths_test.rb | 91 + .../v1/storage_insights_rest_test.rb | 879 ++++ .../v1/storage_insights_test.rb | 1018 +++++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-storage_transfer-v1/.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-storage_transfer-v1/Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../google-cloud-storage_transfer-v1/Rakefile | 169 + .../gapic_metadata.json | 88 + .../google-cloud-storage_transfer-v1.gemspec | 28 + .../lib/google-cloud-storage_transfer-v1.rb | 21 + .../lib/google/cloud/storage_transfer/v1.rb | 45 + .../google/cloud/storage_transfer/v1/rest.rb | 37 + .../v1/storage_transfer_service.rb | 58 + .../v1/storage_transfer_service/client.rb | 1832 +++++++++ .../storage_transfer_service/credentials.rb | 47 + .../v1/storage_transfer_service/operations.rb | 841 ++++ .../v1/storage_transfer_service/paths.rb | 50 + .../v1/storage_transfer_service/rest.rb | 55 + .../storage_transfer_service/rest/client.rb | 1707 ++++++++ .../rest/operations.rb | 925 +++++ .../rest/service_stub.rb | 938 +++++ .../cloud/storage_transfer/v1/version.rb | 28 + .../google/storagetransfer/v1/transfer_pb.rb | 44 + .../v1/transfer_services_pb.rb | 91 + .../storagetransfer/v1/transfer_types_pb.rb | 78 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/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/code.rb | 185 + .../proto_docs/google/rpc/status.rb | 48 + .../google/storagetransfer/v1/transfer.rb | 307 ++ .../storagetransfer/v1/transfer_types.rb | 1534 +++++++ .../proto_docs/google/type/date.rb | 53 + .../proto_docs/google/type/timeofday.rb | 45 + .../snippets/Gemfile | 32 + ...et_metadata_google.storagetransfer.v1.json | 575 +++ .../create_agent_pool.rb | 47 + .../create_transfer_job.rb | 47 + .../delete_agent_pool.rb | 47 + .../delete_transfer_job.rb | 47 + .../get_agent_pool.rb | 47 + .../get_google_service_account.rb | 47 + .../get_transfer_job.rb | 47 + .../list_agent_pools.rb | 51 + .../list_transfer_jobs.rb | 51 + .../pause_transfer_operation.rb | 47 + .../resume_transfer_operation.rb | 47 + .../run_transfer_job.rb | 54 + .../update_agent_pool.rb | 47 + .../update_transfer_job.rb | 47 + ...torage_transfer_service_operations_test.rb | 400 ++ .../v1/storage_transfer_service_paths_test.rb | 55 + .../v1/storage_transfer_service_rest_test.rb | 869 ++++ .../v1/storage_transfer_service_test.rb | 973 +++++ .../test/helper.rb | 26 + .../google-cloud-support-v2/.gitignore | 22 + .../.repo-metadata.json | 17 + .../google-cloud-support-v2/.rubocop.yml | 33 + .../google-cloud-support-v2/.toys.rb | 28 + .../google-cloud-support-v2/.yardopts | 12 + .../google-cloud-support-v2/AUTHENTICATION.md | 122 + .../google-cloud-support-v2/CHANGELOG.md | 2 + .../google-cloud-support-v2/Gemfile | 14 + .../google-cloud-support-v2/LICENSE.md | 201 + .../google-cloud-support-v2/README.md | 154 + .../google-cloud-support-v2/Rakefile | 169 + .../gapic_metadata.json | 91 + .../google-cloud-support-v2.gemspec | 28 + .../lib/google-cloud-support-v2.rb | 21 + .../lib/google/cloud/support/v2.rb | 42 + .../lib/google/cloud/support/v2/actor_pb.rb | 23 + .../google/cloud/support/v2/attachment_pb.rb | 26 + .../cloud/support/v2/attachment_service_pb.rb | 28 + .../v2/attachment_service_services_pb.rb | 45 + .../support/v2/case_attachment_service.rb | 49 + .../v2/case_attachment_service/client.rb | 497 +++ .../v2/case_attachment_service/credentials.rb | 47 + .../v2/case_attachment_service/paths.rb | 72 + .../lib/google/cloud/support/v2/case_pb.rb | 29 + .../google/cloud/support/v2/case_service.rb | 49 + .../cloud/support/v2/case_service/client.rb | 1264 ++++++ .../support/v2/case_service/credentials.rb | 47 + .../cloud/support/v2/case_service/paths.rb | 100 + .../cloud/support/v2/case_service_pb.rb | 39 + .../support/v2/case_service_services_pb.rb | 82 + .../lib/google/cloud/support/v2/comment_pb.rb | 26 + .../cloud/support/v2/comment_service.rb | 49 + .../support/v2/comment_service/client.rb | 588 +++ .../support/v2/comment_service/credentials.rb | 47 + .../cloud/support/v2/comment_service/paths.rb | 115 + .../cloud/support/v2/comment_service_pb.rb | 29 + .../support/v2/comment_service_services_pb.rb | 49 + .../google/cloud/support/v2/escalation_pb.rb | 24 + .../lib/google/cloud/support/v2/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/support/v2/actor.rb | 59 + .../google/cloud/support/v2/attachment.rb | 58 + .../cloud/support/v2/attachment_service.rb | 63 + .../google/cloud/support/v2/case.rb | 191 + .../google/cloud/support/v2/case_service.rb | 238 ++ .../google/cloud/support/v2/comment.rb | 58 + .../cloud/support/v2/comment_service.rb | 68 + .../google/cloud/support/v2/escalation.rb | 55 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../google-cloud-support-v2/snippets/Gemfile | 32 + .../list_attachments.rb | 51 + .../snippets/case_service/close_case.rb | 47 + .../snippets/case_service/create_case.rb | 47 + .../snippets/case_service/escalate_case.rb | 47 + .../snippets/case_service/get_case.rb | 47 + .../snippets/case_service/list_cases.rb | 51 + .../search_case_classifications.rb | 51 + .../snippets/case_service/search_cases.rb | 51 + .../snippets/case_service/update_case.rb | 47 + .../comment_service/create_comment.rb | 47 + .../snippets/comment_service/list_comments.rb | 51 + ...ppet_metadata_google.cloud.support.v2.json | 455 ++ .../v2/case_attachment_service_paths_test.rb | 58 + .../v2/case_attachment_service_test.rb | 171 + .../support/v2/case_service_paths_test.rb | 82 + .../cloud/support/v2/case_service_test.rb | 605 +++ .../support/v2/comment_service_paths_test.rb | 73 + .../cloud/support/v2/comment_service_test.rb | 231 ++ .../google-cloud-support-v2/test/helper.rb | 26 + .../google-cloud-support-v2beta/.gitignore | 22 + .../.repo-metadata.json | 17 + .../google-cloud-support-v2beta/.rubocop.yml | 33 + .../google-cloud-support-v2beta/.toys.rb | 28 + .../google-cloud-support-v2beta/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-support-v2beta/CHANGELOG.md | 2 + .../google-cloud-support-v2beta/Gemfile | 14 + .../google-cloud-support-v2beta/LICENSE.md | 201 + .../google-cloud-support-v2beta/README.md | 154 + .../google-cloud-support-v2beta/Rakefile | 169 + .../gapic_metadata.json | 115 + .../google-cloud-support-v2beta.gemspec | 28 + .../lib/google-cloud-support-v2beta.rb | 21 + .../lib/google/cloud/support/v2beta.rb | 48 + .../google/cloud/support/v2beta/actor_pb.rb | 23 + .../cloud/support/v2beta/attachment_pb.rb | 26 + .../support/v2beta/attachment_service_pb.rb | 29 + .../v2beta/attachment_service_services_pb.rb | 47 + .../support/v2beta/case_attachment_service.rb | 55 + .../v2beta/case_attachment_service/client.rb | 589 +++ .../case_attachment_service/credentials.rb | 47 + .../v2beta/case_attachment_service/paths.rb | 115 + .../v2beta/case_attachment_service/rest.rb | 52 + .../case_attachment_service/rest/client.rb | 532 +++ .../rest/service_stub.rb | 210 + .../google/cloud/support/v2beta/case_pb.rb | 31 + .../cloud/support/v2beta/case_service.rb | 55 + .../support/v2beta/case_service/client.rb | 1269 ++++++ .../v2beta/case_service/credentials.rb | 47 + .../support/v2beta/case_service/paths.rb | 100 + .../cloud/support/v2beta/case_service/rest.rb | 52 + .../v2beta/case_service/rest/client.rb | 1178 ++++++ .../v2beta/case_service/rest/service_stub.rb | 624 +++ .../cloud/support/v2beta/case_service_pb.rb | 39 + .../v2beta/case_service_services_pb.rb | 82 + .../google/cloud/support/v2beta/comment_pb.rb | 26 + .../cloud/support/v2beta/comment_service.rb | 55 + .../support/v2beta/comment_service/client.rb | 680 +++ .../v2beta/comment_service/credentials.rb | 47 + .../support/v2beta/comment_service/paths.rb | 115 + .../support/v2beta/comment_service/rest.rb | 52 + .../v2beta/comment_service/rest/client.rb | 616 +++ .../comment_service/rest/service_stub.rb | 280 ++ .../support/v2beta/comment_service_pb.rb | 30 + .../v2beta/comment_service_services_pb.rb | 51 + .../google/cloud/support/v2beta/content_pb.rb | 21 + .../cloud/support/v2beta/email_message_pb.rb | 27 + .../cloud/support/v2beta/escalation_pb.rb | 24 + .../cloud/support/v2beta/feed_item_pb.rb | 27 + .../cloud/support/v2beta/feed_service.rb | 55 + .../support/v2beta/feed_service/client.rb | 499 +++ .../v2beta/feed_service/credentials.rb | 47 + .../support/v2beta/feed_service/paths.rb | 72 + .../cloud/support/v2beta/feed_service/rest.rb | 52 + .../v2beta/feed_service/rest/client.rb | 449 ++ .../v2beta/feed_service/rest/service_stub.rb | 149 + .../cloud/support/v2beta/feed_service_pb.rb | 28 + .../v2beta/feed_service_services_pb.rb | 46 + .../lib/google/cloud/support/v2beta/rest.rb | 40 + .../google/cloud/support/v2beta/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/support/v2beta/actor.rb | 59 + .../google/cloud/support/v2beta/attachment.rb | 58 + .../support/v2beta/attachment_service.rb | 72 + .../google/cloud/support/v2beta/case.rb | 215 + .../cloud/support/v2beta/case_service.rb | 245 ++ .../google/cloud/support/v2beta/comment.rb | 58 + .../cloud/support/v2beta/comment_service.rb | 77 + .../google/cloud/support/v2beta/content.rb | 35 + .../cloud/support/v2beta/email_message.rb | 55 + .../google/cloud/support/v2beta/escalation.rb | 55 + .../google/cloud/support/v2beta/feed_item.rb | 56 + .../cloud/support/v2beta/feed_service.rb | 65 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../snippets/Gemfile | 32 + .../case_attachment_service/get_attachment.rb | 47 + .../list_attachments.rb | 51 + .../snippets/case_service/close_case.rb | 47 + .../snippets/case_service/create_case.rb | 47 + .../snippets/case_service/escalate_case.rb | 47 + .../snippets/case_service/get_case.rb | 47 + .../snippets/case_service/list_cases.rb | 51 + .../search_case_classifications.rb | 51 + .../snippets/case_service/search_cases.rb | 51 + .../snippets/case_service/update_case.rb | 47 + .../comment_service/create_comment.rb | 47 + .../snippets/comment_service/get_comment.rb | 47 + .../snippets/comment_service/list_comments.rb | 51 + .../snippets/feed_service/show_feed.rb | 51 + ..._metadata_google.cloud.support.v2beta.json | 575 +++ .../case_attachment_service_paths_test.rb | 73 + .../case_attachment_service_rest_test.rb | 209 + .../v2beta/case_attachment_service_test.rb | 229 ++ .../support/v2beta/case_service_paths_test.rb | 82 + .../support/v2beta/case_service_rest_test.rb | 544 +++ .../cloud/support/v2beta/case_service_test.rb | 610 +++ .../v2beta/comment_service_paths_test.rb | 73 + .../v2beta/comment_service_rest_test.rb | 264 ++ .../support/v2beta/comment_service_test.rb | 289 ++ .../support/v2beta/feed_service_paths_test.rb | 58 + .../support/v2beta/feed_service_rest_test.rb | 156 + .../cloud/support/v2beta/feed_service_test.rb | 173 + .../test/helper.rb | 26 + .../google-cloud-talent-v4/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-talent-v4/.rubocop.yml | 33 + .../google-cloud-talent-v4/.toys.rb | 28 + .../google-cloud-talent-v4/.yardopts | 12 + .../google-cloud-talent-v4/AUTHENTICATION.md | 122 + .../google-cloud-talent-v4/CHANGELOG.md | 2 + .../google-cloud-talent-v4/Gemfile | 14 + .../google-cloud-talent-v4/LICENSE.md | 201 + .../google-cloud-talent-v4/README.md | 154 + .../google-cloud-talent-v4/Rakefile | 169 + .../gapic_metadata.json | 164 + .../google-cloud-talent-v4.gemspec | 28 + .../lib/google-cloud-talent-v4.rb | 21 + .../lib/google/cloud/talent/v4.rb | 49 + .../lib/google/cloud/talent/v4/common_pb.rb | 53 + .../lib/google/cloud/talent/v4/company_pb.rb | 26 + .../google/cloud/talent/v4/company_service.rb | 55 + .../cloud/talent/v4/company_service/client.rb | 909 ++++ .../talent/v4/company_service/credentials.rb | 52 + .../cloud/talent/v4/company_service/paths.rb | 69 + .../cloud/talent/v4/company_service/rest.rb | 52 + .../talent/v4/company_service/rest/client.rb | 831 ++++ .../v4/company_service/rest/service_stub.rb | 388 ++ .../cloud/talent/v4/company_service_pb.rb | 35 + .../talent/v4/company_service_services_pb.rb | 54 + .../lib/google/cloud/talent/v4/completion.rb | 55 + .../cloud/talent/v4/completion/client.rb | 510 +++ .../cloud/talent/v4/completion/credentials.rb | 52 + .../cloud/talent/v4/completion/paths.rb | 69 + .../google/cloud/talent/v4/completion/rest.rb | 52 + .../cloud/talent/v4/completion/rest/client.rb | 460 +++ .../talent/v4/completion/rest/service_stub.rb | 142 + .../cloud/talent/v4/completion_service_pb.rb | 31 + .../v4/completion_service_services_pb.rb | 46 + .../lib/google/cloud/talent/v4/event_pb.rb | 26 + .../google/cloud/talent/v4/event_service.rb | 55 + .../cloud/talent/v4/event_service/client.rb | 488 +++ .../talent/v4/event_service/credentials.rb | 52 + .../cloud/talent/v4/event_service/paths.rb | 50 + .../cloud/talent/v4/event_service/rest.rb | 52 + .../talent/v4/event_service/rest/client.rb | 438 ++ .../v4/event_service/rest/service_stub.rb | 143 + .../cloud/talent/v4/event_service_pb.rb | 27 + .../talent/v4/event_service_services_pb.rb | 51 + .../lib/google/cloud/talent/v4/filters_pb.rb | 33 + .../google/cloud/talent/v4/histogram_pb.rb | 22 + .../lib/google/cloud/talent/v4/job_pb.rb | 29 + .../lib/google/cloud/talent/v4/job_service.rb | 56 + .../cloud/talent/v4/job_service/client.rb | 2062 ++++++++++ .../talent/v4/job_service/credentials.rb | 52 + .../cloud/talent/v4/job_service/operations.rb | 841 ++++ .../cloud/talent/v4/job_service/paths.rb | 88 + .../cloud/talent/v4/job_service/rest.rb | 53 + .../talent/v4/job_service/rest/client.rb | 1949 +++++++++ .../talent/v4/job_service/rest/operations.rb | 925 +++++ .../v4/job_service/rest/service_stub.rb | 698 ++++ .../google/cloud/talent/v4/job_service_pb.rb | 58 + .../talent/v4/job_service_services_pb.rb | 90 + .../lib/google/cloud/talent/v4/rest.rb | 41 + .../lib/google/cloud/talent/v4/tenant_pb.rb | 24 + .../google/cloud/talent/v4/tenant_service.rb | 55 + .../cloud/talent/v4/tenant_service/client.rb | 897 ++++ .../talent/v4/tenant_service/credentials.rb | 52 + .../cloud/talent/v4/tenant_service/paths.rb | 64 + .../cloud/talent/v4/tenant_service/rest.rb | 52 + .../talent/v4/tenant_service/rest/client.rb | 819 ++++ .../v4/tenant_service/rest/service_stub.rb | 388 ++ .../cloud/talent/v4/tenant_service_pb.rb | 35 + .../talent/v4/tenant_service_services_pb.rb | 53 + .../lib/google/cloud/talent/v4/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 589 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/talent/v4/common.rb | 959 +++++ .../google/cloud/talent/v4/company.rb | 123 + .../google/cloud/talent/v4/company_service.rb | 133 + .../cloud/talent/v4/completion_service.rb | 148 + .../google/cloud/talent/v4/event.rb | 179 + .../google/cloud/talent/v4/event_service.rb | 42 + .../google/cloud/talent/v4/filters.rb | 392 ++ .../google/cloud/talent/v4/histogram.rb | 72 + .../proto_docs/google/cloud/talent/v4/job.rb | 392 ++ .../google/cloud/talent/v4/job_service.rb | 929 +++++ .../google/cloud/talent/v4/tenant.rb | 50 + .../google/cloud/talent/v4/tenant_service.rb | 121 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 148 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/latlng.rb | 38 + .../proto_docs/google/type/money.rb | 43 + .../proto_docs/google/type/postal_address.rb | 135 + .../proto_docs/google/type/timeofday.rb | 45 + .../google-cloud-talent-v4/snippets/Gemfile | 32 + .../company_service/create_company.rb | 47 + .../company_service/delete_company.rb | 47 + .../snippets/company_service/get_company.rb | 47 + .../company_service/list_companies.rb | 51 + .../company_service/update_company.rb | 47 + .../snippets/completion/complete_query.rb | 47 + .../event_service/create_client_event.rb | 47 + .../snippets/job_service/batch_create_jobs.rb | 54 + .../snippets/job_service/batch_delete_jobs.rb | 54 + .../snippets/job_service/batch_update_jobs.rb | 54 + .../snippets/job_service/create_job.rb | 47 + .../snippets/job_service/delete_job.rb | 47 + .../snippets/job_service/get_job.rb | 47 + .../snippets/job_service/list_jobs.rb | 51 + .../snippets/job_service/search_jobs.rb | 47 + .../job_service/search_jobs_for_alert.rb | 47 + .../snippets/job_service/update_job.rb | 47 + ...ippet_metadata_google.cloud.talent.v4.json | 895 ++++ .../snippets/tenant_service/create_tenant.rb | 47 + .../snippets/tenant_service/delete_tenant.rb | 47 + .../snippets/tenant_service/get_tenant.rb | 47 + .../snippets/tenant_service/list_tenants.rb | 51 + .../snippets/tenant_service/update_tenant.rb | 47 + .../talent/v4/company_service_paths_test.rb | 67 + .../talent/v4/company_service_rest_test.rb | 374 ++ .../cloud/talent/v4/company_service_test.rb | 409 ++ .../cloud/talent/v4/completion_paths_test.rb | 67 + .../cloud/talent/v4/completion_rest_test.rb | 159 + .../google/cloud/talent/v4/completion_test.rb | 174 + .../talent/v4/event_service_paths_test.rb | 55 + .../talent/v4/event_service_rest_test.rb | 154 + .../cloud/talent/v4/event_service_test.rb | 164 + .../talent/v4/job_service_operations_test.rb | 400 ++ .../cloud/talent/v4/job_service_paths_test.rb | 79 + .../cloud/talent/v4/job_service_rest_test.rb | 679 +++ .../cloud/talent/v4/job_service_test.rb | 798 ++++ .../talent/v4/tenant_service_paths_test.rb | 67 + .../talent/v4/tenant_service_rest_test.rb | 373 ++ .../cloud/talent/v4/tenant_service_test.rb | 407 ++ .../google-cloud-talent-v4/test/helper.rb | 26 + 1552 files changed, 304002 insertions(+) create mode 100644 owl-bot-staging/google-cloud-service_control-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-service_control-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-service_control-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-service_control-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-service_control-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-service_control-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-service_control-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_control-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-service_control-v1/README.md create mode 100644 owl-bot-staging/google-cloud-service_control-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-service_control-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-service_control-v1/google-cloud-service_control-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google-cloud-service_control-v1.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/check_error_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/distribution_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/http_request_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/log_entry_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/metric_value_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/operation_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/client.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/credentials.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/client.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/credentials.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/distribution.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/check_error.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/distribution.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/http_request.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/log_entry.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/metric_value.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/operation.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/quota_controller.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/service_controller.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/logging/type/log_severity.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/check.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/report.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json create mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb create mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/README.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/google-cloud-service_directory-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google-cloud-service_directory-v1.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/endpoint_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/namespace_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/lookup_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/registration_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/google-cloud-service_directory-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google-cloud-service_directory-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/endpoint_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/namespace_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/lookup_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/registration_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb create mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-service_health-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-service_health-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-service_health-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-service_health-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-service_health-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-service_health-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_health-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-service_health-v1/README.md create mode 100644 owl-bot-staging/google-cloud-service_health-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-service_health-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-service_health-v1/google-cloud-service_health-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google-cloud-service_health-v1.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/client.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/credentials.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/paths.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/cloud/servicehealth/v1/event_resources.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_event.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_event.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_impact.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_events.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_events.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_impacts.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/snippet_metadata_google.cloud.servicehealth.v1.json create mode 100644 owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_test.rb create mode 100644 owl-bot-staging/google-cloud-service_health-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-service_management-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-service_management-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-service_management-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-service_management-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-service_management-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-service_management-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_management-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-service_management-v1/README.md create mode 100644 owl-bot-staging/google-cloud-service_management-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-service_management-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-service_management-v1/google-cloud-service_management-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google-cloud-service_management-v1.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/credentials.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/operations.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/auth.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/backend.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/billing.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/config_change.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/context.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/control.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/label.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/log.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/logging.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/metric.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitoring.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/policy.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/quota.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/service.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/resources.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/servicemanager.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/source_info.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/system_parameter.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/usage.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/api.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/source_context.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/type.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_services.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json create mode 100644 owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb create mode 100644 owl-bot-staging/google-cloud-service_management-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/README.md create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/google-cloud-service_usage-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google-cloud-service_usage-v1.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/client.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/credentials.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/operations.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/label.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitoring.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/resources.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/serviceusage.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/api.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/source_context.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/type.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb create mode 100644 owl-bot-staging/google-cloud-service_usage-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-shell-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-shell-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-shell-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-shell-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-shell-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-shell-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-shell-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-shell-v1/README.md create mode 100644 owl-bot-staging/google-cloud-shell-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-shell-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-shell-v1/google-cloud-shell-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google-cloud-shell-v1.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/client.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json create mode 100644 owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb create mode 100644 owl-bot-staging/google-cloud-shell-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/google-cloud-spanner-admin-database-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google-cloud-spanner-admin-database-v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/credentials.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/common.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/add_split_points.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup_schedule.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup_schedule.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup_schedule.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/internal_update_graph_operation.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_schedules.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup_schedule.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/transaction_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/type_pb.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb create mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-speech-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-speech-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-speech-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-speech-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-speech-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-speech-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-speech-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-speech-v1/README.md create mode 100644 owl-bot-staging/google-cloud-speech-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-speech-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-speech-v1/google-cloud-speech-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google-cloud-speech-v1.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/credentials.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/paths.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/resource_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/credentials.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/paths.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech_adaptation.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/resource.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/speech/recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/google-cloud-speech-v1p1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google-cloud-speech-v1p1beta1.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/credentials.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/resource_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/credentials.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/paths.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/resource.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-speech-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-speech-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-speech-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/README.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb create mode 100644 owl-bot-staging/google-cloud-speech-v2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/README.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/README.md create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/google-cloud-storage_batch_operations-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google-cloud-storage_batch_operations-v1.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/client.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/paths.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations_types.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/code.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/snippet_metadata_google.cloud.storagebatchoperations.v1.json create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/cancel_job.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/create_job.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/delete_job.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_bucket_operation.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_job.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_bucket_operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_jobs.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/README.md create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/google-cloud-storage_insights-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google-cloud-storage_insights-v1.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/credentials.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/date.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/datetime.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/snippet_metadata_google.cloud.storageinsights.v1.json create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_dataset_config.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_report_config.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_dataset_config.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_report_config.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_dataset_config.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_config.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_detail.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/link_dataset.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_dataset_configs.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_configs.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_details.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/unlink_dataset.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_dataset_config.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_report_config.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/README.md create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/google-cloud-storage_transfer-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google-cloud-storage_transfer-v1.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/client.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_types_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/code.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer_types.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/date.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb create mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-support-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-support-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-support-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-support-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-support-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-support-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-support-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-support-v2/README.md create mode 100644 owl-bot-staging/google-cloud-support-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-support-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-support-v2/google-cloud-support-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google-cloud-support-v2.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/actor_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/escalation_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/actor.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/escalation.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_attachment_service/list_attachments.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/close_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/create_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/escalate_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/get_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/list_cases.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_case_classifications.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_cases.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/update_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/comment_service/create_comment.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/comment_service/list_comments.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/snippet_metadata_google.cloud.support.v2.json create mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/.gitignore create mode 100644 owl-bot-staging/google-cloud-support-v2beta/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-support-v2beta/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-support-v2beta/.toys.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/.yardopts create mode 100644 owl-bot-staging/google-cloud-support-v2beta/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-support-v2beta/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-support-v2beta/Gemfile create mode 100644 owl-bot-staging/google-cloud-support-v2beta/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-support-v2beta/README.md create mode 100644 owl-bot-staging/google-cloud-support-v2beta/Rakefile create mode 100644 owl-bot-staging/google-cloud-support-v2beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-support-v2beta/google-cloud-support-v2beta.gemspec create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google-cloud-support-v2beta.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/actor_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/content_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/email_message_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/escalation_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_item_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/rest.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/version.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/actor.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/content.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/email_message.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/escalation.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_item.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_service.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/get_attachment.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/list_attachments.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/close_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/create_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/escalate_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/get_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/list_cases.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_case_classifications.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_cases.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/update_case.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/create_comment.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/get_comment.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/list_comments.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/feed_service/show_feed.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/snippet_metadata_google.cloud.support.v2beta.json create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_test.rb create mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/.gitignore create mode 100644 owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-talent-v4/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-talent-v4/.toys.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/.yardopts create mode 100644 owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/Gemfile create mode 100644 owl-bot-staging/google-cloud-talent-v4/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/README.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/Rakefile create mode 100644 owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/helper.rb diff --git a/owl-bot-staging/google-cloud-service_control-v1/.gitignore b/owl-bot-staging/google-cloud-service_control-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_control-v1/.repo-metadata.json new file mode 100644 index 000000000000..6f4ac0605165 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "servicecontrol.googleapis.com", + "api_shortname": "servicecontrol", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_control-v1/latest", + "distribution_name": "google-cloud-service_control-v1", + "is_cloud": true, + "language": "ruby", + "name": "servicecontrol", + "name_pretty": "Service Control API V1 API", + "product_documentation": "https://cloud.google.com/service-infrastructure/docs/overview/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Service Control API provides control plane functionality to managed services, such as logging, monitoring, and status checks. Note that google-cloud-service_control-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_control instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SERVICE_CONTROL", + "ruby-cloud-product-url": "https://cloud.google.com/service-infrastructure/docs/overview/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-service_control-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_control-v1/.rubocop.yml new file mode 100644 index 000000000000..12b1f90426a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-service_control-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-service_control-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_control-v1/.toys.rb b/owl-bot-staging/google-cloud-service_control-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/.yardopts b/owl-bot-staging/google-cloud-service_control-v1/.yardopts new file mode 100644 index 000000000000..2bbe9053aeb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Service Control API 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-service_control-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_control-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..d242e6b29038 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-service_control-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-service_control-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/service_control/v1" + +client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/service_control/v1" + +::Google::Cloud::ServiceControl::V1::QuotaController::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::ServiceControl::V1::QuotaController::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-service_control-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/service_control/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::ServiceControl::V1::QuotaController::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-service_control-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_control-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-service_control-v1/Gemfile b/owl-bot-staging/google-cloud-service_control-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_control-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_control-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/README.md b/owl-bot-staging/google-cloud-service_control-v1/README.md new file mode 100644 index 000000000000..61c19750c2f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Service Control API V1 API + +Provides admission control and telemetry reporting for services integrated with Service Infrastructure. + +The Service Control API provides control plane functionality to managed services, such as logging, monitoring, and status checks. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Service Control API V1 API. Most users should consider using +the main client gem, +[google-cloud-service_control](https://rubygems.org/gems/google-cloud-service_control). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-service_control-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/servicecontrol.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/service_control/v1" + +client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new +request = ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new # (request fields as keyword arguments...) +response = client.allocate_quota request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_control-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/service-infrastructure/docs/overview/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/service_control/v1" +require "logger" + +client = ::Google::Cloud::ServiceControl::V1::QuotaController::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-service_control`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-service_control-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-service_control`. +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-service_control-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-service_control-v1/Rakefile b/owl-bot-staging/google-cloud-service_control-v1/Rakefile new file mode 100644 index 000000000000..1cadd92fcbaf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SERVICE_CONTROL_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SERVICE_CONTROL_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SERVICE_CONTROL_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 SERVICE_CONTROL_TEST_PROJECT=test123 SERVICE_CONTROL_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/service_control/v1/quota_controller/credentials" + ::Google::Cloud::ServiceControl::V1::QuotaController::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SERVICE_CONTROL_PROJECT"] = project + ENV["SERVICE_CONTROL_TEST_PROJECT"] = project + ENV["SERVICE_CONTROL_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-service_control-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-service_control-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-service_control-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-service_control-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-service_control-v1" + header "google-cloud-service_control-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-service_control-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-service_control-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-service_control-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-service_control-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-service_control-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_control-v1/gapic_metadata.json new file mode 100644 index 000000000000..f4217c466359 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/gapic_metadata.json @@ -0,0 +1,42 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.api.servicecontrol.v1", + "libraryPackage": "::Google::Cloud::ServiceControl::V1", + "services": { + "QuotaController": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ServiceControl::V1::QuotaController::Client", + "rpcs": { + "AllocateQuota": { + "methods": [ + "allocate_quota" + ] + } + } + } + } + }, + "ServiceController": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ServiceControl::V1::ServiceController::Client", + "rpcs": { + "Check": { + "methods": [ + "check" + ] + }, + "Report": { + "methods": [ + "report" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-service_control-v1/google-cloud-service_control-v1.gemspec b/owl-bot-staging/google-cloud-service_control-v1/google-cloud-service_control-v1.gemspec new file mode 100644 index 000000000000..afc0b1bb3a36 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/google-cloud-service_control-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/service_control/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-service_control-v1" + gem.version = Google::Cloud::ServiceControl::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Service Control API provides control plane functionality to managed services, such as logging, monitoring, and status checks. Note that google-cloud-service_control-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_control instead. See the readme for more details." + gem.summary = "Provides admission control and telemetry reporting for services integrated with Service Infrastructure." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google-cloud-service_control-v1.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google-cloud-service_control-v1.rb new file mode 100644 index 000000000000..bfde08f78cb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google-cloud-service_control-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/service_control/v1" diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/check_error_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/check_error_pb.rb new file mode 100644 index 000000000000..413356e9ac39 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/check_error_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicecontrol/v1/check_error.proto + +require 'google/protobuf' + +require 'google/rpc/status_pb' + + +descriptor_data = "\n.google/api/servicecontrol/v1/check_error.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x17google/rpc/status.proto\"\xae\x05\n\nCheckError\x12;\n\x04\x63ode\x18\x01 \x01(\x0e\x32-.google.api.servicecontrol.v1.CheckError.Code\x12\x0f\n\x07subject\x18\x04 \x01(\t\x12\x0e\n\x06\x64\x65tail\x18\x02 \x01(\t\x12\"\n\x06status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\"\x9d\x04\n\x04\x43ode\x12\x1a\n\x16\x45RROR_CODE_UNSPECIFIED\x10\x00\x12\r\n\tNOT_FOUND\x10\x05\x12\x15\n\x11PERMISSION_DENIED\x10\x07\x12\x16\n\x12RESOURCE_EXHAUSTED\x10\x08\x12\x19\n\x15SERVICE_NOT_ACTIVATED\x10h\x12\x14\n\x10\x42ILLING_DISABLED\x10k\x12\x13\n\x0fPROJECT_DELETED\x10l\x12\x13\n\x0fPROJECT_INVALID\x10r\x12\x14\n\x10\x43ONSUMER_INVALID\x10}\x12\x16\n\x12IP_ADDRESS_BLOCKED\x10m\x12\x13\n\x0fREFERER_BLOCKED\x10n\x12\x16\n\x12\x43LIENT_APP_BLOCKED\x10o\x12\x16\n\x12\x41PI_TARGET_BLOCKED\x10z\x12\x13\n\x0f\x41PI_KEY_INVALID\x10i\x12\x13\n\x0f\x41PI_KEY_EXPIRED\x10p\x12\x15\n\x11\x41PI_KEY_NOT_FOUND\x10q\x12\x16\n\x12INVALID_CREDENTIAL\x10{\x12!\n\x1cNAMESPACE_LOOKUP_UNAVAILABLE\x10\xac\x02\x12\x1f\n\x1aSERVICE_STATUS_UNAVAILABLE\x10\xad\x02\x12\x1f\n\x1a\x42ILLING_STATUS_UNAVAILABLE\x10\xae\x02\x12/\n*CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE\x10\xb1\x02\x42\xea\x01\n com.google.api.servicecontrol.v1B\x0f\x43heckErrorProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceControl + module V1 + CheckError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckError").msgclass + CheckError::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckError.Code").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/distribution_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/distribution_pb.rb new file mode 100644 index 000000000000..3e7990f61904 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/distribution_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicecontrol/v1/distribution.proto + +require 'google/protobuf' + +require 'google/api/distribution_pb' + + +descriptor_data = "\n/google/api/servicecontrol/v1/distribution.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x1dgoogle/api/distribution.proto\"\x9e\x05\n\x0c\x44istribution\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\x12\x0c\n\x04mean\x18\x02 \x01(\x01\x12\x0f\n\x07minimum\x18\x03 \x01(\x01\x12\x0f\n\x07maximum\x18\x04 \x01(\x01\x12 \n\x18sum_of_squared_deviation\x18\x05 \x01(\x01\x12\x15\n\rbucket_counts\x18\x06 \x03(\x03\x12R\n\x0elinear_buckets\x18\x07 \x01(\x0b\x32\x38.google.api.servicecontrol.v1.Distribution.LinearBucketsH\x00\x12\\\n\x13\x65xponential_buckets\x18\x08 \x01(\x0b\x32=.google.api.servicecontrol.v1.Distribution.ExponentialBucketsH\x00\x12V\n\x10\x65xplicit_buckets\x18\t \x01(\x0b\x32:.google.api.servicecontrol.v1.Distribution.ExplicitBucketsH\x00\x12\x34\n\texemplars\x18\n \x03(\x0b\x32!.google.api.Distribution.Exemplar\x1aJ\n\rLinearBuckets\x12\x1a\n\x12num_finite_buckets\x18\x01 \x01(\x05\x12\r\n\x05width\x18\x02 \x01(\x01\x12\x0e\n\x06offset\x18\x03 \x01(\x01\x1aV\n\x12\x45xponentialBuckets\x12\x1a\n\x12num_finite_buckets\x18\x01 \x01(\x05\x12\x15\n\rgrowth_factor\x18\x02 \x01(\x01\x12\r\n\x05scale\x18\x03 \x01(\x01\x1a!\n\x0f\x45xplicitBuckets\x12\x0e\n\x06\x62ounds\x18\x01 \x03(\x01\x42\x0f\n\rbucket_optionB\xec\x01\n com.google.api.servicecontrol.v1B\x11\x44istributionProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceControl + module V1 + Distribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Distribution").msgclass + Distribution::LinearBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Distribution.LinearBuckets").msgclass + Distribution::ExponentialBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Distribution.ExponentialBuckets").msgclass + Distribution::ExplicitBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Distribution.ExplicitBuckets").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/http_request_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/http_request_pb.rb new file mode 100644 index 000000000000..de8a58424660 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/http_request_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicecontrol/v1/http_request.proto + +require 'google/protobuf' + +require 'google/protobuf/duration_pb' + + +descriptor_data = "\n/google/api/servicecontrol/v1/http_request.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x1egoogle/protobuf/duration.proto\"\xef\x02\n\x0bHttpRequest\x12\x16\n\x0erequest_method\x18\x01 \x01(\t\x12\x13\n\x0brequest_url\x18\x02 \x01(\t\x12\x14\n\x0crequest_size\x18\x03 \x01(\x03\x12\x0e\n\x06status\x18\x04 \x01(\x05\x12\x15\n\rresponse_size\x18\x05 \x01(\x03\x12\x12\n\nuser_agent\x18\x06 \x01(\t\x12\x11\n\tremote_ip\x18\x07 \x01(\t\x12\x11\n\tserver_ip\x18\r \x01(\t\x12\x0f\n\x07referer\x18\x08 \x01(\t\x12*\n\x07latency\x18\x0e \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x14\n\x0c\x63\x61\x63he_lookup\x18\x0b \x01(\x08\x12\x11\n\tcache_hit\x18\t \x01(\x08\x12*\n\"cache_validated_with_origin_server\x18\n \x01(\x08\x12\x18\n\x10\x63\x61\x63he_fill_bytes\x18\x0c \x01(\x03\x12\x10\n\x08protocol\x18\x0f \x01(\tB\xe8\x01\n com.google.api.servicecontrol.v1B\x10HttpRequestProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceControl + module V1 + HttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.HttpRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/log_entry_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/log_entry_pb.rb new file mode 100644 index 000000000000..33520e195e44 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/log_entry_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicecontrol/v1/log_entry.proto + +require 'google/protobuf' + +require 'google/api/servicecontrol/v1/http_request_pb' +require 'google/logging/type/log_severity_pb' +require 'google/protobuf/any_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/api/servicecontrol/v1/log_entry.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a/google/api/servicecontrol/v1/http_request.proto\x1a&google/logging/type/log_severity.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe9\x04\n\x08LogEntry\x12\x0c\n\x04name\x18\n \x01(\t\x12-\n\ttimestamp\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x08severity\x18\x0c \x01(\x0e\x32 .google.logging.type.LogSeverity\x12?\n\x0chttp_request\x18\x0e \x01(\x0b\x32).google.api.servicecontrol.v1.HttpRequest\x12\r\n\x05trace\x18\x0f \x01(\t\x12\x11\n\tinsert_id\x18\x04 \x01(\t\x12\x42\n\x06labels\x18\r \x03(\x0b\x32\x32.google.api.servicecontrol.v1.LogEntry.LabelsEntry\x12-\n\rproto_payload\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12\x16\n\x0ctext_payload\x18\x03 \x01(\tH\x00\x12\x31\n\x0estruct_payload\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x42\n\toperation\x18\x10 \x01(\x0b\x32/.google.api.servicecontrol.v1.LogEntryOperation\x12M\n\x0fsource_location\x18\x11 \x01(\x0b\x32\x34.google.api.servicecontrol.v1.LogEntrySourceLocation\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07payload\"N\n\x11LogEntryOperation\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08producer\x18\x02 \x01(\t\x12\r\n\x05\x66irst\x18\x03 \x01(\x08\x12\x0c\n\x04last\x18\x04 \x01(\x08\"F\n\x16LogEntrySourceLocation\x12\x0c\n\x04\x66ile\x18\x01 \x01(\t\x12\x0c\n\x04line\x18\x02 \x01(\x03\x12\x10\n\x08\x66unction\x18\x03 \x01(\tB\xe5\x01\n com.google.api.servicecontrol.v1B\rLogEntryProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceControl + module V1 + LogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.LogEntry").msgclass + LogEntryOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.LogEntryOperation").msgclass + LogEntrySourceLocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.LogEntrySourceLocation").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/metric_value_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/metric_value_pb.rb new file mode 100644 index 000000000000..f9d9676426f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/metric_value_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicecontrol/v1/metric_value.proto + +require 'google/protobuf' + +require 'google/api/servicecontrol/v1/distribution_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/api/servicecontrol/v1/metric_value.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a/google/api/servicecontrol/v1/distribution.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x91\x03\n\x0bMetricValue\x12\x45\n\x06labels\x18\x01 \x03(\x0b\x32\x35.google.api.servicecontrol.v1.MetricValue.LabelsEntry\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\nbool_value\x18\x04 \x01(\x08H\x00\x12\x15\n\x0bint64_value\x18\x05 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x06 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x07 \x01(\tH\x00\x12H\n\x12\x64istribution_value\x18\x08 \x01(\x0b\x32*.google.api.servicecontrol.v1.DistributionH\x00\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x07\n\x05value\"g\n\x0eMetricValueSet\x12\x13\n\x0bmetric_name\x18\x01 \x01(\t\x12@\n\rmetric_values\x18\x02 \x03(\x0b\x32).google.api.servicecontrol.v1.MetricValueB\xee\x01\n com.google.api.servicecontrol.v1B\x13MetricValueSetProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceControl + module V1 + MetricValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.MetricValue").msgclass + MetricValueSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.MetricValueSet").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/operation_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/operation_pb.rb new file mode 100644 index 000000000000..0c98c8aaddb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/operation_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicecontrol/v1/operation.proto + +require 'google/protobuf' + +require 'google/api/servicecontrol/v1/log_entry_pb' +require 'google/api/servicecontrol/v1/metric_value_pb' +require 'google/protobuf/any_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/api/servicecontrol/v1/operation.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a,google/api/servicecontrol/v1/log_entry.proto\x1a/google/api/servicecontrol/v1/metric_value.proto\x1a\x19google/protobuf/any.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb9\x04\n\tOperation\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12\x16\n\x0eoperation_name\x18\x02 \x01(\t\x12\x13\n\x0b\x63onsumer_id\x18\x03 \x01(\t\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.api.servicecontrol.v1.Operation.LabelsEntry\x12G\n\x11metric_value_sets\x18\x07 \x03(\x0b\x32,.google.api.servicecontrol.v1.MetricValueSet\x12;\n\x0blog_entries\x18\x08 \x03(\x0b\x32&.google.api.servicecontrol.v1.LogEntry\x12\x46\n\nimportance\x18\x0b \x01(\x0e\x32\x32.google.api.servicecontrol.v1.Operation.Importance\x12(\n\nextensions\x18\x10 \x03(\x0b\x32\x14.google.protobuf.Any\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x1f\n\nImportance\x12\x07\n\x03LOW\x10\x00\x12\x08\n\x04HIGH\x10\x01\x42\xe9\x01\n com.google.api.servicecontrol.v1B\x0eOperationProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceControl + module V1 + Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Operation").msgclass + Operation::Importance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Operation.Importance").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_pb.rb new file mode 100644 index 000000000000..0ea8ec878e62 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_pb.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicecontrol/v1/quota_controller.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/servicecontrol/v1/metric_value_pb' +require 'google/rpc/status_pb' +require 'google/api/client_pb' + + +descriptor_data = "\n3google/api/servicecontrol/v1/quota_controller.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x1cgoogle/api/annotations.proto\x1a/google/api/servicecontrol/v1/metric_value.proto\x1a\x17google/rpc/status.proto\x1a\x17google/api/client.proto\"\x91\x01\n\x14\x41llocateQuotaRequest\x12\x14\n\x0cservice_name\x18\x01 \x01(\t\x12H\n\x12\x61llocate_operation\x18\x02 \x01(\x0b\x32,.google.api.servicecontrol.v1.QuotaOperation\x12\x19\n\x11service_config_id\x18\x04 \x01(\t\"\xc6\x03\n\x0eQuotaOperation\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12\x13\n\x0bmethod_name\x18\x02 \x01(\t\x12\x13\n\x0b\x63onsumer_id\x18\x03 \x01(\t\x12H\n\x06labels\x18\x04 \x03(\x0b\x32\x38.google.api.servicecontrol.v1.QuotaOperation.LabelsEntry\x12\x43\n\rquota_metrics\x18\x05 \x03(\x0b\x32,.google.api.servicecontrol.v1.MetricValueSet\x12J\n\nquota_mode\x18\x06 \x01(\x0e\x32\x36.google.api.servicecontrol.v1.QuotaOperation.QuotaMode\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"j\n\tQuotaMode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x0f\n\x0b\x42\x45ST_EFFORT\x10\x02\x12\x0e\n\nCHECK_ONLY\x10\x03\x12\x0e\n\nQUERY_ONLY\x10\x04\x12\x0f\n\x0b\x41\x44JUST_ONLY\x10\x05\"\xd0\x01\n\x15\x41llocateQuotaResponse\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12\x41\n\x0f\x61llocate_errors\x18\x02 \x03(\x0b\x32(.google.api.servicecontrol.v1.QuotaError\x12\x43\n\rquota_metrics\x18\x03 \x03(\x0b\x32,.google.api.servicecontrol.v1.MetricValueSet\x12\x19\n\x11service_config_id\x18\x04 \x01(\t\"\x9c\x02\n\nQuotaError\x12;\n\x04\x63ode\x18\x01 \x01(\x0e\x32-.google.api.servicecontrol.v1.QuotaError.Code\x12\x0f\n\x07subject\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\"\n\x06status\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"\x86\x01\n\x04\x43ode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x16\n\x12RESOURCE_EXHAUSTED\x10\x08\x12\x16\n\x12\x42ILLING_NOT_ACTIVE\x10k\x12\x13\n\x0fPROJECT_DELETED\x10l\x12\x13\n\x0f\x41PI_KEY_INVALID\x10i\x12\x13\n\x0f\x41PI_KEY_EXPIRED\x10p2\xc5\x02\n\x0fQuotaController\x12\xae\x01\n\rAllocateQuota\x12\x32.google.api.servicecontrol.v1.AllocateQuotaRequest\x1a\x33.google.api.servicecontrol.v1.AllocateQuotaResponse\"4\x82\xd3\xe4\x93\x02.\")/v1/services/{service_name}:allocateQuota:\x01*\x1a\x80\x01\xca\x41\x1dservicecontrol.googleapis.com\xd2\x41]https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/servicecontrolB\xef\x01\n com.google.api.servicecontrol.v1B\x14QuotaControllerProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceControl + module V1 + AllocateQuotaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.AllocateQuotaRequest").msgclass + QuotaOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.QuotaOperation").msgclass + QuotaOperation::QuotaMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.QuotaOperation.QuotaMode").enummodule + AllocateQuotaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.AllocateQuotaResponse").msgclass + QuotaError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.QuotaError").msgclass + QuotaError::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.QuotaError.Code").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_services_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_services_pb.rb new file mode 100644 index 000000000000..9e6901992de2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_services_pb.rb @@ -0,0 +1,58 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/api/servicecontrol/v1/quota_controller.proto for package 'Google.Cloud.ServiceControl.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/api/servicecontrol/v1/quota_controller_pb' + +module Google + module Cloud + module ServiceControl + module V1 + module QuotaController + # [Google Quota Control API](/service-control/overview) + # + # Allows clients to allocate and release quota against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.api.servicecontrol.v1.QuotaController' + + # Attempts to allocate quota for the specified consumer. It should be called + # before the operation is executed. + # + # This method requires the `servicemanagement.services.quota` + # permission on the specified service. For more information, see + # [Cloud IAM](https://cloud.google.com/iam). + # + # **NOTE:** The client **must** fail-open on server errors `INTERNAL`, + # `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system + # reliability, the server may inject these errors to prohibit any hard + # dependency on the quota functionality. + rpc :AllocateQuota, ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest, ::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_pb.rb new file mode 100644 index 000000000000..4c2ddaba171b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicecontrol/v1/service_controller.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/servicecontrol/v1/check_error_pb' +require 'google/api/servicecontrol/v1/operation_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n5google/api/servicecontrol/v1/service_controller.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a.google/api/servicecontrol/v1/check_error.proto\x1a,google/api/servicecontrol/v1/operation.proto\x1a\x17google/rpc/status.proto\"{\n\x0c\x43heckRequest\x12\x14\n\x0cservice_name\x18\x01 \x01(\t\x12:\n\toperation\x18\x02 \x01(\x0b\x32\'.google.api.servicecontrol.v1.Operation\x12\x19\n\x11service_config_id\x18\x04 \x01(\t\"\xfc\x04\n\rCheckResponse\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12>\n\x0c\x63heck_errors\x18\x02 \x03(\x0b\x32(.google.api.servicecontrol.v1.CheckError\x12\x19\n\x11service_config_id\x18\x05 \x01(\t\x12\x1a\n\x12service_rollout_id\x18\x0b \x01(\t\x12I\n\ncheck_info\x18\x06 \x01(\x0b\x32\x35.google.api.servicecontrol.v1.CheckResponse.CheckInfo\x1a\x8b\x01\n\tCheckInfo\x12\x18\n\x10unused_arguments\x18\x01 \x03(\t\x12O\n\rconsumer_info\x18\x02 \x01(\x0b\x32\x38.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo\x12\x13\n\x0b\x61pi_key_uid\x18\x05 \x01(\t\x1a\x84\x02\n\x0c\x43onsumerInfo\x12\x16\n\x0eproject_number\x18\x01 \x01(\x03\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType\x12\x17\n\x0f\x63onsumer_number\x18\x03 \x01(\x03\"n\n\x0c\x43onsumerType\x12\x1d\n\x19\x43ONSUMER_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PROJECT\x10\x01\x12\n\n\x06\x46OLDER\x10\x02\x12\x10\n\x0cORGANIZATION\x10\x03\x12\x14\n\x10SERVICE_SPECIFIC\x10\x04\"}\n\rReportRequest\x12\x14\n\x0cservice_name\x18\x01 \x01(\t\x12;\n\noperations\x18\x02 \x03(\x0b\x32\'.google.api.servicecontrol.v1.Operation\x12\x19\n\x11service_config_id\x18\x03 \x01(\t\"\xe1\x01\n\x0eReportResponse\x12O\n\rreport_errors\x18\x01 \x03(\x0b\x32\x38.google.api.servicecontrol.v1.ReportResponse.ReportError\x12\x19\n\x11service_config_id\x18\x02 \x01(\t\x12\x1a\n\x12service_rollout_id\x18\x04 \x01(\t\x1aG\n\x0bReportError\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status2\xbc\x03\n\x11ServiceController\x12\x8e\x01\n\x05\x43heck\x12*.google.api.servicecontrol.v1.CheckRequest\x1a+.google.api.servicecontrol.v1.CheckResponse\",\x82\xd3\xe4\x93\x02&\"!/v1/services/{service_name}:check:\x01*\x12\x92\x01\n\x06Report\x12+.google.api.servicecontrol.v1.ReportRequest\x1a,.google.api.servicecontrol.v1.ReportResponse\"-\x82\xd3\xe4\x93\x02\'\"\"/v1/services/{service_name}:report:\x01*\x1a\x80\x01\xca\x41\x1dservicecontrol.googleapis.com\xd2\x41]https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/servicecontrolB\xf8\x01\n com.google.api.servicecontrol.v1B\x16ServiceControllerProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xa2\x02\x04GASC\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceControl + module V1 + CheckRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckRequest").msgclass + CheckResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckResponse").msgclass + CheckResponse::CheckInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckResponse.CheckInfo").msgclass + CheckResponse::ConsumerInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckResponse.ConsumerInfo").msgclass + CheckResponse::ConsumerInfo::ConsumerType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType").enummodule + ReportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.ReportRequest").msgclass + ReportResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.ReportResponse").msgclass + ReportResponse::ReportError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.ReportResponse.ReportError").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_services_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_services_pb.rb new file mode 100644 index 000000000000..fe7d24ccfbad --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_services_pb.rb @@ -0,0 +1,80 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/api/servicecontrol/v1/service_controller.proto for package 'Google.Cloud.ServiceControl.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/api/servicecontrol/v1/service_controller_pb' + +module Google + module Cloud + module ServiceControl + module V1 + module ServiceController + # [Google Service Control API](/service-control/overview) + # + # Lets clients check and report operations against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.api.servicecontrol.v1.ServiceController' + + # Checks whether an operation on a service should be allowed to proceed + # based on the configuration of the service and related policies. It must be + # called before the operation is executed. + # + # If feasible, the client should cache the check results and reuse them for + # 60 seconds. In case of any server errors, the client should rely on the + # cached results for much longer time to avoid outage. + # WARNING: There is general 60s delay for the configuration and policy + # propagation, therefore callers MUST NOT depend on the `Check` method having + # the latest policy information. + # + # NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has + # the size limit (wire-format byte size) of 1MB. + # + # This method requires the `servicemanagement.services.check` permission + # on the specified service. For more information, see + # [Cloud IAM](https://cloud.google.com/iam). + rpc :Check, ::Google::Cloud::ServiceControl::V1::CheckRequest, ::Google::Cloud::ServiceControl::V1::CheckResponse + # Reports operation results to Google Service Control, such as logs and + # metrics. It should be called after an operation is completed. + # + # If feasible, the client should aggregate reporting data for up to 5 + # seconds to reduce API traffic. Limiting aggregation to 5 seconds is to + # reduce data loss during client crashes. Clients should carefully choose + # the aggregation time window to avoid data loss risk more than 0.01% + # for business and compliance reasons. + # + # NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has + # the size limit (wire-format byte size) of 1MB. + # + # This method requires the `servicemanagement.services.report` permission + # on the specified service. For more information, see + # [Google Cloud IAM](https://cloud.google.com/iam). + rpc :Report, ::Google::Cloud::ServiceControl::V1::ReportRequest, ::Google::Cloud::ServiceControl::V1::ReportResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1.rb new file mode 100644 index 000000000000..dcc95829cf0e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1.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/service_control/v1/quota_controller" +require "google/cloud/service_control/v1/service_controller" +require "google/cloud/service_control/v1/version" + +module Google + module Cloud + module ServiceControl + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/service_control/v1" + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/service_control/v1" + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/service_control/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller.rb new file mode 100644 index 000000000000..32352d8a09f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/service_control/v1/version" + +require "google/cloud/service_control/v1/quota_controller/credentials" +require "google/cloud/service_control/v1/quota_controller/client" +require "google/cloud/service_control/v1/quota_controller/rest" + +module Google + module Cloud + module ServiceControl + module V1 + ## + # [Google Quota Control API](/service-control/overview) + # + # Allows clients to allocate and release quota against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/service_control/v1/quota_controller" + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/service_control/v1/quota_controller/rest" + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new + # + module QuotaController + end + end + end + end +end + +helper_path = ::File.join __dir__, "quota_controller", "helpers.rb" +require "google/cloud/service_control/v1/quota_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/client.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/client.rb new file mode 100644 index 000000000000..da48107007a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/client.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 "google/cloud/errors" +require "google/api/servicecontrol/v1/quota_controller_pb" + +module Google + module Cloud + module ServiceControl + module V1 + module QuotaController + ## + # Client for the QuotaController service. + # + # [Google Quota Control API](/service-control/overview) + # + # Allows clients to allocate and release quota against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicecontrol.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :quota_controller_stub + + ## + # Configure the QuotaController Client class. + # + # See {::Google::Cloud::ServiceControl::V1::QuotaController::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all QuotaController clients + # ::Google::Cloud::ServiceControl::V1::QuotaController::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceControl", "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 QuotaController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceControl::V1::QuotaController::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @quota_controller_stub.universe_domain + end + + ## + # Create a new QuotaController client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the QuotaController 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/api/servicecontrol/v1/quota_controller_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 + + @quota_controller_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ServiceControl::V1::QuotaController::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 + ) + + @quota_controller_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 + @quota_controller_stub.logger + end + + # Service calls + + ## + # Attempts to allocate quota for the specified consumer. It should be called + # before the operation is executed. + # + # This method requires the `servicemanagement.services.quota` + # permission on the specified service. For more information, see + # [Cloud IAM](https://cloud.google.com/iam). + # + # **NOTE:** The client **must** fail-open on server errors `INTERNAL`, + # `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system + # reliability, the server may inject these errors to prohibit any hard + # dependency on the quota functionality. + # + # @overload allocate_quota(request, options = nil) + # Pass arguments to `allocate_quota` via a request object, either of type + # {::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload allocate_quota(service_name: nil, allocate_operation: nil, service_config_id: nil) + # Pass arguments to `allocate_quota` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Name of the service as specified in the service configuration. For example, + # `"pubsub.googleapis.com"`. + # + # See [google.api.Service][google.api.Service] for the definition of a service name. + # @param allocate_operation [::Google::Cloud::ServiceControl::V1::QuotaOperation, ::Hash] + # Operation that describes the quota allocation. + # @param service_config_id [::String] + # Specifies which version of service configuration should be used to process + # the request. If unspecified or no matching version can be found, the latest + # one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_control/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceControl::V1::QuotaController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new + # + # # Call the allocate_quota method. + # result = client.allocate_quota request + # + # # The returned object is of type Google::Cloud::ServiceControl::V1::AllocateQuotaResponse. + # p result + # + def allocate_quota request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.allocate_quota.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.allocate_quota.timeout, + metadata: metadata, + retry_policy: @config.rpcs.allocate_quota.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @quota_controller_stub.call_rpc :allocate_quota, request, 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 QuotaController API. + # + # This class represents the configuration for QuotaController, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceControl::V1::QuotaController::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # allocate_quota to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceControl::V1::QuotaController::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.allocate_quota.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.allocate_quota.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::ServiceControl::V1::QuotaController::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicecontrol.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the QuotaController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `allocate_quota` + # @return [::Gapic::Config::Method] + # + attr_reader :allocate_quota + + # @private + def initialize parent_rpcs = nil + allocate_quota_config = parent_rpcs.allocate_quota if parent_rpcs.respond_to? :allocate_quota + @allocate_quota = ::Gapic::Config::Method.new allocate_quota_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/credentials.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/credentials.rb new file mode 100644 index 000000000000..e06bb9ba406a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module ServiceControl + module V1 + module QuotaController + # Credentials for the QuotaController API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/servicecontrol" + ] + self.env_vars = [ + "SERVICE_CONTROL_CREDENTIALS", + "SERVICE_CONTROL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SERVICE_CONTROL_CREDENTIALS_JSON", + "SERVICE_CONTROL_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-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest.rb new file mode 100644 index 000000000000..cc62437a5104 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/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/service_control/v1/version" + +require "google/cloud/service_control/v1/quota_controller/credentials" +require "google/cloud/service_control/v1/quota_controller/rest/client" + +module Google + module Cloud + module ServiceControl + module V1 + ## + # [Google Quota Control API](/service-control/overview) + # + # Allows clients to allocate and release quota against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/service_control/v1/quota_controller/rest" + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new + # + module QuotaController + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/service_control/v1/quota_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/client.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/client.rb new file mode 100644 index 000000000000..1e3c298cf0b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/client.rb @@ -0,0 +1,444 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/api/servicecontrol/v1/quota_controller_pb" +require "google/cloud/service_control/v1/quota_controller/rest/service_stub" + +module Google + module Cloud + module ServiceControl + module V1 + module QuotaController + module Rest + ## + # REST client for the QuotaController service. + # + # [Google Quota Control API](/service-control/overview) + # + # Allows clients to allocate and release quota against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicecontrol.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :quota_controller_stub + + ## + # Configure the QuotaController Client class. + # + # See {::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all QuotaController clients + # ::Google::Cloud::ServiceControl::V1::QuotaController::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", "ServiceControl", "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 QuotaController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceControl::V1::QuotaController::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 + @quota_controller_stub.universe_domain + end + + ## + # Create a new QuotaController REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the QuotaController 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 + + @quota_controller_stub = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @quota_controller_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 + @quota_controller_stub.logger + end + + # Service calls + + ## + # Attempts to allocate quota for the specified consumer. It should be called + # before the operation is executed. + # + # This method requires the `servicemanagement.services.quota` + # permission on the specified service. For more information, see + # [Cloud IAM](https://cloud.google.com/iam). + # + # **NOTE:** The client **must** fail-open on server errors `INTERNAL`, + # `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system + # reliability, the server may inject these errors to prohibit any hard + # dependency on the quota functionality. + # + # @overload allocate_quota(request, options = nil) + # Pass arguments to `allocate_quota` via a request object, either of type + # {::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload allocate_quota(service_name: nil, allocate_operation: nil, service_config_id: nil) + # Pass arguments to `allocate_quota` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Name of the service as specified in the service configuration. For example, + # `"pubsub.googleapis.com"`. + # + # See [google.api.Service][google.api.Service] for the definition of a service name. + # @param allocate_operation [::Google::Cloud::ServiceControl::V1::QuotaOperation, ::Hash] + # Operation that describes the quota allocation. + # @param service_config_id [::String] + # Specifies which version of service configuration should be used to process + # the request. If unspecified or no matching version can be found, the latest + # one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_control/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new + # + # # Call the allocate_quota method. + # result = client.allocate_quota request + # + # # The returned object is of type Google::Cloud::ServiceControl::V1::AllocateQuotaResponse. + # p result + # + def allocate_quota request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.allocate_quota.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.allocate_quota.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.allocate_quota.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @quota_controller_stub.allocate_quota request, 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 QuotaController REST API. + # + # This class represents the configuration for QuotaController REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # allocate_quota to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.allocate_quota.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.allocate_quota.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicecontrol.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the QuotaController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `allocate_quota` + # @return [::Gapic::Config::Method] + # + attr_reader :allocate_quota + + # @private + def initialize parent_rpcs = nil + allocate_quota_config = parent_rpcs.allocate_quota if parent_rpcs.respond_to? :allocate_quota + @allocate_quota = ::Gapic::Config::Method.new allocate_quota_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb new file mode 100644 index 000000000000..f4dcafdb9c1a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/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/api/servicecontrol/v1/quota_controller_pb" + +module Google + module Cloud + module ServiceControl + module V1 + module QuotaController + module Rest + ## + # REST service stub for the QuotaController 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 allocate_quota REST call + # + # @param request_pb [::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] + # A result object deserialized from the server's reply + def allocate_quota request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_allocate_quota_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "allocate_quota", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse.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 allocate_quota REST call + # + # @param request_pb [::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_allocate_quota_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/services/{service_name}:allocateQuota", + body: "*", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/rest.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/rest.rb new file mode 100644 index 000000000000..b1390881305c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/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/service_control/v1/quota_controller/rest" +require "google/cloud/service_control/v1/service_controller/rest" +require "google/cloud/service_control/v1/version" + +module Google + module Cloud + module ServiceControl + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/service_control/v1/rest" + # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller.rb new file mode 100644 index 000000000000..fcd57419afc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/service_control/v1/version" + +require "google/cloud/service_control/v1/service_controller/credentials" +require "google/cloud/service_control/v1/service_controller/client" +require "google/cloud/service_control/v1/service_controller/rest" + +module Google + module Cloud + module ServiceControl + module V1 + ## + # [Google Service Control API](/service-control/overview) + # + # Lets clients check and report operations against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/service_control/v1/service_controller" + # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/service_control/v1/service_controller/rest" + # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new + # + module ServiceController + end + end + end + end +end + +helper_path = ::File.join __dir__, "service_controller", "helpers.rb" +require "google/cloud/service_control/v1/service_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/client.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/client.rb new file mode 100644 index 000000000000..994cb7199cb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/client.rb @@ -0,0 +1,640 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/api/servicecontrol/v1/service_controller_pb" + +module Google + module Cloud + module ServiceControl + module V1 + module ServiceController + ## + # Client for the ServiceController service. + # + # [Google Service Control API](/service-control/overview) + # + # Lets clients check and report operations against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicecontrol.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :service_controller_stub + + ## + # Configure the ServiceController Client class. + # + # See {::Google::Cloud::ServiceControl::V1::ServiceController::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServiceController clients + # ::Google::Cloud::ServiceControl::V1::ServiceController::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceControl", "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.check.timeout = 5.0 + default_config.rpcs.check.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.report.timeout = 16.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServiceController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceControl::V1::ServiceController::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @service_controller_stub.universe_domain + end + + ## + # Create a new ServiceController client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServiceController 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/api/servicecontrol/v1/service_controller_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 + + @service_controller_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ServiceControl::V1::ServiceController::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 + ) + + @service_controller_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 + @service_controller_stub.logger + end + + # Service calls + + ## + # Checks whether an operation on a service should be allowed to proceed + # based on the configuration of the service and related policies. It must be + # called before the operation is executed. + # + # If feasible, the client should cache the check results and reuse them for + # 60 seconds. In case of any server errors, the client should rely on the + # cached results for much longer time to avoid outage. + # WARNING: There is general 60s delay for the configuration and policy + # propagation, therefore callers MUST NOT depend on the `Check` method having + # the latest policy information. + # + # NOTE: the {::Google::Cloud::ServiceControl::V1::CheckRequest CheckRequest} has + # the size limit (wire-format byte size) of 1MB. + # + # This method requires the `servicemanagement.services.check` permission + # on the specified service. For more information, see + # [Cloud IAM](https://cloud.google.com/iam). + # + # @overload check(request, options = nil) + # Pass arguments to `check` via a request object, either of type + # {::Google::Cloud::ServiceControl::V1::CheckRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceControl::V1::CheckRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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(service_name: nil, operation: nil, service_config_id: nil) + # Pass arguments to `check` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # The service name as specified in its service configuration. For example, + # `"pubsub.googleapis.com"`. + # + # See + # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + # for the definition of a service name. + # @param operation [::Google::Cloud::ServiceControl::V1::Operation, ::Hash] + # The operation to be checked. + # @param service_config_id [::String] + # Specifies which version of service configuration should be used to process + # the request. + # + # If unspecified or no matching version can be found, the + # latest one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceControl::V1::CheckResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceControl::V1::CheckResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_control/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceControl::V1::CheckRequest.new + # + # # Call the check method. + # result = client.check request + # + # # The returned object is of type Google::Cloud::ServiceControl::V1::CheckResponse. + # p result + # + def check request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::CheckRequest + + # Converts hash and nil to 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.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.check.timeout, + metadata: metadata, + retry_policy: @config.rpcs.check.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_controller_stub.call_rpc :check, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reports operation results to Google Service Control, such as logs and + # metrics. It should be called after an operation is completed. + # + # If feasible, the client should aggregate reporting data for up to 5 + # seconds to reduce API traffic. Limiting aggregation to 5 seconds is to + # reduce data loss during client crashes. Clients should carefully choose + # the aggregation time window to avoid data loss risk more than 0.01% + # for business and compliance reasons. + # + # NOTE: the {::Google::Cloud::ServiceControl::V1::ReportRequest ReportRequest} has + # the size limit (wire-format byte size) of 1MB. + # + # This method requires the `servicemanagement.services.report` permission + # on the specified service. For more information, see + # [Google Cloud IAM](https://cloud.google.com/iam). + # + # @overload report(request, options = nil) + # Pass arguments to `report` via a request object, either of type + # {::Google::Cloud::ServiceControl::V1::ReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceControl::V1::ReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload report(service_name: nil, operations: nil, service_config_id: nil) + # Pass arguments to `report` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # The service name as specified in its service configuration. For example, + # `"pubsub.googleapis.com"`. + # + # See + # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + # for the definition of a service name. + # @param operations [::Array<::Google::Cloud::ServiceControl::V1::Operation, ::Hash>] + # Operations to be reported. + # + # Typically the service should report one operation per request. + # Putting multiple operations into a single request is allowed, but should + # be used only when multiple operations are natually available at the time + # of the report. + # + # There is no limit on the number of operations in the same ReportRequest, + # however the ReportRequest size should be no larger than 1MB. See + # {::Google::Cloud::ServiceControl::V1::ReportResponse#report_errors ReportResponse.report_errors} + # for partial failure behavior. + # @param service_config_id [::String] + # Specifies which version of service config should be used to process the + # request. + # + # If unspecified or no matching version can be found, the + # latest one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceControl::V1::ReportResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceControl::V1::ReportResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_control/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceControl::V1::ReportRequest.new + # + # # Call the report method. + # result = client.report request + # + # # The returned object is of type Google::Cloud::ServiceControl::V1::ReportResponse. + # p result + # + def report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::ReportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.report.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.report.timeout, + metadata: metadata, + retry_policy: @config.rpcs.report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_controller_stub.call_rpc :report, request, 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 ServiceController API. + # + # This class represents the configuration for ServiceController, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceControl::V1::ServiceController::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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 to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceControl::V1::ServiceController::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.check.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.check.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::ServiceControl::V1::ServiceController::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicecontrol.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ServiceController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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` + # @return [::Gapic::Config::Method] + # + attr_reader :check + ## + # RPC-specific configuration for `report` + # @return [::Gapic::Config::Method] + # + attr_reader :report + + # @private + def initialize parent_rpcs = nil + check_config = parent_rpcs.check if parent_rpcs.respond_to? :check + @check = ::Gapic::Config::Method.new check_config + report_config = parent_rpcs.report if parent_rpcs.respond_to? :report + @report = ::Gapic::Config::Method.new report_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/credentials.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/credentials.rb new file mode 100644 index 000000000000..ae04179c3e7e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module ServiceControl + module V1 + module ServiceController + # Credentials for the ServiceController API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/servicecontrol" + ] + self.env_vars = [ + "SERVICE_CONTROL_CREDENTIALS", + "SERVICE_CONTROL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SERVICE_CONTROL_CREDENTIALS_JSON", + "SERVICE_CONTROL_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-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest.rb new file mode 100644 index 000000000000..13f29e53b5c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/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/service_control/v1/version" + +require "google/cloud/service_control/v1/service_controller/credentials" +require "google/cloud/service_control/v1/service_controller/rest/client" + +module Google + module Cloud + module ServiceControl + module V1 + ## + # [Google Service Control API](/service-control/overview) + # + # Lets clients check and report operations against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/service_control/v1/service_controller/rest" + # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new + # + module ServiceController + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/service_control/v1/service_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/client.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/client.rb new file mode 100644 index 000000000000..a657751772a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/client.rb @@ -0,0 +1,583 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/api/servicecontrol/v1/service_controller_pb" +require "google/cloud/service_control/v1/service_controller/rest/service_stub" + +module Google + module Cloud + module ServiceControl + module V1 + module ServiceController + module Rest + ## + # REST client for the ServiceController service. + # + # [Google Service Control API](/service-control/overview) + # + # Lets clients check and report operations against a [managed + # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicecontrol.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :service_controller_stub + + ## + # Configure the ServiceController Client class. + # + # See {::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServiceController clients + # ::Google::Cloud::ServiceControl::V1::ServiceController::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", "ServiceControl", "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.check.timeout = 5.0 + default_config.rpcs.check.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.report.timeout = 16.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServiceController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceControl::V1::ServiceController::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 + @service_controller_stub.universe_domain + end + + ## + # Create a new ServiceController REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServiceController 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 + + @service_controller_stub = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @service_controller_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 + @service_controller_stub.logger + end + + # Service calls + + ## + # Checks whether an operation on a service should be allowed to proceed + # based on the configuration of the service and related policies. It must be + # called before the operation is executed. + # + # If feasible, the client should cache the check results and reuse them for + # 60 seconds. In case of any server errors, the client should rely on the + # cached results for much longer time to avoid outage. + # WARNING: There is general 60s delay for the configuration and policy + # propagation, therefore callers MUST NOT depend on the `Check` method having + # the latest policy information. + # + # NOTE: the {::Google::Cloud::ServiceControl::V1::CheckRequest CheckRequest} has + # the size limit (wire-format byte size) of 1MB. + # + # This method requires the `servicemanagement.services.check` permission + # on the specified service. For more information, see + # [Cloud IAM](https://cloud.google.com/iam). + # + # @overload check(request, options = nil) + # Pass arguments to `check` via a request object, either of type + # {::Google::Cloud::ServiceControl::V1::CheckRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceControl::V1::CheckRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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(service_name: nil, operation: nil, service_config_id: nil) + # Pass arguments to `check` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # The service name as specified in its service configuration. For example, + # `"pubsub.googleapis.com"`. + # + # See + # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + # for the definition of a service name. + # @param operation [::Google::Cloud::ServiceControl::V1::Operation, ::Hash] + # The operation to be checked. + # @param service_config_id [::String] + # Specifies which version of service configuration should be used to process + # the request. + # + # If unspecified or no matching version can be found, the + # latest one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceControl::V1::CheckResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceControl::V1::CheckResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_control/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceControl::V1::CheckRequest.new + # + # # Call the check method. + # result = client.check request + # + # # The returned object is of type Google::Cloud::ServiceControl::V1::CheckResponse. + # p result + # + def check request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::CheckRequest + + # Converts hash and nil to an 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.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.check.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_controller_stub.check request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reports operation results to Google Service Control, such as logs and + # metrics. It should be called after an operation is completed. + # + # If feasible, the client should aggregate reporting data for up to 5 + # seconds to reduce API traffic. Limiting aggregation to 5 seconds is to + # reduce data loss during client crashes. Clients should carefully choose + # the aggregation time window to avoid data loss risk more than 0.01% + # for business and compliance reasons. + # + # NOTE: the {::Google::Cloud::ServiceControl::V1::ReportRequest ReportRequest} has + # the size limit (wire-format byte size) of 1MB. + # + # This method requires the `servicemanagement.services.report` permission + # on the specified service. For more information, see + # [Google Cloud IAM](https://cloud.google.com/iam). + # + # @overload report(request, options = nil) + # Pass arguments to `report` via a request object, either of type + # {::Google::Cloud::ServiceControl::V1::ReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceControl::V1::ReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload report(service_name: nil, operations: nil, service_config_id: nil) + # Pass arguments to `report` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # The service name as specified in its service configuration. For example, + # `"pubsub.googleapis.com"`. + # + # See + # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + # for the definition of a service name. + # @param operations [::Array<::Google::Cloud::ServiceControl::V1::Operation, ::Hash>] + # Operations to be reported. + # + # Typically the service should report one operation per request. + # Putting multiple operations into a single request is allowed, but should + # be used only when multiple operations are natually available at the time + # of the report. + # + # There is no limit on the number of operations in the same ReportRequest, + # however the ReportRequest size should be no larger than 1MB. See + # {::Google::Cloud::ServiceControl::V1::ReportResponse#report_errors ReportResponse.report_errors} + # for partial failure behavior. + # @param service_config_id [::String] + # Specifies which version of service config should be used to process the + # request. + # + # If unspecified or no matching version can be found, the + # latest one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceControl::V1::ReportResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceControl::V1::ReportResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_control/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceControl::V1::ReportRequest.new + # + # # Call the report method. + # result = client.report request + # + # # The returned object is of type Google::Cloud::ServiceControl::V1::ReportResponse. + # p result + # + def report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::ReportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.report.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.report.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_controller_stub.report request, 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 ServiceController REST API. + # + # This class represents the configuration for ServiceController REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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 to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.check.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.check.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicecontrol.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ServiceController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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` + # @return [::Gapic::Config::Method] + # + attr_reader :check + ## + # RPC-specific configuration for `report` + # @return [::Gapic::Config::Method] + # + attr_reader :report + + # @private + def initialize parent_rpcs = nil + check_config = parent_rpcs.check if parent_rpcs.respond_to? :check + @check = ::Gapic::Config::Method.new check_config + report_config = parent_rpcs.report if parent_rpcs.respond_to? :report + @report = ::Gapic::Config::Method.new report_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb new file mode 100644 index 000000000000..3203240fae04 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/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/api/servicecontrol/v1/service_controller_pb" + +module Google + module Cloud + module ServiceControl + module V1 + module ServiceController + module Rest + ## + # REST service stub for the ServiceController 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 REST call + # + # @param request_pb [::Google::Cloud::ServiceControl::V1::CheckRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceControl::V1::CheckResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceControl::V1::CheckResponse] + # A result object deserialized from the server's reply + def check request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_check_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceControl::V1::CheckResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the report REST call + # + # @param request_pb [::Google::Cloud::ServiceControl::V1::ReportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceControl::V1::ReportResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceControl::V1::ReportResponse] + # A result object deserialized from the server's reply + def report request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_report_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "report", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceControl::V1::ReportResponse.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 REST call + # + # @param request_pb [::Google::Cloud::ServiceControl::V1::CheckRequest] + # 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_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/services/{service_name}:check", + body: "*", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the report REST call + # + # @param request_pb [::Google::Cloud::ServiceControl::V1::ReportRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_report_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/services/{service_name}:report", + body: "*", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/version.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/version.rb new file mode 100644 index 000000000000..f4ed47989a7e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/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 ServiceControl + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/README.md new file mode 100644 index 000000000000..9aa07e3d9899 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Service Control API 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-service_control-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/distribution.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/distribution.rb new file mode 100644 index 000000000000..e4f870d5ad0d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/distribution.rb @@ -0,0 +1,233 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # `Distribution` contains summary statistics for a population of values. It + # optionally contains a histogram representing the distribution of those values + # across a set of buckets. + # + # The summary statistics are the count, mean, sum of the squared deviation from + # the mean, the minimum, and the maximum of the set of population of values. + # The histogram is based on a sequence of buckets and gives a count of values + # that fall into each bucket. The boundaries of the buckets are given either + # explicitly or by formulas for buckets of fixed or exponentially increasing + # widths. + # + # Although it is not forbidden, it is generally a bad idea to include + # non-finite values (infinities or NaNs) in the population of values, as this + # will render the `mean` and `sum_of_squared_deviation` fields meaningless. + # @!attribute [rw] count + # @return [::Integer] + # The number of values in the population. Must be non-negative. This value + # must equal the sum of the values in `bucket_counts` if a histogram is + # provided. + # @!attribute [rw] mean + # @return [::Float] + # The arithmetic mean of the values in the population. If `count` is zero + # then this field must be zero. + # @!attribute [rw] sum_of_squared_deviation + # @return [::Float] + # The sum of squared deviations from the mean of the values in the + # population. For values x_i this is: + # + # Sum[i=1..n]((x_i - mean)^2) + # + # Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition + # describes Welford's method for accumulating this sum in one pass. + # + # If `count` is zero then this field must be zero. + # @!attribute [rw] range + # @return [::Google::Api::Distribution::Range] + # If specified, contains the range of the population values. The field + # must not be present if the `count` is zero. + # @!attribute [rw] bucket_options + # @return [::Google::Api::Distribution::BucketOptions] + # Defines the histogram bucket boundaries. If the distribution does not + # contain a histogram, then omit this field. + # @!attribute [rw] bucket_counts + # @return [::Array<::Integer>] + # The number of values in each bucket of the histogram, as described in + # `bucket_options`. If the distribution does not have a histogram, then omit + # this field. If there is a histogram, then the sum of the values in + # `bucket_counts` must equal the value in the `count` field of the + # distribution. + # + # If present, `bucket_counts` should contain N values, where N is the number + # of buckets specified in `bucket_options`. If you supply fewer than N + # values, the remaining values are assumed to be 0. + # + # The order of the values in `bucket_counts` follows the bucket numbering + # schemes described for the three bucket types. The first value must be the + # count for the underflow bucket (number 0). The next N-2 values are the + # counts for the finite buckets (number 1 through N-2). The N'th value in + # `bucket_counts` is the count for the overflow bucket (number N-1). + # @!attribute [rw] exemplars + # @return [::Array<::Google::Api::Distribution::Exemplar>] + # Must be in increasing order of `value` field. + class Distribution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The range of the population values. + # @!attribute [rw] min + # @return [::Float] + # The minimum of the population values. + # @!attribute [rw] max + # @return [::Float] + # The maximum of the population values. + class Range + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BucketOptions` describes the bucket boundaries used to create a histogram + # for the distribution. The buckets can be in a linear sequence, an + # exponential sequence, or each bucket can be specified explicitly. + # `BucketOptions` does not include the number of values in each bucket. + # + # A bucket has an inclusive lower bound and exclusive upper bound for the + # values that are counted for that bucket. The upper bound of a bucket must + # be strictly greater than the lower bound. The sequence of N buckets for a + # distribution consists of an underflow bucket (number 0), zero or more + # finite buckets (number 1 through N - 2) and an overflow bucket (number N - + # 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the + # same as the upper bound of bucket i - 1. The buckets span the whole range + # of finite values: lower bound of the underflow bucket is -infinity and the + # upper bound of the overflow bucket is +infinity. The finite buckets are + # so-called because both bounds are finite. + # @!attribute [rw] linear_buckets + # @return [::Google::Api::Distribution::BucketOptions::Linear] + # The linear bucket. + # + # Note: The following fields are mutually exclusive: `linear_buckets`, `exponential_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exponential_buckets + # @return [::Google::Api::Distribution::BucketOptions::Exponential] + # The exponential buckets. + # + # Note: The following fields are mutually exclusive: `exponential_buckets`, `linear_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] explicit_buckets + # @return [::Google::Api::Distribution::BucketOptions::Explicit] + # The explicit buckets. + # + # Note: The following fields are mutually exclusive: `explicit_buckets`, `linear_buckets`, `exponential_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class BucketOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies a linear sequence of buckets that all have the same width + # (except overflow and underflow). Each bucket represents a constant + # absolute uncertainty on the specific value in the bucket. + # + # There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the + # following boundaries: + # + # Upper bound (0 <= i < N-1): offset + (width * i). + # + # Lower bound (1 <= i < N): offset + (width * (i - 1)). + # @!attribute [rw] num_finite_buckets + # @return [::Integer] + # Must be greater than 0. + # @!attribute [rw] width + # @return [::Float] + # Must be greater than 0. + # @!attribute [rw] offset + # @return [::Float] + # Lower bound of the first bucket. + class Linear + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies an exponential sequence of buckets that have a width that is + # proportional to the value of the lower bound. Each bucket represents a + # constant relative uncertainty on a specific value in the bucket. + # + # There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the + # following boundaries: + # + # Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). + # + # Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). + # @!attribute [rw] num_finite_buckets + # @return [::Integer] + # Must be greater than 0. + # @!attribute [rw] growth_factor + # @return [::Float] + # Must be greater than 1. + # @!attribute [rw] scale + # @return [::Float] + # Must be greater than 0. + class Exponential + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies a set of buckets with arbitrary widths. + # + # There are `size(bounds) + 1` (= N) buckets. Bucket `i` has the following + # boundaries: + # + # Upper bound (0 <= i < N-1): bounds[i] + # Lower bound (1 <= i < N); bounds[i - 1] + # + # The `bounds` field must contain at least one element. If `bounds` has + # only one element, then there are no finite buckets, and that single + # element is the common boundary of the overflow and underflow buckets. + # @!attribute [rw] bounds + # @return [::Array<::Float>] + # The values must be monotonically increasing. + class Explicit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Exemplars are example points that may be used to annotate aggregated + # distribution values. They are metadata that gives information about a + # particular value added to a Distribution bucket, such as a trace ID that + # was active when a value was added. They may contain further information, + # such as a example values and timestamps, origin, etc. + # @!attribute [rw] value + # @return [::Float] + # Value of the exemplar point. This value determines to which bucket the + # exemplar belongs. + # @!attribute [rw] timestamp + # @return [::Google::Protobuf::Timestamp] + # The observation (sampling) time of the above value. + # @!attribute [rw] attachments + # @return [::Array<::Google::Protobuf::Any>] + # Contextual information about the example value. Examples are: + # + # Trace: type.googleapis.com/google.monitoring.v3.SpanContext + # + # Literal string: type.googleapis.com/google.protobuf.StringValue + # + # Labels dropped during aggregation: + # type.googleapis.com/google.monitoring.v3.DroppedLabels + # + # There may be only a single attachment of any given message type in a + # single exemplar, and this is enforced by the system. + class Exemplar + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/api/servicecontrol/v1/check_error.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/check_error.rb new file mode 100644 index 000000000000..7110942b8071 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/check_error.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceControl + module V1 + # Defines the errors to be returned in + # {::Google::Cloud::ServiceControl::V1::CheckResponse#check_errors google.api.servicecontrol.v1.CheckResponse.check_errors}. + # @!attribute [rw] code + # @return [::Google::Cloud::ServiceControl::V1::CheckError::Code] + # The error code. + # @!attribute [rw] subject + # @return [::String] + # Subject to whom this error applies. See the specific code enum for more + # details on this field. For example: + # + # - "project:" + # - "folder:" + # - "organization:" + # @!attribute [rw] detail + # @return [::String] + # Free-form text providing details on the error cause of the error. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Contains public information about the check error. If available, + # `status.code` will be non zero and client can propagate it out as public + # error. + class CheckError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Error codes for Check responses. + module Code + # This is never used in `CheckResponse`. + ERROR_CODE_UNSPECIFIED = 0 + + # The consumer's project id, network container, or resource container was + # not found. Same as [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND]. + NOT_FOUND = 5 + + # The consumer doesn't have access to the specified resource. + # Same as [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + PERMISSION_DENIED = 7 + + # Quota check failed. Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED]. + RESOURCE_EXHAUSTED = 8 + + # The consumer hasn't activated the service. + SERVICE_NOT_ACTIVATED = 104 + + # The consumer cannot access the service because billing is disabled. + BILLING_DISABLED = 107 + + # The consumer's project has been marked as deleted (soft deletion). + PROJECT_DELETED = 108 + + # The consumer's project number or id does not represent a valid project. + PROJECT_INVALID = 114 + + # The input consumer info does not represent a valid consumer folder or + # organization. + CONSUMER_INVALID = 125 + + # The IP address of the consumer is invalid for the specific consumer + # project. + IP_ADDRESS_BLOCKED = 109 + + # The referer address of the consumer request is invalid for the specific + # consumer project. + REFERER_BLOCKED = 110 + + # The client application of the consumer request is invalid for the + # specific consumer project. + CLIENT_APP_BLOCKED = 111 + + # The API targeted by this request is invalid for the specified consumer + # project. + API_TARGET_BLOCKED = 122 + + # The consumer's API key is invalid. + API_KEY_INVALID = 105 + + # The consumer's API Key has expired. + API_KEY_EXPIRED = 112 + + # The consumer's API Key was not found in config record. + API_KEY_NOT_FOUND = 113 + + # The credential in the request can not be verified. + INVALID_CREDENTIAL = 123 + + # The backend server for looking up project id/number is unavailable. + NAMESPACE_LOOKUP_UNAVAILABLE = 300 + + # The backend server for checking service status is unavailable. + SERVICE_STATUS_UNAVAILABLE = 301 + + # The backend server for checking billing status is unavailable. + BILLING_STATUS_UNAVAILABLE = 302 + + # Cloud Resource Manager backend server is unavailable. + CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE = 305 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/distribution.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/distribution.rb new file mode 100644 index 000000000000..7138a0567228 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/distribution.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceControl + module V1 + # Distribution represents a frequency distribution of double-valued sample + # points. It contains the size of the population of sample points plus + # additional optional information: + # + # * the arithmetic mean of the samples + # * the minimum and maximum of the samples + # * the sum-squared-deviation of the samples, used to compute variance + # * a histogram of the values of the sample points + # @!attribute [rw] count + # @return [::Integer] + # The total number of samples in the distribution. Must be >= 0. + # @!attribute [rw] mean + # @return [::Float] + # The arithmetic mean of the samples in the distribution. If `count` is + # zero then this field must be zero. + # @!attribute [rw] minimum + # @return [::Float] + # The minimum of the population of values. Ignored if `count` is zero. + # @!attribute [rw] maximum + # @return [::Float] + # The maximum of the population of values. Ignored if `count` is zero. + # @!attribute [rw] sum_of_squared_deviation + # @return [::Float] + # The sum of squared deviations from the mean: + # Sum[i=1..count]((x_i - mean)^2) + # where each x_i is a sample values. If `count` is zero then this field + # must be zero, otherwise validation of the request fails. + # @!attribute [rw] bucket_counts + # @return [::Array<::Integer>] + # The number of samples in each histogram bucket. `bucket_counts` are + # optional. If present, they must sum to the `count` value. + # + # The buckets are defined below in `bucket_option`. There are N buckets. + # `bucket_counts[0]` is the number of samples in the underflow bucket. + # `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples + # in each of the finite buckets. And `bucket_counts[N] is the number + # of samples in the overflow bucket. See the comments of `bucket_option` + # below for more details. + # + # Any suffix of trailing zeros may be omitted. + # @!attribute [rw] linear_buckets + # @return [::Google::Cloud::ServiceControl::V1::Distribution::LinearBuckets] + # Buckets with constant width. + # + # Note: The following fields are mutually exclusive: `linear_buckets`, `exponential_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exponential_buckets + # @return [::Google::Cloud::ServiceControl::V1::Distribution::ExponentialBuckets] + # Buckets with exponentially growing width. + # + # Note: The following fields are mutually exclusive: `exponential_buckets`, `linear_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] explicit_buckets + # @return [::Google::Cloud::ServiceControl::V1::Distribution::ExplicitBuckets] + # Buckets with arbitrary user-provided width. + # + # Note: The following fields are mutually exclusive: `explicit_buckets`, `linear_buckets`, `exponential_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exemplars + # @return [::Array<::Google::Api::Distribution::Exemplar>] + # Example points. Must be in increasing order of `value` field. + class Distribution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describing buckets with constant width. + # @!attribute [rw] num_finite_buckets + # @return [::Integer] + # The number of finite buckets. With the underflow and overflow buckets, + # the total number of buckets is `num_finite_buckets` + 2. + # See comments on `bucket_options` for details. + # @!attribute [rw] width + # @return [::Float] + # The i'th linear bucket covers the interval + # [offset + (i-1) * width, offset + i * width) + # where i ranges from 1 to num_finite_buckets, inclusive. + # Must be strictly positive. + # @!attribute [rw] offset + # @return [::Float] + # The i'th linear bucket covers the interval + # [offset + (i-1) * width, offset + i * width) + # where i ranges from 1 to num_finite_buckets, inclusive. + class LinearBuckets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describing buckets with exponentially growing width. + # @!attribute [rw] num_finite_buckets + # @return [::Integer] + # The number of finite buckets. With the underflow and overflow buckets, + # the total number of buckets is `num_finite_buckets` + 2. + # See comments on `bucket_options` for details. + # @!attribute [rw] growth_factor + # @return [::Float] + # The i'th exponential bucket covers the interval + # [scale * growth_factor^(i-1), scale * growth_factor^i) + # where i ranges from 1 to num_finite_buckets inclusive. + # Must be larger than 1.0. + # @!attribute [rw] scale + # @return [::Float] + # The i'th exponential bucket covers the interval + # [scale * growth_factor^(i-1), scale * growth_factor^i) + # where i ranges from 1 to num_finite_buckets inclusive. + # Must be > 0. + class ExponentialBuckets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describing buckets with arbitrary user-provided width. + # @!attribute [rw] bounds + # @return [::Array<::Float>] + # 'bound' is a list of strictly increasing boundaries between + # buckets. Note that a list of length N-1 defines N buckets because + # of fenceposting. See comments on `bucket_options` for details. + # + # The i'th finite bucket covers the interval + # [bound[i-1], bound[i]) + # where i ranges from 1 to bound_size() - 1. Note that there are no + # finite buckets at all if 'bound' only contains a single element; in + # that special case the single bound defines the boundary between the + # underflow and overflow buckets. + # + # bucket number lower bound upper bound + # i == 0 (underflow) -inf bound[i] + # 0 < i < bound_size() bound[i-1] bound[i] + # i == bound_size() (overflow) bound[i-1] +inf + class ExplicitBuckets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/http_request.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/http_request.rb new file mode 100644 index 000000000000..ac7a9f7bee71 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/http_request.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceControl + module V1 + # A common proto for logging HTTP requests. Only contains semantics + # defined by the HTTP specification. Product-specific logging + # information MUST be defined in a separate message. + # @!attribute [rw] request_method + # @return [::String] + # The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + # @!attribute [rw] request_url + # @return [::String] + # The scheme (http, https), the host name, the path, and the query + # portion of the URL that was requested. + # Example: `"http://example.com/some/info?color=red"`. + # @!attribute [rw] request_size + # @return [::Integer] + # The size of the HTTP request message in bytes, including the request + # headers and the request body. + # @!attribute [rw] status + # @return [::Integer] + # The response code indicating the status of the response. + # Examples: 200, 404. + # @!attribute [rw] response_size + # @return [::Integer] + # The size of the HTTP response message sent back to the client, in bytes, + # including the response headers and the response body. + # @!attribute [rw] user_agent + # @return [::String] + # The user agent sent by the client. Example: + # `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET + # CLR 1.0.3705)"`. + # @!attribute [rw] remote_ip + # @return [::String] + # The IP address (IPv4 or IPv6) of the client that issued the HTTP + # request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. + # @!attribute [rw] server_ip + # @return [::String] + # The IP address (IPv4 or IPv6) of the origin server that the request was + # sent to. + # @!attribute [rw] referer + # @return [::String] + # The referer URL of the request, as defined in + # [HTTP/1.1 Header Field + # Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + # @!attribute [rw] latency + # @return [::Google::Protobuf::Duration] + # The request processing latency on the server, from the time the request was + # received until the response was sent. + # @!attribute [rw] cache_lookup + # @return [::Boolean] + # Whether or not a cache lookup was attempted. + # @!attribute [rw] cache_hit + # @return [::Boolean] + # Whether or not an entity was served from cache + # (with or without validation). + # @!attribute [rw] cache_validated_with_origin_server + # @return [::Boolean] + # Whether or not the response was validated with the origin server before + # being served from cache. This field is only meaningful if `cache_hit` is + # True. + # @!attribute [rw] cache_fill_bytes + # @return [::Integer] + # The number of HTTP response bytes inserted into cache. Set only when a + # cache fill was attempted. + # @!attribute [rw] protocol + # @return [::String] + # Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + class HttpRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/log_entry.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/log_entry.rb new file mode 100644 index 000000000000..bb1679135a7f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/log_entry.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! + + +module Google + module Cloud + module ServiceControl + module V1 + # An individual log entry. + # @!attribute [rw] name + # @return [::String] + # Required. The log to which this log entry belongs. Examples: `"syslog"`, + # `"book_log"`. + # @!attribute [rw] timestamp + # @return [::Google::Protobuf::Timestamp] + # The time the event described by the log entry occurred. If + # omitted, defaults to operation start time. + # @!attribute [rw] severity + # @return [::Google::Cloud::Logging::Type::LogSeverity] + # The severity of the log entry. The default value is + # `LogSeverity.DEFAULT`. + # @!attribute [rw] http_request + # @return [::Google::Cloud::ServiceControl::V1::HttpRequest] + # Optional. Information about the HTTP request associated with this + # log entry, if applicable. + # @!attribute [rw] trace + # @return [::String] + # Optional. Resource name of the trace associated with the log entry, if any. + # If this field contains a relative resource name, you can assume the name is + # relative to `//tracing.googleapis.com`. Example: + # `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` + # @!attribute [rw] insert_id + # @return [::String] + # A unique ID for the log entry used for deduplication. If omitted, + # the implementation will generate one based on operation_id. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # A set of user-defined (key, value) data that provides additional + # information about the log entry. + # @!attribute [rw] proto_payload + # @return [::Google::Protobuf::Any] + # The log entry payload, represented as a protocol buffer that is + # expressed as a JSON object. The only accepted type currently is + # [AuditLog][google.cloud.audit.AuditLog]. + # + # Note: The following fields are mutually exclusive: `proto_payload`, `text_payload`, `struct_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] text_payload + # @return [::String] + # The log entry payload, represented as a Unicode string (UTF-8). + # + # Note: The following fields are mutually exclusive: `text_payload`, `proto_payload`, `struct_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_payload + # @return [::Google::Protobuf::Struct] + # The log entry payload, represented as a structure that + # is expressed as a JSON object. + # + # Note: The following fields are mutually exclusive: `struct_payload`, `proto_payload`, `text_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] operation + # @return [::Google::Cloud::ServiceControl::V1::LogEntryOperation] + # Optional. Information about an operation associated with the log entry, if + # applicable. + # @!attribute [rw] source_location + # @return [::Google::Cloud::ServiceControl::V1::LogEntrySourceLocation] + # Optional. Source code location information associated with the log entry, + # if any. + class LogEntry + 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 + + # Additional information about a potentially long-running operation with which + # a log entry is associated. + # @!attribute [rw] id + # @return [::String] + # Optional. An arbitrary operation identifier. Log entries with the + # same identifier are assumed to be part of the same operation. + # @!attribute [rw] producer + # @return [::String] + # Optional. An arbitrary producer identifier. The combination of + # `id` and `producer` must be globally unique. Examples for `producer`: + # `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + # @!attribute [rw] first + # @return [::Boolean] + # Optional. Set this to True if this is the first log entry in the operation. + # @!attribute [rw] last + # @return [::Boolean] + # Optional. Set this to True if this is the last log entry in the operation. + class LogEntryOperation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional information about the source code location that produced the log + # entry. + # @!attribute [rw] file + # @return [::String] + # Optional. Source file name. Depending on the runtime environment, this + # might be a simple name or a fully-qualified name. + # @!attribute [rw] line + # @return [::Integer] + # Optional. Line within the source file. 1-based; 0 indicates no line number + # available. + # @!attribute [rw] function + # @return [::String] + # Optional. Human-readable name of the function or method being invoked, with + # optional context such as the class or package name. This information may be + # used in contexts such as the logs viewer, where a file and line number are + # less meaningful. The format can vary by language. For example: + # `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + # (Python). + class LogEntrySourceLocation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/metric_value.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/metric_value.rb new file mode 100644 index 000000000000..619686dfb260 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/metric_value.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceControl + module V1 + # Represents a single metric value. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels describing the metric value. + # See comments on {::Google::Cloud::ServiceControl::V1::Operation#labels google.api.servicecontrol.v1.Operation.labels} for + # the overriding relationship. + # Note that this map must not contain monitored resource labels. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The start of the time period over which this metric value's measurement + # applies. The time period has different semantics for different metric + # types (cumulative, delta, and gauge). See the metric definition + # documentation in the service configuration for details. If not specified, + # {::Google::Cloud::ServiceControl::V1::Operation#start_time google.api.servicecontrol.v1.Operation.start_time} will be used. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The end of the time period over which this metric value's measurement + # applies. If not specified, + # {::Google::Cloud::ServiceControl::V1::Operation#end_time google.api.servicecontrol.v1.Operation.end_time} will be used. + # @!attribute [rw] bool_value + # @return [::Boolean] + # A boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `int64_value`, `double_value`, `string_value`, `distribution_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] int64_value + # @return [::Integer] + # A signed 64-bit integer value. + # + # Note: The following fields are mutually exclusive: `int64_value`, `bool_value`, `double_value`, `string_value`, `distribution_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] double_value + # @return [::Float] + # A double precision floating point value. + # + # Note: The following fields are mutually exclusive: `double_value`, `bool_value`, `int64_value`, `string_value`, `distribution_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] + # A text string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `bool_value`, `int64_value`, `double_value`, `distribution_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] distribution_value + # @return [::Google::Cloud::ServiceControl::V1::Distribution] + # A distribution value. + # + # Note: The following fields are mutually exclusive: `distribution_value`, `bool_value`, `int64_value`, `double_value`, `string_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class MetricValue + 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 + + # Represents a set of metric values in the same metric. + # Each metric value in the set should have a unique combination of start time, + # end time, and label values. + # @!attribute [rw] metric_name + # @return [::String] + # The metric name defined in the service configuration. + # @!attribute [rw] metric_values + # @return [::Array<::Google::Cloud::ServiceControl::V1::MetricValue>] + # The values in this metric. + class MetricValueSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/operation.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/operation.rb new file mode 100644 index 000000000000..11aeafef060a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/operation.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceControl + module V1 + # Represents information regarding an operation. + # @!attribute [rw] operation_id + # @return [::String] + # Identity of the operation. This must be unique within the scope of the + # service that generated the operation. If the service calls + # Check() and Report() on the same operation, the two calls should carry + # the same id. + # + # UUID version 4 is recommended, though not required. + # In scenarios where an operation is computed from existing information + # and an idempotent id is desirable for deduplication purpose, UUID version 5 + # is recommended. See RFC 4122 for details. + # @!attribute [rw] operation_name + # @return [::String] + # Fully qualified name of the operation. Reserved for future use. + # @!attribute [rw] consumer_id + # @return [::String] + # Identity of the consumer who is using the service. + # This field should be filled in for the operations initiated by a + # consumer, but not for service-initiated operations that are + # not related to a specific consumer. + # + # - This can be in one of the following formats: + # - project:PROJECT_ID, + # - project`_`number:PROJECT_NUMBER, + # - projects/PROJECT_ID or PROJECT_NUMBER, + # - folders/FOLDER_NUMBER, + # - organizations/ORGANIZATION_NUMBER, + # - api`_`key:API_KEY. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Required. Start time of the operation. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End time of the operation. + # Required when the operation is used in + # {::Google::Cloud::ServiceControl::V1::ServiceController::Client#report ServiceController.Report}, + # but optional when the operation is used in + # {::Google::Cloud::ServiceControl::V1::ServiceController::Client#check ServiceController.Check}. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels describing the operation. Only the following labels are allowed: + # + # - Labels describing monitored resources as defined in + # the service configuration. + # - Default labels of metric values. When specified, labels defined in the + # metric value override these default. + # - The following labels defined by Google Cloud Platform: + # - `cloud.googleapis.com/location` describing the location where the + # operation happened, + # - `servicecontrol.googleapis.com/user_agent` describing the user agent + # of the API request, + # - `servicecontrol.googleapis.com/service_agent` describing the service + # used to handle the API request (e.g. ESP), + # - `servicecontrol.googleapis.com/platform` describing the platform + # where the API is served, such as App Engine, Compute Engine, or + # Kubernetes Engine. + # @!attribute [rw] metric_value_sets + # @return [::Array<::Google::Cloud::ServiceControl::V1::MetricValueSet>] + # Represents information about this operation. Each MetricValueSet + # corresponds to a metric defined in the service configuration. + # The data type used in the MetricValueSet must agree with + # the data type specified in the metric definition. + # + # Within a single operation, it is not allowed to have more than one + # MetricValue instances that have the same metric names and identical + # label value combinations. If a request has such duplicated MetricValue + # instances, the entire request is rejected with + # an invalid argument error. + # @!attribute [rw] log_entries + # @return [::Array<::Google::Cloud::ServiceControl::V1::LogEntry>] + # Represents information to be logged. + # @!attribute [rw] importance + # @return [::Google::Cloud::ServiceControl::V1::Operation::Importance] + # DO NOT USE. This is an experimental field. + # @!attribute [rw] extensions + # @return [::Array<::Google::Protobuf::Any>] + # Unimplemented. + class Operation + 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 + + # Defines the importance of the data contained in the operation. + module Importance + # Allows data caching, batching, and aggregation. It provides + # higher performance with higher data loss risk. + LOW = 0 + + # Disables data aggregation to minimize data loss. It is for operations + # that contains significant monetary value or audit trail. This feature + # only applies to the client libraries. + HIGH = 1 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/quota_controller.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/quota_controller.rb new file mode 100644 index 000000000000..ebc862a7e774 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/quota_controller.rb @@ -0,0 +1,232 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceControl + module V1 + # Request message for the AllocateQuota method. + # @!attribute [rw] service_name + # @return [::String] + # Name of the service as specified in the service configuration. For example, + # `"pubsub.googleapis.com"`. + # + # See [google.api.Service][google.api.Service] for the definition of a service name. + # @!attribute [rw] allocate_operation + # @return [::Google::Cloud::ServiceControl::V1::QuotaOperation] + # Operation that describes the quota allocation. + # @!attribute [rw] service_config_id + # @return [::String] + # Specifies which version of service configuration should be used to process + # the request. If unspecified or no matching version can be found, the latest + # one will be used. + class AllocateQuotaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents information regarding a quota operation. + # @!attribute [rw] operation_id + # @return [::String] + # Identity of the operation. This is expected to be unique within the scope + # of the service that generated the operation, and guarantees idempotency in + # case of retries. + # + # In order to ensure best performance and latency in the Quota backends, + # operation_ids are optimally associated with time, so that related + # operations can be accessed fast in storage. For this reason, the + # recommended token for services that intend to operate at a high QPS is + # Unix time in nanos + UUID + # @!attribute [rw] method_name + # @return [::String] + # Fully qualified name of the API method for which this quota operation is + # requested. This name is used for matching quota rules or metric rules and + # billing status rules defined in service configuration. + # + # This field should not be set if any of the following is true: + # (1) the quota operation is performed on non-API resources. + # (2) quota_metrics is set because the caller is doing quota override. + # + # + # Example of an RPC method name: + # google.example.library.v1.LibraryService.CreateShelf + # @!attribute [rw] consumer_id + # @return [::String] + # Identity of the consumer for whom this quota operation is being performed. + # + # This can be in one of the following formats: + # project:, + # project_number:, + # api_key:. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels describing the operation. + # @!attribute [rw] quota_metrics + # @return [::Array<::Google::Cloud::ServiceControl::V1::MetricValueSet>] + # Represents information about this operation. Each MetricValueSet + # corresponds to a metric defined in the service configuration. + # The data type used in the MetricValueSet must agree with + # the data type specified in the metric definition. + # + # Within a single operation, it is not allowed to have more than one + # MetricValue instances that have the same metric names and identical + # label value combinations. If a request has such duplicated MetricValue + # instances, the entire request is rejected with + # an invalid argument error. + # + # This field is mutually exclusive with method_name. + # @!attribute [rw] quota_mode + # @return [::Google::Cloud::ServiceControl::V1::QuotaOperation::QuotaMode] + # Quota mode for this operation. + class QuotaOperation + 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 + + # Supported quota modes. + module QuotaMode + # Guard against implicit default. Must not be used. + UNSPECIFIED = 0 + + # For AllocateQuota request, allocates quota for the amount specified in + # the service configuration or specified using the quota metrics. If the + # amount is higher than the available quota, allocation error will be + # returned and no quota will be allocated. + # If multiple quotas are part of the request, and one fails, none of the + # quotas are allocated or released. + NORMAL = 1 + + # The operation allocates quota for the amount specified in the service + # configuration or specified using the quota metrics. If the amount is + # higher than the available quota, request does not fail but all available + # quota will be allocated. + # For rate quota, BEST_EFFORT will continue to deduct from other groups + # even if one does not have enough quota. For allocation, it will find the + # minimum available amount across all groups and deduct that amount from + # all the affected groups. + BEST_EFFORT = 2 + + # For AllocateQuota request, only checks if there is enough quota + # available and does not change the available quota. No lock is placed on + # the available quota either. + CHECK_ONLY = 3 + + # Unimplemented. When used in AllocateQuotaRequest, this returns the + # effective quota limit(s) in the response, and no quota check will be + # performed. Not supported for other requests, and even for + # AllocateQuotaRequest, this is currently supported only for allowlisted + # services. + QUERY_ONLY = 4 + + # The operation allocates quota for the amount specified in the service + # configuration or specified using the quota metrics. If the requested + # amount is higher than the available quota, request does not fail and + # remaining quota would become negative (going over the limit). + # Not supported for Rate Quota. + ADJUST_ONLY = 5 + end + end + + # Response message for the AllocateQuota method. + # @!attribute [rw] operation_id + # @return [::String] + # The same operation_id value used in the AllocateQuotaRequest. Used for + # logging and diagnostics purposes. + # @!attribute [rw] allocate_errors + # @return [::Array<::Google::Cloud::ServiceControl::V1::QuotaError>] + # Indicates the decision of the allocate. + # @!attribute [rw] quota_metrics + # @return [::Array<::Google::Cloud::ServiceControl::V1::MetricValueSet>] + # Quota metrics to indicate the result of allocation. Depending on the + # request, one or more of the following metrics will be included: + # + # 1. Per quota group or per quota metric incremental usage will be specified + # using the following delta metric : + # "serviceruntime.googleapis.com/api/consumer/quota_used_count" + # + # 2. The quota limit reached condition will be specified using the following + # boolean metric : + # "serviceruntime.googleapis.com/quota/exceeded" + # @!attribute [rw] service_config_id + # @return [::String] + # ID of the actual config used to process the request. + class AllocateQuotaResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents error information for {::Google::Cloud::ServiceControl::V1::QuotaOperation QuotaOperation}. + # @!attribute [rw] code + # @return [::Google::Cloud::ServiceControl::V1::QuotaError::Code] + # Error code. + # @!attribute [rw] subject + # @return [::String] + # Subject to whom this error applies. See the specific enum for more details + # on this field. For example, "clientip:" or + # "project:". + # @!attribute [rw] description + # @return [::String] + # Free-form text that provides details on the cause of the error. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Contains additional information about the quota error. + # If available, `status.code` will be non zero. + class QuotaError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Error codes related to project config validations are deprecated since the + # quota controller methods do not perform these validations. Instead services + # have to call the Check method, without quota_properties field, to perform + # these validations before calling the quota controller methods. These + # methods check only for project deletion to be wipe out compliant. + module Code + # This is never used. + UNSPECIFIED = 0 + + # Quota allocation failed. + # Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED]. + RESOURCE_EXHAUSTED = 8 + + # Consumer cannot access the service because the service requires active + # billing. + BILLING_NOT_ACTIVE = 107 + + # Consumer's project has been marked as deleted (soft deletion). + PROJECT_DELETED = 108 + + # Specified API key is invalid. + API_KEY_INVALID = 105 + + # Specified API Key has expired. + API_KEY_EXPIRED = 112 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/service_controller.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/service_controller.rb new file mode 100644 index 000000000000..c63f78cb240d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/service_controller.rb @@ -0,0 +1,217 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceControl + module V1 + # Request message for the Check method. + # @!attribute [rw] service_name + # @return [::String] + # The service name as specified in its service configuration. For example, + # `"pubsub.googleapis.com"`. + # + # See + # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + # for the definition of a service name. + # @!attribute [rw] operation + # @return [::Google::Cloud::ServiceControl::V1::Operation] + # The operation to be checked. + # @!attribute [rw] service_config_id + # @return [::String] + # Specifies which version of service configuration should be used to process + # the request. + # + # If unspecified or no matching version can be found, the + # latest one will be used. + class CheckRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the Check method. + # @!attribute [rw] operation_id + # @return [::String] + # The same operation_id value used in the + # {::Google::Cloud::ServiceControl::V1::CheckRequest CheckRequest}. Used for logging + # and diagnostics purposes. + # @!attribute [rw] check_errors + # @return [::Array<::Google::Cloud::ServiceControl::V1::CheckError>] + # Indicate the decision of the check. + # + # If no check errors are present, the service should process the operation. + # Otherwise the service should use the list of errors to determine the + # appropriate action. + # @!attribute [rw] service_config_id + # @return [::String] + # The actual config id used to process the request. + # @!attribute [rw] service_rollout_id + # @return [::String] + # The current service rollout id used to process the request. + # @!attribute [rw] check_info + # @return [::Google::Cloud::ServiceControl::V1::CheckResponse::CheckInfo] + # Feedback data returned from the server during processing a Check request. + class CheckResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contains additional information about the check operation. + # @!attribute [rw] unused_arguments + # @return [::Array<::String>] + # A list of fields and label keys that are ignored by the server. + # The client doesn't need to send them for following requests to improve + # performance and allow better aggregation. + # @!attribute [rw] consumer_info + # @return [::Google::Cloud::ServiceControl::V1::CheckResponse::ConsumerInfo] + # Consumer info of this check. + # @!attribute [rw] api_key_uid + # @return [::String] + # The unique id of the api key in the format of "apikey:". + # This field will be populated when the consumer passed to Service Control + # is an API key and all the API key related validations are successful. + class CheckInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ConsumerInfo` provides information about the consumer. + # @!attribute [rw] project_number + # @return [::Integer] + # The Google cloud project number, e.g. 1234567890. A value of 0 indicates + # no project number is found. + # + # NOTE: This field is deprecated after we support flexible consumer + # id. New code should not depend on this field anymore. + # @!attribute [rw] type + # @return [::Google::Cloud::ServiceControl::V1::CheckResponse::ConsumerInfo::ConsumerType] + # The type of the consumer which should have been defined in + # [Google Resource Manager](https://cloud.google.com/resource-manager/). + # @!attribute [rw] consumer_number + # @return [::Integer] + # The consumer identity number, can be Google cloud project number, folder + # number or organization number e.g. 1234567890. A value of 0 indicates no + # consumer number is found. + class ConsumerInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the consumer as defined in + # [Google Resource Manager](https://cloud.google.com/resource-manager/). + module ConsumerType + # This is never used. + CONSUMER_TYPE_UNSPECIFIED = 0 + + # The consumer is a Google Cloud Project. + PROJECT = 1 + + # The consumer is a Google Cloud Folder. + FOLDER = 2 + + # The consumer is a Google Cloud Organization. + ORGANIZATION = 3 + + # Service-specific resource container which is defined by the service + # producer to offer their users the ability to manage service control + # functionalities at a finer level of granularity than the PROJECT. + SERVICE_SPECIFIC = 4 + end + end + end + + # Request message for the Report method. + # @!attribute [rw] service_name + # @return [::String] + # The service name as specified in its service configuration. For example, + # `"pubsub.googleapis.com"`. + # + # See + # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + # for the definition of a service name. + # @!attribute [rw] operations + # @return [::Array<::Google::Cloud::ServiceControl::V1::Operation>] + # Operations to be reported. + # + # Typically the service should report one operation per request. + # Putting multiple operations into a single request is allowed, but should + # be used only when multiple operations are natually available at the time + # of the report. + # + # There is no limit on the number of operations in the same ReportRequest, + # however the ReportRequest size should be no larger than 1MB. See + # {::Google::Cloud::ServiceControl::V1::ReportResponse#report_errors ReportResponse.report_errors} + # for partial failure behavior. + # @!attribute [rw] service_config_id + # @return [::String] + # Specifies which version of service config should be used to process the + # request. + # + # If unspecified or no matching version can be found, the + # latest one will be used. + class ReportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the Report method. + # @!attribute [rw] report_errors + # @return [::Array<::Google::Cloud::ServiceControl::V1::ReportResponse::ReportError>] + # Partial failures, one for each `Operation` in the request that failed + # processing. There are three possible combinations of the RPC status: + # + # 1. The combination of a successful RPC status and an empty `report_errors` + # list indicates a complete success where all `Operations` in the + # request are processed successfully. + # 2. The combination of a successful RPC status and a non-empty + # `report_errors` list indicates a partial success where some + # `Operations` in the request succeeded. Each + # `Operation` that failed processing has a corresponding item + # in this list. + # 3. A failed RPC status indicates a general non-deterministic failure. + # When this happens, it's impossible to know which of the + # 'Operations' in the request succeeded or failed. + # @!attribute [rw] service_config_id + # @return [::String] + # The actual config id used to process the request. + # @!attribute [rw] service_rollout_id + # @return [::String] + # The current service rollout id used to process the request. + class ReportResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the processing error of one + # {::Google::Cloud::ServiceControl::V1::Operation Operation} in the request. + # @!attribute [rw] operation_id + # @return [::String] + # The + # {::Google::Cloud::ServiceControl::V1::Operation#operation_id Operation.operation_id} + # value from the request. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Details of the error when processing the + # {::Google::Cloud::ServiceControl::V1::Operation Operation}. + class ReportError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/logging/type/log_severity.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/logging/type/log_severity.rb new file mode 100644 index 000000000000..63f6b0689a92 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/logging/type/log_severity.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Logging + module Type + # The severity of the event described in a log entry, expressed as one of the + # standard severity levels listed below. For your reference, the levels are + # assigned the listed numeric values. The effect of using numeric values other + # than those listed is undefined. + # + # You can filter for log entries by severity. For example, the following + # filter expression will match log entries with severities `INFO`, `NOTICE`, + # and `WARNING`: + # + # severity > DEBUG AND severity <= WARNING + # + # If you are writing log entries, you should map other severity encodings to + # one of these standard levels. For example, you might map all of Java's FINE, + # FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the + # original severity level in the log entry payload if you wish. + module LogSeverity + # (0) The log entry has no assigned severity level. + DEFAULT = 0 + + # (100) Debug or trace information. + DEBUG = 100 + + # (200) Routine information, such as ongoing status or performance. + INFO = 200 + + # (300) Normal but significant events, such as start up, shut down, or + # a configuration change. + NOTICE = 300 + + # (400) Warning events might cause problems. + WARNING = 400 + + # (500) Error events are likely to cause problems. + ERROR = 500 + + # (600) Critical events cause more severe problems or outages. + CRITICAL = 600 + + # (700) A person must take an action immediately. + ALERT = 700 + + # (800) One or more systems are unusable. + EMERGENCY = 800 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_control-v1/snippets/Gemfile new file mode 100644 index 000000000000..2860c5bace9a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-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-service_control-v1", path: "../" +else + gem "google-cloud-service_control-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-service_control-v1/snippets/quota_controller/allocate_quota.rb b/owl-bot-staging/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb new file mode 100644 index 000000000000..6b1f93d4a4b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicecontrol_v1_generated_QuotaController_AllocateQuota_sync] +require "google/cloud/service_control/v1" + +## +# Snippet for the allocate_quota call in the QuotaController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceControl::V1::QuotaController::Client#allocate_quota. +# +def allocate_quota + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceControl::V1::QuotaController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new + + # Call the allocate_quota method. + result = client.allocate_quota request + + # The returned object is of type Google::Cloud::ServiceControl::V1::AllocateQuotaResponse. + p result +end +# [END servicecontrol_v1_generated_QuotaController_AllocateQuota_sync] diff --git a/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/check.rb b/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/check.rb new file mode 100644 index 000000000000..2f26d0a78028 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/check.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicecontrol_v1_generated_ServiceController_Check_sync] +require "google/cloud/service_control/v1" + +## +# Snippet for the check call in the ServiceController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceControl::V1::ServiceController::Client#check. +# +def check + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceControl::V1::CheckRequest.new + + # Call the check method. + result = client.check request + + # The returned object is of type Google::Cloud::ServiceControl::V1::CheckResponse. + p result +end +# [END servicecontrol_v1_generated_ServiceController_Check_sync] diff --git a/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/report.rb b/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/report.rb new file mode 100644 index 000000000000..cc7c77bb4409 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/report.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicecontrol_v1_generated_ServiceController_Report_sync] +require "google/cloud/service_control/v1" + +## +# Snippet for the report call in the ServiceController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceControl::V1::ServiceController::Client#report. +# +def report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceControl::V1::ReportRequest.new + + # Call the report method. + result = client.report request + + # The returned object is of type Google::Cloud::ServiceControl::V1::ReportResponse. + p result +end +# [END servicecontrol_v1_generated_ServiceController_Report_sync] diff --git a/owl-bot-staging/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json b/owl-bot-staging/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json new file mode 100644 index 000000000000..fc96d4a24ac2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json @@ -0,0 +1,135 @@ +{ + "client_library": { + "name": "google-cloud-service_control-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.api.servicecontrol.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "servicecontrol_v1_generated_QuotaController_AllocateQuota_sync", + "title": "Snippet for the allocate_quota call in the QuotaController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceControl::V1::QuotaController::Client#allocate_quota.", + "file": "quota_controller/allocate_quota.rb", + "language": "RUBY", + "client_method": { + "short_name": "allocate_quota", + "full_name": "::Google::Cloud::ServiceControl::V1::QuotaController::Client#allocate_quota", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse", + "client": { + "short_name": "QuotaController::Client", + "full_name": "::Google::Cloud::ServiceControl::V1::QuotaController::Client" + }, + "method": { + "short_name": "AllocateQuota", + "full_name": "google.api.servicecontrol.v1.QuotaController.AllocateQuota", + "service": { + "short_name": "QuotaController", + "full_name": "google.api.servicecontrol.v1.QuotaController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicecontrol_v1_generated_ServiceController_Check_sync", + "title": "Snippet for the check call in the ServiceController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceControl::V1::ServiceController::Client#check.", + "file": "service_controller/check.rb", + "language": "RUBY", + "client_method": { + "short_name": "check", + "full_name": "::Google::Cloud::ServiceControl::V1::ServiceController::Client#check", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceControl::V1::CheckRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceControl::V1::CheckResponse", + "client": { + "short_name": "ServiceController::Client", + "full_name": "::Google::Cloud::ServiceControl::V1::ServiceController::Client" + }, + "method": { + "short_name": "Check", + "full_name": "google.api.servicecontrol.v1.ServiceController.Check", + "service": { + "short_name": "ServiceController", + "full_name": "google.api.servicecontrol.v1.ServiceController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicecontrol_v1_generated_ServiceController_Report_sync", + "title": "Snippet for the report call in the ServiceController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceControl::V1::ServiceController::Client#report.", + "file": "service_controller/report.rb", + "language": "RUBY", + "client_method": { + "short_name": "report", + "full_name": "::Google::Cloud::ServiceControl::V1::ServiceController::Client#report", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceControl::V1::ReportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceControl::V1::ReportResponse", + "client": { + "short_name": "ServiceController::Client", + "full_name": "::Google::Cloud::ServiceControl::V1::ServiceController::Client" + }, + "method": { + "short_name": "Report", + "full_name": "google.api.servicecontrol.v1.ServiceController.Report", + "service": { + "short_name": "ServiceController", + "full_name": "google.api.servicecontrol.v1.ServiceController" + } + } + }, + "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-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb new file mode 100644 index 000000000000..0f19356538a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_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/api/servicecontrol/v1/quota_controller_pb" +require "google/cloud/service_control/v1/quota_controller/rest" + + +class ::Google::Cloud::ServiceControl::V1::QuotaController::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_allocate_quota + # Create test objects. + client_result = ::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + allocate_operation = {} + service_config_id = "hello world" + + allocate_quota_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::ServiceStub.stub :transcode_allocate_quota_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, allocate_quota_client_stub do + # Create client + client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.allocate_quota({ service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.allocate_quota service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.allocate_quota ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new(service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.allocate_quota({ service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.allocate_quota(::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new(service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, allocate_quota_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::ServiceControl::V1::QuotaController::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::ServiceControl::V1::QuotaController::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb new file mode 100644 index 000000000000..afde88fdd136 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/api/servicecontrol/v1/quota_controller_pb" +require "google/cloud/service_control/v1/quota_controller" + +class ::Google::Cloud::ServiceControl::V1::QuotaController::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_allocate_quota + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + allocate_operation = {} + service_config_id = "hello world" + + allocate_quota_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :allocate_quota, name + assert_kind_of ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest, request + assert_equal "hello world", request["service_name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceControl::V1::QuotaOperation), request["allocate_operation"] + assert_equal "hello world", request["service_config_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, allocate_quota_client_stub do + # Create client + client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.allocate_quota({ service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.allocate_quota service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.allocate_quota ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new(service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.allocate_quota({ service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.allocate_quota(::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new(service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, allocate_quota_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceControl::V1::QuotaController::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::ServiceControl::V1::QuotaController::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::ServiceControl::V1::QuotaController::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ServiceControl::V1::QuotaController::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb new file mode 100644 index 000000000000..e69da3904bfb --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb @@ -0,0 +1,211 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/api/servicecontrol/v1/service_controller_pb" +require "google/cloud/service_control/v1/service_controller/rest" + + +class ::Google::Cloud::ServiceControl::V1::ServiceController::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 + # Create test objects. + client_result = ::Google::Cloud::ServiceControl::V1::CheckResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + operation = {} + service_config_id = "hello world" + + check_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::ServiceStub.stub :transcode_check_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, check_client_stub do + # Create client + client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.check({ service_name: service_name, operation: operation, service_config_id: service_config_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.check service_name: service_name, operation: operation, service_config_id: service_config_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.check ::Google::Cloud::ServiceControl::V1::CheckRequest.new(service_name: service_name, operation: operation, service_config_id: service_config_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.check({ service_name: service_name, operation: operation, service_config_id: service_config_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.check(::Google::Cloud::ServiceControl::V1::CheckRequest.new(service_name: service_name, operation: operation, service_config_id: service_config_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, check_client_stub.call_count + end + end + end + + def test_report + # Create test objects. + client_result = ::Google::Cloud::ServiceControl::V1::ReportResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + operations = [{}] + service_config_id = "hello world" + + report_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::ServiceStub.stub :transcode_report_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, report_client_stub do + # Create client + client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.report({ service_name: service_name, operations: operations, service_config_id: service_config_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.report service_name: service_name, operations: operations, service_config_id: service_config_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.report ::Google::Cloud::ServiceControl::V1::ReportRequest.new(service_name: service_name, operations: operations, service_config_id: service_config_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.report({ service_name: service_name, operations: operations, service_config_id: service_config_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.report(::Google::Cloud::ServiceControl::V1::ReportRequest.new(service_name: service_name, operations: operations, service_config_id: service_config_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, report_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::ServiceControl::V1::ServiceController::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::ServiceControl::V1::ServiceController::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb new file mode 100644 index 000000000000..28c4b1c80654 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb @@ -0,0 +1,228 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/api/servicecontrol/v1/service_controller_pb" +require "google/cloud/service_control/v1/service_controller" + +class ::Google::Cloud::ServiceControl::V1::ServiceController::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 + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceControl::V1::CheckResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + operation = {} + service_config_id = "hello world" + + check_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :check, name + assert_kind_of ::Google::Cloud::ServiceControl::V1::CheckRequest, request + assert_equal "hello world", request["service_name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceControl::V1::Operation), request["operation"] + assert_equal "hello world", request["service_config_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, check_client_stub do + # Create client + client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.check({ service_name: service_name, operation: operation, service_config_id: service_config_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.check service_name: service_name, operation: operation, service_config_id: service_config_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.check ::Google::Cloud::ServiceControl::V1::CheckRequest.new(service_name: service_name, operation: operation, service_config_id: service_config_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.check({ service_name: service_name, operation: operation, service_config_id: service_config_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.check(::Google::Cloud::ServiceControl::V1::CheckRequest.new(service_name: service_name, operation: operation, service_config_id: service_config_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, check_client_stub.call_rpc_count + end + end + + def test_report + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceControl::V1::ReportResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + operations = [{}] + service_config_id = "hello world" + + report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :report, name + assert_kind_of ::Google::Cloud::ServiceControl::V1::ReportRequest, request + assert_equal "hello world", request["service_name"] + assert_kind_of ::Google::Cloud::ServiceControl::V1::Operation, request["operations"].first + assert_equal "hello world", request["service_config_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, report_client_stub do + # Create client + client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.report({ service_name: service_name, operations: operations, service_config_id: service_config_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.report service_name: service_name, operations: operations, service_config_id: service_config_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.report ::Google::Cloud::ServiceControl::V1::ReportRequest.new(service_name: service_name, operations: operations, service_config_id: service_config_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.report({ service_name: service_name, operations: operations, service_config_id: service_config_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.report(::Google::Cloud::ServiceControl::V1::ReportRequest.new(service_name: service_name, operations: operations, service_config_id: service_config_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, report_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceControl::V1::ServiceController::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::ServiceControl::V1::ServiceController::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::ServiceControl::V1::ServiceController::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ServiceControl::V1::ServiceController::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-service_control-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_control-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_control-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_directory-v1/.gitignore b/owl-bot-staging/google-cloud-service_directory-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_directory-v1/.repo-metadata.json new file mode 100644 index 000000000000..e30062150998 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "servicedirectory.googleapis.com", + "api_shortname": "servicedirectory", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1/latest", + "distribution_name": "google-cloud-service_directory-v1", + "is_cloud": true, + "language": "ruby", + "name": "servicedirectory", + "name_pretty": "Service Directory V1 API", + "product_documentation": "https://cloud.google.com/service-directory", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Service Directory is the single place to register, browse, and resolve application services. Note that google-cloud-service_directory-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_directory instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SERVICE_DIRECTORY", + "ruby-cloud-product-url": "https://cloud.google.com/service-directory", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-service_directory-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_directory-v1/.rubocop.yml new file mode 100644 index 000000000000..2903a8a1c753 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-service_directory-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-service_directory-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_directory-v1/.toys.rb b/owl-bot-staging/google-cloud-service_directory-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/.yardopts b/owl-bot-staging/google-cloud-service_directory-v1/.yardopts new file mode 100644 index 000000000000..769ff9a87e62 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Service Directory 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-service_directory-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_directory-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..8f7d9efc4ef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-service_directory-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-service_directory-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/service_directory/v1" + +client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/service_directory/v1" + +::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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-service_directory-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/service_directory/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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-service_directory-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_directory-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-service_directory-v1/Gemfile b/owl-bot-staging/google-cloud-service_directory-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_directory-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_directory-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/README.md b/owl-bot-staging/google-cloud-service_directory-v1/README.md new file mode 100644 index 000000000000..247ee156e088 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Service Directory V1 API + +Service Directory is a platform for discovering, publishing, and connecting services. + +Service Directory is the single place to register, browse, and resolve application 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 Service Directory V1 API. Most users should consider using +the main client gem, +[google-cloud-service_directory](https://rubygems.org/gems/google-cloud-service_directory). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-service_directory-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/servicedirectory.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/service_directory/v1" + +client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new +request = ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new # (request fields as keyword arguments...) +response = client.resolve_service request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/service-directory) +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/service_directory/v1" +require "logger" + +client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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-service_directory`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-service_directory-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-service_directory`. +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-service_directory-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-service_directory-v1/Rakefile b/owl-bot-staging/google-cloud-service_directory-v1/Rakefile new file mode 100644 index 000000000000..f9df8b5c37c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SERVICE_DIRECTORY_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SERVICE_DIRECTORY_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SERVICE_DIRECTORY_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 SERVICE_DIRECTORY_TEST_PROJECT=test123 SERVICE_DIRECTORY_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/service_directory/v1/lookup_service/credentials" + ::Google::Cloud::ServiceDirectory::V1::LookupService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SERVICE_DIRECTORY_PROJECT"] = project + ENV["SERVICE_DIRECTORY_TEST_PROJECT"] = project + ENV["SERVICE_DIRECTORY_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-service_directory-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-service_directory-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-service_directory-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-service_directory-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-service_directory-v1" + header "google-cloud-service_directory-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-service_directory-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-service_directory-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-service_directory-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-service_directory-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-service_directory-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_directory-v1/gapic_metadata.json new file mode 100644 index 000000000000..7e737f2663a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/gapic_metadata.json @@ -0,0 +1,122 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.servicedirectory.v1", + "libraryPackage": "::Google::Cloud::ServiceDirectory::V1", + "services": { + "LookupService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ServiceDirectory::V1::LookupService::Client", + "rpcs": { + "ResolveService": { + "methods": [ + "resolve_service" + ] + } + } + } + } + }, + "RegistrationService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client", + "rpcs": { + "CreateNamespace": { + "methods": [ + "create_namespace" + ] + }, + "ListNamespaces": { + "methods": [ + "list_namespaces" + ] + }, + "GetNamespace": { + "methods": [ + "get_namespace" + ] + }, + "UpdateNamespace": { + "methods": [ + "update_namespace" + ] + }, + "DeleteNamespace": { + "methods": [ + "delete_namespace" + ] + }, + "CreateService": { + "methods": [ + "create_service" + ] + }, + "ListServices": { + "methods": [ + "list_services" + ] + }, + "GetService": { + "methods": [ + "get_service" + ] + }, + "UpdateService": { + "methods": [ + "update_service" + ] + }, + "DeleteService": { + "methods": [ + "delete_service" + ] + }, + "CreateEndpoint": { + "methods": [ + "create_endpoint" + ] + }, + "ListEndpoints": { + "methods": [ + "list_endpoints" + ] + }, + "GetEndpoint": { + "methods": [ + "get_endpoint" + ] + }, + "UpdateEndpoint": { + "methods": [ + "update_endpoint" + ] + }, + "DeleteEndpoint": { + "methods": [ + "delete_endpoint" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-service_directory-v1/google-cloud-service_directory-v1.gemspec b/owl-bot-staging/google-cloud-service_directory-v1/google-cloud-service_directory-v1.gemspec new file mode 100644 index 000000000000..5d5f9fb75909 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/google-cloud-service_directory-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/service_directory/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-service_directory-v1" + gem.version = Google::Cloud::ServiceDirectory::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Service Directory is the single place to register, browse, and resolve application services. Note that google-cloud-service_directory-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_directory instead. See the readme for more details." + gem.summary = "Service Directory is a platform for discovering, publishing, and connecting services." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google-cloud-service_directory-v1.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google-cloud-service_directory-v1.rb new file mode 100644 index 000000000000..7e40c302a7eb --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google-cloud-service_directory-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/service_directory/v1" diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1.rb new file mode 100644 index 000000000000..356086baaaf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1.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/service_directory/v1/lookup_service" +require "google/cloud/service_directory/v1/registration_service" +require "google/cloud/service_directory/v1/version" + +module Google + module Cloud + module ServiceDirectory + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/service_directory/v1" + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/service_directory/v1" + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/service_directory/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/bindings_override.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/bindings_override.rb new file mode 100644 index 000000000000..0b6ee08b6376 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/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 ServiceDirectory + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/service_directory/v1/rest" + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceDirectory"] + parent_config = while namespace.any? + parent_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-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service.rb new file mode 100644 index 000000000000..f8b983756e2c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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/service_directory/v1/version" + +require "google/cloud/service_directory/v1/lookup_service/credentials" +require "google/cloud/service_directory/v1/lookup_service/paths" +require "google/cloud/service_directory/v1/lookup_service/client" +require "google/cloud/service_directory/v1/lookup_service/rest" + +module Google + module Cloud + module ServiceDirectory + module V1 + ## + # Service Directory API for looking up service data at runtime. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/service_directory/v1/lookup_service" + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/service_directory/v1/lookup_service/rest" + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new + # + module LookupService + end + end + end + end +end + +helper_path = ::File.join __dir__, "lookup_service", "helpers.rb" +require "google/cloud/service_directory/v1/lookup_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb new file mode 100644 index 000000000000..d450c568ab7e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb @@ -0,0 +1,538 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/servicedirectory/v1/lookup_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module ServiceDirectory + module V1 + module LookupService + ## + # Client for the LookupService service. + # + # Service Directory API for looking up service data at runtime. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :lookup_service_stub + + ## + # Configure the LookupService Client class. + # + # See {::Google::Cloud::ServiceDirectory::V1::LookupService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LookupService clients + # ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceDirectory", "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 = 15.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the LookupService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceDirectory::V1::LookupService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @lookup_service_stub.universe_domain + end + + ## + # Create a new LookupService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LookupService 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/servicedirectory/v1/lookup_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 + + @lookup_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ServiceDirectory::V1::LookupService::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 + ) + + @lookup_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @lookup_service_stub.endpoint + config.universe_domain = @lookup_service_stub.universe_domain + config.logger = @lookup_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @lookup_service_stub.logger + end + + # Service calls + + ## + # Returns a {::Google::Cloud::ServiceDirectory::V1::Service service} and its + # associated endpoints. + # Resolving a service is not considered an active developer method. + # + # @overload resolve_service(request, options = nil) + # Pass arguments to `resolve_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) + # Pass arguments to `resolve_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to resolve. + # @param max_endpoints [::Integer] + # Optional. The maximum number of endpoints to return. Defaults to 25. + # Maximum is 100. If a value less than one is specified, the Default is used. + # If a value greater than the Maximum is specified, the Maximum is used. + # @param endpoint_filter [::String] + # Optional. The filter applied to the endpoints of the resolved service. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, or `annotations.` for + # map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `annotations.owner` returns endpoints that have a annotation with the + # key `owner`, this is the same as `annotations:owner` + # * `annotations.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * + # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + # returns the endpoint that has an endpoint_id equal to `ep-1` + # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + # have `owner` in annotation key but value is not `sd` AND have + # key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoint, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::LookupService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new + # + # # Call the resolve_service method. + # result = client.resolve_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse. + # p result + # + def resolve_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.resolve_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.resolve_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resolve_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @lookup_service_stub.call_rpc :resolve_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the LookupService API. + # + # This class represents the configuration for LookupService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceDirectory::V1::LookupService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # resolve_service to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.resolve_service.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.resolve_service.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::ServiceDirectory::V1::LookupService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the LookupService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `resolve_service` + # @return [::Gapic::Config::Method] + # + attr_reader :resolve_service + + # @private + def initialize parent_rpcs = nil + resolve_service_config = parent_rpcs.resolve_service if parent_rpcs.respond_to? :resolve_service + @resolve_service = ::Gapic::Config::Method.new resolve_service_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/credentials.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/credentials.rb new file mode 100644 index 000000000000..6c5cf14ef212 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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 ServiceDirectory + module V1 + module LookupService + # Credentials for the LookupService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SERVICE_DIRECTORY_CREDENTIALS", + "SERVICE_DIRECTORY_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SERVICE_DIRECTORY_CREDENTIALS_JSON", + "SERVICE_DIRECTORY_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-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/paths.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/paths.rb new file mode 100644 index 000000000000..cc44f978fb76 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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 ServiceDirectory + module V1 + module LookupService + # Path helper methods for the LookupService API. + module Paths + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, namespace:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest.rb new file mode 100644 index 000000000000..b8876ebbbc79 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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/service_directory/v1/version" +require "google/cloud/service_directory/v1/bindings_override" + +require "google/cloud/service_directory/v1/lookup_service/credentials" +require "google/cloud/service_directory/v1/lookup_service/paths" +require "google/cloud/service_directory/v1/lookup_service/rest/client" + +module Google + module Cloud + module ServiceDirectory + module V1 + ## + # Service Directory API for looking up service data at runtime. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/service_directory/v1/lookup_service/rest" + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new + # + module LookupService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/service_directory/v1/lookup_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb new file mode 100644 index 000000000000..363bf0c08240 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/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/cloud/servicedirectory/v1/lookup_service_pb" +require "google/cloud/service_directory/v1/lookup_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module ServiceDirectory + module V1 + module LookupService + module Rest + ## + # REST client for the LookupService service. + # + # Service Directory API for looking up service data at runtime. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :lookup_service_stub + + ## + # Configure the LookupService Client class. + # + # See {::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LookupService clients + # ::Google::Cloud::ServiceDirectory::V1::LookupService::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", "ServiceDirectory", "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 = 15.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the LookupService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceDirectory::V1::LookupService::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 + @lookup_service_stub.universe_domain + end + + ## + # Create a new LookupService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LookupService 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 + + @lookup_service_stub = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @lookup_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @lookup_service_stub.endpoint + config.universe_domain = @lookup_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @lookup_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @lookup_service_stub.logger + end + + # Service calls + + ## + # Returns a {::Google::Cloud::ServiceDirectory::V1::Service service} and its + # associated endpoints. + # Resolving a service is not considered an active developer method. + # + # @overload resolve_service(request, options = nil) + # Pass arguments to `resolve_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) + # Pass arguments to `resolve_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to resolve. + # @param max_endpoints [::Integer] + # Optional. The maximum number of endpoints to return. Defaults to 25. + # Maximum is 100. If a value less than one is specified, the Default is used. + # If a value greater than the Maximum is specified, the Maximum is used. + # @param endpoint_filter [::String] + # Optional. The filter applied to the endpoints of the resolved service. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, or `annotations.` for + # map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `annotations.owner` returns endpoints that have a annotation with the + # key `owner`, this is the same as `annotations:owner` + # * `annotations.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * + # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + # returns the endpoint that has an endpoint_id equal to `ep-1` + # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + # have `owner` in annotation key but value is not `sd` AND have + # key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoint, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new + # + # # Call the resolve_service method. + # result = client.resolve_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse. + # p result + # + def resolve_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.resolve_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.resolve_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resolve_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @lookup_service_stub.resolve_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the LookupService REST API. + # + # This class represents the configuration for LookupService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # resolve_service to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.resolve_service.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.resolve_service.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 LookupService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `resolve_service` + # @return [::Gapic::Config::Method] + # + attr_reader :resolve_service + + # @private + def initialize parent_rpcs = nil + resolve_service_config = parent_rpcs.resolve_service if parent_rpcs.respond_to? :resolve_service + @resolve_service = ::Gapic::Config::Method.new resolve_service_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb new file mode 100644 index 000000000000..2afe5d13b79c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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/servicedirectory/v1/lookup_service_pb" + +module Google + module Cloud + module ServiceDirectory + module V1 + module LookupService + module Rest + ## + # REST service stub for the LookupService 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 resolve_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] + # A result object deserialized from the server's reply + def resolve_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resolve_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "resolve_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse.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 resolve_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resolve_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:resolve", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service.rb new file mode 100644 index 000000000000..33d7c627d411 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/service_directory/v1/version" + +require "google/cloud/service_directory/v1/registration_service/credentials" +require "google/cloud/service_directory/v1/registration_service/paths" +require "google/cloud/service_directory/v1/registration_service/client" +require "google/cloud/service_directory/v1/registration_service/rest" + +module Google + module Cloud + module ServiceDirectory + module V1 + ## + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Namespace Namespace} + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Service Service} resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Endpoint Endpoint} + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/service_directory/v1/registration_service" + # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/service_directory/v1/registration_service/rest" + # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + module RegistrationService + end + end + end + end +end + +helper_path = ::File.join __dir__, "registration_service", "helpers.rb" +require "google/cloud/service_directory/v1/registration_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb new file mode 100644 index 000000000000..ec031e78140d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb @@ -0,0 +1,2297 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/servicedirectory/v1/registration_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module ServiceDirectory + module V1 + module RegistrationService + ## + # Client for the RegistrationService service. + # + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Namespace Namespace} + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Service Service} resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Endpoint Endpoint} + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :registration_service_stub + + ## + # Configure the RegistrationService Client class. + # + # See {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RegistrationService clients + # ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceDirectory", "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 = 15.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RegistrationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @registration_service_stub.universe_domain + end + + ## + # Create a new RegistrationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RegistrationService 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/servicedirectory/v1/registration_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 + + @registration_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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 + ) + + @registration_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registration_service_stub.endpoint + config.universe_domain = @registration_service_stub.universe_domain + config.logger = @registration_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @registration_service_stub.logger + end + + # Service calls + + ## + # Creates a namespace, and returns the new namespace. + # + # @overload create_namespace(request, options = nil) + # Pass arguments to `create_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_namespace(parent: nil, namespace_id: nil, namespace: nil) + # Pass arguments to `create_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project and location the namespace + # will be created in. + # @param namespace_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param namespace [::Google::Cloud::ServiceDirectory::V1::Namespace, ::Hash] + # Required. A namespace with initial fields set. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Namespace] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new + # + # # Call the create_namespace method. + # result = client.create_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + # p result + # + def create_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest + + # Converts hash and nil to 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_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :create_namespace, request, 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 namespaces. + # + # @overload list_namespaces(request, options = nil) + # Pass arguments to `list_namespaces` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_namespaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project and location whose namespaces + # you'd like to list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name` or `labels.` for map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `labels.owner` returns namespaces that have a label with the key + # `owner`, this is the same as `labels:owner` + # * `labels.owner=sd` returns namespaces that have key/value + # `owner=sd` + # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + # returns namespaces that have name that is alphabetically later than the + # string, so "namespace-e" is returned but "namespace-a" is not + # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + # `owner` in label key but value is not `sd` AND have key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that namespace + # doesn't have a field called "doesnotexist". Since the filter does not + # match any namespaces, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.new + # + # # Call the list_namespaces method. + # result = client.list_namespaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Namespace. + # p item + # end + # + def list_namespaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_namespaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_namespaces.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_namespaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :list_namespaces, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_namespaces, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a namespace. + # + # @overload get_namespace(request, options = nil) + # Pass arguments to `get_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_namespace(name: nil) + # Pass arguments to `get_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 namespace to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Namespace] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new + # + # # Call the get_namespace method. + # result = client.get_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + # p result + # + def get_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :get_namespace, request, 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 namespace. + # + # @overload update_namespace(request, options = nil) + # Pass arguments to `update_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_namespace(namespace: nil, update_mask: nil) + # Pass arguments to `update_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param namespace [::Google::Cloud::ServiceDirectory::V1::Namespace, ::Hash] + # Required. The updated namespace. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Namespace] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new + # + # # Call the update_namespace method. + # result = client.update_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + # p result + # + def update_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest + + # Converts hash and nil to 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_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.namespace&.name + header_params["namespace.name"] = request.namespace.name + end + + request_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_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :update_namespace, request, 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 namespace. This also deletes all services and endpoints in + # the namespace. + # + # @overload delete_namespace(request, options = nil) + # Pass arguments to `delete_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_namespace(name: nil) + # Pass arguments to `delete_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 namespace to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new + # + # # Call the delete_namespace method. + # result = client.delete_namespace request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :delete_namespace, request, 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 service, and returns the new service. + # + # @overload create_service(request, options = nil) + # Pass arguments to `create_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_service(parent: nil, service_id: nil, service: nil) + # Pass arguments to `create_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the namespace this service will belong to. + # @param service_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param service [::Google::Cloud::ServiceDirectory::V1::Service, ::Hash] + # Required. A service with initial fields set. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Service] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new + # + # # Call the create_service method. + # result = client.create_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + # p result + # + def create_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest + + # Converts hash and nil to 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :create_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all services belonging to a namespace. + # + # @overload list_services(request, options = nil) + # Pass arguments to `list_services` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::ListServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::ListServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the namespace whose services you'd + # like to list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name` or `annotations.` for map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `annotations.owner` returns services that have a annotation with the + # key `owner`, this is the same as `annotations:owner` + # * `annotations.protocol=gRPC` returns services that have key/value + # `protocol=gRPC` + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + # returns services that have name that is alphabetically later than the + # string, so "service-e" is returned but "service-a" is not + # * `annotations.owner!=sd AND annotations.foo=bar` returns services that + # have `owner` in annotation key but value is not `sd` AND have + # key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that service + # doesn't have a field called "doesnotexist". Since the filter does not + # match any services, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::ListServicesRequest.new + # + # # Call the list_services method. + # result = client.list_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Service. + # p item + # end + # + def list_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_services.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :list_services, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_services, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a service. + # + # @overload get_service(request, options = nil) + # Pass arguments to `get_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::GetServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::GetServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_service(name: nil) + # Pass arguments to `get_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Service] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new + # + # # Call the get_service method. + # result = client.get_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + # p result + # + def get_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :get_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a service. + # + # @overload update_service(request, options = nil) + # Pass arguments to `update_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_service(service: nil, update_mask: nil) + # Pass arguments to `update_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service [::Google::Cloud::ServiceDirectory::V1::Service, ::Hash] + # Required. The updated service. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Service] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new + # + # # Call the update_service method. + # result = client.update_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + # p result + # + def update_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest + + # Converts hash and nil to 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service&.name + header_params["service.name"] = request.service.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :update_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a service. This also deletes all endpoints associated with + # the service. + # + # @overload delete_service(request, options = nil) + # Pass arguments to `delete_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_service(name: nil) + # Pass arguments to `delete_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new + # + # # Call the delete_service method. + # result = client.delete_service request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :delete_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an endpoint, and returns the new endpoint. + # + # @overload create_endpoint(request, options = nil) + # Pass arguments to `create_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) + # Pass arguments to `create_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the service that this endpoint provides. + # @param endpoint_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param endpoint [::Google::Cloud::ServiceDirectory::V1::Endpoint, ::Hash] + # Required. A endpoint with initial fields set. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new + # + # # Call the create_endpoint method. + # result = client.create_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + # p result + # + def create_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest + + # Converts hash and nil to 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_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :create_endpoint, request, 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 endpoints. + # + # @overload list_endpoints(request, options = nil) + # Pass arguments to `list_endpoints` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_endpoints` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the service whose endpoints you'd like to + # list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, or `annotations.` for + # map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `annotations.owner` returns endpoints that have a annotation with the + # key `owner`, this is the same as `annotations:owner` + # * `annotations.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + # have `owner` in annotation key but value is not `sd` AND have + # key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoints, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows values: `name`, `address`, `port` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.new + # + # # Call the list_endpoints method. + # result = client.list_endpoints request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Endpoint. + # p item + # end + # + def list_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_endpoints.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :list_endpoints, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_endpoints, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an endpoint. + # + # @overload get_endpoint(request, options = nil) + # Pass arguments to `get_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_endpoint(name: nil) + # Pass arguments to `get_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 endpoint to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new + # + # # Call the get_endpoint method. + # result = client.get_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + # p result + # + def get_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :get_endpoint, request, 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 endpoint. + # + # @overload update_endpoint(request, options = nil) + # Pass arguments to `update_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_endpoint(endpoint: nil, update_mask: nil) + # Pass arguments to `update_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param endpoint [::Google::Cloud::ServiceDirectory::V1::Endpoint, ::Hash] + # Required. The updated endpoint. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new + # + # # Call the update_endpoint method. + # result = client.update_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + # p result + # + def update_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest + + # Converts hash and nil to 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_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.endpoint&.name + header_params["endpoint.name"] = request.endpoint.name + end + + request_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_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :update_endpoint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an endpoint. + # + # @overload delete_endpoint(request, options = nil) + # Pass arguments to `delete_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_endpoint(name: nil) + # Pass arguments to `delete_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 endpoint to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new + # + # # Call the delete_endpoint method. + # result = client.delete_endpoint request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :delete_endpoint, request, 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 IAM Policy for a resource (namespace or service only). + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the IAM Policy for a resource (namespace or service only). + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Tests IAM permissions for a resource (namespace or service only). + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the RegistrationService API. + # + # This class represents the configuration for RegistrationService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_namespace to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_namespace.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_namespace.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::ServiceDirectory::V1::RegistrationService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the RegistrationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :create_namespace + ## + # RPC-specific configuration for `list_namespaces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_namespaces + ## + # RPC-specific configuration for `get_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :get_namespace + ## + # RPC-specific configuration for `update_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :update_namespace + ## + # RPC-specific configuration for `delete_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_namespace + ## + # RPC-specific configuration for `create_service` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service + ## + # RPC-specific configuration for `list_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_services + ## + # RPC-specific configuration for `get_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service + ## + # RPC-specific configuration for `update_service` + # @return [::Gapic::Config::Method] + # + attr_reader :update_service + ## + # RPC-specific configuration for `delete_service` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_service + ## + # RPC-specific configuration for `create_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_endpoint + ## + # RPC-specific configuration for `list_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_endpoints + ## + # RPC-specific configuration for `get_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_endpoint + ## + # RPC-specific configuration for `update_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_endpoint + ## + # RPC-specific configuration for `delete_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_endpoint + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + create_namespace_config = parent_rpcs.create_namespace if parent_rpcs.respond_to? :create_namespace + @create_namespace = ::Gapic::Config::Method.new create_namespace_config + list_namespaces_config = parent_rpcs.list_namespaces if parent_rpcs.respond_to? :list_namespaces + @list_namespaces = ::Gapic::Config::Method.new list_namespaces_config + get_namespace_config = parent_rpcs.get_namespace if parent_rpcs.respond_to? :get_namespace + @get_namespace = ::Gapic::Config::Method.new get_namespace_config + update_namespace_config = parent_rpcs.update_namespace if parent_rpcs.respond_to? :update_namespace + @update_namespace = ::Gapic::Config::Method.new update_namespace_config + delete_namespace_config = parent_rpcs.delete_namespace if parent_rpcs.respond_to? :delete_namespace + @delete_namespace = ::Gapic::Config::Method.new delete_namespace_config + create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service + @create_service = ::Gapic::Config::Method.new create_service_config + list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services + @list_services = ::Gapic::Config::Method.new list_services_config + get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service + @get_service = ::Gapic::Config::Method.new get_service_config + update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service + @update_service = ::Gapic::Config::Method.new update_service_config + delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service + @delete_service = ::Gapic::Config::Method.new delete_service_config + create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint + @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config + list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints + @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config + get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint + @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config + update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint + @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config + delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint + @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/credentials.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/credentials.rb new file mode 100644 index 000000000000..f73edf4dec0f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_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 ServiceDirectory + module V1 + module RegistrationService + # Credentials for the RegistrationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SERVICE_DIRECTORY_CREDENTIALS", + "SERVICE_DIRECTORY_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SERVICE_DIRECTORY_CREDENTIALS_JSON", + "SERVICE_DIRECTORY_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-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/paths.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/paths.rb new file mode 100644 index 000000000000..57e83b8a9a40 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/paths.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceDirectory + module V1 + module RegistrationService + # Path helper methods for the RegistrationService API. + module Paths + ## + # Create a fully-qualified Endpoint resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # @param service [String] + # @param endpoint [String] + # + # @return [::String] + def endpoint_path project:, location:, namespace:, service:, endpoint: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" + raise ::ArgumentError, "service cannot contain /" if service.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}/endpoints/#{endpoint}" + 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 Namespace resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # + # @return [::String] + def namespace_path project:, location:, namespace: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/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}/locations/global/networks/#{network}" + end + + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, namespace:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest.rb new file mode 100644 index 000000000000..d9c6b16b6864 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/service_directory/v1/version" +require "google/cloud/service_directory/v1/bindings_override" + +require "google/cloud/service_directory/v1/registration_service/credentials" +require "google/cloud/service_directory/v1/registration_service/paths" +require "google/cloud/service_directory/v1/registration_service/rest/client" + +module Google + module Cloud + module ServiceDirectory + module V1 + ## + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Namespace Namespace} + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Service Service} resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Endpoint Endpoint} + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/service_directory/v1/registration_service/rest" + # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + module RegistrationService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/service_directory/v1/registration_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb new file mode 100644 index 000000000000..ea1aa47e9ae9 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb @@ -0,0 +1,2136 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/servicedirectory/v1/registration_service_pb" +require "google/cloud/service_directory/v1/registration_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module ServiceDirectory + module V1 + module RegistrationService + module Rest + ## + # REST client for the RegistrationService service. + # + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Namespace Namespace} + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Service Service} resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # {::Google::Cloud::ServiceDirectory::V1::Endpoint Endpoint} + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :registration_service_stub + + ## + # Configure the RegistrationService Client class. + # + # See {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RegistrationService clients + # ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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", "ServiceDirectory", "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 = 15.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RegistrationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceDirectory::V1::RegistrationService::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 + @registration_service_stub.universe_domain + end + + ## + # Create a new RegistrationService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RegistrationService 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 + + @registration_service_stub = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @registration_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registration_service_stub.endpoint + config.universe_domain = @registration_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @registration_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @registration_service_stub.logger + end + + # Service calls + + ## + # Creates a namespace, and returns the new namespace. + # + # @overload create_namespace(request, options = nil) + # Pass arguments to `create_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_namespace(parent: nil, namespace_id: nil, namespace: nil) + # Pass arguments to `create_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project and location the namespace + # will be created in. + # @param namespace_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param namespace [::Google::Cloud::ServiceDirectory::V1::Namespace, ::Hash] + # Required. A namespace with initial fields set. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new + # + # # Call the create_namespace method. + # result = client.create_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + # p result + # + def create_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest + + # Converts hash and nil to an 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_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.create_namespace request, 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 namespaces. + # + # @overload list_namespaces(request, options = nil) + # Pass arguments to `list_namespaces` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_namespaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project and location whose namespaces + # you'd like to list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name` or `labels.` for map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `labels.owner` returns namespaces that have a label with the key + # `owner`, this is the same as `labels:owner` + # * `labels.owner=sd` returns namespaces that have key/value + # `owner=sd` + # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + # returns namespaces that have name that is alphabetically later than the + # string, so "namespace-e" is returned but "namespace-a" is not + # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + # `owner` in label key but value is not `sd` AND have key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that namespace + # doesn't have a field called "doesnotexist". Since the filter does not + # match any namespaces, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.new + # + # # Call the list_namespaces method. + # result = client.list_namespaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Namespace. + # p item + # end + # + def list_namespaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_namespaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_namespaces.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_namespaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.list_namespaces request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_namespaces, "namespaces", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a namespace. + # + # @overload get_namespace(request, options = nil) + # Pass arguments to `get_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_namespace(name: nil) + # Pass arguments to `get_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 namespace to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new + # + # # Call the get_namespace method. + # result = client.get_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + # p result + # + def get_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.get_namespace request, 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 namespace. + # + # @overload update_namespace(request, options = nil) + # Pass arguments to `update_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_namespace(namespace: nil, update_mask: nil) + # Pass arguments to `update_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param namespace [::Google::Cloud::ServiceDirectory::V1::Namespace, ::Hash] + # Required. The updated namespace. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new + # + # # Call the update_namespace method. + # result = client.update_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + # p result + # + def update_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest + + # Converts hash and nil to an 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_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.update_namespace request, 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 namespace. This also deletes all services and endpoints in + # the namespace. + # + # @overload delete_namespace(request, options = nil) + # Pass arguments to `delete_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_namespace(name: nil) + # Pass arguments to `delete_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 namespace to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new + # + # # Call the delete_namespace method. + # result = client.delete_namespace request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.delete_namespace request, 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 service, and returns the new service. + # + # @overload create_service(request, options = nil) + # Pass arguments to `create_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_service(parent: nil, service_id: nil, service: nil) + # Pass arguments to `create_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the namespace this service will belong to. + # @param service_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param service [::Google::Cloud::ServiceDirectory::V1::Service, ::Hash] + # Required. A service with initial fields set. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new + # + # # Call the create_service method. + # result = client.create_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + # p result + # + def create_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest + + # Converts hash and nil to an 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.create_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all services belonging to a namespace. + # + # @overload list_services(request, options = nil) + # Pass arguments to `list_services` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::ListServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::ListServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the namespace whose services you'd + # like to list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name` or `annotations.` for map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `annotations.owner` returns services that have a annotation with the + # key `owner`, this is the same as `annotations:owner` + # * `annotations.protocol=gRPC` returns services that have key/value + # `protocol=gRPC` + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + # returns services that have name that is alphabetically later than the + # string, so "service-e" is returned but "service-a" is not + # * `annotations.owner!=sd AND annotations.foo=bar` returns services that + # have `owner` in annotation key but value is not `sd` AND have + # key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that service + # doesn't have a field called "doesnotexist". Since the filter does not + # match any services, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::ListServicesRequest.new + # + # # Call the list_services method. + # result = client.list_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Service. + # p item + # end + # + def list_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_services.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.list_services request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_services, "services", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a service. + # + # @overload get_service(request, options = nil) + # Pass arguments to `get_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::GetServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::GetServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_service(name: nil) + # Pass arguments to `get_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new + # + # # Call the get_service method. + # result = client.get_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + # p result + # + def get_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.get_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a service. + # + # @overload update_service(request, options = nil) + # Pass arguments to `update_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_service(service: nil, update_mask: nil) + # Pass arguments to `update_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service [::Google::Cloud::ServiceDirectory::V1::Service, ::Hash] + # Required. The updated service. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new + # + # # Call the update_service method. + # result = client.update_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + # p result + # + def update_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest + + # Converts hash and nil to an 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.update_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a service. This also deletes all endpoints associated with + # the service. + # + # @overload delete_service(request, options = nil) + # Pass arguments to `delete_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_service(name: nil) + # Pass arguments to `delete_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new + # + # # Call the delete_service method. + # result = client.delete_service request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.delete_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an endpoint, and returns the new endpoint. + # + # @overload create_endpoint(request, options = nil) + # Pass arguments to `create_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) + # Pass arguments to `create_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the service that this endpoint provides. + # @param endpoint_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param endpoint [::Google::Cloud::ServiceDirectory::V1::Endpoint, ::Hash] + # Required. A endpoint with initial fields set. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new + # + # # Call the create_endpoint method. + # result = client.create_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + # p result + # + def create_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest + + # Converts hash and nil to an 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_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.create_endpoint request, 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 endpoints. + # + # @overload list_endpoints(request, options = nil) + # Pass arguments to `list_endpoints` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_endpoints` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the service whose endpoints you'd like to + # list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, or `annotations.` for + # map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `annotations.owner` returns endpoints that have a annotation with the + # key `owner`, this is the same as `annotations:owner` + # * `annotations.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + # have `owner` in annotation key but value is not `sd` AND have + # key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoints, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows values: `name`, `address`, `port` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.new + # + # # Call the list_endpoints method. + # result = client.list_endpoints request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Endpoint. + # p item + # end + # + def list_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_endpoints.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.list_endpoints request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_endpoints, "endpoints", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an endpoint. + # + # @overload get_endpoint(request, options = nil) + # Pass arguments to `get_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_endpoint(name: nil) + # Pass arguments to `get_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 endpoint to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new + # + # # Call the get_endpoint method. + # result = client.get_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + # p result + # + def get_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.get_endpoint request, 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 endpoint. + # + # @overload update_endpoint(request, options = nil) + # Pass arguments to `update_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_endpoint(endpoint: nil, update_mask: nil) + # Pass arguments to `update_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param endpoint [::Google::Cloud::ServiceDirectory::V1::Endpoint, ::Hash] + # Required. The updated endpoint. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new + # + # # Call the update_endpoint method. + # result = client.update_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + # p result + # + def update_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest + + # Converts hash and nil to an 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_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.update_endpoint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an endpoint. + # + # @overload delete_endpoint(request, options = nil) + # Pass arguments to `delete_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_endpoint(name: nil) + # Pass arguments to `delete_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 endpoint to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new + # + # # Call the delete_endpoint method. + # result = client.delete_endpoint request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.delete_endpoint request, 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 IAM Policy for a resource (namespace or service only). + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the IAM Policy for a resource (namespace or service only). + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Tests IAM permissions for a resource (namespace or service only). + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the RegistrationService REST API. + # + # This class represents the configuration for RegistrationService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_namespace to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_namespace.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_namespace.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 RegistrationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :create_namespace + ## + # RPC-specific configuration for `list_namespaces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_namespaces + ## + # RPC-specific configuration for `get_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :get_namespace + ## + # RPC-specific configuration for `update_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :update_namespace + ## + # RPC-specific configuration for `delete_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_namespace + ## + # RPC-specific configuration for `create_service` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service + ## + # RPC-specific configuration for `list_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_services + ## + # RPC-specific configuration for `get_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service + ## + # RPC-specific configuration for `update_service` + # @return [::Gapic::Config::Method] + # + attr_reader :update_service + ## + # RPC-specific configuration for `delete_service` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_service + ## + # RPC-specific configuration for `create_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_endpoint + ## + # RPC-specific configuration for `list_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_endpoints + ## + # RPC-specific configuration for `get_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_endpoint + ## + # RPC-specific configuration for `update_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_endpoint + ## + # RPC-specific configuration for `delete_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_endpoint + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + create_namespace_config = parent_rpcs.create_namespace if parent_rpcs.respond_to? :create_namespace + @create_namespace = ::Gapic::Config::Method.new create_namespace_config + list_namespaces_config = parent_rpcs.list_namespaces if parent_rpcs.respond_to? :list_namespaces + @list_namespaces = ::Gapic::Config::Method.new list_namespaces_config + get_namespace_config = parent_rpcs.get_namespace if parent_rpcs.respond_to? :get_namespace + @get_namespace = ::Gapic::Config::Method.new get_namespace_config + update_namespace_config = parent_rpcs.update_namespace if parent_rpcs.respond_to? :update_namespace + @update_namespace = ::Gapic::Config::Method.new update_namespace_config + delete_namespace_config = parent_rpcs.delete_namespace if parent_rpcs.respond_to? :delete_namespace + @delete_namespace = ::Gapic::Config::Method.new delete_namespace_config + create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service + @create_service = ::Gapic::Config::Method.new create_service_config + list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services + @list_services = ::Gapic::Config::Method.new list_services_config + get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service + @get_service = ::Gapic::Config::Method.new get_service_config + update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service + @update_service = ::Gapic::Config::Method.new update_service_config + delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service + @delete_service = ::Gapic::Config::Method.new delete_service_config + create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint + @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config + list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints + @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config + get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint + @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config + update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint + @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config + delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint + @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb new file mode 100644 index 000000000000..7b4fd8ee718b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb @@ -0,0 +1,1212 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/servicedirectory/v1/registration_service_pb" + +module Google + module Cloud + module ServiceDirectory + module V1 + module RegistrationService + module Rest + ## + # REST service stub for the RegistrationService 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_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # A result object deserialized from the server's reply + def create_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_namespace_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::Namespace.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_namespaces REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse] + # A result object deserialized from the server's reply + def list_namespaces request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_namespaces_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_namespaces", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # A result object deserialized from the server's reply + def get_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_namespace_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::Namespace.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_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # A result object deserialized from the server's reply + def update_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_namespace_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::Namespace.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_namespace_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 create_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # A result object deserialized from the server's reply + def create_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::Service.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_services REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListServicesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ListServicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::ListServicesResponse] + # A result object deserialized from the server's reply + def list_services request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_services_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_services", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # A result object deserialized from the server's reply + def get_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::Service.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_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # A result object deserialized from the server's reply + def update_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::Service.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 create_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # A result object deserialized from the server's reply + def create_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_endpoint_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.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_endpoints REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse] + # A result object deserialized from the server's reply + def list_endpoints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_endpoints_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_endpoints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # A result object deserialized from the server's reply + def get_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_endpoint_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.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_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # A result object deserialized from the server's reply + def update_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_endpoint_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_endpoint_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest] + # 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_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/namespaces", + body: "namespace", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_namespaces REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_namespaces_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/namespaces", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest] + # 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_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{namespace.name}", + body: "namespace", + matches: [ + ["namespace.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest] + # 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_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/services", + body: "service", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_services REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListServicesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_services_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/services", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest] + # 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_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{service.name}", + body: "service", + matches: [ + ["service.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest] + # 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_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/endpoints", + body: "endpoint", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_endpoints REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_endpoints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/endpoints", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest] + # 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_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{endpoint.name}", + body: "endpoint", + matches: [ + ["endpoint.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/rest.rb new file mode 100644 index 000000000000..908b621706ff --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/service_directory/v1/lookup_service/rest" +require "google/cloud/service_directory/v1/registration_service/rest" +require "google/cloud/service_directory/v1/bindings_override" +require "google/cloud/service_directory/v1/version" + +module Google + module Cloud + module ServiceDirectory + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/service_directory/v1/rest" + # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/version.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/version.rb new file mode 100644 index 000000000000..8c946fd91333 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/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 ServiceDirectory + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/endpoint_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/endpoint_pb.rb new file mode 100644 index 000000000000..e3f1be259794 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/endpoint_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1/endpoint.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n/google/cloud/servicedirectory/v1/endpoint.proto\x12 google.cloud.servicedirectory.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xbe\x03\n\x08\x45ndpoint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04port\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12U\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32;.google.cloud.servicedirectory.v1.Endpoint.AnnotationsEntryB\x03\xe0\x41\x01\x12@\n\x07network\x18\x08 \x01(\tB/\xe0\x41\x05\xfa\x41)\n\'servicedirectory.googleapis.com/Network\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x96\x01\xea\x41\x92\x01\n(servicedirectory.googleapis.com/Endpoint\x12\x66projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B\xd9\x02\n$com.google.cloud.servicedirectory.v1B\rEndpointProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1\xea\x41\x61\n\'servicedirectory.googleapis.com/Network\x12\x36projects/{project}/locations/global/networks/{network}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1 + Endpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.Endpoint").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_pb.rb new file mode 100644 index 000000000000..b4d80dacd301 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1/lookup_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/servicedirectory/v1/service_pb' + + +descriptor_data = "\n5google/cloud/servicedirectory/v1/lookup_service.proto\x12 google.cloud.servicedirectory.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/servicedirectory/v1/service.proto\"\x90\x01\n\x15ResolveServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x1a\n\rmax_endpoints\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1c\n\x0f\x65ndpoint_filter\x18\x03 \x01(\tB\x03\xe0\x41\x01\"T\n\x16ResolveServiceResponse\x12:\n\x07service\x18\x01 \x01(\x0b\x32).google.cloud.servicedirectory.v1.Service2\xb8\x02\n\rLookupService\x12\xd1\x01\n\x0eResolveService\x12\x37.google.cloud.servicedirectory.v1.ResolveServiceRequest\x1a\x38.google.cloud.servicedirectory.v1.ResolveServiceResponse\"L\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve:\x01*\x1aS\xca\x41\x1fservicedirectory.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xfa\x01\n$com.google.cloud.servicedirectory.v1B\x12LookupServiceProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1 + ResolveServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ResolveServiceRequest").msgclass + ResolveServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ResolveServiceResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_services_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_services_pb.rb new file mode 100644 index 000000000000..6ae9e530a2c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/servicedirectory/v1/lookup_service.proto for package 'Google.Cloud.ServiceDirectory.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/servicedirectory/v1/lookup_service_pb' + +module Google + module Cloud + module ServiceDirectory + module V1 + module LookupService + # Service Directory API for looking up service data at runtime. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.servicedirectory.v1.LookupService' + + # Returns a [service][google.cloud.servicedirectory.v1.Service] and its + # associated endpoints. + # Resolving a service is not considered an active developer method. + rpc :ResolveService, ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest, ::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/namespace_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/namespace_pb.rb new file mode 100644 index 000000000000..3c410e6a30eb --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/namespace_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1/namespace.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n0google/cloud/servicedirectory/v1/namespace.proto\x12 google.cloud.servicedirectory.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9d\x02\n\tNamespace\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12L\n\x06labels\x18\x02 \x03(\x0b\x32\x37.google.cloud.servicedirectory.v1.Namespace.LabelsEntryB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x05 \x01(\tB\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:n\xea\x41k\n)servicedirectory.googleapis.com/Namespace\x12>projects/{project}/locations/{location}/namespaces/{namespace}B\xf6\x01\n$com.google.cloud.servicedirectory.v1B\x0eNamespaceProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1 + Namespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.Namespace").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_pb.rb new file mode 100644 index 000000000000..0bb3da719b14 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1/registration_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/servicedirectory/v1/endpoint_pb' +require 'google/cloud/servicedirectory/v1/namespace_pb' +require 'google/cloud/servicedirectory/v1/service_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n;google/cloud/servicedirectory/v1/registration_service.proto\x12 google.cloud.servicedirectory.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/servicedirectory/v1/endpoint.proto\x1a\x30google/cloud/servicedirectory/v1/namespace.proto\x1a.google/cloud/servicedirectory/v1/service.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb3\x01\n\x16\x43reateNamespaceRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0cnamespace_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\tnamespace\x18\x03 \x01(\x0b\x32+.google.cloud.servicedirectory.v1.NamespaceB\x03\xe0\x41\x02\"\xaf\x01\n\x15ListNamespacesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"r\n\x16ListNamespacesResponse\x12?\n\nnamespaces\x18\x01 \x03(\x0b\x32+.google.cloud.servicedirectory.v1.Namespace\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x13GetNamespaceRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\"\x93\x01\n\x16UpdateNamespaceRequest\x12\x43\n\tnamespace\x18\x01 \x01(\x0b\x32+.google.cloud.servicedirectory.v1.NamespaceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"Y\n\x16\x44\x65leteNamespaceRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\"\xb3\x01\n\x14\x43reateServiceRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\x12\x17\n\nservice_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x07service\x18\x03 \x01(\x0b\x32).google.cloud.servicedirectory.v1.ServiceB\x03\xe0\x41\x02\"\xb5\x01\n\x13ListServicesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\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\"l\n\x14ListServicesResponse\x12;\n\x08services\x18\x01 \x03(\x0b\x32).google.cloud.servicedirectory.v1.Service\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x11GetServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\"\x8d\x01\n\x14UpdateServiceRequest\x12?\n\x07service\x18\x01 \x01(\x0b\x32).google.cloud.servicedirectory.v1.ServiceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"U\n\x14\x44\x65leteServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\"\xb5\x01\n\x15\x43reateEndpointRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x18\n\x0b\x65ndpoint_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x08\x65ndpoint\x18\x03 \x01(\x0b\x32*.google.cloud.servicedirectory.v1.EndpointB\x03\xe0\x41\x02\"\xb4\x01\n\x14ListEndpointsRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\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\"o\n\x15ListEndpointsResponse\x12=\n\tendpoints\x18\x01 \x03(\x0b\x32*.google.cloud.servicedirectory.v1.Endpoint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x12GetEndpointRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(servicedirectory.googleapis.com/Endpoint\"\x90\x01\n\x15UpdateEndpointRequest\x12\x41\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32*.google.cloud.servicedirectory.v1.EndpointB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"W\n\x15\x44\x65leteEndpointRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(servicedirectory.googleapis.com/Endpoint2\xdf\x1e\n\x13RegistrationService\x12\xdb\x01\n\x0f\x43reateNamespace\x12\x38.google.cloud.servicedirectory.v1.CreateNamespaceRequest\x1a+.google.cloud.servicedirectory.v1.Namespace\"a\xda\x41\x1dparent,namespace,namespace_id\x82\xd3\xe4\x93\x02;\"./v1/{parent=projects/*/locations/*}/namespaces:\tnamespace\x12\xc4\x01\n\x0eListNamespaces\x12\x37.google.cloud.servicedirectory.v1.ListNamespacesRequest\x1a\x38.google.cloud.servicedirectory.v1.ListNamespacesResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/namespaces\x12\xb1\x01\n\x0cGetNamespace\x12\x35.google.cloud.servicedirectory.v1.GetNamespaceRequest\x1a+.google.cloud.servicedirectory.v1.Namespace\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/namespaces/*}\x12\xdd\x01\n\x0fUpdateNamespace\x12\x38.google.cloud.servicedirectory.v1.UpdateNamespaceRequest\x1a+.google.cloud.servicedirectory.v1.Namespace\"c\xda\x41\x15namespace,update_mask\x82\xd3\xe4\x93\x02\x45\x32\x38/v1/{namespace.name=projects/*/locations/*/namespaces/*}:\tnamespace\x12\xa2\x01\n\x0f\x44\x65leteNamespace\x12\x38.google.cloud.servicedirectory.v1.DeleteNamespaceRequest\x1a\x16.google.protobuf.Empty\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/namespaces/*}\x12\xda\x01\n\rCreateService\x12\x36.google.cloud.servicedirectory.v1.CreateServiceRequest\x1a).google.cloud.servicedirectory.v1.Service\"f\xda\x41\x19parent,service,service_id\x82\xd3\xe4\x93\x02\x44\"9/v1/{parent=projects/*/locations/*/namespaces/*}/services:\x07service\x12\xc9\x01\n\x0cListServices\x12\x35.google.cloud.servicedirectory.v1.ListServicesRequest\x1a\x36.google.cloud.servicedirectory.v1.ListServicesResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/namespaces/*}/services\x12\xb6\x01\n\nGetService\x12\x33.google.cloud.servicedirectory.v1.GetServiceRequest\x1a).google.cloud.servicedirectory.v1.Service\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/namespaces/*/services/*}\x12\xdc\x01\n\rUpdateService\x12\x36.google.cloud.servicedirectory.v1.UpdateServiceRequest\x1a).google.cloud.servicedirectory.v1.Service\"h\xda\x41\x13service,update_mask\x82\xd3\xe4\x93\x02L2A/v1/{service.name=projects/*/locations/*/namespaces/*/services/*}:\x07service\x12\xa9\x01\n\rDeleteService\x12\x36.google.cloud.servicedirectory.v1.DeleteServiceRequest\x1a\x16.google.protobuf.Empty\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/namespaces/*/services/*}\x12\xec\x01\n\x0e\x43reateEndpoint\x12\x37.google.cloud.servicedirectory.v1.CreateEndpointRequest\x1a*.google.cloud.servicedirectory.v1.Endpoint\"u\xda\x41\x1bparent,endpoint,endpoint_id\x82\xd3\xe4\x93\x02Q\"E/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints:\x08\x65ndpoint\x12\xd8\x01\n\rListEndpoints\x12\x36.google.cloud.servicedirectory.v1.ListEndpointsRequest\x1a\x37.google.cloud.servicedirectory.v1.ListEndpointsResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints\x12\xc5\x01\n\x0bGetEndpoint\x12\x34.google.cloud.servicedirectory.v1.GetEndpointRequest\x1a*.google.cloud.servicedirectory.v1.Endpoint\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}\x12\xee\x01\n\x0eUpdateEndpoint\x12\x37.google.cloud.servicedirectory.v1.UpdateEndpointRequest\x1a*.google.cloud.servicedirectory.v1.Endpoint\"w\xda\x41\x14\x65ndpoint,update_mask\x82\xd3\xe4\x93\x02Z2N/v1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}:\x08\x65ndpoint\x12\xb7\x01\n\x0e\x44\x65leteEndpoint\x12\x37.google.cloud.servicedirectory.v1.DeleteEndpointRequest\x1a\x16.google.protobuf.Empty\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G*E/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}\x12\xe8\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x9c\x01\x82\xd3\xe4\x93\x02\x95\x01\"?/v1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:\x01*ZO\"J/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:\x01*\x12\xe8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x9c\x01\x82\xd3\xe4\x93\x02\x95\x01\"?/v1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:\x01*ZO\"J/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:\x01*\x12\x94\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xa8\x01\x82\xd3\xe4\x93\x02\xa1\x01\"E/v1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:\x01*ZU\"P/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:\x01*\x1aS\xca\x41\x1fservicedirectory.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x80\x02\n$com.google.cloud.servicedirectory.v1B\x18RegistrationServiceProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1 + CreateNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.CreateNamespaceRequest").msgclass + ListNamespacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListNamespacesRequest").msgclass + ListNamespacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListNamespacesResponse").msgclass + GetNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.GetNamespaceRequest").msgclass + UpdateNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.UpdateNamespaceRequest").msgclass + DeleteNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.DeleteNamespaceRequest").msgclass + CreateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.CreateServiceRequest").msgclass + ListServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListServicesRequest").msgclass + ListServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListServicesResponse").msgclass + GetServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.GetServiceRequest").msgclass + UpdateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.UpdateServiceRequest").msgclass + DeleteServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.DeleteServiceRequest").msgclass + CreateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.CreateEndpointRequest").msgclass + ListEndpointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListEndpointsRequest").msgclass + ListEndpointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListEndpointsResponse").msgclass + GetEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.GetEndpointRequest").msgclass + UpdateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.UpdateEndpointRequest").msgclass + DeleteEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.DeleteEndpointRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb new file mode 100644 index 000000000000..b0459122277a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb @@ -0,0 +1,95 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/servicedirectory/v1/registration_service.proto for package 'Google.Cloud.ServiceDirectory.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/servicedirectory/v1/registration_service_pb' + +module Google + module Cloud + module ServiceDirectory + module V1 + module RegistrationService + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # [Namespace][google.cloud.servicedirectory.v1.Namespace] + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # [Service][google.cloud.servicedirectory.v1.Service] resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # [Endpoint][google.cloud.servicedirectory.v1.Endpoint] + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.servicedirectory.v1.RegistrationService' + + # Creates a namespace, and returns the new namespace. + rpc :CreateNamespace, ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1::Namespace + # Lists all namespaces. + rpc :ListNamespaces, ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest, ::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse + # Gets a namespace. + rpc :GetNamespace, ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1::Namespace + # Updates a namespace. + rpc :UpdateNamespace, ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1::Namespace + # Deletes a namespace. This also deletes all services and endpoints in + # the namespace. + rpc :DeleteNamespace, ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest, ::Google::Protobuf::Empty + # Creates a service, and returns the new service. + rpc :CreateService, ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest, ::Google::Cloud::ServiceDirectory::V1::Service + # Lists all services belonging to a namespace. + rpc :ListServices, ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest, ::Google::Cloud::ServiceDirectory::V1::ListServicesResponse + # Gets a service. + rpc :GetService, ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest, ::Google::Cloud::ServiceDirectory::V1::Service + # Updates a service. + rpc :UpdateService, ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest, ::Google::Cloud::ServiceDirectory::V1::Service + # Deletes a service. This also deletes all endpoints associated with + # the service. + rpc :DeleteService, ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest, ::Google::Protobuf::Empty + # Creates an endpoint, and returns the new endpoint. + rpc :CreateEndpoint, ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest, ::Google::Cloud::ServiceDirectory::V1::Endpoint + # Lists all endpoints. + rpc :ListEndpoints, ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest, ::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse + # Gets an endpoint. + rpc :GetEndpoint, ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest, ::Google::Cloud::ServiceDirectory::V1::Endpoint + # Updates an endpoint. + rpc :UpdateEndpoint, ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest, ::Google::Cloud::ServiceDirectory::V1::Endpoint + # Deletes an endpoint. + rpc :DeleteEndpoint, ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest, ::Google::Protobuf::Empty + # Gets the IAM Policy for a resource (namespace or service only). + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the IAM Policy for a resource (namespace or service only). + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Tests IAM permissions for a resource (namespace or service only). + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/service_pb.rb new file mode 100644 index 000000000000..1ff4ae69888a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/service_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1/service.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/servicedirectory/v1/endpoint_pb' + + +descriptor_data = "\n.google/cloud/servicedirectory/v1/service.proto\x12 google.cloud.servicedirectory.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/servicedirectory/v1/endpoint.proto\"\xfd\x02\n\x07Service\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12T\n\x0b\x61nnotations\x18\x04 \x03(\x0b\x32:.google.cloud.servicedirectory.v1.Service.AnnotationsEntryB\x03\xe0\x41\x01\x12\x42\n\tendpoints\x18\x03 \x03(\x0b\x32*.google.cloud.servicedirectory.v1.EndpointB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x07 \x01(\tB\x03\xe0\x41\x03\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x7f\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}B\xf4\x01\n$com.google.cloud.servicedirectory.v1B\x0cServiceProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1 + Service = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.Service").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/README.md new file mode 100644 index 000000000000..01dcdec0b753 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Service Directory 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-service_directory-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/endpoint.rb new file mode 100644 index 000000000000..4ee11e3d1a61 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/endpoint.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceDirectory + module V1 + # An individual endpoint that provides a + # {::Google::Cloud::ServiceDirectory::V1::Service service}. The service must + # already exist to create an endpoint. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name for the endpoint in the format + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # @!attribute [rw] address + # @return [::String] + # Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + # like: + # + # * `8.8.8` + # * `8.8.8.8:53` + # * `test:bad:address` + # * `[::1]` + # * `[::1]:8080` + # + # Limited to 45 characters. + # @!attribute [rw] port + # @return [::Integer] + # Optional. Service Directory rejects values outside of `[0, 65535]`. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations for the endpoint. This data can be consumed by + # service clients. + # + # Restrictions: + # + # * The entire annotations dictionary may contain up to 512 characters, + # spread accoss all key-value pairs. Annotations that go beyond this + # limit are rejected + # * Valid annotation keys have two segments: an optional prefix and name, + # separated by a slash (/). The name segment is required and must be 63 + # characters or less, beginning and ending with an alphanumeric character + # ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + # alphanumerics between. The prefix is optional. If specified, the prefix + # must be a DNS subdomain: a series of DNS labels separated by dots (.), + # not longer than 253 characters in total, followed by a slash (/) + # Annotations that fails to meet these requirements are rejected. + # + # Note: This field is equivalent to the `metadata` field in the v1beta1 API. + # They have the same syntax and read/write to the same location in Service + # Directory. + # @!attribute [rw] network + # @return [::String] + # Immutable. The Google Compute Engine network (VPC) of the endpoint in the + # format `projects//locations/global/networks/*`. + # + # The project must be specified by project number (project id is rejected). + # Incorrectly formatted networks are rejected, we also check to make sure + # that you have the servicedirectory.networks.attach permission on the + # project specified. + # @!attribute [r] uid + # @return [::String] + # Output only. The globally unique identifier of the endpoint in the UUID4 + # format. + class Endpoint + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/lookup_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/lookup_service.rb new file mode 100644 index 000000000000..9e859a550af2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/lookup_service.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 ServiceDirectory + module V1 + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service LookupService.ResolveService}. + # Looks up a service by its name, returns the service and its endpoints. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the service to resolve. + # @!attribute [rw] max_endpoints + # @return [::Integer] + # Optional. The maximum number of endpoints to return. Defaults to 25. + # Maximum is 100. If a value less than one is specified, the Default is used. + # If a value greater than the Maximum is specified, the Maximum is used. + # @!attribute [rw] endpoint_filter + # @return [::String] + # Optional. The filter applied to the endpoints of the resolved service. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, or `annotations.` for + # map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `annotations.owner` returns endpoints that have a annotation with the + # key `owner`, this is the same as `annotations:owner` + # * `annotations.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * + # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + # returns the endpoint that has an endpoint_id equal to `ep-1` + # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + # have `owner` in annotation key but value is not `sd` AND have + # key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoint, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + class ResolveServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service LookupService.ResolveService}. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + class ResolveServiceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/namespace.rb new file mode 100644 index 000000000000..6b3bcca2d4f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/namespace.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 ServiceDirectory + module V1 + # A container for {::Google::Cloud::ServiceDirectory::V1::Service services}. + # Namespaces allow administrators to group services together and define + # permissions for a collection of services. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name for the namespace in the format + # `projects/*/locations/*/namespaces/*`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Resource labels associated with this namespace. + # No more than 64 user labels can be associated with a given resource. Label + # keys and values can be no longer than 63 characters. + # @!attribute [r] uid + # @return [::String] + # Output only. The globally unique identifier of the namespace in the UUID4 + # format. + class Namespace + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/registration_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/registration_service.rb new file mode 100644 index 000000000000..45b348787942 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/registration_service.rb @@ -0,0 +1,425 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceDirectory + module V1 + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_namespace RegistrationService.CreateNamespace}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project and location the namespace + # will be created in. + # @!attribute [rw] namespace_id + # @return [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @!attribute [rw] namespace + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # Required. A namespace with initial fields set. + class CreateNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces RegistrationService.ListNamespaces}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project and location whose namespaces + # you'd like to list. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name` or `labels.` for map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `labels.owner` returns namespaces that have a label with the key + # `owner`, this is the same as `labels:owner` + # * `labels.owner=sd` returns namespaces that have key/value + # `owner=sd` + # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + # returns namespaces that have name that is alphabetically later than the + # string, so "namespace-e" is returned but "namespace-a" is not + # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + # `owner` in label key but value is not `sd` AND have key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that namespace + # doesn't have a field called "doesnotexist". Since the filter does not + # match any namespaces, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + class ListNamespacesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces RegistrationService.ListNamespaces}. + # @!attribute [rw] namespaces + # @return [::Array<::Google::Cloud::ServiceDirectory::V1::Namespace>] + # The list of namespaces. + # @!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. + class ListNamespacesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_namespace RegistrationService.GetNamespace}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the namespace to retrieve. + class GetNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_namespace RegistrationService.UpdateNamespace}. + # @!attribute [rw] namespace + # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] + # Required. The updated namespace. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_namespace RegistrationService.DeleteNamespace}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the namespace to delete. + class DeleteNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_service RegistrationService.CreateService}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the namespace this service will belong to. + # @!attribute [rw] service_id + # @return [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # Required. A service with initial fields set. + class CreateServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services RegistrationService.ListServices}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the namespace whose services you'd + # like to list. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name` or `annotations.` for map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `annotations.owner` returns services that have a annotation with the + # key `owner`, this is the same as `annotations:owner` + # * `annotations.protocol=gRPC` returns services that have key/value + # `protocol=gRPC` + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + # returns services that have name that is alphabetically later than the + # string, so "service-e" is returned but "service-a" is not + # * `annotations.owner!=sd AND annotations.foo=bar` returns services that + # have `owner` in annotation key but value is not `sd` AND have + # key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that service + # doesn't have a field called "doesnotexist". Since the filter does not + # match any services, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + class ListServicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services RegistrationService.ListServices}. + # @!attribute [rw] services + # @return [::Array<::Google::Cloud::ServiceDirectory::V1::Service>] + # The list of services. + # @!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. + class ListServicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_service RegistrationService.GetService}. + # This should not be used for looking up a service. Instead, use the `resolve` + # method as it contains all endpoints and associated annotations. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the service to get. + class GetServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_service RegistrationService.UpdateService}. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceDirectory::V1::Service] + # Required. The updated service. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_service RegistrationService.DeleteService}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the service to delete. + class DeleteServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_endpoint RegistrationService.CreateEndpoint}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the service that this endpoint provides. + # @!attribute [rw] endpoint_id + # @return [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @!attribute [rw] endpoint + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # Required. A endpoint with initial fields set. + class CreateEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the service whose endpoints you'd like to + # list. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, or `annotations.` for + # map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `annotations.owner` returns endpoints that have a annotation with the + # key `owner`, this is the same as `annotations:owner` + # * `annotations.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that + # have `owner` in annotation key but value is not `sd` AND have + # key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoints, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows values: `name`, `address`, `port` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + class ListEndpointsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. + # @!attribute [rw] endpoints + # @return [::Array<::Google::Cloud::ServiceDirectory::V1::Endpoint>] + # The list of endpoints. + # @!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. + class ListEndpointsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_endpoint RegistrationService.GetEndpoint}. + # This should not be used to lookup endpoints at runtime. Instead, use + # the `resolve` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the endpoint to get. + class GetEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_endpoint RegistrationService.UpdateEndpoint}. + # @!attribute [rw] endpoint + # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] + # Required. The updated endpoint. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_endpoint RegistrationService.DeleteEndpoint}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the endpoint to delete. + class DeleteEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/service.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/service.rb new file mode 100644 index 000000000000..0b8538d4fc4e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/service.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 Cloud + module ServiceDirectory + module V1 + # An individual service. A service contains a name and optional metadata. + # A service must exist before + # {::Google::Cloud::ServiceDirectory::V1::Endpoint endpoints} can be + # added to it. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name for the service in the format + # `projects/*/locations/*/namespaces/*/services/*`. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Annotations for the service. This data can be consumed by service + # clients. + # + # Restrictions: + # + # * The entire annotations dictionary may contain up to 2000 characters, + # spread accoss all key-value pairs. Annotations that go beyond this + # limit are rejected + # * Valid annotation keys have two segments: an optional prefix and name, + # separated by a slash (/). The name segment is required and must be 63 + # characters or less, beginning and ending with an alphanumeric character + # ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + # alphanumerics between. The prefix is optional. If specified, the prefix + # must be a DNS subdomain: a series of DNS labels separated by dots (.), + # not longer than 253 characters in total, followed by a slash (/). + # Annotations that fails to meet these requirements are rejected + # + # Note: This field is equivalent to the `metadata` field in the v1beta1 API. + # They have the same syntax and read/write to the same location in Service + # Directory. + # @!attribute [r] endpoints + # @return [::Array<::Google::Cloud::ServiceDirectory::V1::Endpoint>] + # Output only. Endpoints associated with this service. Returned on + # {::Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service LookupService.ResolveService}. + # Control plane clients should use + # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. + # @!attribute [r] uid + # @return [::String] + # Output only. The globally unique identifier of the service in the UUID4 + # format. + class Service + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_directory-v1/snippets/Gemfile new file mode 100644 index 000000000000..e8fbbd9f688d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1", path: "../" +else + gem "google-cloud-service_directory-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-service_directory-v1/snippets/lookup_service/resolve_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb new file mode 100644 index 000000000000..42d41523aeb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_LookupService_ResolveService_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the resolve_service call in the LookupService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service. +# +def resolve_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::LookupService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new + + # Call the resolve_service method. + result = client.resolve_service request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse. + p result +end +# [END servicedirectory_v1_generated_LookupService_ResolveService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb new file mode 100644 index 000000000000..6b362874d99c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the create_endpoint call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_endpoint. +# +def create_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new + + # Call the create_endpoint method. + result = client.create_endpoint request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb new file mode 100644 index 000000000000..9c1ca78aebfd --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the create_namespace call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_namespace. +# +def create_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new + + # Call the create_namespace method. + result = client.create_namespace request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb new file mode 100644 index 000000000000..c62abb5f64e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_CreateService_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the create_service call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_service. +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new + + # Call the create_service method. + result = client.create_service request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_CreateService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb new file mode 100644 index 000000000000..6640ad275320 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the delete_endpoint call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_endpoint. +# +def delete_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new + + # Call the delete_endpoint method. + result = client.delete_endpoint request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb new file mode 100644 index 000000000000..973d1427f276 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the delete_namespace call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_namespace. +# +def delete_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new + + # Call the delete_namespace method. + result = client.delete_namespace request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb new file mode 100644 index 000000000000..41c35556e4cf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_DeleteService_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the delete_service call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_service. +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new + + # Call the delete_service method. + result = client.delete_service request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_DeleteService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb new file mode 100644 index 000000000000..7c3a9036a8f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the get_endpoint call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_endpoint. +# +def get_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new + + # Call the get_endpoint method. + result = client.get_endpoint request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb new file mode 100644 index 000000000000..3edcd0855cec --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the get_iam_policy call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb new file mode 100644 index 000000000000..38a5886b9b20 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_GetNamespace_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the get_namespace call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_namespace. +# +def get_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new + + # Call the get_namespace method. + result = client.get_namespace request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_GetNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb new file mode 100644 index 000000000000..8d9c8345bf13 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_GetService_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the get_service call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_service. +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new + + # Call the get_service method. + result = client.get_service request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_GetService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb new file mode 100644 index 000000000000..0144213ae217 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.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 servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the list_endpoints call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints. +# +def list_endpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.new + + # Call the list_endpoints method. + result = client.list_endpoints request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Endpoint. + p item + end +end +# [END servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb new file mode 100644 index 000000000000..181100cb1862 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.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 servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the list_namespaces call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces. +# +def list_namespaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.new + + # Call the list_namespaces method. + result = client.list_namespaces request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Namespace. + p item + end +end +# [END servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb new file mode 100644 index 000000000000..ff60767be1ea --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_ListServices_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the list_services call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services. +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::ListServicesRequest.new + + # Call the list_services method. + result = client.list_services request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Service. + p item + end +end +# [END servicedirectory_v1_generated_RegistrationService_ListServices_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb new file mode 100644 index 000000000000..6123a80d0ef7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the set_iam_policy call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb new file mode 100644 index 000000000000..3790cb0c71e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the test_iam_permissions call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb new file mode 100644 index 000000000000..dc43cb46df74 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the update_endpoint call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_endpoint. +# +def update_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new + + # Call the update_endpoint method. + result = client.update_endpoint request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb new file mode 100644 index 000000000000..4a3b1c3523d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the update_namespace call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_namespace. +# +def update_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new + + # Call the update_namespace method. + result = client.update_namespace request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb new file mode 100644 index 000000000000..967e62ebca9a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1_generated_RegistrationService_UpdateService_sync] +require "google/cloud/service_directory/v1" + +## +# Snippet for the update_service call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_service. +# +def update_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new + + # Call the update_service method. + result = client.update_service request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + p result +end +# [END servicedirectory_v1_generated_RegistrationService_UpdateService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json b/owl-bot-staging/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json new file mode 100644 index 000000000000..602d9485afe4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json @@ -0,0 +1,775 @@ +{ + "client_library": { + "name": "google-cloud-service_directory-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.servicedirectory.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "servicedirectory_v1_generated_LookupService_ResolveService_sync", + "title": "Snippet for the resolve_service call in the LookupService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service.", + "file": "lookup_service/resolve_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "resolve_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse", + "client": { + "short_name": "LookupService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::LookupService::Client" + }, + "method": { + "short_name": "ResolveService", + "full_name": "google.cloud.servicedirectory.v1.LookupService.ResolveService", + "service": { + "short_name": "LookupService", + "full_name": "google.cloud.servicedirectory.v1.LookupService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync", + "title": "Snippet for the create_namespace call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_namespace.", + "file": "registration_service/create_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_namespace", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::Namespace", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "CreateNamespace", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.CreateNamespace", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync", + "title": "Snippet for the list_namespaces call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces.", + "file": "registration_service/list_namespaces.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_namespaces", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "ListNamespaces", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.ListNamespaces", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_GetNamespace_sync", + "title": "Snippet for the get_namespace call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_namespace.", + "file": "registration_service/get_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_namespace", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::Namespace", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "GetNamespace", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.GetNamespace", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync", + "title": "Snippet for the update_namespace call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_namespace.", + "file": "registration_service/update_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_namespace", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::Namespace", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "UpdateNamespace", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.UpdateNamespace", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync", + "title": "Snippet for the delete_namespace call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_namespace.", + "file": "registration_service/delete_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_namespace", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "DeleteNamespace", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.DeleteNamespace", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_CreateService_sync", + "title": "Snippet for the create_service call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_service.", + "file": "registration_service/create_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::Service", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "CreateService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.CreateService", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_ListServices_sync", + "title": "Snippet for the list_services call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services.", + "file": "registration_service/list_services.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_services", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::ListServicesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::ListServicesResponse", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "ListServices", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.ListServices", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_GetService_sync", + "title": "Snippet for the get_service call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_service.", + "file": "registration_service/get_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::GetServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::Service", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "GetService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.GetService", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_UpdateService_sync", + "title": "Snippet for the update_service call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_service.", + "file": "registration_service/update_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::Service", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "UpdateService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.UpdateService", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_DeleteService_sync", + "title": "Snippet for the delete_service call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_service.", + "file": "registration_service/delete_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "DeleteService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.DeleteService", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync", + "title": "Snippet for the create_endpoint call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_endpoint.", + "file": "registration_service/create_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_endpoint", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::Endpoint", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "CreateEndpoint", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.CreateEndpoint", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync", + "title": "Snippet for the list_endpoints call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints.", + "file": "registration_service/list_endpoints.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_endpoints", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "ListEndpoints", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync", + "title": "Snippet for the get_endpoint call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_endpoint.", + "file": "registration_service/get_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_endpoint", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::Endpoint", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "GetEndpoint", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.GetEndpoint", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync", + "title": "Snippet for the update_endpoint call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_endpoint.", + "file": "registration_service/update_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_endpoint", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1::Endpoint", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "UpdateEndpoint", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.UpdateEndpoint", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync", + "title": "Snippet for the delete_endpoint call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_endpoint.", + "file": "registration_service/delete_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_endpoint", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "DeleteEndpoint", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.DeleteEndpoint", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_iam_policy.", + "file": "registration_service/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.GetIamPolicy", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#set_iam_policy.", + "file": "registration_service/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.SetIamPolicy", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#test_iam_permissions.", + "file": "registration_service/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService.TestIamPermissions", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1.RegistrationService" + } + } + }, + "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-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb new file mode 100644 index 000000000000..2eda77de1994 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_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/service_directory/v1/lookup_service" + +class ::Google::Cloud::ServiceDirectory::V1::LookupService::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_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" + assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb new file mode 100644 index 000000000000..869730c95a5e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/servicedirectory/v1/lookup_service_pb" +require "google/cloud/service_directory/v1/lookup_service/rest" + + +class ::Google::Cloud::ServiceDirectory::V1::LookupService::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_resolve_service + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + max_endpoints = 42 + endpoint_filter = "hello world" + + resolve_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::ServiceStub.stub :transcode_resolve_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resolve_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resolve_service name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resolve_service ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resolve_service(::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resolve_service_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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::ServiceDirectory::V1::LookupService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb new file mode 100644 index 000000000000..9d5e92ce315f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/servicedirectory/v1/lookup_service_pb" +require "google/cloud/service_directory/v1/lookup_service" + +class ::Google::Cloud::ServiceDirectory::V1::LookupService::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_resolve_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + max_endpoints = 42 + endpoint_filter = "hello world" + + resolve_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resolve_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["max_endpoints"] + assert_equal "hello world", request["endpoint_filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resolve_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resolve_service name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resolve_service ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resolve_service(::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, resolve_service_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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::ServiceDirectory::V1::LookupService::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::ServiceDirectory::V1::LookupService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::LookupService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb new file mode 100644 index 000000000000..a8dbd3c6867f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/service_directory/v1/registration_service" + +class ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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_endpoint_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.endpoint_path project: "value0", location: "value1", namespace: "value2", service: "value3", endpoint: "value4" + assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3/endpoints/value4", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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_namespace_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.namespace_path project: "value0", location: "value1", namespace: "value2" + assert_equal "projects/value0/locations/value1/namespaces/value2", 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::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", network: "value1" + assert_equal "projects/value0/locations/global/networks/value1", path + end + end + + def test_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" + assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb new file mode 100644 index 000000000000..48555a3966c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb @@ -0,0 +1,1096 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/servicedirectory/v1/registration_service_pb" +require "google/cloud/service_directory/v1/registration_service/rest" + + +class ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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_namespace + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::Namespace.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + namespace_id = "hello world" + namespace = {} + + create_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_create_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_namespace parent: parent, namespace_id: namespace_id, namespace: namespace do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_namespace ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_namespace(::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_namespace_client_stub.call_count + end + end + end + + def test_list_namespaces + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse.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_namespaces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_list_namespaces_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_namespaces_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_namespaces({ 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_namespaces 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_namespaces ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.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_namespaces({ 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_namespaces(::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.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_namespaces_client_stub.call_count + end + end + end + + def test_get_namespace + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::Namespace.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_get_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_namespace({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_namespace name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_namespace ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_namespace({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_namespace(::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_namespace_client_stub.call_count + end + end + end + + def test_update_namespace + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::Namespace.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + namespace = {} + update_mask = {} + + update_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_update_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_namespace({ namespace: namespace, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_namespace namespace: namespace, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_namespace ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new(namespace: namespace, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_namespace({ namespace: namespace, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_namespace(::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new(namespace: namespace, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_namespace_client_stub.call_count + end + end + end + + def test_delete_namespace + # 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_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_namespace({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_namespace name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_namespace ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_namespace({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_namespace(::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_namespace_client_stub.call_count + end + end + end + + def test_create_service + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::Service.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + service_id = "hello world" + service = {} + + create_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_create_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_service({ parent: parent, service_id: service_id, service: service }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_service parent: parent, service_id: service_id, service: service do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_service ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_service({ parent: parent, service_id: service_id, service: service }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_service(::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_service_client_stub.call_count + end + end + end + + def test_list_services + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::ListServicesResponse.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_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_list_services_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_services({ 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_services 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_services ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceDirectory::V1::ListServicesRequest.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_services_client_stub.call_count + end + end + end + + def test_get_service + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::Service.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_get_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_service({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_service name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_service ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_service({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_service(::Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_service_client_stub.call_count + end + end + end + + def test_update_service + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::Service.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service = {} + update_mask = {} + + update_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_update_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_service({ service: service, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_service service: service, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_service ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new(service: service, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_service({ service: service, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_service(::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new(service: service, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_service_client_stub.call_count + end + end + end + + def test_delete_service + # 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_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_service({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_service name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_service ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_service({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_service(::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_service_client_stub.call_count + end + end + end + + def test_create_endpoint + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + endpoint_id = "hello world" + endpoint = {} + + create_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_create_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_endpoint parent: parent, endpoint_id: endpoint_id, endpoint: endpoint do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_endpoint ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_endpoint(::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_endpoint_client_stub.call_count + end + end + end + + def test_list_endpoints + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse.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_endpoints_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_list_endpoints_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_endpoints_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_endpoints({ 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_endpoints 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_endpoints ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.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_endpoints({ 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_endpoints(::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.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_endpoints_client_stub.call_count + end + end + end + + def test_get_endpoint + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_get_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_endpoint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_endpoint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_endpoint ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_endpoint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_endpoint(::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_endpoint_client_stub.call_count + end + end + end + + def test_update_endpoint + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + endpoint = {} + update_mask = {} + + update_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_update_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_endpoint endpoint: endpoint, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_endpoint ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new(endpoint: endpoint, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_endpoint(::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new(endpoint: endpoint, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_endpoint_client_stub.call_count + end + end + end + + def test_delete_endpoint + # 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_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_endpoint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_endpoint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_endpoint ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_endpoint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_endpoint(::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_endpoint_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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::ServiceDirectory::V1::RegistrationService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb new file mode 100644 index 000000000000..9ca3fd528e1b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb @@ -0,0 +1,1213 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/servicedirectory/v1/registration_service_pb" +require "google/cloud/service_directory/v1/registration_service" + +class ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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_namespace + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::Namespace.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + namespace_id = "hello world" + namespace = {} + + create_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_namespace, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["namespace_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Namespace), request["namespace"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_namespace parent: parent, namespace_id: namespace_id, namespace: namespace do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_namespace ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_namespace(::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_namespace_client_stub.call_rpc_count + end + end + + def test_list_namespaces + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_namespaces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_namespaces, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest, 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_namespaces_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_namespaces({ 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_namespaces 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_namespaces ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.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_namespaces({ 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_namespaces(::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.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_namespaces_client_stub.call_rpc_count + end + end + + def test_get_namespace + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::Namespace.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_namespace, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_namespace({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_namespace name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_namespace ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_namespace({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_namespace(::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_namespace_client_stub.call_rpc_count + end + end + + def test_update_namespace + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::Namespace.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + namespace = {} + update_mask = {} + + update_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_namespace, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Namespace), request["namespace"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_namespace({ namespace: namespace, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_namespace namespace: namespace, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_namespace ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new(namespace: namespace, 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_namespace({ namespace: namespace, 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_namespace(::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new(namespace: namespace, 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_namespace_client_stub.call_rpc_count + end + end + + def test_delete_namespace + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_namespace, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_namespace({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_namespace name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_namespace ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_namespace({ 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_namespace(::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new(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_namespace_client_stub.call_rpc_count + end + end + + def test_create_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::Service.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + service_id = "hello world" + service = {} + + create_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["service_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Service), request["service"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_service({ parent: parent, service_id: service_id, service: service }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_service parent: parent, service_id: service_id, service: service do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_service ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_service({ parent: parent, service_id: service_id, service: service }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_service(::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_service_client_stub.call_rpc_count + end + end + + def test_list_services + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::ListServicesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_services, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest, 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_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_services({ 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_services 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_services ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceDirectory::V1::ListServicesRequest.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_services_client_stub.call_rpc_count + end + end + + def test_get_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::Service.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_service({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_service name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_service ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_service({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_service(::Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_service_client_stub.call_rpc_count + end + end + + def test_update_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::Service.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service = {} + update_mask = {} + + update_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Service), request["service"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_service({ service: service, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_service service: service, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_service ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new(service: service, 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_service({ service: service, 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_service(::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new(service: service, 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_service_client_stub.call_rpc_count + end + end + + def test_delete_service + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_service({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_service name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_service ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_service({ 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_service(::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new(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_service_client_stub.call_rpc_count + end + end + + def test_create_endpoint + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + endpoint_id = "hello world" + endpoint = {} + + create_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_endpoint, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["endpoint_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Endpoint), request["endpoint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_endpoint parent: parent, endpoint_id: endpoint_id, endpoint: endpoint do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_endpoint ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_endpoint(::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_endpoint_client_stub.call_rpc_count + end + end + + def test_list_endpoints + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_endpoints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_endpoints, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest, 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_endpoints_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_endpoints({ 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_endpoints 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_endpoints ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.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_endpoints({ 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_endpoints(::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.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_endpoints_client_stub.call_rpc_count + end + end + + def test_get_endpoint + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_endpoint, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_endpoint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_endpoint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_endpoint ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_endpoint({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_endpoint(::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_endpoint_client_stub.call_rpc_count + end + end + + def test_update_endpoint + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + endpoint = {} + update_mask = {} + + update_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_endpoint, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Endpoint), request["endpoint"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_endpoint endpoint: endpoint, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_endpoint ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new(endpoint: endpoint, 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_endpoint({ endpoint: endpoint, 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_endpoint(::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new(endpoint: endpoint, 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_endpoint_client_stub.call_rpc_count + end + end + + def test_delete_endpoint + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_endpoint, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_endpoint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_endpoint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_endpoint ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_endpoint({ 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_endpoint(::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new(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_endpoint_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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::ServiceDirectory::V1::RegistrationService::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::ServiceDirectory::V1::RegistrationService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/.gitignore b/owl-bot-staging/google-cloud-service_directory-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_directory-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..0344f921c12e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "servicedirectory.googleapis.com", + "api_shortname": "servicedirectory", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1beta1/latest", + "distribution_name": "google-cloud-service_directory-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "servicedirectory", + "name_pretty": "Service Directory V1beta1 API", + "product_documentation": "https://cloud.google.com/service-directory", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Service directory is the single place to register, browse, and resolve application services. Note that google-cloud-service_directory-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_directory instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SERVICE_DIRECTORY", + "ruby-cloud-product-url": "https://cloud.google.com/service-directory", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-service_directory-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..d1efd0d6f24d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-service_directory-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-service_directory-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/.yardopts b/owl-bot-staging/google-cloud-service_directory-v1beta1/.yardopts new file mode 100644 index 000000000000..c2eb327a2a4b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Service Directory 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-service_directory-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..6a7d3111b2f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-service_directory-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-service_directory-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/service_directory/v1beta1" + +client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/service_directory/v1beta1" + +::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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-service_directory-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/service_directory/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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-service_directory-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/Gemfile b/owl-bot-staging/google-cloud-service_directory-v1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/README.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/README.md new file mode 100644 index 000000000000..8ad874720629 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Service Directory V1beta1 API + +Service Directory is a platform for discovering, publishing, and connecting services. + +Service directory is the single place to register, browse, and resolve application 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 Service Directory V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-service_directory](https://rubygems.org/gems/google-cloud-service_directory). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-service_directory-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/servicedirectory.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/service_directory/v1beta1" + +client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new +request = ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new # (request fields as keyword arguments...) +response = client.resolve_service request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/service-directory) +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/service_directory/v1beta1" +require "logger" + +client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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-service_directory`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-service_directory-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-service_directory`. +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-service_directory-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-service_directory-v1beta1/Rakefile b/owl-bot-staging/google-cloud-service_directory-v1beta1/Rakefile new file mode 100644 index 000000000000..02b546ed1792 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SERVICE_DIRECTORY_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SERVICE_DIRECTORY_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SERVICE_DIRECTORY_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 SERVICE_DIRECTORY_TEST_PROJECT=test123 SERVICE_DIRECTORY_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/service_directory/v1beta1/lookup_service/credentials" + ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SERVICE_DIRECTORY_PROJECT"] = project + ENV["SERVICE_DIRECTORY_TEST_PROJECT"] = project + ENV["SERVICE_DIRECTORY_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-service_directory-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-service_directory-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-service_directory-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-service_directory-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-service_directory-v1beta1" + header "google-cloud-service_directory-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-service_directory-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-service_directory-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-service_directory-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-service_directory-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-service_directory-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_directory-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..2ab2d2885e40 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/gapic_metadata.json @@ -0,0 +1,122 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.servicedirectory.v1beta1", + "libraryPackage": "::Google::Cloud::ServiceDirectory::V1beta1", + "services": { + "LookupService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client", + "rpcs": { + "ResolveService": { + "methods": [ + "resolve_service" + ] + } + } + } + } + }, + "RegistrationService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client", + "rpcs": { + "CreateNamespace": { + "methods": [ + "create_namespace" + ] + }, + "ListNamespaces": { + "methods": [ + "list_namespaces" + ] + }, + "GetNamespace": { + "methods": [ + "get_namespace" + ] + }, + "UpdateNamespace": { + "methods": [ + "update_namespace" + ] + }, + "DeleteNamespace": { + "methods": [ + "delete_namespace" + ] + }, + "CreateService": { + "methods": [ + "create_service" + ] + }, + "ListServices": { + "methods": [ + "list_services" + ] + }, + "GetService": { + "methods": [ + "get_service" + ] + }, + "UpdateService": { + "methods": [ + "update_service" + ] + }, + "DeleteService": { + "methods": [ + "delete_service" + ] + }, + "CreateEndpoint": { + "methods": [ + "create_endpoint" + ] + }, + "ListEndpoints": { + "methods": [ + "list_endpoints" + ] + }, + "GetEndpoint": { + "methods": [ + "get_endpoint" + ] + }, + "UpdateEndpoint": { + "methods": [ + "update_endpoint" + ] + }, + "DeleteEndpoint": { + "methods": [ + "delete_endpoint" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/google-cloud-service_directory-v1beta1.gemspec b/owl-bot-staging/google-cloud-service_directory-v1beta1/google-cloud-service_directory-v1beta1.gemspec new file mode 100644 index 000000000000..3293eafe752e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/google-cloud-service_directory-v1beta1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/service_directory/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-service_directory-v1beta1" + gem.version = Google::Cloud::ServiceDirectory::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Service directory is the single place to register, browse, and resolve application services. Note that google-cloud-service_directory-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_directory instead. See the readme for more details." + gem.summary = "Service Directory is a platform for discovering, publishing, and connecting services." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google-cloud-service_directory-v1beta1.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google-cloud-service_directory-v1beta1.rb new file mode 100644 index 000000000000..c08367906250 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google-cloud-service_directory-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/service_directory/v1beta1" diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1.rb new file mode 100644 index 000000000000..6bcb343006c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1.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/service_directory/v1beta1/lookup_service" +require "google/cloud/service_directory/v1beta1/registration_service" +require "google/cloud/service_directory/v1beta1/version" + +module Google + module Cloud + module ServiceDirectory + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/service_directory/v1beta1" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/service_directory/v1beta1" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new + # + module V1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/service_directory/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/bindings_override.rb new file mode 100644 index 000000000000..59fc75fb480d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module ServiceDirectory + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/service_directory/v1beta1/rest" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new + # + module V1beta1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceDirectory"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service.rb new file mode 100644 index 000000000000..79639aca3a89 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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/service_directory/v1beta1/version" + +require "google/cloud/service_directory/v1beta1/lookup_service/credentials" +require "google/cloud/service_directory/v1beta1/lookup_service/paths" +require "google/cloud/service_directory/v1beta1/lookup_service/client" +require "google/cloud/service_directory/v1beta1/lookup_service/rest" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + ## + # Service Directory API for looking up service data at runtime. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/service_directory/v1beta1/lookup_service" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/service_directory/v1beta1/lookup_service/rest" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new + # + module LookupService + end + end + end + end +end + +helper_path = ::File.join __dir__, "lookup_service", "helpers.rb" +require "google/cloud/service_directory/v1beta1/lookup_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb new file mode 100644 index 000000000000..fb69b5af313c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb @@ -0,0 +1,538 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/servicedirectory/v1beta1/lookup_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + module LookupService + ## + # Client for the LookupService service. + # + # Service Directory API for looking up service data at runtime. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :lookup_service_stub + + ## + # Configure the LookupService Client class. + # + # See {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LookupService clients + # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceDirectory", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 15.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the LookupService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @lookup_service_stub.universe_domain + end + + ## + # Create a new LookupService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LookupService 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/servicedirectory/v1beta1/lookup_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 + + @lookup_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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 + ) + + @lookup_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @lookup_service_stub.endpoint + config.universe_domain = @lookup_service_stub.universe_domain + config.logger = @lookup_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @lookup_service_stub.logger + end + + # Service calls + + ## + # Returns a {::Google::Cloud::ServiceDirectory::V1beta1::Service service} and its + # associated endpoints. + # Resolving a service is not considered an active developer method. + # + # @overload resolve_service(request, options = nil) + # Pass arguments to `resolve_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) + # Pass arguments to `resolve_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to resolve. + # @param max_endpoints [::Integer] + # Optional. The maximum number of endpoints to return. Defaults to 25. + # Maximum is 100. If a value less than one is specified, the Default is used. + # If a value greater than the Maximum is specified, the Maximum is used. + # @param endpoint_filter [::String] + # Optional. The filter applied to the endpoints of the resolved service. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, or `metadata.` for + # map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `metadata.owner` returns endpoints that have a annotation with the key + # `owner`, this is the same as `metadata:owner` + # * `metadata.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * + # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + # returns the endpoint that has an endpoint_id equal to `ep-1` + # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + # `owner` in annotation key but value is not `sd` AND have key/value + # `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoint, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new + # + # # Call the resolve_service method. + # result = client.resolve_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse. + # p result + # + def resolve_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.resolve_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.resolve_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resolve_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @lookup_service_stub.call_rpc :resolve_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the LookupService API. + # + # This class represents the configuration for LookupService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # resolve_service to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.resolve_service.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.resolve_service.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::ServiceDirectory::V1beta1::LookupService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the LookupService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `resolve_service` + # @return [::Gapic::Config::Method] + # + attr_reader :resolve_service + + # @private + def initialize parent_rpcs = nil + resolve_service_config = parent_rpcs.resolve_service if parent_rpcs.respond_to? :resolve_service + @resolve_service = ::Gapic::Config::Method.new resolve_service_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/credentials.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/credentials.rb new file mode 100644 index 000000000000..53cdf629fbe5 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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 ServiceDirectory + module V1beta1 + module LookupService + # Credentials for the LookupService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SERVICE_DIRECTORY_CREDENTIALS", + "SERVICE_DIRECTORY_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SERVICE_DIRECTORY_CREDENTIALS_JSON", + "SERVICE_DIRECTORY_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-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/paths.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/paths.rb new file mode 100644 index 000000000000..50d7bedddd03 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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 ServiceDirectory + module V1beta1 + module LookupService + # Path helper methods for the LookupService API. + module Paths + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, namespace:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest.rb new file mode 100644 index 000000000000..8555356e42e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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/service_directory/v1beta1/version" +require "google/cloud/service_directory/v1beta1/bindings_override" + +require "google/cloud/service_directory/v1beta1/lookup_service/credentials" +require "google/cloud/service_directory/v1beta1/lookup_service/paths" +require "google/cloud/service_directory/v1beta1/lookup_service/rest/client" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + ## + # Service Directory API for looking up service data at runtime. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/service_directory/v1beta1/lookup_service/rest" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new + # + module LookupService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/service_directory/v1beta1/lookup_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb new file mode 100644 index 000000000000..7e7765b5d44f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/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/cloud/servicedirectory/v1beta1/lookup_service_pb" +require "google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + module LookupService + module Rest + ## + # REST client for the LookupService service. + # + # Service Directory API for looking up service data at runtime. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :lookup_service_stub + + ## + # Configure the LookupService Client class. + # + # See {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LookupService clients + # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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", "ServiceDirectory", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 15.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the LookupService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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 + @lookup_service_stub.universe_domain + end + + ## + # Create a new LookupService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LookupService 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 + + @lookup_service_stub = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @lookup_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @lookup_service_stub.endpoint + config.universe_domain = @lookup_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @lookup_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @lookup_service_stub.logger + end + + # Service calls + + ## + # Returns a {::Google::Cloud::ServiceDirectory::V1beta1::Service service} and its + # associated endpoints. + # Resolving a service is not considered an active developer method. + # + # @overload resolve_service(request, options = nil) + # Pass arguments to `resolve_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) + # Pass arguments to `resolve_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to resolve. + # @param max_endpoints [::Integer] + # Optional. The maximum number of endpoints to return. Defaults to 25. + # Maximum is 100. If a value less than one is specified, the Default is used. + # If a value greater than the Maximum is specified, the Maximum is used. + # @param endpoint_filter [::String] + # Optional. The filter applied to the endpoints of the resolved service. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, or `metadata.` for + # map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `metadata.owner` returns endpoints that have a annotation with the key + # `owner`, this is the same as `metadata:owner` + # * `metadata.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * + # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + # returns the endpoint that has an endpoint_id equal to `ep-1` + # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + # `owner` in annotation key but value is not `sd` AND have key/value + # `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoint, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new + # + # # Call the resolve_service method. + # result = client.resolve_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse. + # p result + # + def resolve_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.resolve_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.resolve_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resolve_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @lookup_service_stub.resolve_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the LookupService REST API. + # + # This class represents the configuration for LookupService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # resolve_service to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.resolve_service.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.resolve_service.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 LookupService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `resolve_service` + # @return [::Gapic::Config::Method] + # + attr_reader :resolve_service + + # @private + def initialize parent_rpcs = nil + resolve_service_config = parent_rpcs.resolve_service if parent_rpcs.respond_to? :resolve_service + @resolve_service = ::Gapic::Config::Method.new resolve_service_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb new file mode 100644 index 000000000000..b7c4ba7a4500 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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/servicedirectory/v1beta1/lookup_service_pb" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + module LookupService + module Rest + ## + # REST service stub for the LookupService 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 resolve_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] + # A result object deserialized from the server's reply + def resolve_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resolve_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "resolve_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse.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 resolve_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resolve_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:resolve", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service.rb new file mode 100644 index 000000000000..7acfe52f8b07 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/service_directory/v1beta1/version" + +require "google/cloud/service_directory/v1beta1/registration_service/credentials" +require "google/cloud/service_directory/v1beta1/registration_service/paths" +require "google/cloud/service_directory/v1beta1/registration_service/client" +require "google/cloud/service_directory/v1beta1/registration_service/rest" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + ## + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Namespace Namespace} + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Service Service} resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint Endpoint} + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/service_directory/v1beta1/registration_service" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/service_directory/v1beta1/registration_service/rest" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + module RegistrationService + end + end + end + end +end + +helper_path = ::File.join __dir__, "registration_service", "helpers.rb" +require "google/cloud/service_directory/v1beta1/registration_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb new file mode 100644 index 000000000000..50478f67a20e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb @@ -0,0 +1,2305 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/servicedirectory/v1beta1/registration_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + module RegistrationService + ## + # Client for the RegistrationService service. + # + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Namespace Namespace} + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Service Service} resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint Endpoint} + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :registration_service_stub + + ## + # Configure the RegistrationService Client class. + # + # See {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RegistrationService clients + # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceDirectory", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 15.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RegistrationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @registration_service_stub.universe_domain + end + + ## + # Create a new RegistrationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RegistrationService 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/servicedirectory/v1beta1/registration_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 + + @registration_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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 + ) + + @registration_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registration_service_stub.endpoint + config.universe_domain = @registration_service_stub.universe_domain + config.logger = @registration_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @registration_service_stub.logger + end + + # Service calls + + ## + # Creates a namespace, and returns the new namespace. + # + # @overload create_namespace(request, options = nil) + # Pass arguments to `create_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_namespace(parent: nil, namespace_id: nil, namespace: nil) + # Pass arguments to `create_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project and location the namespace + # will be created in. + # @param namespace_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param namespace [::Google::Cloud::ServiceDirectory::V1beta1::Namespace, ::Hash] + # Required. A namespace with initial fields set. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new + # + # # Call the create_namespace method. + # result = client.create_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + # p result + # + def create_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest + + # Converts hash and nil to 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_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :create_namespace, request, 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 namespaces. + # + # @overload list_namespaces(request, options = nil) + # Pass arguments to `list_namespaces` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_namespaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project and location whose namespaces + # you'd like to list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The default value is 100. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `labels.` for map field, or + # `attributes.` for attributes field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `labels.owner` returns namespaces that have a label with the key + # `owner`, this is the same as `labels:owner` + # * `labels.owner=sd` returns namespaces that have key/value `owner=sd` + # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + # returns namespaces that have name that is alphabetically later than the + # string, so "namespace-e" is returned but "namespace-a" is not + # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + # `owner` in label key but value is not `sd` AND have key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that namespace + # doesn't have a field called "doesnotexist". Since the filter does not + # match any namespaces, it returns no results + # * `attributes.managed_registration=true` returns namespaces that are + # managed by a GCP product or service + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.new + # + # # Call the list_namespaces method. + # result = client.list_namespaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Namespace. + # p item + # end + # + def list_namespaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_namespaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_namespaces.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_namespaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :list_namespaces, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_namespaces, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a namespace. + # + # @overload get_namespace(request, options = nil) + # Pass arguments to `get_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_namespace(name: nil) + # Pass arguments to `get_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 namespace to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new + # + # # Call the get_namespace method. + # result = client.get_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + # p result + # + def get_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :get_namespace, request, 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 namespace. + # + # @overload update_namespace(request, options = nil) + # Pass arguments to `update_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_namespace(namespace: nil, update_mask: nil) + # Pass arguments to `update_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param namespace [::Google::Cloud::ServiceDirectory::V1beta1::Namespace, ::Hash] + # Required. The updated namespace. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new + # + # # Call the update_namespace method. + # result = client.update_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + # p result + # + def update_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest + + # Converts hash and nil to 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_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.namespace&.name + header_params["namespace.name"] = request.namespace.name + end + + request_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_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :update_namespace, request, 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 namespace. This also deletes all services and endpoints in + # the namespace. + # + # @overload delete_namespace(request, options = nil) + # Pass arguments to `delete_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_namespace(name: nil) + # Pass arguments to `delete_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 namespace to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new + # + # # Call the delete_namespace method. + # result = client.delete_namespace request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_namespace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :delete_namespace, request, 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 service, and returns the new service. + # + # @overload create_service(request, options = nil) + # Pass arguments to `create_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_service(parent: nil, service_id: nil, service: nil) + # Pass arguments to `create_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the namespace this service will belong to. + # @param service_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param service [::Google::Cloud::ServiceDirectory::V1beta1::Service, ::Hash] + # Required. A service with initial fields set. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new + # + # # Call the create_service method. + # result = client.create_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + # p result + # + def create_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest + + # Converts hash and nil to 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :create_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all services belonging to a namespace. + # + # @overload list_services(request, options = nil) + # Pass arguments to `list_services` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the namespace whose services you'd + # like to list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The default value is 100. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name` or `metadata.` for map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `metadata.owner` returns services that have a metadata with the key + # `owner`, this is the same as `metadata:owner` + # * `metadata.protocol=gRPC` returns services that have key/value + # `protocol=gRPC` + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + # returns services that have name that is alphabetically later than the + # string, so "service-e" is returned but "service-a" is not + # * `metadata.owner!=sd AND metadata.foo=bar` returns services that have + # `owner` in metadata key but value is not `sd` AND have key/value + # `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that service + # doesn't have a field called "doesnotexist". Since the filter does not + # match any services, it returns no results + # * `attributes.managed_registration=true` returns services that are + # managed + # by a GCP product or service + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Service>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Service>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.new + # + # # Call the list_services method. + # result = client.list_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Service. + # p item + # end + # + def list_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_services.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :list_services, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_services, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a service. + # + # @overload get_service(request, options = nil) + # Pass arguments to `get_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_service(name: nil) + # Pass arguments to `get_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new + # + # # Call the get_service method. + # result = client.get_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + # p result + # + def get_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :get_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a service. + # + # @overload update_service(request, options = nil) + # Pass arguments to `update_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_service(service: nil, update_mask: nil) + # Pass arguments to `update_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service [::Google::Cloud::ServiceDirectory::V1beta1::Service, ::Hash] + # Required. The updated service. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new + # + # # Call the update_service method. + # result = client.update_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + # p result + # + def update_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest + + # Converts hash and nil to 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service&.name + header_params["service.name"] = request.service.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :update_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a service. This also deletes all endpoints associated with + # the service. + # + # @overload delete_service(request, options = nil) + # Pass arguments to `delete_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_service(name: nil) + # Pass arguments to `delete_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new + # + # # Call the delete_service method. + # result = client.delete_service request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :delete_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an endpoint, and returns the new endpoint. + # + # @overload create_endpoint(request, options = nil) + # Pass arguments to `create_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) + # Pass arguments to `create_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the service that this endpoint provides. + # @param endpoint_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param endpoint [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint, ::Hash] + # Required. A endpoint with initial fields set. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new + # + # # Call the create_endpoint method. + # result = client.create_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + # p result + # + def create_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest + + # Converts hash and nil to 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_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :create_endpoint, request, 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 endpoints. + # + # @overload list_endpoints(request, options = nil) + # Pass arguments to `list_endpoints` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_endpoints` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the service whose endpoints you'd like to + # list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The default value is 100. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, `metadata.` for map + # field, or `attributes.` for attributes field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `metadata.owner` returns endpoints that have a metadata with the key + # `owner`, this is the same as `metadata:owner` + # * `metadata.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + # `owner` in metadata key but value is not `sd` AND have key/value + # `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoints, it returns no results + # * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + # IP` returns endpoints with the corresponding kubernetes_resource_type + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows values: `name`, `address`, `port` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.new + # + # # Call the list_endpoints method. + # result = client.list_endpoints request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + # p item + # end + # + def list_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_endpoints.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :list_endpoints, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_endpoints, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an endpoint. + # + # @overload get_endpoint(request, options = nil) + # Pass arguments to `get_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_endpoint(name: nil) + # Pass arguments to `get_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 endpoint to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new + # + # # Call the get_endpoint method. + # result = client.get_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + # p result + # + def get_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :get_endpoint, request, 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 endpoint. + # + # @overload update_endpoint(request, options = nil) + # Pass arguments to `update_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_endpoint(endpoint: nil, update_mask: nil) + # Pass arguments to `update_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param endpoint [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint, ::Hash] + # Required. The updated endpoint. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new + # + # # Call the update_endpoint method. + # result = client.update_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + # p result + # + def update_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest + + # Converts hash and nil to 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_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.endpoint&.name + header_params["endpoint.name"] = request.endpoint.name + end + + request_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_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :update_endpoint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an endpoint. + # + # @overload delete_endpoint(request, options = nil) + # Pass arguments to `delete_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_endpoint(name: nil) + # Pass arguments to `delete_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 endpoint to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new + # + # # Call the delete_endpoint method. + # result = client.delete_endpoint request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :delete_endpoint, request, 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 IAM Policy for a resource + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the IAM Policy for a resource + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Tests IAM permissions for a resource (namespace, service or + # service workload only). + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the RegistrationService API. + # + # This class represents the configuration for RegistrationService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_namespace to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_namespace.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_namespace.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the RegistrationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :create_namespace + ## + # RPC-specific configuration for `list_namespaces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_namespaces + ## + # RPC-specific configuration for `get_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :get_namespace + ## + # RPC-specific configuration for `update_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :update_namespace + ## + # RPC-specific configuration for `delete_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_namespace + ## + # RPC-specific configuration for `create_service` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service + ## + # RPC-specific configuration for `list_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_services + ## + # RPC-specific configuration for `get_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service + ## + # RPC-specific configuration for `update_service` + # @return [::Gapic::Config::Method] + # + attr_reader :update_service + ## + # RPC-specific configuration for `delete_service` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_service + ## + # RPC-specific configuration for `create_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_endpoint + ## + # RPC-specific configuration for `list_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_endpoints + ## + # RPC-specific configuration for `get_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_endpoint + ## + # RPC-specific configuration for `update_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_endpoint + ## + # RPC-specific configuration for `delete_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_endpoint + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + create_namespace_config = parent_rpcs.create_namespace if parent_rpcs.respond_to? :create_namespace + @create_namespace = ::Gapic::Config::Method.new create_namespace_config + list_namespaces_config = parent_rpcs.list_namespaces if parent_rpcs.respond_to? :list_namespaces + @list_namespaces = ::Gapic::Config::Method.new list_namespaces_config + get_namespace_config = parent_rpcs.get_namespace if parent_rpcs.respond_to? :get_namespace + @get_namespace = ::Gapic::Config::Method.new get_namespace_config + update_namespace_config = parent_rpcs.update_namespace if parent_rpcs.respond_to? :update_namespace + @update_namespace = ::Gapic::Config::Method.new update_namespace_config + delete_namespace_config = parent_rpcs.delete_namespace if parent_rpcs.respond_to? :delete_namespace + @delete_namespace = ::Gapic::Config::Method.new delete_namespace_config + create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service + @create_service = ::Gapic::Config::Method.new create_service_config + list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services + @list_services = ::Gapic::Config::Method.new list_services_config + get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service + @get_service = ::Gapic::Config::Method.new get_service_config + update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service + @update_service = ::Gapic::Config::Method.new update_service_config + delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service + @delete_service = ::Gapic::Config::Method.new delete_service_config + create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint + @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config + list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints + @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config + get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint + @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config + update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint + @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config + delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint + @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/credentials.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/credentials.rb new file mode 100644 index 000000000000..d90bb79b2ad3 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_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 ServiceDirectory + module V1beta1 + module RegistrationService + # Credentials for the RegistrationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SERVICE_DIRECTORY_CREDENTIALS", + "SERVICE_DIRECTORY_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SERVICE_DIRECTORY_CREDENTIALS_JSON", + "SERVICE_DIRECTORY_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-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/paths.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/paths.rb new file mode 100644 index 000000000000..7d67a139666f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/paths.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + module RegistrationService + # Path helper methods for the RegistrationService API. + module Paths + ## + # Create a fully-qualified Endpoint resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # @param service [String] + # @param endpoint [String] + # + # @return [::String] + def endpoint_path project:, location:, namespace:, service:, endpoint: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" + raise ::ArgumentError, "service cannot contain /" if service.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}/endpoints/#{endpoint}" + 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 Namespace resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # + # @return [::String] + def namespace_path project:, location:, namespace: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/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}/locations/global/networks/#{network}" + end + + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, namespace:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest.rb new file mode 100644 index 000000000000..3cf7fab4eda2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/service_directory/v1beta1/version" +require "google/cloud/service_directory/v1beta1/bindings_override" + +require "google/cloud/service_directory/v1beta1/registration_service/credentials" +require "google/cloud/service_directory/v1beta1/registration_service/paths" +require "google/cloud/service_directory/v1beta1/registration_service/rest/client" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + ## + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Namespace Namespace} + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Service Service} resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint Endpoint} + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/service_directory/v1beta1/registration_service/rest" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + module RegistrationService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/service_directory/v1beta1/registration_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb new file mode 100644 index 000000000000..389cc15802b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb @@ -0,0 +1,2144 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/servicedirectory/v1beta1/registration_service_pb" +require "google/cloud/service_directory/v1beta1/registration_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + module RegistrationService + module Rest + ## + # REST client for the RegistrationService service. + # + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Namespace Namespace} + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Service Service} resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint Endpoint} + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :registration_service_stub + + ## + # Configure the RegistrationService Client class. + # + # See {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RegistrationService clients + # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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", "ServiceDirectory", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 15.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RegistrationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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 + @registration_service_stub.universe_domain + end + + ## + # Create a new RegistrationService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RegistrationService 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 + + @registration_service_stub = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @registration_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registration_service_stub.endpoint + config.universe_domain = @registration_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @registration_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @registration_service_stub.logger + end + + # Service calls + + ## + # Creates a namespace, and returns the new namespace. + # + # @overload create_namespace(request, options = nil) + # Pass arguments to `create_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_namespace(parent: nil, namespace_id: nil, namespace: nil) + # Pass arguments to `create_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project and location the namespace + # will be created in. + # @param namespace_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param namespace [::Google::Cloud::ServiceDirectory::V1beta1::Namespace, ::Hash] + # Required. A namespace with initial fields set. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new + # + # # Call the create_namespace method. + # result = client.create_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + # p result + # + def create_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest + + # Converts hash and nil to an 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_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.create_namespace request, 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 namespaces. + # + # @overload list_namespaces(request, options = nil) + # Pass arguments to `list_namespaces` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_namespaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project and location whose namespaces + # you'd like to list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The default value is 100. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `labels.` for map field, or + # `attributes.` for attributes field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `labels.owner` returns namespaces that have a label with the key + # `owner`, this is the same as `labels:owner` + # * `labels.owner=sd` returns namespaces that have key/value `owner=sd` + # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + # returns namespaces that have name that is alphabetically later than the + # string, so "namespace-e" is returned but "namespace-a" is not + # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + # `owner` in label key but value is not `sd` AND have key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that namespace + # doesn't have a field called "doesnotexist". Since the filter does not + # match any namespaces, it returns no results + # * `attributes.managed_registration=true` returns namespaces that are + # managed by a GCP product or service + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.new + # + # # Call the list_namespaces method. + # result = client.list_namespaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Namespace. + # p item + # end + # + def list_namespaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_namespaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_namespaces.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_namespaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.list_namespaces request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_namespaces, "namespaces", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a namespace. + # + # @overload get_namespace(request, options = nil) + # Pass arguments to `get_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_namespace(name: nil) + # Pass arguments to `get_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 namespace to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new + # + # # Call the get_namespace method. + # result = client.get_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + # p result + # + def get_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.get_namespace request, 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 namespace. + # + # @overload update_namespace(request, options = nil) + # Pass arguments to `update_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_namespace(namespace: nil, update_mask: nil) + # Pass arguments to `update_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param namespace [::Google::Cloud::ServiceDirectory::V1beta1::Namespace, ::Hash] + # Required. The updated namespace. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new + # + # # Call the update_namespace method. + # result = client.update_namespace request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + # p result + # + def update_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest + + # Converts hash and nil to an 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_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.update_namespace request, 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 namespace. This also deletes all services and endpoints in + # the namespace. + # + # @overload delete_namespace(request, options = nil) + # Pass arguments to `delete_namespace` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_namespace(name: nil) + # Pass arguments to `delete_namespace` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 namespace to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new + # + # # Call the delete_namespace method. + # result = client.delete_namespace request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_namespace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_namespace.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_namespace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_namespace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.delete_namespace request, 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 service, and returns the new service. + # + # @overload create_service(request, options = nil) + # Pass arguments to `create_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_service(parent: nil, service_id: nil, service: nil) + # Pass arguments to `create_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the namespace this service will belong to. + # @param service_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param service [::Google::Cloud::ServiceDirectory::V1beta1::Service, ::Hash] + # Required. A service with initial fields set. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new + # + # # Call the create_service method. + # result = client.create_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + # p result + # + def create_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest + + # Converts hash and nil to an 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.create_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all services belonging to a namespace. + # + # @overload list_services(request, options = nil) + # Pass arguments to `list_services` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the namespace whose services you'd + # like to list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The default value is 100. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name` or `metadata.` for map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `metadata.owner` returns services that have a metadata with the key + # `owner`, this is the same as `metadata:owner` + # * `metadata.protocol=gRPC` returns services that have key/value + # `protocol=gRPC` + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + # returns services that have name that is alphabetically later than the + # string, so "service-e" is returned but "service-a" is not + # * `metadata.owner!=sd AND metadata.foo=bar` returns services that have + # `owner` in metadata key but value is not `sd` AND have key/value + # `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that service + # doesn't have a field called "doesnotexist". Since the filter does not + # match any services, it returns no results + # * `attributes.managed_registration=true` returns services that are + # managed + # by a GCP product or service + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Service>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Service>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.new + # + # # Call the list_services method. + # result = client.list_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Service. + # p item + # end + # + def list_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_services.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.list_services request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_services, "services", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a service. + # + # @overload get_service(request, options = nil) + # Pass arguments to `get_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_service(name: nil) + # Pass arguments to `get_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new + # + # # Call the get_service method. + # result = client.get_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + # p result + # + def get_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.get_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a service. + # + # @overload update_service(request, options = nil) + # Pass arguments to `update_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_service(service: nil, update_mask: nil) + # Pass arguments to `update_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service [::Google::Cloud::ServiceDirectory::V1beta1::Service, ::Hash] + # Required. The updated service. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new + # + # # Call the update_service method. + # result = client.update_service request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + # p result + # + def update_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest + + # Converts hash and nil to an 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.update_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a service. This also deletes all endpoints associated with + # the service. + # + # @overload delete_service(request, options = nil) + # Pass arguments to `delete_service` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_service(name: nil) + # Pass arguments to `delete_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the service to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new + # + # # Call the delete_service method. + # result = client.delete_service request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.delete_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an endpoint, and returns the new endpoint. + # + # @overload create_endpoint(request, options = nil) + # Pass arguments to `create_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) + # Pass arguments to `create_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the service that this endpoint provides. + # @param endpoint_id [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @param endpoint [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint, ::Hash] + # Required. A endpoint with initial fields set. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new + # + # # Call the create_endpoint method. + # result = client.create_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + # p result + # + def create_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest + + # Converts hash and nil to an 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_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.create_endpoint request, 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 endpoints. + # + # @overload list_endpoints(request, options = nil) + # Pass arguments to `list_endpoints` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_endpoints` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the service whose endpoints you'd like to + # list. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The default value is 100. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @param filter [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, `metadata.` for map + # field, or `attributes.` for attributes field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `metadata.owner` returns endpoints that have a metadata with the key + # `owner`, this is the same as `metadata:owner` + # * `metadata.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + # `owner` in metadata key but value is not `sd` AND have key/value + # `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoints, it returns no results + # * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + # IP` returns endpoints with the corresponding kubernetes_resource_type + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param order_by [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows values: `name`, `address`, `port` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.new + # + # # Call the list_endpoints method. + # result = client.list_endpoints request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + # p item + # end + # + def list_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_endpoints.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.list_endpoints request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_endpoints, "endpoints", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an endpoint. + # + # @overload get_endpoint(request, options = nil) + # Pass arguments to `get_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_endpoint(name: nil) + # Pass arguments to `get_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 endpoint to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new + # + # # Call the get_endpoint method. + # result = client.get_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + # p result + # + def get_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.get_endpoint request, 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 endpoint. + # + # @overload update_endpoint(request, options = nil) + # Pass arguments to `update_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_endpoint(endpoint: nil, update_mask: nil) + # Pass arguments to `update_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param endpoint [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint, ::Hash] + # Required. The updated endpoint. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new + # + # # Call the update_endpoint method. + # result = client.update_endpoint request + # + # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + # p result + # + def update_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest + + # Converts hash and nil to an 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_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.update_endpoint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an endpoint. + # + # @overload delete_endpoint(request, options = nil) + # Pass arguments to `delete_endpoint` via a request object, either of type + # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_endpoint(name: nil) + # Pass arguments to `delete_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 endpoint to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new + # + # # Call the delete_endpoint method. + # result = client.delete_endpoint request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_endpoint.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.delete_endpoint request, 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 IAM Policy for a resource + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the IAM Policy for a resource + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Tests IAM permissions for a resource (namespace, service or + # service workload only). + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_directory/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @registration_service_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the RegistrationService REST API. + # + # This class represents the configuration for RegistrationService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_namespace to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_namespace.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_namespace.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 RegistrationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :create_namespace + ## + # RPC-specific configuration for `list_namespaces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_namespaces + ## + # RPC-specific configuration for `get_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :get_namespace + ## + # RPC-specific configuration for `update_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :update_namespace + ## + # RPC-specific configuration for `delete_namespace` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_namespace + ## + # RPC-specific configuration for `create_service` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service + ## + # RPC-specific configuration for `list_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_services + ## + # RPC-specific configuration for `get_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service + ## + # RPC-specific configuration for `update_service` + # @return [::Gapic::Config::Method] + # + attr_reader :update_service + ## + # RPC-specific configuration for `delete_service` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_service + ## + # RPC-specific configuration for `create_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_endpoint + ## + # RPC-specific configuration for `list_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_endpoints + ## + # RPC-specific configuration for `get_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_endpoint + ## + # RPC-specific configuration for `update_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_endpoint + ## + # RPC-specific configuration for `delete_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_endpoint + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + create_namespace_config = parent_rpcs.create_namespace if parent_rpcs.respond_to? :create_namespace + @create_namespace = ::Gapic::Config::Method.new create_namespace_config + list_namespaces_config = parent_rpcs.list_namespaces if parent_rpcs.respond_to? :list_namespaces + @list_namespaces = ::Gapic::Config::Method.new list_namespaces_config + get_namespace_config = parent_rpcs.get_namespace if parent_rpcs.respond_to? :get_namespace + @get_namespace = ::Gapic::Config::Method.new get_namespace_config + update_namespace_config = parent_rpcs.update_namespace if parent_rpcs.respond_to? :update_namespace + @update_namespace = ::Gapic::Config::Method.new update_namespace_config + delete_namespace_config = parent_rpcs.delete_namespace if parent_rpcs.respond_to? :delete_namespace + @delete_namespace = ::Gapic::Config::Method.new delete_namespace_config + create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service + @create_service = ::Gapic::Config::Method.new create_service_config + list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services + @list_services = ::Gapic::Config::Method.new list_services_config + get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service + @get_service = ::Gapic::Config::Method.new get_service_config + update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service + @update_service = ::Gapic::Config::Method.new update_service_config + delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service + @delete_service = ::Gapic::Config::Method.new delete_service_config + create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint + @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config + list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints + @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config + get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint + @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config + update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint + @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config + delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint + @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb new file mode 100644 index 000000000000..c4fcd4b792c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb @@ -0,0 +1,1236 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/servicedirectory/v1beta1/registration_service_pb" + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + module RegistrationService + module Rest + ## + # REST service stub for the RegistrationService 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_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # A result object deserialized from the server's reply + def create_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_namespace_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.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_namespaces REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse] + # A result object deserialized from the server's reply + def list_namespaces request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_namespaces_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_namespaces", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # A result object deserialized from the server's reply + def get_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_namespace_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.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_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # A result object deserialized from the server's reply + def update_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_namespace_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_namespace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_namespace_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_namespace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 create_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # A result object deserialized from the server's reply + def create_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.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_services REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse] + # A result object deserialized from the server's reply + def list_services request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_services_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_services", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # A result object deserialized from the server's reply + def get_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.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_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # A result object deserialized from the server's reply + def update_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 create_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # A result object deserialized from the server's reply + def create_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_endpoint_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.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_endpoints REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse] + # A result object deserialized from the server's reply + def list_endpoints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_endpoints_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_endpoints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # A result object deserialized from the server's reply + def get_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_endpoint_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.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_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # A result object deserialized from the server's reply + def update_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_endpoint_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_endpoint_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest] + # 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_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/namespaces", + body: "namespace", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_namespaces REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_namespaces_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/namespaces", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest] + # 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_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{namespace.name}", + body: "namespace", + matches: [ + ["namespace.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_namespace REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_namespace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest] + # 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_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/services", + body: "service", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_services REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_services_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/services", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest] + # 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_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{service.name}", + body: "service", + matches: [ + ["service.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_service REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest] + # 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_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/endpoints", + body: "endpoint", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_endpoints REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_endpoints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/endpoints", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest] + # 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_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{endpoint.name}", + body: "endpoint", + matches: [ + ["endpoint.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_endpoint REST call + # + # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/rest.rb new file mode 100644 index 000000000000..134b4ad50df3 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/service_directory/v1beta1/lookup_service/rest" +require "google/cloud/service_directory/v1beta1/registration_service/rest" +require "google/cloud/service_directory/v1beta1/bindings_override" +require "google/cloud/service_directory/v1beta1/version" + +module Google + module Cloud + module ServiceDirectory + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/service_directory/v1beta1/rest" + # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new + # + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/version.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/version.rb new file mode 100644 index 000000000000..36b1b4ea06f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/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 ServiceDirectory + module V1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/endpoint_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/endpoint_pb.rb new file mode 100644 index 000000000000..cfaf5542a650 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/endpoint_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1beta1/endpoint.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/servicedirectory/v1beta1/endpoint.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa6\x04\n\x08\x45ndpoint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04port\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12T\n\x08metadata\x18\x04 \x03(\x0b\x32=.google.cloud.servicedirectory.v1beta1.Endpoint.MetadataEntryB\x03\xe0\x41\x01\x12@\n\x07network\x18\x05 \x01(\tB/\xe0\x41\x05\xfa\x41)\n\'servicedirectory.googleapis.com/Network\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x08 \x01(\tB\x03\xe0\x41\x03\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x96\x01\xea\x41\x92\x01\n(servicedirectory.googleapis.com/Endpoint\x12\x66projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B\xf2\x02\n)com.google.cloud.servicedirectory.v1beta1B\rEndpointProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1\xea\x41\x61\n\'servicedirectory.googleapis.com/Network\x12\x36projects/{project}/locations/global/networks/{network}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + Endpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.Endpoint").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_pb.rb new file mode 100644 index 000000000000..02a971e3be35 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1beta1/lookup_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/servicedirectory/v1beta1/service_pb' + + +descriptor_data = "\n:google/cloud/servicedirectory/v1beta1/lookup_service.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/servicedirectory/v1beta1/service.proto\"\x90\x01\n\x15ResolveServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x1a\n\rmax_endpoints\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1c\n\x0f\x65ndpoint_filter\x18\x03 \x01(\tB\x03\xe0\x41\x01\"Y\n\x16ResolveServiceResponse\x12?\n\x07service\x18\x01 \x01(\x0b\x32..google.cloud.servicedirectory.v1beta1.Service2\xc7\x02\n\rLookupService\x12\xe0\x01\n\x0eResolveService\x12<.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest\x1a=.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse\"Q\x82\xd3\xe4\x93\x02K\"F/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve:\x01*\x1aS\xca\x41\x1fservicedirectory.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x93\x02\n)com.google.cloud.servicedirectory.v1beta1B\x12LookupServiceProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + ResolveServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ResolveServiceRequest").msgclass + ResolveServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ResolveServiceResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_services_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_services_pb.rb new file mode 100644 index 000000000000..dd25c43fecfb --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/servicedirectory/v1beta1/lookup_service.proto for package 'Google.Cloud.ServiceDirectory.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/servicedirectory/v1beta1/lookup_service_pb' + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + module LookupService + # Service Directory API for looking up service data at runtime. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.servicedirectory.v1beta1.LookupService' + + # Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its + # associated endpoints. + # Resolving a service is not considered an active developer method. + rpc :ResolveService, ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/namespace_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/namespace_pb.rb new file mode 100644 index 000000000000..31939c1f5a8a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/namespace_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1beta1/namespace.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n5google/cloud/servicedirectory/v1beta1/namespace.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8e\x03\n\tNamespace\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12Q\n\x06labels\x18\x02 \x03(\x0b\x32<.google.cloud.servicedirectory.v1beta1.Namespace.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x06 \x01(\tB\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:n\xea\x41k\n)servicedirectory.googleapis.com/Namespace\x12>projects/{project}/locations/{location}/namespaces/{namespace}B\x8f\x02\n)com.google.cloud.servicedirectory.v1beta1B\x0eNamespaceProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + Namespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.Namespace").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_pb.rb new file mode 100644 index 000000000000..a9424447815d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1beta1/registration_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/servicedirectory/v1beta1/endpoint_pb' +require 'google/cloud/servicedirectory/v1beta1/namespace_pb' +require 'google/cloud/servicedirectory/v1beta1/service_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n@google/cloud/servicedirectory/v1beta1/registration_service.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/servicedirectory/v1beta1/endpoint.proto\x1a\x35google/cloud/servicedirectory/v1beta1/namespace.proto\x1a\x33google/cloud/servicedirectory/v1beta1/service.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb8\x01\n\x16\x43reateNamespaceRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0cnamespace_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\tnamespace\x18\x03 \x01(\x0b\x32\x30.google.cloud.servicedirectory.v1beta1.NamespaceB\x03\xe0\x41\x02\"\xaf\x01\n\x15ListNamespacesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"w\n\x16ListNamespacesResponse\x12\x44\n\nnamespaces\x18\x01 \x03(\x0b\x32\x30.google.cloud.servicedirectory.v1beta1.Namespace\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x13GetNamespaceRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\"\x98\x01\n\x16UpdateNamespaceRequest\x12H\n\tnamespace\x18\x01 \x01(\x0b\x32\x30.google.cloud.servicedirectory.v1beta1.NamespaceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"Y\n\x16\x44\x65leteNamespaceRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\"\xb8\x01\n\x14\x43reateServiceRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\x12\x17\n\nservice_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x07service\x18\x03 \x01(\x0b\x32..google.cloud.servicedirectory.v1beta1.ServiceB\x03\xe0\x41\x02\"\xb5\x01\n\x13ListServicesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\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\"q\n\x14ListServicesResponse\x12@\n\x08services\x18\x01 \x03(\x0b\x32..google.cloud.servicedirectory.v1beta1.Service\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x11GetServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\"\x92\x01\n\x14UpdateServiceRequest\x12\x44\n\x07service\x18\x01 \x01(\x0b\x32..google.cloud.servicedirectory.v1beta1.ServiceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"U\n\x14\x44\x65leteServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\"\xba\x01\n\x15\x43reateEndpointRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x18\n\x0b\x65ndpoint_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\x08\x65ndpoint\x18\x03 \x01(\x0b\x32/.google.cloud.servicedirectory.v1beta1.EndpointB\x03\xe0\x41\x02\"\xb4\x01\n\x14ListEndpointsRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\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\"t\n\x15ListEndpointsResponse\x12\x42\n\tendpoints\x18\x01 \x03(\x0b\x32/.google.cloud.servicedirectory.v1beta1.Endpoint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x12GetEndpointRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(servicedirectory.googleapis.com/Endpoint\"\x95\x01\n\x15UpdateEndpointRequest\x12\x46\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32/.google.cloud.servicedirectory.v1beta1.EndpointB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"W\n\x15\x44\x65leteEndpointRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(servicedirectory.googleapis.com/Endpoint2\xda\"\n\x13RegistrationService\x12\xea\x01\n\x0f\x43reateNamespace\x12=.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest\x1a\x30.google.cloud.servicedirectory.v1beta1.Namespace\"f\xda\x41\x1dparent,namespace,namespace_id\x82\xd3\xe4\x93\x02@\"3/v1beta1/{parent=projects/*/locations/*}/namespaces:\tnamespace\x12\xd3\x01\n\x0eListNamespaces\x12<.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest\x1a=.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1beta1/{parent=projects/*/locations/*}/namespaces\x12\xc0\x01\n\x0cGetNamespace\x12:.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest\x1a\x30.google.cloud.servicedirectory.v1beta1.Namespace\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1beta1/{name=projects/*/locations/*/namespaces/*}\x12\xec\x01\n\x0fUpdateNamespace\x12=.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest\x1a\x30.google.cloud.servicedirectory.v1beta1.Namespace\"h\xda\x41\x15namespace,update_mask\x82\xd3\xe4\x93\x02J2=/v1beta1/{namespace.name=projects/*/locations/*/namespaces/*}:\tnamespace\x12\xac\x01\n\x0f\x44\x65leteNamespace\x12=.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1beta1/{name=projects/*/locations/*/namespaces/*}\x12\xe9\x01\n\rCreateService\x12;.google.cloud.servicedirectory.v1beta1.CreateServiceRequest\x1a..google.cloud.servicedirectory.v1beta1.Service\"k\xda\x41\x19parent,service,service_id\x82\xd3\xe4\x93\x02I\">/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services:\x07service\x12\xd8\x01\n\x0cListServices\x12:.google.cloud.servicedirectory.v1beta1.ListServicesRequest\x1a;.google.cloud.servicedirectory.v1beta1.ListServicesResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services\x12\xc5\x01\n\nGetService\x12\x38.google.cloud.servicedirectory.v1beta1.GetServiceRequest\x1a..google.cloud.servicedirectory.v1beta1.Service\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}\x12\xeb\x01\n\rUpdateService\x12;.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest\x1a..google.cloud.servicedirectory.v1beta1.Service\"m\xda\x41\x13service,update_mask\x82\xd3\xe4\x93\x02Q2F/v1beta1/{service.name=projects/*/locations/*/namespaces/*/services/*}:\x07service\x12\xb3\x01\n\rDeleteService\x12;.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest\x1a\x16.google.protobuf.Empty\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}\x12\xfb\x01\n\x0e\x43reateEndpoint\x12<.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest\x1a/.google.cloud.servicedirectory.v1beta1.Endpoint\"z\xda\x41\x1bparent,endpoint,endpoint_id\x82\xd3\xe4\x93\x02V\"J/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints:\x08\x65ndpoint\x12\xe7\x01\n\rListEndpoints\x12;.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest\x1a<.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse\"[\xda\x41\x06parent\x82\xd3\xe4\x93\x02L\x12J/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints\x12\xd4\x01\n\x0bGetEndpoint\x12\x39.google.cloud.servicedirectory.v1beta1.GetEndpointRequest\x1a/.google.cloud.servicedirectory.v1beta1.Endpoint\"Y\xda\x41\x04name\x82\xd3\xe4\x93\x02L\x12J/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}\x12\xfd\x01\n\x0eUpdateEndpoint\x12<.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest\x1a/.google.cloud.servicedirectory.v1beta1.Endpoint\"|\xda\x41\x14\x65ndpoint,update_mask\x82\xd3\xe4\x93\x02_2S/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}:\x08\x65ndpoint\x12\xc1\x01\n\x0e\x44\x65leteEndpoint\x12<.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest\x1a\x16.google.protobuf.Empty\"Y\xda\x41\x04name\x82\xd3\xe4\x93\x02L*J/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}\x12\xc9\x02\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xfd\x01\x82\xd3\xe4\x93\x02\xf6\x01\"D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:\x01*ZT\"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:\x01*ZU\"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:getIamPolicy:\x01*\x12\xc9\x02\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xfd\x01\x82\xd3\xe4\x93\x02\xf6\x01\"D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:\x01*ZT\"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:\x01*ZU\"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:setIamPolicy:\x01*\x12\xfb\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\x8f\x02\x82\xd3\xe4\x93\x02\x88\x02\"J/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:\x01*ZZ\"U/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:\x01*Z[\"V/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:testIamPermissions:\x01*\x1aS\xca\x41\x1fservicedirectory.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x99\x02\n)com.google.cloud.servicedirectory.v1beta1B\x18RegistrationServiceProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + CreateNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest").msgclass + ListNamespacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListNamespacesRequest").msgclass + ListNamespacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListNamespacesResponse").msgclass + GetNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.GetNamespaceRequest").msgclass + UpdateNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest").msgclass + DeleteNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest").msgclass + CreateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.CreateServiceRequest").msgclass + ListServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListServicesRequest").msgclass + ListServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListServicesResponse").msgclass + GetServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.GetServiceRequest").msgclass + UpdateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.UpdateServiceRequest").msgclass + DeleteServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.DeleteServiceRequest").msgclass + CreateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.CreateEndpointRequest").msgclass + ListEndpointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListEndpointsRequest").msgclass + ListEndpointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListEndpointsResponse").msgclass + GetEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.GetEndpointRequest").msgclass + UpdateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest").msgclass + DeleteEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_services_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_services_pb.rb new file mode 100644 index 000000000000..062c769d7350 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_services_pb.rb @@ -0,0 +1,96 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/servicedirectory/v1beta1/registration_service.proto for package 'Google.Cloud.ServiceDirectory.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/servicedirectory/v1beta1/registration_service_pb' + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + module RegistrationService + # Service Directory API for registering services. It defines the following + # resource model: + # + # - The API has a collection of + # [Namespace][google.cloud.servicedirectory.v1beta1.Namespace] + # resources, named `projects/*/locations/*/namespaces/*`. + # + # - Each Namespace has a collection of + # [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named + # `projects/*/locations/*/namespaces/*/services/*`. + # + # - Each Service has a collection of + # [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint] + # resources, named + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.servicedirectory.v1beta1.RegistrationService' + + # Creates a namespace, and returns the new namespace. + rpc :CreateNamespace, ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Namespace + # Lists all namespaces. + rpc :ListNamespaces, ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest, ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse + # Gets a namespace. + rpc :GetNamespace, ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Namespace + # Updates a namespace. + rpc :UpdateNamespace, ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Namespace + # Deletes a namespace. This also deletes all services and endpoints in + # the namespace. + rpc :DeleteNamespace, ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest, ::Google::Protobuf::Empty + # Creates a service, and returns the new service. + rpc :CreateService, ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Service + # Lists all services belonging to a namespace. + rpc :ListServices, ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest, ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse + # Gets a service. + rpc :GetService, ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Service + # Updates a service. + rpc :UpdateService, ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Service + # Deletes a service. This also deletes all endpoints associated with + # the service. + rpc :DeleteService, ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest, ::Google::Protobuf::Empty + # Creates an endpoint, and returns the new endpoint. + rpc :CreateEndpoint, ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint + # Lists all endpoints. + rpc :ListEndpoints, ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest, ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse + # Gets an endpoint. + rpc :GetEndpoint, ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint + # Updates an endpoint. + rpc :UpdateEndpoint, ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint + # Deletes an endpoint. + rpc :DeleteEndpoint, ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest, ::Google::Protobuf::Empty + # Gets the IAM Policy for a resource + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the IAM Policy for a resource + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Tests IAM permissions for a resource (namespace, service or + # service workload only). + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/service_pb.rb new file mode 100644 index 000000000000..9a7d25ed4376 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/service_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicedirectory/v1beta1/service.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/servicedirectory/v1beta1/endpoint_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n3google/cloud/servicedirectory/v1beta1/service.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/servicedirectory/v1beta1/endpoint.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xea\x03\n\x07Service\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12S\n\x08metadata\x18\x02 \x03(\x0b\x32<.google.cloud.servicedirectory.v1beta1.Service.MetadataEntryB\x03\xe0\x41\x01\x12G\n\tendpoints\x18\x03 \x03(\x0b\x32/.google.cloud.servicedirectory.v1beta1.EndpointB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x08 \x01(\tB\x03\xe0\x41\x03\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x7f\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}B\x8d\x02\n)com.google.cloud.servicedirectory.v1beta1B\x0cServiceProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + Service = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.Service").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..93d67c3e7936 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Service Directory 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-service_directory-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/endpoint.rb new file mode 100644 index 000000000000..711458f230d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/endpoint.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + # An individual endpoint that provides a + # {::Google::Cloud::ServiceDirectory::V1beta1::Service service}. The service must + # already exist to create an endpoint. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name for the endpoint in the format + # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + # @!attribute [rw] address + # @return [::String] + # Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses + # like: + # + # * `8.8.8` + # * `8.8.8.8:53` + # * `test:bad:address` + # * `[::1]` + # * `[::1]:8080` + # + # Limited to 45 characters. + # @!attribute [rw] port + # @return [::Integer] + # Optional. Service Directory rejects values outside of `[0, 65535]`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Metadata for the endpoint. This data can be consumed by service + # clients. + # + # Restrictions: + # + # * The entire metadata dictionary may contain up to 512 characters, + # spread accoss all key-value pairs. Metadata that goes beyond this + # limit are rejected + # * Valid metadata keys have two segments: an optional prefix and name, + # separated by a slash (/). The name segment is required and must be 63 + # characters or less, beginning and ending with an alphanumeric character + # ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + # alphanumerics between. The prefix is optional. If specified, the prefix + # must be a DNS subdomain: a series of DNS labels separated by dots (.), + # not longer than 253 characters in total, followed by a slash (/). + # Metadata that fails to meet these requirements are rejected + # + # Note: This field is equivalent to the `annotations` field in the v1 API. + # They have the same syntax and read/write to the same location in Service + # Directory. + # @!attribute [rw] network + # @return [::String] + # Immutable. The Google Compute Engine network (VPC) of the endpoint in the + # format `projects//locations/global/networks/*`. + # + # The project must be specified by project number (project id is rejected). + # Incorrectly formatted networks are rejected, but no other validation + # is performed on this field (ex. network or project existence, reachability, + # or permissions). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the endpoint was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the endpoint was last updated. + # @!attribute [r] uid + # @return [::String] + # Output only. A globally unique identifier (in UUID4 format) for this + # endpoint. + class Endpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + 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-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/lookup_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/lookup_service.rb new file mode 100644 index 000000000000..14fcc99f8faa --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/lookup_service.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 ServiceDirectory + module V1beta1 + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service LookupService.ResolveService}. + # Looks up a service by its name, returns the service and its endpoints. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the service to resolve. + # @!attribute [rw] max_endpoints + # @return [::Integer] + # Optional. The maximum number of endpoints to return. Defaults to 25. + # Maximum is 100. If a value less than one is specified, the Default is used. + # If a value greater than the Maximum is specified, the Maximum is used. + # @!attribute [rw] endpoint_filter + # @return [::String] + # Optional. The filter applied to the endpoints of the resolved service. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, or `metadata.` for + # map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `metadata.owner` returns endpoints that have a annotation with the key + # `owner`, this is the same as `metadata:owner` + # * `metadata.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * + # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` + # returns the endpoint that has an endpoint_id equal to `ep-1` + # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + # `owner` in annotation key but value is not `sd` AND have key/value + # `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoint, it returns no results + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + class ResolveServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service LookupService.ResolveService}. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + class ResolveServiceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/namespace.rb new file mode 100644 index 000000000000..ccb58df1f634 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/namespace.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + # A container for {::Google::Cloud::ServiceDirectory::V1beta1::Service services}. + # Namespaces allow administrators to group services together and define + # permissions for a collection of services. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name for the namespace in the format + # `projects/*/locations/*/namespaces/*`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Resource labels associated with this namespace. + # No more than 64 user labels can be associated with a given resource. Label + # keys and values can be no longer than 63 characters. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the namespace was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the namespace was last updated. + # @!attribute [r] uid + # @return [::String] + # Output only. A globally unique identifier (in UUID4 format) for this + # namespace. + class Namespace + 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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/registration_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/registration_service.rb new file mode 100644 index 000000000000..6db231e8d14a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/registration_service.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! + + +module Google + module Cloud + module ServiceDirectory + module V1beta1 + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_namespace RegistrationService.CreateNamespace}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project and location the namespace + # will be created in. + # @!attribute [rw] namespace_id + # @return [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @!attribute [rw] namespace + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # Required. A namespace with initial fields set. + class CreateNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces RegistrationService.ListNamespaces}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project and location whose namespaces + # you'd like to list. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. The default value is 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `labels.` for map field, or + # `attributes.` for attributes field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `labels.owner` returns namespaces that have a label with the key + # `owner`, this is the same as `labels:owner` + # * `labels.owner=sd` returns namespaces that have key/value `owner=sd` + # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` + # returns namespaces that have name that is alphabetically later than the + # string, so "namespace-e" is returned but "namespace-a" is not + # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have + # `owner` in label key but value is not `sd` AND have key/value `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that namespace + # doesn't have a field called "doesnotexist". Since the filter does not + # match any namespaces, it returns no results + # * `attributes.managed_registration=true` returns namespaces that are + # managed by a GCP product or service + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + class ListNamespacesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces RegistrationService.ListNamespaces}. + # @!attribute [rw] namespaces + # @return [::Array<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] + # The list of namespaces. + # @!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. + class ListNamespacesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_namespace RegistrationService.GetNamespace}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the namespace to retrieve. + class GetNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_namespace RegistrationService.UpdateNamespace}. + # @!attribute [rw] namespace + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] + # Required. The updated namespace. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_namespace RegistrationService.DeleteNamespace}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the namespace to delete. + class DeleteNamespaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_service RegistrationService.CreateService}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the namespace this service will belong to. + # @!attribute [rw] service_id + # @return [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # Required. A service with initial fields set. + class CreateServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services RegistrationService.ListServices}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the namespace whose services you'd + # like to list. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. The default value is 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name` or `metadata.` for map field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `metadata.owner` returns services that have a metadata with the key + # `owner`, this is the same as `metadata:owner` + # * `metadata.protocol=gRPC` returns services that have key/value + # `protocol=gRPC` + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` + # returns services that have name that is alphabetically later than the + # string, so "service-e" is returned but "service-a" is not + # * `metadata.owner!=sd AND metadata.foo=bar` returns services that have + # `owner` in metadata key but value is not `sd` AND have key/value + # `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that service + # doesn't have a field called "doesnotexist". Since the filter does not + # match any services, it returns no results + # * `attributes.managed_registration=true` returns services that are + # managed + # by a GCP product or service + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows value: `name` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + class ListServicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services RegistrationService.ListServices}. + # @!attribute [rw] services + # @return [::Array<::Google::Cloud::ServiceDirectory::V1beta1::Service>] + # The list of services. + # @!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. + class ListServicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_service RegistrationService.GetService}. + # This should not be used for looking up a service. Instead, use the `resolve` + # method as it contains all endpoints and associated metadata. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the service to get. + class GetServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_service RegistrationService.UpdateService}. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] + # Required. The updated service. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_service RegistrationService.DeleteService}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the service to delete. + class DeleteServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_endpoint RegistrationService.CreateEndpoint}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the service that this endpoint provides. + # @!attribute [rw] endpoint_id + # @return [::String] + # Required. The Resource ID must be 1-63 characters long, and comply with + # RFC1035. + # Specifically, the name must be 1-63 characters long and match the regular + # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + # character must be a lowercase letter, and all following characters must + # be a dash, lowercase letter, or digit, except the last character, which + # cannot be a dash. + # @!attribute [rw] endpoint + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # Required. A endpoint with initial fields set. + class CreateEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the service whose endpoints you'd like to + # list. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. The default value is 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous List request, + # if any. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter to list results by. + # + # General `filter` string syntax: + # ` ()` + # + # * `` can be `name`, `address`, `port`, `metadata.` for map + # field, or `attributes.` for attributes field + # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` + # means `HAS`, and is roughly the same as `=` + # * `` must be the same data type as field + # * `` can be `AND`, `OR`, `NOT` + # + # Examples of valid filters: + # + # * `metadata.owner` returns endpoints that have a metadata with the key + # `owner`, this is the same as `metadata:owner` + # * `metadata.protocol=gRPC` returns endpoints that have key/value + # `protocol=gRPC` + # * `address=192.108.1.105` returns endpoints that have this address + # * `port>8080` returns endpoints that have port number larger than 8080 + # * + # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` + # returns endpoints that have name that is alphabetically later than the + # string, so "endpoint-e" is returned but "endpoint-a" is not + # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have + # `owner` in metadata key but value is not `sd` AND have key/value + # `foo=bar` + # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint + # doesn't have a field called "doesnotexist". Since the filter does not + # match any endpoints, it returns no results + # * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ + # IP` returns endpoints with the corresponding kubernetes_resource_type + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. The order to list results by. + # + # General `order_by` string syntax: ` () (,)` + # + # * `` allows values: `name`, `address`, `port` + # * `` ascending or descending order by ``. If this is + # left blank, `asc` is used + # + # Note that an empty `order_by` string results in default order, which is + # order by `name` in ascending order. + class ListEndpointsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. + # @!attribute [rw] endpoints + # @return [::Array<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] + # The list of endpoints. + # @!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. + class ListEndpointsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_endpoint RegistrationService.GetEndpoint}. + # This should not be used to lookup endpoints at runtime. Instead, use + # the `resolve` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the endpoint to get. + class GetEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_endpoint RegistrationService.UpdateEndpoint}. + # @!attribute [rw] endpoint + # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] + # Required. The updated endpoint. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated in this request. + class UpdateEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_endpoint RegistrationService.DeleteEndpoint}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the endpoint to delete. + class DeleteEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/service.rb new file mode 100644 index 000000000000..0f5ce424212a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/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 ServiceDirectory + module V1beta1 + # An individual service. A service contains a name and optional metadata. + # A service must exist before + # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint endpoints} can be + # added to it. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name for the service in the format + # `projects/*/locations/*/namespaces/*/services/*`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Metadata for the service. This data can be consumed by service + # clients. + # + # Restrictions: + # + # * The entire metadata dictionary may contain up to 2000 characters, + # spread accoss all key-value pairs. Metadata that goes beyond this + # limit are rejected + # * Valid metadata keys have two segments: an optional prefix and name, + # separated by a slash (/). The name segment is required and must be 63 + # characters or less, beginning and ending with an alphanumeric character + # ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + # alphanumerics between. The prefix is optional. If specified, the prefix + # must be a DNS subdomain: a series of DNS labels separated by dots (.), + # not longer than 253 characters in total, followed by a slash (/). + # Metadata that fails to meet these requirements are rejected + # + # Note: This field is equivalent to the `annotations` field in the v1 API. + # They have the same syntax and read/write to the same location in Service + # Directory. + # @!attribute [r] endpoints + # @return [::Array<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] + # Output only. Endpoints associated with this service. Returned on + # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service LookupService.ResolveService}. + # Control plane clients should use + # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the service was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the service was last updated. Note: + # endpoints being created/deleted/updated within the service are not + # considered service updates for the purpose of this timestamp. + # @!attribute [r] uid + # @return [::String] + # Output only. A globally unique identifier (in UUID4 format) for this + # service. + class Service + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + 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-service_directory-v1beta1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..97414f0ec896 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1", path: "../" +else + gem "google-cloud-service_directory-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-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb new file mode 100644 index 000000000000..d71eb3c1791d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_LookupService_ResolveService_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the resolve_service call in the LookupService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service. +# +def resolve_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new + + # Call the resolve_service method. + result = client.resolve_service request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse. + p result +end +# [END servicedirectory_v1beta1_generated_LookupService_ResolveService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb new file mode 100644 index 000000000000..3e2ad8dfb2e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the create_endpoint call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_endpoint. +# +def create_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new + + # Call the create_endpoint method. + result = client.create_endpoint request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb new file mode 100644 index 000000000000..ec054cee82d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the create_namespace call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_namespace. +# +def create_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new + + # Call the create_namespace method. + result = client.create_namespace request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb new file mode 100644 index 000000000000..25d40b538366 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the create_service call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_service. +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new + + # Call the create_service method. + result = client.create_service request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb new file mode 100644 index 000000000000..a0f9e22f857a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the delete_endpoint call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_endpoint. +# +def delete_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new + + # Call the delete_endpoint method. + result = client.delete_endpoint request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb new file mode 100644 index 000000000000..6571a245cbe3 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the delete_namespace call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_namespace. +# +def delete_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new + + # Call the delete_namespace method. + result = client.delete_namespace request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb new file mode 100644 index 000000000000..d078459a4702 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the delete_service call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_service. +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new + + # Call the delete_service method. + result = client.delete_service request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb new file mode 100644 index 000000000000..54ec62254a8f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the get_endpoint call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_endpoint. +# +def get_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new + + # Call the get_endpoint method. + result = client.get_endpoint request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb new file mode 100644 index 000000000000..6c93e204b20f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the get_iam_policy call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb new file mode 100644 index 000000000000..5050a16a6530 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the get_namespace call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_namespace. +# +def get_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new + + # Call the get_namespace method. + result = client.get_namespace request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb new file mode 100644 index 000000000000..275196ffb4e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_GetService_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the get_service call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_service. +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new + + # Call the get_service method. + result = client.get_service request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_GetService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb new file mode 100644 index 000000000000..4793441f9ebf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.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 servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the list_endpoints call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints. +# +def list_endpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.new + + # Call the list_endpoints method. + result = client.list_endpoints request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + p item + end +end +# [END servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb new file mode 100644 index 000000000000..28f67143a5f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.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 servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the list_namespaces call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces. +# +def list_namespaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.new + + # Call the list_namespaces method. + result = client.list_namespaces request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Namespace. + p item + end +end +# [END servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb new file mode 100644 index 000000000000..feec94510bd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the list_services call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services. +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.new + + # Call the list_services method. + result = client.list_services request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Service. + p item + end +end +# [END servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb new file mode 100644 index 000000000000..fa2aa1005639 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the set_iam_policy call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb new file mode 100644 index 000000000000..acb3050b1c96 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the test_iam_permissions call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb new file mode 100644 index 000000000000..43c96f11aaef --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the update_endpoint call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_endpoint. +# +def update_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new + + # Call the update_endpoint method. + result = client.update_endpoint request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb new file mode 100644 index 000000000000..6e2d2ebcd57f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the update_namespace call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_namespace. +# +def update_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new + + # Call the update_namespace method. + result = client.update_namespace request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb new file mode 100644 index 000000000000..bd7b63693a51 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync] +require "google/cloud/service_directory/v1beta1" + +## +# Snippet for the update_service call in the RegistrationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_service. +# +def update_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new + + # Call the update_service method. + result = client.update_service request + + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + p result +end +# [END servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json new file mode 100644 index 000000000000..3d9a66c9a57a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json @@ -0,0 +1,775 @@ +{ + "client_library": { + "name": "google-cloud-service_directory-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.servicedirectory.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "servicedirectory_v1beta1_generated_LookupService_ResolveService_sync", + "title": "Snippet for the resolve_service call in the LookupService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service.", + "file": "lookup_service/resolve_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "resolve_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse", + "client": { + "short_name": "LookupService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client" + }, + "method": { + "short_name": "ResolveService", + "full_name": "google.cloud.servicedirectory.v1beta1.LookupService.ResolveService", + "service": { + "short_name": "LookupService", + "full_name": "google.cloud.servicedirectory.v1beta1.LookupService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync", + "title": "Snippet for the create_namespace call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_namespace.", + "file": "registration_service/create_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_namespace", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Namespace", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "CreateNamespace", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.CreateNamespace", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync", + "title": "Snippet for the list_namespaces call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces.", + "file": "registration_service/list_namespaces.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_namespaces", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "ListNamespaces", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync", + "title": "Snippet for the get_namespace call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_namespace.", + "file": "registration_service/get_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_namespace", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Namespace", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "GetNamespace", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.GetNamespace", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync", + "title": "Snippet for the update_namespace call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_namespace.", + "file": "registration_service/update_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_namespace", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Namespace", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "UpdateNamespace", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateNamespace", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync", + "title": "Snippet for the delete_namespace call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_namespace.", + "file": "registration_service/delete_namespace.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_namespace", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_namespace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "DeleteNamespace", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteNamespace", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync", + "title": "Snippet for the create_service call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_service.", + "file": "registration_service/create_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Service", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "CreateService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.CreateService", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync", + "title": "Snippet for the list_services call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services.", + "file": "registration_service/list_services.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_services", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "ListServices", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_GetService_sync", + "title": "Snippet for the get_service call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_service.", + "file": "registration_service/get_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Service", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "GetService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.GetService", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync", + "title": "Snippet for the update_service call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_service.", + "file": "registration_service/update_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Service", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "UpdateService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateService", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync", + "title": "Snippet for the delete_service call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_service.", + "file": "registration_service/delete_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_service", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "DeleteService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteService", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync", + "title": "Snippet for the create_endpoint call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_endpoint.", + "file": "registration_service/create_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_endpoint", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Endpoint", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "CreateEndpoint", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.CreateEndpoint", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync", + "title": "Snippet for the list_endpoints call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints.", + "file": "registration_service/list_endpoints.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_endpoints", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "ListEndpoints", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync", + "title": "Snippet for the get_endpoint call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_endpoint.", + "file": "registration_service/get_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_endpoint", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Endpoint", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "GetEndpoint", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.GetEndpoint", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync", + "title": "Snippet for the update_endpoint call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_endpoint.", + "file": "registration_service/update_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_endpoint", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Endpoint", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "UpdateEndpoint", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateEndpoint", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync", + "title": "Snippet for the delete_endpoint call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_endpoint.", + "file": "registration_service/delete_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_endpoint", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "DeleteEndpoint", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteEndpoint", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_iam_policy.", + "file": "registration_service/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.GetIamPolicy", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#set_iam_policy.", + "file": "registration_service/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.SetIamPolicy", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the RegistrationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#test_iam_permissions.", + "file": "registration_service/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "RegistrationService::Client", + "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.TestIamPermissions", + "service": { + "short_name": "RegistrationService", + "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" + } + } + }, + "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-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb new file mode 100644 index 000000000000..6353a46aff02 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_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/service_directory/v1beta1/lookup_service" + +class ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" + assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb new file mode 100644 index 000000000000..6decc70066f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/servicedirectory/v1beta1/lookup_service_pb" +require "google/cloud/service_directory/v1beta1/lookup_service/rest" + + +class ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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_resolve_service + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + max_endpoints = 42 + endpoint_filter = "hello world" + + resolve_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::ServiceStub.stub :transcode_resolve_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resolve_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resolve_service name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resolve_service ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resolve_service(::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resolve_service_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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::ServiceDirectory::V1beta1::LookupService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb new file mode 100644 index 000000000000..7fbc24e4356a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/servicedirectory/v1beta1/lookup_service_pb" +require "google/cloud/service_directory/v1beta1/lookup_service" + +class ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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_resolve_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + max_endpoints = 42 + endpoint_filter = "hello world" + + resolve_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resolve_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["max_endpoints"] + assert_equal "hello world", request["endpoint_filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resolve_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resolve_service name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resolve_service ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resolve_service(::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, resolve_service_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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::ServiceDirectory::V1beta1::LookupService::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::ServiceDirectory::V1beta1::LookupService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb new file mode 100644 index 000000000000..37f95cd118d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/service_directory/v1beta1/registration_service" + +class ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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_endpoint_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.endpoint_path project: "value0", location: "value1", namespace: "value2", service: "value3", endpoint: "value4" + assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3/endpoints/value4", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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_namespace_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.namespace_path project: "value0", location: "value1", namespace: "value2" + assert_equal "projects/value0/locations/value1/namespaces/value2", 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::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", network: "value1" + assert_equal "projects/value0/locations/global/networks/value1", path + end + end + + def test_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" + assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb new file mode 100644 index 000000000000..b5c2928a3a96 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb @@ -0,0 +1,1096 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/servicedirectory/v1beta1/registration_service_pb" +require "google/cloud/service_directory/v1beta1/registration_service/rest" + + +class ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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_namespace + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + namespace_id = "hello world" + namespace = {} + + create_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_create_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_namespace parent: parent, namespace_id: namespace_id, namespace: namespace do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_namespace ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_namespace(::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_namespace_client_stub.call_count + end + end + end + + def test_list_namespaces + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse.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_namespaces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_list_namespaces_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_namespaces_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_namespaces({ 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_namespaces 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_namespaces ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.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_namespaces({ 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_namespaces(::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.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_namespaces_client_stub.call_count + end + end + end + + def test_get_namespace + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_get_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_namespace({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_namespace name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_namespace ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_namespace({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_namespace(::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_namespace_client_stub.call_count + end + end + end + + def test_update_namespace + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + namespace = {} + update_mask = {} + + update_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_update_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_namespace({ namespace: namespace, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_namespace namespace: namespace, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_namespace ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new(namespace: namespace, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_namespace({ namespace: namespace, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_namespace(::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new(namespace: namespace, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_namespace_client_stub.call_count + end + end + end + + def test_delete_namespace + # 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_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_namespace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_namespace({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_namespace name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_namespace ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_namespace({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_namespace(::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_namespace_client_stub.call_count + end + end + end + + def test_create_service + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + service_id = "hello world" + service = {} + + create_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_create_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_service({ parent: parent, service_id: service_id, service: service }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_service parent: parent, service_id: service_id, service: service do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_service ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_service({ parent: parent, service_id: service_id, service: service }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_service(::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_service_client_stub.call_count + end + end + end + + def test_list_services + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse.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_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_list_services_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_services({ 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_services 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_services ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.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_services_client_stub.call_count + end + end + end + + def test_get_service + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_get_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_service({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_service name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_service ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_service({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_service(::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_service_client_stub.call_count + end + end + end + + def test_update_service + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service = {} + update_mask = {} + + update_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_update_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_service({ service: service, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_service service: service, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_service ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new(service: service, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_service({ service: service, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_service(::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new(service: service, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_service_client_stub.call_count + end + end + end + + def test_delete_service + # 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_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_service({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_service name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_service ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_service({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_service(::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_service_client_stub.call_count + end + end + end + + def test_create_endpoint + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + endpoint_id = "hello world" + endpoint = {} + + create_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_create_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_endpoint parent: parent, endpoint_id: endpoint_id, endpoint: endpoint do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_endpoint_client_stub.call_count + end + end + end + + def test_list_endpoints + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse.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_endpoints_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_list_endpoints_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_endpoints_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_endpoints({ 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_endpoints 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_endpoints ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.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_endpoints({ 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_endpoints(::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.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_endpoints_client_stub.call_count + end + end + end + + def test_get_endpoint + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_get_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_endpoint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_endpoint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_endpoint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_endpoint_client_stub.call_count + end + end + end + + def test_update_endpoint + # Create test objects. + client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + endpoint = {} + update_mask = {} + + update_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_update_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_endpoint endpoint: endpoint, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new(endpoint: endpoint, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new(endpoint: endpoint, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_endpoint_client_stub.call_count + end + end + end + + def test_delete_endpoint + # 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_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_endpoint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_endpoint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_endpoint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_endpoint_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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::ServiceDirectory::V1beta1::RegistrationService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb new file mode 100644 index 000000000000..5e2eac15feba --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb @@ -0,0 +1,1213 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/servicedirectory/v1beta1/registration_service_pb" +require "google/cloud/service_directory/v1beta1/registration_service" + +class ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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_namespace + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + namespace_id = "hello world" + namespace = {} + + create_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_namespace, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["namespace_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Namespace), request["namespace"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_namespace parent: parent, namespace_id: namespace_id, namespace: namespace do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_namespace ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_namespace(::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_namespace_client_stub.call_rpc_count + end + end + + def test_list_namespaces + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_namespaces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_namespaces, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest, 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_namespaces_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_namespaces({ 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_namespaces 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_namespaces ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.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_namespaces({ 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_namespaces(::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.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_namespaces_client_stub.call_rpc_count + end + end + + def test_get_namespace + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_namespace, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_namespace({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_namespace name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_namespace ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_namespace({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_namespace(::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_namespace_client_stub.call_rpc_count + end + end + + def test_update_namespace + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + namespace = {} + update_mask = {} + + update_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_namespace, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Namespace), request["namespace"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_namespace({ namespace: namespace, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_namespace namespace: namespace, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_namespace ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new(namespace: namespace, 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_namespace({ namespace: namespace, 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_namespace(::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new(namespace: namespace, 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_namespace_client_stub.call_rpc_count + end + end + + def test_delete_namespace + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_namespace, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_namespace_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_namespace({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_namespace name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_namespace ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_namespace({ 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_namespace(::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new(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_namespace_client_stub.call_rpc_count + end + end + + def test_create_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + service_id = "hello world" + service = {} + + create_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["service_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Service), request["service"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_service({ parent: parent, service_id: service_id, service: service }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_service parent: parent, service_id: service_id, service: service do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_service ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_service({ parent: parent, service_id: service_id, service: service }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_service(::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_service_client_stub.call_rpc_count + end + end + + def test_list_services + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_services, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest, 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_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_services({ 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_services 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_services ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.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_services_client_stub.call_rpc_count + end + end + + def test_get_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_service({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_service name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_service ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_service({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_service(::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_service_client_stub.call_rpc_count + end + end + + def test_update_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service = {} + update_mask = {} + + update_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Service), request["service"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_service({ service: service, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_service service: service, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_service ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new(service: service, 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_service({ service: service, 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_service(::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new(service: service, 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_service_client_stub.call_rpc_count + end + end + + def test_delete_service + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_service, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_service({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_service name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_service ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_service({ 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_service(::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new(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_service_client_stub.call_rpc_count + end + end + + def test_create_endpoint + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + endpoint_id = "hello world" + endpoint = {} + + create_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_endpoint, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["endpoint_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint), request["endpoint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_endpoint parent: parent, endpoint_id: endpoint_id, endpoint: endpoint do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_endpoint_client_stub.call_rpc_count + end + end + + def test_list_endpoints + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_endpoints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_endpoints, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest, 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_endpoints_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_endpoints({ 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_endpoints 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_endpoints ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.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_endpoints({ 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_endpoints(::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.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_endpoints_client_stub.call_rpc_count + end + end + + def test_get_endpoint + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_endpoint, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_endpoint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_endpoint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_endpoint({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_endpoint_client_stub.call_rpc_count + end + end + + def test_update_endpoint + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + endpoint = {} + update_mask = {} + + update_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_endpoint, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint), request["endpoint"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_endpoint endpoint: endpoint, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new(endpoint: endpoint, 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_endpoint({ endpoint: endpoint, 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_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new(endpoint: endpoint, 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_endpoint_client_stub.call_rpc_count + end + end + + def test_delete_endpoint + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_endpoint, name + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_endpoint_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_endpoint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_endpoint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_endpoint({ 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_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new(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_endpoint_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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::ServiceDirectory::V1beta1::RegistrationService::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::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_health-v1/.gitignore b/owl-bot-staging/google-cloud-service_health-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_health-v1/.repo-metadata.json new file mode 100644 index 000000000000..e5a8dac5c000 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "servicehealth.googleapis.com", + "api_shortname": "servicehealth", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_health-v1/latest", + "distribution_name": "google-cloud-service_health-v1", + "is_cloud": true, + "language": "ruby", + "name": "servicehealth", + "name_pretty": "Service Health V1 API", + "product_documentation": "https://cloud.google.com/service-health/docs/overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. Note that google-cloud-service_health-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_health instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/service-health/docs/overview", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-service_health-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_health-v1/.rubocop.yml new file mode 100644 index 000000000000..292707c824d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-service_health-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-service_health-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_health-v1/.toys.rb b/owl-bot-staging/google-cloud-service_health-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1/.yardopts b/owl-bot-staging/google-cloud-service_health-v1/.yardopts new file mode 100644 index 000000000000..26f81cadbdb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Service Health 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-service_health-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_health-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..48d8d8aa8f78 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-service_health-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-service_health-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/service_health/v1" + +client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/service_health/v1" + +::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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-service_health-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/service_health/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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-service_health-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_health-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-service_health-v1/Gemfile b/owl-bot-staging/google-cloud-service_health-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_health-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_health-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1/README.md b/owl-bot-staging/google-cloud-service_health-v1/README.md new file mode 100644 index 000000000000..9f339ec88358 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Service Health V1 API + +Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. + +Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Service Health V1 API. Most users should consider using +the main client gem, +[google-cloud-service_health](https://rubygems.org/gems/google-cloud-service_health). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-service_health-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/servicehealth.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/service_health/v1" + +client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new +request = ::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new # (request fields as keyword arguments...) +response = client.list_events request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_health-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/service-health/docs/overview) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/service_health/v1" +require "logger" + +client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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-service_health`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-service_health-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-service_health`. +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-service_health-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-service_health-v1/Rakefile b/owl-bot-staging/google-cloud-service_health-v1/Rakefile new file mode 100644 index 000000000000..516ae4796426 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-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/service_health/v1/service_health/credentials" + ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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-service_health-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-service_health-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-service_health-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-service_health-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-service_health-v1" + header "google-cloud-service_health-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-service_health-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-service_health-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-service_health-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-service_health-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-service_health-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_health-v1/gapic_metadata.json new file mode 100644 index 000000000000..f6d45dcb69e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/gapic_metadata.json @@ -0,0 +1,48 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.servicehealth.v1", + "libraryPackage": "::Google::Cloud::ServiceHealth::V1", + "services": { + "ServiceHealth": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client", + "rpcs": { + "ListEvents": { + "methods": [ + "list_events" + ] + }, + "GetEvent": { + "methods": [ + "get_event" + ] + }, + "ListOrganizationEvents": { + "methods": [ + "list_organization_events" + ] + }, + "GetOrganizationEvent": { + "methods": [ + "get_organization_event" + ] + }, + "ListOrganizationImpacts": { + "methods": [ + "list_organization_impacts" + ] + }, + "GetOrganizationImpact": { + "methods": [ + "get_organization_impact" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-service_health-v1/google-cloud-service_health-v1.gemspec b/owl-bot-staging/google-cloud-service_health-v1/google-cloud-service_health-v1.gemspec new file mode 100644 index 000000000000..04a2f2009352 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/google-cloud-service_health-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/service_health/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-service_health-v1" + gem.version = Google::Cloud::ServiceHealth::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. Note that google-cloud-service_health-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_health instead. See the readme for more details." + gem.summary = "Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google-cloud-service_health-v1.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google-cloud-service_health-v1.rb new file mode 100644 index 000000000000..1fd09f220a8c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google-cloud-service_health-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/service_health/v1" diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1.rb new file mode 100644 index 000000000000..0450d1bde309 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/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/service_health/v1/service_health" +require "google/cloud/service_health/v1/version" + +module Google + module Cloud + module ServiceHealth + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/service_health/v1" + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/service_health/v1" + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/service_health/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/bindings_override.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/bindings_override.rb new file mode 100644 index 000000000000..1d734180955c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/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 ServiceHealth + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/service_health/v1/rest" + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceHealth"] + parent_config = while namespace.any? + parent_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-service_health-v1/lib/google/cloud/service_health/v1/rest.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/rest.rb new file mode 100644 index 000000000000..7c4fab8806ab --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/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/service_health/v1/service_health/rest" +require "google/cloud/service_health/v1/bindings_override" +require "google/cloud/service_health/v1/version" + +module Google + module Cloud + module ServiceHealth + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/service_health/v1/rest" + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health.rb new file mode 100644 index 000000000000..e2ae0bacf94a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health.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/service_health/v1/version" + +require "google/cloud/service_health/v1/service_health/credentials" +require "google/cloud/service_health/v1/service_health/paths" +require "google/cloud/service_health/v1/service_health/client" +require "google/cloud/service_health/v1/service_health/rest" + +module Google + module Cloud + module ServiceHealth + module V1 + ## + # Request service health events relevant to your Google Cloud project. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/service_health/v1/service_health" + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/service_health/v1/service_health/rest" + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + module ServiceHealth + end + end + end + end +end + +helper_path = ::File.join __dir__, "service_health", "helpers.rb" +require "google/cloud/service_health/v1/service_health/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/client.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/client.rb new file mode 100644 index 000000000000..5c3313ddfc08 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/client.rb @@ -0,0 +1,1142 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/servicehealth/v1/event_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module ServiceHealth + module V1 + module ServiceHealth + ## + # Client for the ServiceHealth service. + # + # Request service health events relevant to your Google Cloud project. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicehealth.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :service_health_stub + + ## + # Configure the ServiceHealth Client class. + # + # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServiceHealth clients + # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceHealth", "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_events.timeout = 60.0 + default_config.rpcs.list_events.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_event.timeout = 60.0 + default_config.rpcs.get_event.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_organization_events.timeout = 60.0 + default_config.rpcs.list_organization_events.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_organization_event.timeout = 60.0 + default_config.rpcs.get_organization_event.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_organization_impacts.timeout = 60.0 + default_config.rpcs.list_organization_impacts.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_organization_impact.timeout = 60.0 + default_config.rpcs.get_organization_impact.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 ServiceHealth Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @service_health_stub.universe_domain + end + + ## + # Create a new ServiceHealth client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServiceHealth 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/servicehealth/v1/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 + + @service_health_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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 + ) + + @service_health_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 = @service_health_stub.endpoint + config.universe_domain = @service_health_stub.universe_domain + config.logger = @service_health_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @service_health_stub.logger + end + + # Service calls + + ## + # Lists events under a given project and location. + # + # @overload list_events(request, options = nil) + # Pass arguments to `list_events` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::ListEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::ListEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) + # Pass arguments to `list_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. Parent value using the form + # `projects/{project_id}/locations/{location}/events`. + # + # `project_id` - ID of the project for which to list service health + # events. + # `location` - The location to get the service health events from. + # To retrieve service health events of category = INCIDENT, use `location` = + # `global`. + # @param page_size [::Integer] + # Optional. The maximum number of events that should be returned. Acceptable + # values are 1 to 100, inclusive. (The default value is 10.) If more results + # are available, the service returns a next_page_token that you can use to + # get the next page of results in subsequent list requests. The service may + # return fewer events than the requested page_size. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Provide Page token returned by a previous `ListEvents` call to retrieve the + # next page of results. When paginating, all other parameters provided to + # `ListEvents` must match the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The expression takes the following forms:
+ # * field=value for `category` and `state`
+ # * field <, >, <=, or >= value for `update_time`
+ # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"`, + # `event_impacts.product.product_name:"Eventarc"` + #
+ # + # Multiple filter queries are separated by spaces. Example: + # `category=INCIDENT state=ACTIVE`. + # + # By default, each expression is an AND expression. However, you can include + # AND and OR expressions explicitly. + # + # Filter is supported for the following fields: `category`, `state`, + # `update_time`, `event_impacts.product.product_name` + # @param view [::Google::Cloud::ServiceHealth::V1::EventView] + # Optional. Event fields to include in response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::ListEventsRequest.new + # + # # Call the list_events method. + # result = client.list_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::ServiceHealth::V1::Event. + # p item + # end + # + def list_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_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::ServiceHealth::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.call_rpc :list_events, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @service_health_stub, :list_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 + + ## + # Retrieves a resource containing information about an event. + # + # @overload get_event(request, options = nil) + # Pass arguments to `get_event` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::GetEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::GetEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_event(name: nil) + # Pass arguments to `get_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 name [::String] + # Required. Unique name of the event in this scope including project + # and location using the form + # `projects/{project_id}/locations/{location}/events/{event_id}`. + # + # `project_id` - Project ID of the project that contains the event.
+ # `location` - The location to get the service health events from.
+ # `event_id` - Event ID to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceHealth::V1::Event] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceHealth::V1::Event] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::GetEventRequest.new + # + # # Call the get_event method. + # result = client.get_event request + # + # # The returned object is of type Google::Cloud::ServiceHealth::V1::Event. + # p result + # + def get_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_event.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.call_rpc :get_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 + + ## + # Lists organization events under a given organization and location. + # + # @overload list_organization_events(request, options = nil) + # Pass arguments to `list_organization_events` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_organization_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) + # Pass arguments to `list_organization_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. Parent value using the form + # `organizations/{organization_id}/locations/{location}/organizationEvents`. + # + # `organization_id` - ID (number) of the project that contains the event. To + # get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `location` - The location to get the service health events from. To + # retrieve service health events of category = INCIDENT, use `location` = + # `global`. + # @param page_size [::Integer] + # Optional. The maximum number of events that should be returned. Acceptable + # values are `1` to `100`, inclusive. (The default value is `10`.) If more + # results are available, the service returns a `next_page_token` that you can + # use to get the next page of results in subsequent list requests. The + # service may return fewer events than the requested `page_size`. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # Provide Page token returned by a previous `ListOrganizationEvents` call to + # retrieve the next page of results. + # + # When paginating, all other parameters provided to + # `ListOrganizationEvents` must match the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The expression takes the following forms: + # + # * field=value for `category` and `state` + # * field <, >, <=, or >= value for `update_time` + # + # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"` + # + # Multiple filter queries are space-separated. Example: + # `category=INCIDENT state=ACTIVE`. + # + # By default, each expression is an AND expression. However, you can include + # AND and OR expressions explicitly. + # + # Filter is supported for the following fields: `category`, `state`, + # `update_time` + # @param view [::Google::Cloud::ServiceHealth::V1::OrganizationEventView] + # Optional. OrganizationEvent fields to include in response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new + # + # # Call the list_organization_events method. + # result = client.list_organization_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::ServiceHealth::V1::OrganizationEvent. + # p item + # end + # + def list_organization_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_organization_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::ServiceHealth::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_organization_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_organization_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.call_rpc :list_organization_events, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @service_health_stub, :list_organization_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 + + ## + # Retrieves a resource containing information about an event affecting an + # organization . + # + # @overload get_organization_event(request, options = nil) + # Pass arguments to `get_organization_event` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_organization_event(name: nil) + # Pass arguments to `get_organization_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 name [::String] + # Required. Unique name of the event in this scope including organization and + # event ID using the form + # `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`. + # + # `organization_id` - ID (number) of the project that contains the event. To + # get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `event_id` - Organization event ID to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new + # + # # Call the get_organization_event method. + # result = client.get_organization_event request + # + # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationEvent. + # p result + # + def get_organization_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_organization_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::ServiceHealth::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_organization_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_organization_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.call_rpc :get_organization_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 + + ## + # Lists assets impacted by organization events under a given organization and + # location. + # + # @overload list_organization_impacts(request, options = nil) + # Pass arguments to `list_organization_impacts` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_organization_impacts(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_organization_impacts` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 using the form + # `organizations/{organization_id}/locations/{location}/organizationImpacts`. + # + # `organization_id` - ID (number) of the project that contains the event. To + # get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + # @param page_size [::Integer] + # Optional. The maximum number of events that should be returned. Acceptable + # values are `1` to `100`, inclusive. The default value is `10`. + # + # If more results are available, the service returns a + # `next_page_token` that can be used to get the next page of results in + # subsequent list requests. The service may return fewer + # [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) + # than the requested `page_size`. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # Provide `page_token` returned by a previous `ListOrganizationImpacts` call + # to retrieve the next page of results. + # + # When paginating, all other parameters provided to `ListOrganizationImpacts` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The expression is in the form of `field:value` for checking if a + # repeated field contains a value. + # + # Example: + # `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id` + # + # To get your `{organization_id}`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + # + # Multiple filter queries are separated by spaces. + # + # By default, each expression is an AND expression. However, you can include + # AND and OR expressions explicitly. + # Filter is supported for the following fields: `events`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.new + # + # # Call the list_organization_impacts method. + # result = client.list_organization_impacts request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceHealth::V1::OrganizationImpact. + # p item + # end + # + def list_organization_impacts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_organization_impacts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_organization_impacts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_organization_impacts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.call_rpc :list_organization_impacts, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @service_health_stub, :list_organization_impacts, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a resource containing information about impact to an asset under + # an organization affected by a service health event. + # + # @overload get_organization_impact(request, options = nil) + # Pass arguments to `get_organization_impact` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_organization_impact(name: nil) + # Pass arguments to `get_organization_impact` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or 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 using the form + # `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`. + # + # `organization_id` - ID (number) of the organization that contains the + # event. To get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `organization_impact_id` - ID of the [OrganizationImpact + # resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new + # + # # Call the get_organization_impact method. + # result = client.get_organization_impact request + # + # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationImpact. + # p result + # + def get_organization_impact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_organization_impact.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_organization_impact.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_organization_impact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.call_rpc :get_organization_impact, request, 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 ServiceHealth API. + # + # This class represents the configuration for ServiceHealth, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_events to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_events.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_events.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::ServiceHealth::V1::ServiceHealth::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicehealth.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ServiceHealth API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_events + ## + # RPC-specific configuration for `get_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event + ## + # RPC-specific configuration for `list_organization_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_organization_events + ## + # RPC-specific configuration for `get_organization_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_event + ## + # RPC-specific configuration for `list_organization_impacts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_organization_impacts + ## + # RPC-specific configuration for `get_organization_impact` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_impact + + # @private + def initialize parent_rpcs = nil + list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events + @list_events = ::Gapic::Config::Method.new list_events_config + get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event + @get_event = ::Gapic::Config::Method.new get_event_config + list_organization_events_config = parent_rpcs.list_organization_events if parent_rpcs.respond_to? :list_organization_events + @list_organization_events = ::Gapic::Config::Method.new list_organization_events_config + get_organization_event_config = parent_rpcs.get_organization_event if parent_rpcs.respond_to? :get_organization_event + @get_organization_event = ::Gapic::Config::Method.new get_organization_event_config + list_organization_impacts_config = parent_rpcs.list_organization_impacts if parent_rpcs.respond_to? :list_organization_impacts + @list_organization_impacts = ::Gapic::Config::Method.new list_organization_impacts_config + get_organization_impact_config = parent_rpcs.get_organization_impact if parent_rpcs.respond_to? :get_organization_impact + @get_organization_impact = ::Gapic::Config::Method.new get_organization_impact_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/credentials.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/credentials.rb new file mode 100644 index 000000000000..76ceb72eed21 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/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 ServiceHealth + module V1 + module ServiceHealth + # Credentials for the ServiceHealth 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-service_health-v1/lib/google/cloud/service_health/v1/service_health/paths.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/paths.rb new file mode 100644 index 000000000000..faffaa39fdf7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/paths.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceHealth + module V1 + module ServiceHealth + # Path helper methods for the ServiceHealth API. + module Paths + ## + # Create a fully-qualified Event resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/events/{event}` + # + # @param project [String] + # @param location [String] + # @param event [String] + # + # @return [::String] + def event_path project:, location:, event: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/events/#{event}" + 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 OrganizationEvent resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/organizationEvents/{event}` + # + # @param organization [String] + # @param location [String] + # @param event [String] + # + # @return [::String] + def organization_event_path organization:, location:, event: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/organizationEvents/#{event}" + end + + ## + # Create a fully-qualified OrganizationImpact resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/organizationImpacts/{organization_impact}` + # + # @param organization [String] + # @param location [String] + # @param organization_impact [String] + # + # @return [::String] + def organization_impact_path organization:, location:, organization_impact: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/organizationImpacts/#{organization_impact}" + 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-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest.rb new file mode 100644 index 000000000000..205266530be8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/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/service_health/v1/version" +require "google/cloud/service_health/v1/bindings_override" + +require "google/cloud/service_health/v1/service_health/credentials" +require "google/cloud/service_health/v1/service_health/paths" +require "google/cloud/service_health/v1/service_health/rest/client" + +module Google + module Cloud + module ServiceHealth + module V1 + ## + # Request service health events relevant to your Google Cloud project. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/service_health/v1/service_health/rest" + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + module ServiceHealth + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/service_health/v1/service_health/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/client.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/client.rb new file mode 100644 index 000000000000..8019a331dad4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/client.rb @@ -0,0 +1,1065 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/servicehealth/v1/event_service_pb" +require "google/cloud/service_health/v1/service_health/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module ServiceHealth + module V1 + module ServiceHealth + module Rest + ## + # REST client for the ServiceHealth service. + # + # Request service health events relevant to your Google Cloud project. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicehealth.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :service_health_stub + + ## + # Configure the ServiceHealth Client class. + # + # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServiceHealth clients + # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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", "ServiceHealth", "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_events.timeout = 60.0 + default_config.rpcs.list_events.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_event.timeout = 60.0 + default_config.rpcs.get_event.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_organization_events.timeout = 60.0 + default_config.rpcs.list_organization_events.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_organization_event.timeout = 60.0 + default_config.rpcs.get_organization_event.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_organization_impacts.timeout = 60.0 + default_config.rpcs.list_organization_impacts.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_organization_impact.timeout = 60.0 + default_config.rpcs.get_organization_impact.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 ServiceHealth Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::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 + @service_health_stub.universe_domain + end + + ## + # Create a new ServiceHealth REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServiceHealth 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 + + @service_health_stub = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @service_health_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 = @service_health_stub.endpoint + config.universe_domain = @service_health_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @service_health_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @service_health_stub.logger + end + + # Service calls + + ## + # Lists events under a given project and location. + # + # @overload list_events(request, options = nil) + # Pass arguments to `list_events` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::ListEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::ListEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) + # Pass arguments to `list_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. Parent value using the form + # `projects/{project_id}/locations/{location}/events`. + # + # `project_id` - ID of the project for which to list service health + # events. + # `location` - The location to get the service health events from. + # To retrieve service health events of category = INCIDENT, use `location` = + # `global`. + # @param page_size [::Integer] + # Optional. The maximum number of events that should be returned. Acceptable + # values are 1 to 100, inclusive. (The default value is 10.) If more results + # are available, the service returns a next_page_token that you can use to + # get the next page of results in subsequent list requests. The service may + # return fewer events than the requested page_size. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Provide Page token returned by a previous `ListEvents` call to retrieve the + # next page of results. When paginating, all other parameters provided to + # `ListEvents` must match the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The expression takes the following forms:
+ # * field=value for `category` and `state`
+ # * field <, >, <=, or >= value for `update_time`
+ # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"`, + # `event_impacts.product.product_name:"Eventarc"` + #
+ # + # Multiple filter queries are separated by spaces. Example: + # `category=INCIDENT state=ACTIVE`. + # + # By default, each expression is an AND expression. However, you can include + # AND and OR expressions explicitly. + # + # Filter is supported for the following fields: `category`, `state`, + # `update_time`, `event_impacts.product.product_name` + # @param view [::Google::Cloud::ServiceHealth::V1::EventView] + # Optional. Event fields to include in response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::ListEventsRequest.new + # + # # Call the list_events method. + # result = client.list_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::ServiceHealth::V1::Event. + # p item + # end + # + def list_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_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::ServiceHealth::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.list_events request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @service_health_stub, :list_events, "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 + + ## + # Retrieves a resource containing information about an event. + # + # @overload get_event(request, options = nil) + # Pass arguments to `get_event` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::GetEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::GetEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_event(name: nil) + # Pass arguments to `get_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 name [::String] + # Required. Unique name of the event in this scope including project + # and location using the form + # `projects/{project_id}/locations/{location}/events/{event_id}`. + # + # `project_id` - Project ID of the project that contains the event.
+ # `location` - The location to get the service health events from.
+ # `event_id` - Event ID to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceHealth::V1::Event] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceHealth::V1::Event] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::GetEventRequest.new + # + # # Call the get_event method. + # result = client.get_event request + # + # # The returned object is of type Google::Cloud::ServiceHealth::V1::Event. + # p result + # + def get_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_event.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.get_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 + + ## + # Lists organization events under a given organization and location. + # + # @overload list_organization_events(request, options = nil) + # Pass arguments to `list_organization_events` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_organization_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) + # Pass arguments to `list_organization_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. Parent value using the form + # `organizations/{organization_id}/locations/{location}/organizationEvents`. + # + # `organization_id` - ID (number) of the project that contains the event. To + # get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `location` - The location to get the service health events from. To + # retrieve service health events of category = INCIDENT, use `location` = + # `global`. + # @param page_size [::Integer] + # Optional. The maximum number of events that should be returned. Acceptable + # values are `1` to `100`, inclusive. (The default value is `10`.) If more + # results are available, the service returns a `next_page_token` that you can + # use to get the next page of results in subsequent list requests. The + # service may return fewer events than the requested `page_size`. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # Provide Page token returned by a previous `ListOrganizationEvents` call to + # retrieve the next page of results. + # + # When paginating, all other parameters provided to + # `ListOrganizationEvents` must match the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The expression takes the following forms: + # + # * field=value for `category` and `state` + # * field <, >, <=, or >= value for `update_time` + # + # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"` + # + # Multiple filter queries are space-separated. Example: + # `category=INCIDENT state=ACTIVE`. + # + # By default, each expression is an AND expression. However, you can include + # AND and OR expressions explicitly. + # + # Filter is supported for the following fields: `category`, `state`, + # `update_time` + # @param view [::Google::Cloud::ServiceHealth::V1::OrganizationEventView] + # Optional. OrganizationEvent fields to include in response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new + # + # # Call the list_organization_events method. + # result = client.list_organization_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::ServiceHealth::V1::OrganizationEvent. + # p item + # end + # + def list_organization_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_organization_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::ServiceHealth::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_organization_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_organization_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.list_organization_events request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @service_health_stub, :list_organization_events, "organization_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 + + ## + # Retrieves a resource containing information about an event affecting an + # organization . + # + # @overload get_organization_event(request, options = nil) + # Pass arguments to `get_organization_event` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_organization_event(name: nil) + # Pass arguments to `get_organization_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 name [::String] + # Required. Unique name of the event in this scope including organization and + # event ID using the form + # `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`. + # + # `organization_id` - ID (number) of the project that contains the event. To + # get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `event_id` - Organization event ID to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new + # + # # Call the get_organization_event method. + # result = client.get_organization_event request + # + # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationEvent. + # p result + # + def get_organization_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_organization_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::ServiceHealth::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_organization_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_organization_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.get_organization_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 + + ## + # Lists assets impacted by organization events under a given organization and + # location. + # + # @overload list_organization_impacts(request, options = nil) + # Pass arguments to `list_organization_impacts` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_organization_impacts(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_organization_impacts` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 using the form + # `organizations/{organization_id}/locations/{location}/organizationImpacts`. + # + # `organization_id` - ID (number) of the project that contains the event. To + # get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + # @param page_size [::Integer] + # Optional. The maximum number of events that should be returned. Acceptable + # values are `1` to `100`, inclusive. The default value is `10`. + # + # If more results are available, the service returns a + # `next_page_token` that can be used to get the next page of results in + # subsequent list requests. The service may return fewer + # [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) + # than the requested `page_size`. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # Provide `page_token` returned by a previous `ListOrganizationImpacts` call + # to retrieve the next page of results. + # + # When paginating, all other parameters provided to `ListOrganizationImpacts` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. A filter expression that filters resources listed in the + # response. The expression is in the form of `field:value` for checking if a + # repeated field contains a value. + # + # Example: + # `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id` + # + # To get your `{organization_id}`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + # + # Multiple filter queries are separated by spaces. + # + # By default, each expression is an AND expression. However, you can include + # AND and OR expressions explicitly. + # Filter is supported for the following fields: `events`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.new + # + # # Call the list_organization_impacts method. + # result = client.list_organization_impacts request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceHealth::V1::OrganizationImpact. + # p item + # end + # + def list_organization_impacts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_organization_impacts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_organization_impacts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_organization_impacts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.list_organization_impacts request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @service_health_stub, :list_organization_impacts, "organization_impacts", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a resource containing information about impact to an asset under + # an organization affected by a service health event. + # + # @overload get_organization_impact(request, options = nil) + # Pass arguments to `get_organization_impact` via a request object, either of type + # {::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_organization_impact(name: nil) + # Pass arguments to `get_organization_impact` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or 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 using the form + # `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`. + # + # `organization_id` - ID (number) of the organization that contains the + # event. To get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `organization_impact_id` - ID of the [OrganizationImpact + # resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_health/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new + # + # # Call the get_organization_impact method. + # result = client.get_organization_impact request + # + # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationImpact. + # p result + # + def get_organization_impact request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_organization_impact.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_organization_impact.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_organization_impact.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_health_stub.get_organization_impact request, 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 ServiceHealth REST API. + # + # This class represents the configuration for ServiceHealth REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_events to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_events.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_events.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicehealth.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 ServiceHealth API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_events + ## + # RPC-specific configuration for `get_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event + ## + # RPC-specific configuration for `list_organization_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_organization_events + ## + # RPC-specific configuration for `get_organization_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_event + ## + # RPC-specific configuration for `list_organization_impacts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_organization_impacts + ## + # RPC-specific configuration for `get_organization_impact` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_impact + + # @private + def initialize parent_rpcs = nil + list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events + @list_events = ::Gapic::Config::Method.new list_events_config + get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event + @get_event = ::Gapic::Config::Method.new get_event_config + list_organization_events_config = parent_rpcs.list_organization_events if parent_rpcs.respond_to? :list_organization_events + @list_organization_events = ::Gapic::Config::Method.new list_organization_events_config + get_organization_event_config = parent_rpcs.get_organization_event if parent_rpcs.respond_to? :get_organization_event + @get_organization_event = ::Gapic::Config::Method.new get_organization_event_config + list_organization_impacts_config = parent_rpcs.list_organization_impacts if parent_rpcs.respond_to? :list_organization_impacts + @list_organization_impacts = ::Gapic::Config::Method.new list_organization_impacts_config + get_organization_impact_config = parent_rpcs.get_organization_impact if parent_rpcs.respond_to? :get_organization_impact + @get_organization_impact = ::Gapic::Config::Method.new get_organization_impact_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/service_stub.rb new file mode 100644 index 000000000000..334b7953ff5e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/service_stub.rb @@ -0,0 +1,447 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/servicehealth/v1/event_service_pb" + +module Google + module Cloud + module ServiceHealth + module V1 + module ServiceHealth + module Rest + ## + # REST service stub for the ServiceHealth 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_events REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListEventsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceHealth::V1::ListEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceHealth::V1::ListEventsResponse] + # A result object deserialized from the server's reply + def list_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_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_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceHealth::V1::ListEventsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_event REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetEventRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceHealth::V1::Event] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceHealth::V1::Event] + # A result object deserialized from the server's reply + def get_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_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: "get_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceHealth::V1::Event.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_organization_events REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse] + # A result object deserialized from the server's reply + def list_organization_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_organization_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_organization_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_organization_event REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] + # A result object deserialized from the server's reply + def get_organization_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_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: "get_organization_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceHealth::V1::OrganizationEvent.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_organization_impacts REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse] + # A result object deserialized from the server's reply + def list_organization_impacts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_organization_impacts_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_organization_impacts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_organization_impact REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] + # A result object deserialized from the server's reply + def get_organization_impact request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_impact_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_organization_impact", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceHealth::V1::OrganizationImpact.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_events REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/events", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_event REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetEventRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/events/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_organization_events REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_organization_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/organizationEvents", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_organization_event REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_organization_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/organizationEvents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_organization_impacts REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_organization_impacts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/organizationImpacts", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_organization_impact REST call + # + # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_organization_impact_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/organizationImpacts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/version.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/version.rb new file mode 100644 index 000000000000..1a6b3fe921b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/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 ServiceHealth + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_resources_pb.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_resources_pb.rb new file mode 100644 index 000000000000..0b6bc5e2a840 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_resources_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicehealth/v1/event_resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n3google/cloud/servicehealth/v1/event_resources.proto\x12\x1dgoogle.cloud.servicehealth.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x93\x0b\n\x05\x45vent\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12I\n\x08\x63\x61tegory\x18\x04 \x01(\x0e\x32\x32.google.cloud.servicehealth.v1.Event.EventCategoryB\x03\xe0\x41\x03\x12U\n\x11\x64\x65tailed_category\x18\x15 \x01(\x0e\x32\x35.google.cloud.servicehealth.v1.Event.DetailedCategoryB\x03\xe0\x41\x03\x12>\n\x05state\x18\x05 \x01(\x0e\x32*.google.cloud.servicehealth.v1.Event.StateB\x03\xe0\x41\x03\x12O\n\x0e\x64\x65tailed_state\x18\x13 \x01(\x0e\x32\x32.google.cloud.servicehealth.v1.Event.DetailedStateB\x03\xe0\x41\x03\x12\x41\n\revent_impacts\x18\x14 \x03(\x0b\x32*.google.cloud.servicehealth.v1.EventImpact\x12\x46\n\trelevance\x18\x08 \x01(\x0e\x32..google.cloud.servicehealth.v1.Event.RelevanceB\x03\xe0\x41\x03\x12@\n\x07updates\x18\t \x03(\x0b\x32*.google.cloud.servicehealth.v1.EventUpdateB\x03\xe0\x41\x03\x12\x19\n\x0cparent_event\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x10next_update_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"=\n\rEventCategory\x12\x1e\n\x1a\x45VENT_CATEGORY_UNSPECIFIED\x10\x00\x12\x0c\n\x08INCIDENT\x10\x02\"d\n\x10\x44\x65tailedCategory\x12!\n\x1d\x44\x45TAILED_CATEGORY_UNSPECIFIED\x10\x00\x12\x16\n\x12\x43ONFIRMED_INCIDENT\x10\x01\x12\x15\n\x11\x45MERGING_INCIDENT\x10\x02\"6\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\n\n\x06\x43LOSED\x10\x02\"\x8b\x01\n\rDetailedState\x12\x1e\n\x1a\x44\x45TAILED_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x45MERGING\x10\x01\x12\r\n\tCONFIRMED\x10\x02\x12\x0c\n\x08RESOLVED\x10\x03\x12\n\n\x06MERGED\x10\x04\x12\x0f\n\x0b\x41UTO_CLOSED\x10\t\x12\x12\n\x0e\x46\x41LSE_POSITIVE\x10\n\"w\n\tRelevance\x12\x19\n\x15RELEVANCE_UNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x02\x12\x10\n\x0cNOT_IMPACTED\x10\x06\x12\x15\n\x11PARTIALLY_RELATED\x10\x07\x12\x0b\n\x07RELATED\x10\x08\x12\x0c\n\x08IMPACTED\x10\t:n\xea\x41k\n\"servicehealth.googleapis.com/Event\x12\x36projects/{project}/locations/{location}/events/{event}*\x06\x65vents2\x05\x65vent\"\xcf\n\n\x11OrganizationEvent\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12U\n\x08\x63\x61tegory\x18\x04 \x01(\x0e\x32>.google.cloud.servicehealth.v1.OrganizationEvent.EventCategoryB\x03\xe0\x41\x03\x12\x61\n\x11\x64\x65tailed_category\x18\x11 \x01(\x0e\x32\x41.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategoryB\x03\xe0\x41\x03\x12J\n\x05state\x18\x05 \x01(\x0e\x32\x36.google.cloud.servicehealth.v1.OrganizationEvent.StateB\x03\xe0\x41\x03\x12[\n\x0e\x64\x65tailed_state\x18\x10 \x01(\x0e\x32>.google.cloud.servicehealth.v1.OrganizationEvent.DetailedStateB\x03\xe0\x41\x03\x12\x46\n\revent_impacts\x18\x0f \x03(\x0b\x32*.google.cloud.servicehealth.v1.EventImpactB\x03\xe0\x41\x03\x12@\n\x07updates\x18\x08 \x03(\x0b\x32*.google.cloud.servicehealth.v1.EventUpdateB\x03\xe0\x41\x03\x12\x19\n\x0cparent_event\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x10next_update_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"=\n\rEventCategory\x12\x1e\n\x1a\x45VENT_CATEGORY_UNSPECIFIED\x10\x00\x12\x0c\n\x08INCIDENT\x10\x02\"d\n\x10\x44\x65tailedCategory\x12!\n\x1d\x44\x45TAILED_CATEGORY_UNSPECIFIED\x10\x00\x12\x16\n\x12\x43ONFIRMED_INCIDENT\x10\x01\x12\x15\n\x11\x45MERGING_INCIDENT\x10\x02\"6\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\n\n\x06\x43LOSED\x10\x02\"\x8b\x01\n\rDetailedState\x12\x1e\n\x1a\x44\x45TAILED_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x45MERGING\x10\x01\x12\r\n\tCONFIRMED\x10\x02\x12\x0c\n\x08RESOLVED\x10\x03\x12\n\n\x06MERGED\x10\x04\x12\x0f\n\x0b\x41UTO_CLOSED\x10\t\x12\x12\n\x0e\x46\x41LSE_POSITIVE\x10\n:\xa9\x01\xea\x41\xa5\x01\n.servicehealth.googleapis.com/OrganizationEvent\x12Lorganizations/{organization}/locations/{location}/organizationEvents/{event}*\x12organizationEvents2\x11organizationEvent\"\xa0\x01\n\x0b\x45ventUpdate\x12\x34\n\x0bupdate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07symptom\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nworkaround\x18\x05 \x01(\tB\x03\xe0\x41\x03\"!\n\x08Location\x12\x15\n\rlocation_name\x18\x01 \x01(\t\"+\n\x07Product\x12\x14\n\x0cproduct_name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\"\x81\x01\n\x0b\x45ventImpact\x12\x37\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.servicehealth.v1.Product\x12\x39\n\x08location\x18\x02 \x01(\x0b\x32\'.google.cloud.servicehealth.v1.Location\"\x94\x03\n\x12OrganizationImpact\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12:\n\x06\x65vents\x18\x02 \x03(\tB*\xe0\x41\x03\xfa\x41$\n\"servicehealth.googleapis.com/Event\x12\x38\n\x05\x61sset\x18\x03 \x01(\x0b\x32$.google.cloud.servicehealth.v1.AssetB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xbb\x01\xea\x41\xb7\x01\n/servicehealth.googleapis.com/OrganizationImpact\x12[organizations/{organization}/locations/{location}/organizationImpacts/{organization_impact}*\x13organizationImpacts2\x12organizationImpact\"9\n\x05\x41sset\x12\x17\n\nasset_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nasset_type\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xd2\x01\n\x11ListEventsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"servicehealth.googleapis.com/Event\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;\n\x04view\x18\x06 \x01(\x0e\x32(.google.cloud.servicehealth.v1.EventViewB\x03\xe0\x41\x01\"\x87\x01\n\x12ListEventsResponse\x12\x39\n\x06\x65vents\x18\x01 \x03(\x0b\x32$.google.cloud.servicehealth.v1.EventB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"K\n\x0fGetEventRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"servicehealth.googleapis.com/Event\"\xf6\x01\n\x1dListOrganizationEventsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.servicehealth.googleapis.com/OrganizationEvent\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\x12G\n\x04view\x18\x06 \x01(\x0e\x32\x34.google.cloud.servicehealth.v1.OrganizationEventViewB\x03\xe0\x41\x01\"\xac\x01\n\x1eListOrganizationEventsResponse\x12R\n\x13organization_events\x18\x01 \x03(\x0b\x32\x30.google.cloud.servicehealth.v1.OrganizationEventB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"c\n\x1bGetOrganizationEventRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.servicehealth.googleapis.com/OrganizationEvent\"\xaf\x01\n\x1eListOrganizationImpactsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\x12/servicehealth.googleapis.com/OrganizationImpact\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\"\xaf\x01\n\x1fListOrganizationImpactsResponse\x12T\n\x14organization_impacts\x18\x01 \x03(\x0b\x32\x31.google.cloud.servicehealth.v1.OrganizationImpactB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"e\n\x1cGetOrganizationImpactRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/servicehealth.googleapis.com/OrganizationImpact*R\n\tEventView\x12\x1a\n\x16\x45VENT_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45VENT_VIEW_BASIC\x10\x01\x12\x13\n\x0f\x45VENT_VIEW_FULL\x10\x02*\x85\x01\n\x15OrganizationEventView\x12\'\n#ORGANIZATION_EVENT_VIEW_UNSPECIFIED\x10\x00\x12!\n\x1dORGANIZATION_EVENT_VIEW_BASIC\x10\x01\x12 \n\x1cORGANIZATION_EVENT_VIEW_FULL\x10\x02\x42\xcf\x02\n!com.google.cloud.servicehealth.v1B\x13\x45ventResourcesProtoP\x01ZGcloud.google.com/go/servicehealth/apiv1/servicehealthpb;servicehealthpb\xaa\x02\x1dGoogle.Cloud.ServiceHealth.V1\xca\x02\x1dGoogle\\Cloud\\ServiceHealth\\V1\xea\x02 Google::Cloud::ServiceHealth::V1\xea\x41\x66\n1servicehealth.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceHealth + module V1 + Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event").msgclass + Event::EventCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.EventCategory").enummodule + Event::DetailedCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.DetailedCategory").enummodule + Event::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.State").enummodule + Event::DetailedState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.DetailedState").enummodule + Event::Relevance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.Relevance").enummodule + OrganizationEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent").msgclass + OrganizationEvent::EventCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent.EventCategory").enummodule + OrganizationEvent::DetailedCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory").enummodule + OrganizationEvent::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent.State").enummodule + OrganizationEvent::DetailedState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent.DetailedState").enummodule + EventUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.EventUpdate").msgclass + Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Location").msgclass + Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Product").msgclass + EventImpact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.EventImpact").msgclass + OrganizationImpact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationImpact").msgclass + Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Asset").msgclass + ListEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListEventsRequest").msgclass + ListEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListEventsResponse").msgclass + GetEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.GetEventRequest").msgclass + ListOrganizationEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListOrganizationEventsRequest").msgclass + ListOrganizationEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListOrganizationEventsResponse").msgclass + GetOrganizationEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.GetOrganizationEventRequest").msgclass + ListOrganizationImpactsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListOrganizationImpactsRequest").msgclass + ListOrganizationImpactsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListOrganizationImpactsResponse").msgclass + GetOrganizationImpactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.GetOrganizationImpactRequest").msgclass + EventView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.EventView").enummodule + OrganizationEventView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEventView").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_pb.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_pb.rb new file mode 100644 index 000000000000..f23b23184afe --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/servicehealth/v1/event_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/cloud/servicehealth/v1/event_resources_pb' + + +descriptor_data = "\n1google/cloud/servicehealth/v1/event_service.proto\x12\x1dgoogle.cloud.servicehealth.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x33google/cloud/servicehealth/v1/event_resources.proto2\xaa\n\n\rServiceHealth\x12\xae\x01\n\nListEvents\x12\x30.google.cloud.servicehealth.v1.ListEventsRequest\x1a\x31.google.cloud.servicehealth.v1.ListEventsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/events\x12\x9b\x01\n\x08GetEvent\x12..google.cloud.servicehealth.v1.GetEventRequest\x1a$.google.cloud.servicehealth.v1.Event\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/events/*}\x12\xe3\x01\n\x16ListOrganizationEvents\x12<.google.cloud.servicehealth.v1.ListOrganizationEventsRequest\x1a=.google.cloud.servicehealth.v1.ListOrganizationEventsResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1/{parent=organizations/*/locations/*}/organizationEvents\x12\xd0\x01\n\x14GetOrganizationEvent\x12:.google.cloud.servicehealth.v1.GetOrganizationEventRequest\x1a\x30.google.cloud.servicehealth.v1.OrganizationEvent\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1/{name=organizations/*/locations/*/organizationEvents/*}\x12\xe7\x01\n\x17ListOrganizationImpacts\x12=.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest\x1a>.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/cloud/servicehealth/v1/event_resources.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/cloud/servicehealth/v1/event_resources.rb new file mode 100644 index 000000000000..60b89ba52554 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/cloud/servicehealth/v1/event_resources.rb @@ -0,0 +1,718 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceHealth + module V1 + # Represents service health events that may affect Google Cloud products. + # Event resource is a read-only view and does not allow any modifications. All + # fields are output only. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. Name of the event. Unique name of the event in + # this scope including project and location using the form + # `projects/{project_id}/locations/{location}/events/{event_id}`. + # @!attribute [r] title + # @return [::String] + # Output only. Brief description for the event. + # @!attribute [r] description + # @return [::String] + # Output only. Free-form, human-readable description. + # @!attribute [r] category + # @return [::Google::Cloud::ServiceHealth::V1::Event::EventCategory] + # Output only. The category of the event. + # @!attribute [r] detailed_category + # @return [::Google::Cloud::ServiceHealth::V1::Event::DetailedCategory] + # Output only. The detailed category of the event. + # @!attribute [r] state + # @return [::Google::Cloud::ServiceHealth::V1::Event::State] + # Output only. The current state of the event. + # @!attribute [r] detailed_state + # @return [::Google::Cloud::ServiceHealth::V1::Event::DetailedState] + # Output only. The current detailed state of the incident. + # @!attribute [rw] event_impacts + # @return [::Array<::Google::Cloud::ServiceHealth::V1::EventImpact>] + # Google Cloud products and locations impacted by the event. + # @!attribute [r] relevance + # @return [::Google::Cloud::ServiceHealth::V1::Event::Relevance] + # Output only. Communicates why a given event is deemed relevant in the + # context of a given project. + # @!attribute [r] updates + # @return [::Array<::Google::Cloud::ServiceHealth::V1::EventUpdate>] + # Output only. Event updates are correspondence from Google. + # @!attribute [r] parent_event + # @return [::String] + # Output only. When `detailed_state`=`MERGED`, `parent_event` contains the + # name of the parent event. All further updates will be published to the + # parent event. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the event was last modified. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of the event, if applicable. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of the event, if applicable. + # @!attribute [r] next_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the next update can be expected. + class Event + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The category of the event. This enum lists all possible categories of + # event. + module EventCategory + # Unspecified category. + EVENT_CATEGORY_UNSPECIFIED = 0 + + # Event category for service outage or degradation. + INCIDENT = 2 + end + + # The detailed category of an event. Contains all possible states for all + # event categories. + module DetailedCategory + # Unspecified detailed category. + DETAILED_CATEGORY_UNSPECIFIED = 0 + + # Indicates an event with category INCIDENT has a confirmed impact to at + # least one Google Cloud product. + CONFIRMED_INCIDENT = 1 + + # Indicates an event with category INCIDENT is under investigation to + # determine if it has a confirmed impact on any Google Cloud products. + EMERGING_INCIDENT = 2 + end + + # The state of the event. This enum lists all possible states of event. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # Event is actively affecting a Google Cloud product and will continue to + # receive updates. + ACTIVE = 1 + + # Event is no longer affecting the Google Cloud product or has been merged + # with another event. + CLOSED = 2 + end + + # The detailed state of the incident. This enum lists all possible detailed + # states of an incident. + module DetailedState + # Unspecified detail state. + DETAILED_STATE_UNSPECIFIED = 0 + + # Google engineers are actively investigating the event to determine the + # impact. + EMERGING = 1 + + # The incident is confirmed and impacting at least one Google Cloud + # product. Ongoing status updates will be provided until it is resolved. + CONFIRMED = 2 + + # The incident is no longer affecting any Google Cloud product, and there + # will be no further updates. + RESOLVED = 3 + + # The incident was merged into a parent incident. All further updates will + # be published to the parent only. The `parent_event` field contains the + # name of the parent. + MERGED = 4 + + # The incident was automatically closed because of the following reasons: + # + # * The impact of the incident could not be confirmed. + # * The incident was intermittent or resolved itself. + # + # The incident does not have a resolution because no action or + # investigation happened. If it is intermittent, the incident may reopen. + AUTO_CLOSED = 9 + + # Upon investigation, Google engineers concluded that the incident is not + # affecting a Google Cloud product. This state can change if the incident + # is reviewed again. + FALSE_POSITIVE = 10 + end + + # Communicates why a given incident is deemed relevant in the context of a + # given project. This enum lists all possible detailed states of relevance. + module Relevance + # Unspecified relevance. + RELEVANCE_UNSPECIFIED = 0 + + # The relevance of the incident to the project is unknown. + UNKNOWN = 2 + + # The incident does not impact the project. + NOT_IMPACTED = 6 + + # The incident is associated with a Google Cloud product your project uses, + # but the incident may not be impacting your project. For example, the + # incident may be impacting a Google Cloud product that your project uses, + # but in a location that your project does not use. + PARTIALLY_RELATED = 7 + + # The incident has a direct connection with your project and impacts a + # Google Cloud product in a location your project uses. + RELATED = 8 + + # The incident is verified to be impacting your project. + IMPACTED = 9 + end + end + + # Represents service health events that may affect Google Cloud products used + # across the organization. It is a read-only view and does not allow any + # modifications. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. Name of the event. Unique name of the event in + # this scope including organization ID and location using the form + # `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`. + # + # `organization_id` - see [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `location` - The location to get the service health events from.
+ # `event_id` - Organization event ID to retrieve. + # @!attribute [r] title + # @return [::String] + # Output only. Brief description for the event. + # @!attribute [r] description + # @return [::String] + # Output only. Free-form, human-readable description. + # @!attribute [r] category + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent::EventCategory] + # Output only. The category of the event. + # @!attribute [r] detailed_category + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent::DetailedCategory] + # Output only. The detailed category of the event. + # @!attribute [r] state + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent::State] + # Output only. The current state of the event. + # @!attribute [r] detailed_state + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent::DetailedState] + # Output only. The current detailed state of the incident. + # @!attribute [r] event_impacts + # @return [::Array<::Google::Cloud::ServiceHealth::V1::EventImpact>] + # Output only. Represents the Google Cloud products and locations impacted by + # the event. + # @!attribute [r] updates + # @return [::Array<::Google::Cloud::ServiceHealth::V1::EventUpdate>] + # Output only. Incident-only field. Event updates are correspondence from + # Google. + # @!attribute [r] parent_event + # @return [::String] + # Output only. When `detailed_state`=`MERGED`, `parent_event` contains the + # name of the parent event. All further updates will be published to the + # parent event. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the update was posted. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of the event, if applicable. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of the event, if applicable. + # @!attribute [r] next_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Incident-only field. The time when the next update can be + # expected. + class OrganizationEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The category of the event. This enum lists all possible categories of + # event. + module EventCategory + # Unspecified category. + EVENT_CATEGORY_UNSPECIFIED = 0 + + # Event category for service outage or degradation. + INCIDENT = 2 + end + + # The detailed category of an event. Contains all possible states for all + # event categories. + module DetailedCategory + # Unspecified detailed category. + DETAILED_CATEGORY_UNSPECIFIED = 0 + + # Indicates an event with category INCIDENT has a confirmed impact to at + # least one Google Cloud product. + CONFIRMED_INCIDENT = 1 + + # Indicates an event with category INCIDENT is under investigation to + # determine if it has a confirmed impact on any Google Cloud products. + EMERGING_INCIDENT = 2 + end + + # The state of the organization event. This enum lists all possible states of + # event. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # Event is actively affecting a Google Cloud product and will continue to + # receive updates. + ACTIVE = 1 + + # Event is no longer affecting the Google Cloud product or has been merged + # with another event. + CLOSED = 2 + end + + # The detailed state of the incident. This enum lists all possible detailed + # states of an incident. + module DetailedState + # Unspecified detail state. + DETAILED_STATE_UNSPECIFIED = 0 + + # Google engineers are actively investigating the incident to determine the + # impact. + EMERGING = 1 + + # The incident is confirmed and impacting at least one Google Cloud + # product. Ongoing status updates will be provided until it is resolved. + CONFIRMED = 2 + + # The incident is no longer affecting any Google Cloud product, and there + # will be no further updates. + RESOLVED = 3 + + # The incident was merged into a parent event. All further updates will be + # published to the parent only. The `parent_event` contains the name of the + # parent. + MERGED = 4 + + # The incident was automatically closed because of the following reasons: + # + # * The impact of the incident could not be confirmed. + # * The incident was intermittent or resolved itself. + # + # The incident does not have a resolution because no action or + # investigation happened. If it is intermittent, the incident may reopen. + AUTO_CLOSED = 9 + + # Upon investigation, Google engineers concluded that the incident is not + # affecting a Google Cloud product. This state can change if the incident + # is reviewed again. + FALSE_POSITIVE = 10 + end + end + + # Records an update made to the event. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the update was posted. + # @!attribute [r] title + # @return [::String] + # Output only. Brief title for the event. + # @!attribute [r] description + # @return [::String] + # Output only. Free-form, human-readable description. + # @!attribute [r] symptom + # @return [::String] + # Output only. Symptoms of the event, if available. + # @!attribute [r] workaround + # @return [::String] + # Output only. Workaround steps to remediate the event impact, if available. + class EventUpdate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the locations impacted by the event. + # @!attribute [rw] location_name + # @return [::String] + # Location impacted by the event. Example: `"us-central1"` + class Location + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the Google Cloud product impacted by the event. + # @!attribute [rw] product_name + # @return [::String] + # Google Cloud product impacted by the event. Example: `"Google Cloud SQL"` + # @!attribute [rw] id + # @return [::String] + # Unique identifier for the product. + class Product + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the Google Cloud products and locations impacted by the event. + # @!attribute [rw] product + # @return [::Google::Cloud::ServiceHealth::V1::Product] + # Google Cloud product impacted by the event. + # @!attribute [rw] location + # @return [::Google::Cloud::ServiceHealth::V1::Location] + # Location impacted by the event. + class EventImpact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents impact to assets at organizational level. It is a read-only view + # and does not allow any modifications. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. Unique name of the organization impact in this + # scope including organization and location using the form + # `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`. + # + # `organization_id` - ID (number) of the organization that contains the + # event. To get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `organization_impact_id` - ID of the [OrganizationImpact + # resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). + # @!attribute [r] events + # @return [::Array<::String>] + # Output only. A list of event names impacting the asset. + # @!attribute [r] asset + # @return [::Google::Cloud::ServiceHealth::V1::Asset] + # Output only. Google Cloud asset possibly impacted by the specified events. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the affected project was last modified. + class OrganizationImpact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the asset impacted by the events. + # @!attribute [r] asset_name + # @return [::String] + # Output only. Full name of the resource as defined in + # [Resource + # Names](https://cloud.google.com/apis/design/resource_names#full_resource_name). + # @!attribute [r] asset_type + # @return [::String] + # Output only. Type of the asset. Example: + # `"cloudresourcemanager.googleapis.com/Project"` + class Asset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Requests list of events. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value using the form + # `projects/{project_id}/locations/{location}/events`. + # + # `project_id` - ID of the project for which to list service health + # events. + # `location` - The location to get the service health events from. + # To retrieve service health events of category = INCIDENT, use `location` = + # `global`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of events that should be returned. Acceptable + # values are 1 to 100, inclusive. (The default value is 10.) If more results + # are available, the service returns a next_page_token that you can use to + # get the next page of results in subsequent list requests. The service may + # return fewer events than the requested page_size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # Provide Page token returned by a previous `ListEvents` call to retrieve the + # next page of results. When paginating, all other parameters provided to + # `ListEvents` must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters resources listed in the + # response. The expression takes the following forms:
+ # * field=value for `category` and `state`
+ # * field <, >, <=, or >= value for `update_time`
+ # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"`, + # `event_impacts.product.product_name:"Eventarc"` + #
+ # + # Multiple filter queries are separated by spaces. Example: + # `category=INCIDENT state=ACTIVE`. + # + # By default, each expression is an AND expression. However, you can include + # AND and OR expressions explicitly. + # + # Filter is supported for the following fields: `category`, `state`, + # `update_time`, `event_impacts.product.product_name` + # @!attribute [rw] view + # @return [::Google::Cloud::ServiceHealth::V1::EventView] + # Optional. Event fields to include in response. + class ListEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to request for listing events. + # @!attribute [r] events + # @return [::Array<::Google::Cloud::ServiceHealth::V1::Event>] + # Output only. List of events. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. The continuation token, used to page through large result + # sets. Provide this value in a subsequent request as page_token to retrieve + # the next page. + # + # If this field is not present, there are no subsequent results. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Gets information about a specific event. + # @!attribute [rw] name + # @return [::String] + # Required. Unique name of the event in this scope including project + # and location using the form + # `projects/{project_id}/locations/{location}/events/{event_id}`. + # + # `project_id` - Project ID of the project that contains the event.
+ # `location` - The location to get the service health events from.
+ # `event_id` - Event ID to retrieve. + class GetEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Requests list of events that affect an organization. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value using the form + # `organizations/{organization_id}/locations/{location}/organizationEvents`. + # + # `organization_id` - ID (number) of the project that contains the event. To + # get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `location` - The location to get the service health events from. To + # retrieve service health events of category = INCIDENT, use `location` = + # `global`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of events that should be returned. Acceptable + # values are `1` to `100`, inclusive. (The default value is `10`.) If more + # results are available, the service returns a `next_page_token` that you can + # use to get the next page of results in subsequent list requests. The + # service may return fewer events than the requested `page_size`. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # + # Provide Page token returned by a previous `ListOrganizationEvents` call to + # retrieve the next page of results. + # + # When paginating, all other parameters provided to + # `ListOrganizationEvents` must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters resources listed in the + # response. The expression takes the following forms: + # + # * field=value for `category` and `state` + # * field <, >, <=, or >= value for `update_time` + # + # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"` + # + # Multiple filter queries are space-separated. Example: + # `category=INCIDENT state=ACTIVE`. + # + # By default, each expression is an AND expression. However, you can include + # AND and OR expressions explicitly. + # + # Filter is supported for the following fields: `category`, `state`, + # `update_time` + # @!attribute [rw] view + # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEventView] + # Optional. OrganizationEvent fields to include in response. + class ListOrganizationEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to request for listing organization events. + # @!attribute [r] organization_events + # @return [::Array<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] + # Output only. List of organization events affecting an organization. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. The continuation token, used to page through large result + # sets. Provide this value in a subsequent request as `page_token` to + # retrieve the next page. + # + # If this field is not present, there are no subsequent results. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListOrganizationEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Gets information about a specific event affecting an organization. + # @!attribute [rw] name + # @return [::String] + # Required. Unique name of the event in this scope including organization and + # event ID using the form + # `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`. + # + # `organization_id` - ID (number) of the project that contains the event. To + # get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `event_id` - Organization event ID to retrieve. + class GetOrganizationEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Requests list of projects under an organization affected by an event. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value using the form + # `organizations/{organization_id}/locations/{location}/organizationImpacts`. + # + # `organization_id` - ID (number) of the project that contains the event. To + # get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of events that should be returned. Acceptable + # values are `1` to `100`, inclusive. The default value is `10`. + # + # If more results are available, the service returns a + # `next_page_token` that can be used to get the next page of results in + # subsequent list requests. The service may return fewer + # [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) + # than the requested `page_size`. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # + # Provide `page_token` returned by a previous `ListOrganizationImpacts` call + # to retrieve the next page of results. + # + # When paginating, all other parameters provided to `ListOrganizationImpacts` + # must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters resources listed in the + # response. The expression is in the form of `field:value` for checking if a + # repeated field contains a value. + # + # Example: + # `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id` + # + # To get your `{organization_id}`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + # + # Multiple filter queries are separated by spaces. + # + # By default, each expression is an AND expression. However, you can include + # AND and OR expressions explicitly. + # Filter is supported for the following fields: `events`. + class ListOrganizationImpactsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to request for listing projects under an organization affected by an + # event. + # @!attribute [r] organization_impacts + # @return [::Array<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] + # Output only. List of + # [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) + # for an organization affected by service health events. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. The continuation token, used to page through large result + # sets. Provide this value in a subsequent request as `page_token` to + # retrieve the next page. + # + # If this field is not present, there are no subsequent results. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListOrganizationImpactsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Gets information about an event that affects a project under an organization. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource using the form + # `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`. + # + # `organization_id` - ID (number) of the organization that contains the + # event. To get your `organization_id`, see + # [Getting your organization resource + # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ # `organization_impact_id` - ID of the [OrganizationImpact + # resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). + class GetOrganizationImpactRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The event fields to include in ListEvents API response. This enum lists all + # possible event views. + module EventView + # Unspecified event view. Default to `EVENT_VIEW_BASIC`. + EVENT_VIEW_UNSPECIFIED = 0 + + # Includes all fields except `updates`. This view is the default for + # ListEvents API. + EVENT_VIEW_BASIC = 1 + + # Includes all event fields. + EVENT_VIEW_FULL = 2 + end + + # The organization event fields to include in ListOrganizationEvents API + # response. This enum lists all possible organization event views. + module OrganizationEventView + # Unspecified event view. Default to `ORGANIZATION_EVENT_VIEW_BASIC`. + ORGANIZATION_EVENT_VIEW_UNSPECIFIED = 0 + + # Includes all organization event fields except `updates`. This view is the + # default for ListOrganizationEvents API. + ORGANIZATION_EVENT_VIEW_BASIC = 1 + + # Includes all organization event fields. + ORGANIZATION_EVENT_VIEW_FULL = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_health-v1/snippets/Gemfile new file mode 100644 index 000000000000..299f6cda7aba --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-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-service_health-v1", path: "../" +else + gem "google-cloud-service_health-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-service_health-v1/snippets/service_health/get_event.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_event.rb new file mode 100644 index 000000000000..23479740a8e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_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 servicehealth_v1_generated_ServiceHealth_GetEvent_sync] +require "google/cloud/service_health/v1" + +## +# Snippet for the get_event call in the ServiceHealth service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_event. +# +def get_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceHealth::V1::GetEventRequest.new + + # Call the get_event method. + result = client.get_event request + + # The returned object is of type Google::Cloud::ServiceHealth::V1::Event. + p result +end +# [END servicehealth_v1_generated_ServiceHealth_GetEvent_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_event.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_event.rb new file mode 100644 index 000000000000..df9646decbc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_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 servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_sync] +require "google/cloud/service_health/v1" + +## +# Snippet for the get_organization_event call in the ServiceHealth service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_event. +# +def get_organization_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new + + # Call the get_organization_event method. + result = client.get_organization_event request + + # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationEvent. + p result +end +# [END servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_impact.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_impact.rb new file mode 100644 index 000000000000..f0a376741737 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_impact.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_sync] +require "google/cloud/service_health/v1" + +## +# Snippet for the get_organization_impact call in the ServiceHealth service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_impact. +# +def get_organization_impact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new + + # Call the get_organization_impact method. + result = client.get_organization_impact request + + # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationImpact. + p result +end +# [END servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_events.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_events.rb new file mode 100644 index 000000000000..53e9fc3e5458 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_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 servicehealth_v1_generated_ServiceHealth_ListEvents_sync] +require "google/cloud/service_health/v1" + +## +# Snippet for the list_events call in the ServiceHealth service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_events. +# +def list_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceHealth::V1::ListEventsRequest.new + + # Call the list_events method. + result = client.list_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::ServiceHealth::V1::Event. + p item + end +end +# [END servicehealth_v1_generated_ServiceHealth_ListEvents_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_events.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_events.rb new file mode 100644 index 000000000000..9d25933b9164 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_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 servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_sync] +require "google/cloud/service_health/v1" + +## +# Snippet for the list_organization_events call in the ServiceHealth service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_events. +# +def list_organization_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new + + # Call the list_organization_events method. + result = client.list_organization_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::ServiceHealth::V1::OrganizationEvent. + p item + end +end +# [END servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_impacts.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_impacts.rb new file mode 100644 index 000000000000..2fdbd490e47d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_impacts.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 servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_sync] +require "google/cloud/service_health/v1" + +## +# Snippet for the list_organization_impacts call in the ServiceHealth service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_impacts. +# +def list_organization_impacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.new + + # Call the list_organization_impacts method. + result = client.list_organization_impacts request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceHealth::V1::OrganizationImpact. + p item + end +end +# [END servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/snippet_metadata_google.cloud.servicehealth.v1.json b/owl-bot-staging/google-cloud-service_health-v1/snippets/snippet_metadata_google.cloud.servicehealth.v1.json new file mode 100644 index 000000000000..64879231d0a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/snippets/snippet_metadata_google.cloud.servicehealth.v1.json @@ -0,0 +1,255 @@ +{ + "client_library": { + "name": "google-cloud-service_health-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.servicehealth.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "servicehealth_v1_generated_ServiceHealth_ListEvents_sync", + "title": "Snippet for the list_events call in the ServiceHealth service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_events.", + "file": "service_health/list_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_events", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceHealth::V1::ListEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceHealth::V1::ListEventsResponse", + "client": { + "short_name": "ServiceHealth::Client", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" + }, + "method": { + "short_name": "ListEvents", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth.ListEvents", + "service": { + "short_name": "ServiceHealth", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicehealth_v1_generated_ServiceHealth_GetEvent_sync", + "title": "Snippet for the get_event call in the ServiceHealth service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_event.", + "file": "service_health/get_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_event", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceHealth::V1::GetEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceHealth::V1::Event", + "client": { + "short_name": "ServiceHealth::Client", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" + }, + "method": { + "short_name": "GetEvent", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth.GetEvent", + "service": { + "short_name": "ServiceHealth", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_sync", + "title": "Snippet for the list_organization_events call in the ServiceHealth service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_events.", + "file": "service_health/list_organization_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_organization_events", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse", + "client": { + "short_name": "ServiceHealth::Client", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" + }, + "method": { + "short_name": "ListOrganizationEvents", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth.ListOrganizationEvents", + "service": { + "short_name": "ServiceHealth", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_sync", + "title": "Snippet for the get_organization_event call in the ServiceHealth service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_event.", + "file": "service_health/get_organization_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_organization_event", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceHealth::V1::OrganizationEvent", + "client": { + "short_name": "ServiceHealth::Client", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" + }, + "method": { + "short_name": "GetOrganizationEvent", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth.GetOrganizationEvent", + "service": { + "short_name": "ServiceHealth", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_sync", + "title": "Snippet for the list_organization_impacts call in the ServiceHealth service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_impacts.", + "file": "service_health/list_organization_impacts.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_organization_impacts", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_impacts", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse", + "client": { + "short_name": "ServiceHealth::Client", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" + }, + "method": { + "short_name": "ListOrganizationImpacts", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth.ListOrganizationImpacts", + "service": { + "short_name": "ServiceHealth", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_sync", + "title": "Snippet for the get_organization_impact call in the ServiceHealth service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_impact.", + "file": "service_health/get_organization_impact.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_organization_impact", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_impact", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceHealth::V1::OrganizationImpact", + "client": { + "short_name": "ServiceHealth::Client", + "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" + }, + "method": { + "short_name": "GetOrganizationImpact", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth.GetOrganizationImpact", + "service": { + "short_name": "ServiceHealth", + "full_name": "google.cloud.servicehealth.v1.ServiceHealth" + } + } + }, + "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-service_health-v1/test/google/cloud/service_health/v1/service_health_paths_test.rb b/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_paths_test.rb new file mode 100644 index 000000000000..230902f0df17 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/service_health/v1/service_health" + +class ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.event_path project: "value0", location: "value1", event: "value2" + assert_equal "projects/value0/locations/value1/events/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::ServiceHealth::V1::ServiceHealth::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_event_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_event_path organization: "value0", location: "value1", event: "value2" + assert_equal "organizations/value0/locations/value1/organizationEvents/value2", path + end + end + + def test_organization_impact_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_impact_path organization: "value0", location: "value1", organization_impact: "value2" + assert_equal "organizations/value0/locations/value1/organizationImpacts/value2", 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::ServiceHealth::V1::ServiceHealth::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-service_health-v1/test/google/cloud/service_health/v1/service_health_rest_test.rb b/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_rest_test.rb new file mode 100644 index 000000000000..81636a4468ad --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_rest_test.rb @@ -0,0 +1,434 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/servicehealth/v1/event_service_pb" +require "google/cloud/service_health/v1/service_health/rest" + + +class ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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_events + # Create test objects. + client_result = ::Google::Cloud::ServiceHealth::V1::ListEventsResponse.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" + view = :EVENT_VIEW_UNSPECIFIED + + list_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::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_list_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_events_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_events ::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_events(::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_events_client_stub.call_count + end + end + end + + def test_get_event + # Create test objects. + client_result = ::Google::Cloud::ServiceHealth::V1::Event.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_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::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_get_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_event_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_event({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_event name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_event ::Google::Cloud::ServiceHealth::V1::GetEventRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_event({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_event(::Google::Cloud::ServiceHealth::V1::GetEventRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_event_client_stub.call_count + end + end + end + + def test_list_organization_events + # Create test objects. + client_result = ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse.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" + view = :ORGANIZATION_EVENT_VIEW_UNSPECIFIED + + list_organization_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::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_list_organization_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_organization_events_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_organization_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_organization_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_organization_events ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_organization_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_organization_events(::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_organization_events_client_stub.call_count + end + end + end + + def test_get_organization_event + # Create test objects. + client_result = ::Google::Cloud::ServiceHealth::V1::OrganizationEvent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_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::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_get_organization_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_organization_event_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_organization_event({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_organization_event name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_organization_event ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_organization_event({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_organization_event(::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_organization_event_client_stub.call_count + end + end + end + + def test_list_organization_impacts + # Create test objects. + client_result = ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse.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_organization_impacts_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_list_organization_impacts_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_organization_impacts_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_organization_impacts({ 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_organization_impacts 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_organization_impacts ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.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_organization_impacts({ 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_organization_impacts(::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.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_organization_impacts_client_stub.call_count + end + end + end + + def test_get_organization_impact + # Create test objects. + client_result = ::Google::Cloud::ServiceHealth::V1::OrganizationImpact.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_impact_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_get_organization_impact_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_organization_impact_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_organization_impact({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_organization_impact name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_organization_impact ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_organization_impact({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_organization_impact(::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_organization_impact_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::ServiceHealth::V1::ServiceHealth::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::ServiceHealth::V1::ServiceHealth::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_test.rb b/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_test.rb new file mode 100644 index 000000000000..9eeb54f0d278 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_test.rb @@ -0,0 +1,489 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/servicehealth/v1/event_service_pb" +require "google/cloud/service_health/v1/service_health" + +class ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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_events + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceHealth::V1::ListEventsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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" + view = :EVENT_VIEW_UNSPECIFIED + + list_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_events, name + assert_kind_of ::Google::Cloud::ServiceHealth::V1::ListEventsRequest, 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 :EVENT_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_events_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_events ::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_events(::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_events_client_stub.call_rpc_count + end + end + + def test_get_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceHealth::V1::Event.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_event, name + assert_kind_of ::Google::Cloud::ServiceHealth::V1::GetEventRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_event_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_event({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_event name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_event ::Google::Cloud::ServiceHealth::V1::GetEventRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_event({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_event(::Google::Cloud::ServiceHealth::V1::GetEventRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_event_client_stub.call_rpc_count + end + end + + def test_list_organization_events + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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" + view = :ORGANIZATION_EVENT_VIEW_UNSPECIFIED + + list_organization_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_organization_events, name + assert_kind_of ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest, 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 :ORGANIZATION_EVENT_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_organization_events_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_organization_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_organization_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_organization_events ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_organization_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_organization_events(::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_organization_events_client_stub.call_rpc_count + end + end + + def test_get_organization_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceHealth::V1::OrganizationEvent.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_organization_event, name + assert_kind_of ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_organization_event_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_organization_event({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_organization_event name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_organization_event ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_organization_event({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_organization_event(::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_organization_event_client_stub.call_rpc_count + end + end + + def test_list_organization_impacts + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_organization_impacts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_organization_impacts, name + assert_kind_of ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest, 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_organization_impacts_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_organization_impacts({ 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_organization_impacts 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_organization_impacts ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.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_organization_impacts({ 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_organization_impacts(::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.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_organization_impacts_client_stub.call_rpc_count + end + end + + def test_get_organization_impact + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceHealth::V1::OrganizationImpact.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_impact_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_organization_impact, name + assert_kind_of ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_organization_impact_client_stub do + # Create client + client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_organization_impact({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_organization_impact name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_organization_impact ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_organization_impact({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_organization_impact(::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_organization_impact_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceHealth::V1::ServiceHealth::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::ServiceHealth::V1::ServiceHealth::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::ServiceHealth::V1::ServiceHealth::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-service_health-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_health-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_health-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_management-v1/.gitignore b/owl-bot-staging/google-cloud-service_management-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-service_management-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_management-v1/.repo-metadata.json new file mode 100644 index 000000000000..966c229fd1cf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "servicemanagement.googleapis.com", + "api_shortname": "servicemanagement", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_management-v1/latest", + "distribution_name": "google-cloud-service_management-v1", + "is_cloud": true, + "language": "ruby", + "name": "servicemanagement", + "name_pretty": "Service Management V1 API", + "product_documentation": "https://cloud.google.com/service-infrastructure/docs/overview/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers. Note that google-cloud-service_management-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_management instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SERVICE_MANAGEMENT", + "ruby-cloud-product-url": "https://cloud.google.com/service-infrastructure/docs/overview/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-service_management-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_management-v1/.rubocop.yml new file mode 100644 index 000000000000..af3b43f29aeb --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-service_management-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-service_management-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_management-v1/.toys.rb b/owl-bot-staging/google-cloud-service_management-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/.yardopts b/owl-bot-staging/google-cloud-service_management-v1/.yardopts new file mode 100644 index 000000000000..50c42b3fcd2e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Service Management V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-service_management-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_management-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..cf5a3d474532 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-service_management-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-service_management-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/service_management/v1" + +client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/service_management/v1" + +::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::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-service_management-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/service_management/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::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-service_management-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_management-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-service_management-v1/Gemfile b/owl-bot-staging/google-cloud-service_management-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_management-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_management-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-service_management-v1/README.md b/owl-bot-staging/google-cloud-service_management-v1/README.md new file mode 100644 index 000000000000..aab331fb4c41 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Service Management V1 API + +Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Service Management V1 API. Most users should consider using +the main client gem, +[google-cloud-service_management](https://rubygems.org/gems/google-cloud-service_management). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-service_management-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/servicemanagement.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/service_management/v1" + +client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +request = ::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new # (request fields as keyword arguments...) +response = client.list_services request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_management-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/service-infrastructure/docs/overview/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/service_management/v1" +require "logger" + +client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::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-service_management`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-service_management-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-service_management`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-service_management-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-service_management-v1/Rakefile b/owl-bot-staging/google-cloud-service_management-v1/Rakefile new file mode 100644 index 000000000000..2de06523c37d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-service_management-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SERVICE_MANAGEMENT_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SERVICE_MANAGEMENT_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SERVICE_MANAGEMENT_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 SERVICE_MANAGEMENT_TEST_PROJECT=test123 SERVICE_MANAGEMENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/service_management/v1/service_manager/credentials" + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SERVICE_MANAGEMENT_PROJECT"] = project + ENV["SERVICE_MANAGEMENT_TEST_PROJECT"] = project + ENV["SERVICE_MANAGEMENT_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-service_management-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-service_management-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-service_management-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-service_management-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-service_management-v1" + header "google-cloud-service_management-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-service_management-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-service_management-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-service_management-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-service_management-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_management-v1/gapic_metadata.json new file mode 100644 index 000000000000..329aa618c796 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-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.api.servicemanagement.v1", + "libraryPackage": "::Google::Cloud::ServiceManagement::V1", + "services": { + "ServiceManager": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client", + "rpcs": { + "ListServices": { + "methods": [ + "list_services" + ] + }, + "GetService": { + "methods": [ + "get_service" + ] + }, + "CreateService": { + "methods": [ + "create_service" + ] + }, + "DeleteService": { + "methods": [ + "delete_service" + ] + }, + "UndeleteService": { + "methods": [ + "undelete_service" + ] + }, + "ListServiceConfigs": { + "methods": [ + "list_service_configs" + ] + }, + "GetServiceConfig": { + "methods": [ + "get_service_config" + ] + }, + "CreateServiceConfig": { + "methods": [ + "create_service_config" + ] + }, + "SubmitConfigSource": { + "methods": [ + "submit_config_source" + ] + }, + "ListServiceRollouts": { + "methods": [ + "list_service_rollouts" + ] + }, + "GetServiceRollout": { + "methods": [ + "get_service_rollout" + ] + }, + "CreateServiceRollout": { + "methods": [ + "create_service_rollout" + ] + }, + "GenerateConfigReport": { + "methods": [ + "generate_config_report" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-service_management-v1/google-cloud-service_management-v1.gemspec b/owl-bot-staging/google-cloud-service_management-v1/google-cloud-service_management-v1.gemspec new file mode 100644 index 000000000000..41e459073fea --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/google-cloud-service_management-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/service_management/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-service_management-v1" + gem.version = Google::Cloud::ServiceManagement::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers. Note that google-cloud-service_management-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_management instead. See the readme for more details." + gem.summary = "Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-iam-v1", "~> 1.3" +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google-cloud-service_management-v1.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google-cloud-service_management-v1.rb new file mode 100644 index 000000000000..49cad33ce88e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google-cloud-service_management-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/service_management/v1" diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/resources_pb.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/resources_pb.rb new file mode 100644 index 000000000000..314a07cea044 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/resources_pb.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicemanagement/v1/resources.proto + +require 'google/protobuf' + +require 'google/api/config_change_pb' +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/api/servicemanagement/v1/resources.proto\x12\x1fgoogle.api.servicemanagement.v1\x1a\x1egoogle/api/config_change.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"C\n\x0eManagedService\x12\x14\n\x0cservice_name\x18\x02 \x01(\t\x12\x1b\n\x13producer_project_id\x18\x03 \x01(\t\"\x91\x03\n\x11OperationMetadata\x12\x16\n\x0eresource_names\x18\x01 \x03(\t\x12\x46\n\x05steps\x18\x02 \x03(\x0b\x32\x37.google.api.servicemanagement.v1.OperationMetadata.Step\x12\x1b\n\x13progress_percentage\x18\x03 \x01(\x05\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x66\n\x04Step\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12I\n\x06status\x18\x04 \x01(\x0e\x32\x39.google.api.servicemanagement.v1.OperationMetadata.Status\"g\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x08\n\x04\x44ONE\x10\x01\x12\x0f\n\x0bNOT_STARTED\x10\x02\x12\x0f\n\x0bIN_PROGRESS\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\x8f\x01\n\nDiagnostic\x12\x10\n\x08location\x18\x01 \x01(\t\x12>\n\x04kind\x18\x02 \x01(\x0e\x32\x30.google.api.servicemanagement.v1.Diagnostic.Kind\x12\x0f\n\x07message\x18\x03 \x01(\t\"\x1e\n\x04Kind\x12\x0b\n\x07WARNING\x10\x00\x12\t\n\x05\x45RROR\x10\x01\"V\n\x0c\x43onfigSource\x12\n\n\x02id\x18\x05 \x01(\t\x12:\n\x05\x66iles\x18\x02 \x03(\x0b\x32+.google.api.servicemanagement.v1.ConfigFile\"\x95\x02\n\nConfigFile\x12\x11\n\tfile_path\x18\x01 \x01(\t\x12\x15\n\rfile_contents\x18\x03 \x01(\x0c\x12G\n\tfile_type\x18\x04 \x01(\x0e\x32\x34.google.api.servicemanagement.v1.ConfigFile.FileType\"\x93\x01\n\x08\x46ileType\x12\x19\n\x15\x46ILE_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13SERVICE_CONFIG_YAML\x10\x01\x12\x11\n\rOPEN_API_JSON\x10\x02\x12\x11\n\rOPEN_API_YAML\x10\x03\x12\x1d\n\x19\x46ILE_DESCRIPTOR_SET_PROTO\x10\x04\x12\x0e\n\nPROTO_FILE\x10\x06\"\x19\n\tConfigRef\x12\x0c\n\x04name\x18\x01 \x01(\t\"@\n\x0c\x43hangeReport\x12\x30\n\x0e\x63onfig_changes\x18\x01 \x03(\x0b\x32\x18.google.api.ConfigChange\"\xf9\x05\n\x07Rollout\x12\x17\n\nrollout_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\ncreated_by\x18\x03 \x01(\t\x12\x46\n\x06status\x18\x04 \x01(\x0e\x32\x36.google.api.servicemanagement.v1.Rollout.RolloutStatus\x12\x63\n\x18traffic_percent_strategy\x18\x05 \x01(\x0b\x32?.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategyH\x00\x12\x62\n\x17\x64\x65lete_service_strategy\x18\xc8\x01 \x01(\x0b\x32>.google.api.servicemanagement.v1.Rollout.DeleteServiceStrategyH\x00\x12\x14\n\x0cservice_name\x18\x08 \x01(\t\x1a\xb3\x01\n\x16TrafficPercentStrategy\x12\x65\n\x0bpercentages\x18\x01 \x03(\x0b\x32P.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.PercentagesEntry\x1a\x32\n\x10PercentagesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x17\n\x15\x44\x65leteServiceStrategy\"\x8d\x01\n\rRolloutStatus\x12\x1e\n\x1aROLLOUT_STATUS_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\x0b\n\x07SUCCESS\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0b\n\x07PENDING\x10\x05\x12\x16\n\x12\x46\x41ILED_ROLLED_BACK\x10\x06\x42\n\n\x08strategyB\x82\x02\n#com.google.api.servicemanagement.v1B\x0eResourcesProtoP\x01ZScloud.google.com/go/servicemanagement/apiv1/servicemanagementpb;servicemanagementpb\xa2\x02\x04GASM\xaa\x02!Google.Cloud.ServiceManagement.V1\xca\x02!Google\\Cloud\\ServiceManagement\\V1\xea\x02$Google::Cloud::ServiceManagement::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceManagement + module V1 + ManagedService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ManagedService").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.OperationMetadata").msgclass + OperationMetadata::Step = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.OperationMetadata.Step").msgclass + OperationMetadata::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.OperationMetadata.Status").enummodule + Diagnostic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Diagnostic").msgclass + Diagnostic::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Diagnostic.Kind").enummodule + ConfigSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ConfigSource").msgclass + ConfigFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ConfigFile").msgclass + ConfigFile::FileType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ConfigFile.FileType").enummodule + ConfigRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ConfigRef").msgclass + ChangeReport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ChangeReport").msgclass + Rollout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Rollout").msgclass + Rollout::TrafficPercentStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy").msgclass + Rollout::DeleteServiceStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy").msgclass + Rollout::RolloutStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Rollout.RolloutStatus").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_pb.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_pb.rb new file mode 100644 index 000000000000..6e78a42d7363 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/servicemanagement/v1/servicemanager.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/service_pb' +require 'google/api/servicemanagement/v1/resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/any_pb' +require 'google/protobuf/empty_pb' + + +descriptor_data = "\n4google/api/servicemanagement/v1/servicemanager.proto\x12\x1fgoogle.api.servicemanagement.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/api/service.proto\x1a/google/api/servicemanagement/v1/resources.proto\x1a#google/longrunning/operations.proto\x1a\x19google/protobuf/any.proto\x1a\x1bgoogle/protobuf/empty.proto\"r\n\x13ListServicesRequest\x12\x1b\n\x13producer_project_id\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\x12\x17\n\x0b\x63onsumer_id\x18\x07 \x01(\tB\x02\x18\x01\"r\n\x14ListServicesResponse\x12\x41\n\x08services\x18\x01 \x03(\x0b\x32/.google.api.servicemanagement.v1.ManagedService\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\".\n\x11GetServiceRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"]\n\x14\x43reateServiceRequest\x12\x45\n\x07service\x18\x01 \x01(\x0b\x32/.google.api.servicemanagement.v1.ManagedServiceB\x03\xe0\x41\x02\"1\n\x14\x44\x65leteServiceRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"3\n\x16UndeleteServiceRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"[\n\x17UndeleteServiceResponse\x12@\n\x07service\x18\x01 \x01(\x0b\x32/.google.api.servicemanagement.v1.ManagedService\"\xc2\x01\n\x17GetServiceConfigRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tconfig_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Q\n\x04view\x18\x03 \x01(\x0e\x32\x43.google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView\"!\n\nConfigView\x12\t\n\x05\x42\x41SIC\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\"]\n\x19ListServiceConfigsRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"c\n\x1aListServiceConfigsResponse\x12,\n\x0fservice_configs\x18\x01 \x03(\x0b\x32\x13.google.api.Service\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"i\n\x1a\x43reateServiceConfigRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x30\n\x0eservice_config\x18\x02 \x01(\x0b\x32\x13.google.api.ServiceB\x03\xe0\x41\x02\"\x9d\x01\n\x19SubmitConfigSourceRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12I\n\rconfig_source\x18\x02 \x01(\x0b\x32-.google.api.servicemanagement.v1.ConfigSourceB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"I\n\x1aSubmitConfigSourceResponse\x12+\n\x0eservice_config\x18\x01 \x01(\x0b\x32\x13.google.api.Service\"x\n\x1b\x43reateServiceRolloutRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12>\n\x07rollout\x18\x02 \x01(\x0b\x32(.google.api.servicemanagement.v1.RolloutB\x03\xe0\x41\x02\"s\n\x1aListServiceRolloutsRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x02\"r\n\x1bListServiceRolloutsResponse\x12:\n\x08rollouts\x18\x01 \x03(\x0b\x32(.google.api.servicemanagement.v1.Rollout\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x18GetServiceRolloutRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrollout_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x17\n\x15\x45nableServiceResponse\"{\n\x1bGenerateConfigReportRequest\x12-\n\nnew_config\x18\x01 \x01(\x0b\x32\x14.google.protobuf.AnyB\x03\xe0\x41\x02\x12-\n\nold_config\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyB\x03\xe0\x41\x01\"\xc9\x01\n\x1cGenerateConfigReportResponse\x12\x14\n\x0cservice_name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x45\n\x0e\x63hange_reports\x18\x03 \x03(\x0b\x32-.google.api.servicemanagement.v1.ChangeReport\x12@\n\x0b\x64iagnostics\x18\x04 \x03(\x0b\x32+.google.api.servicemanagement.v1.Diagnostic2\xc8\x19\n\x0eServiceManager\x12\xb3\x01\n\x0cListServices\x12\x34.google.api.servicemanagement.v1.ListServicesRequest\x1a\x35.google.api.servicemanagement.v1.ListServicesResponse\"6\xda\x41\x1fproducer_project_id,consumer_id\x82\xd3\xe4\x93\x02\x0e\x12\x0c/v1/services\x12\xa5\x01\n\nGetService\x12\x32.google.api.servicemanagement.v1.GetServiceRequest\x1a/.google.api.servicemanagement.v1.ManagedService\"2\xda\x41\x0cservice_name\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/services/{service_name}\x12\xf5\x01\n\rCreateService\x12\x35.google.api.servicemanagement.v1.CreateServiceRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41\x63\n.google.api.servicemanagement.v1.ManagedService\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41\x07service\x82\xd3\xe4\x93\x02\x17\"\x0c/v1/services:\x07service\x12\xe6\x01\n\rDeleteService\x12\x35.google.api.servicemanagement.v1.DeleteServiceRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41J\n\x15google.protobuf.Empty\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41\x0cservice_name\x82\xd3\xe4\x93\x02\x1d*\x1b/v1/services/{service_name}\x12\x96\x02\n\x0fUndeleteService\x12\x37.google.api.servicemanagement.v1.UndeleteServiceRequest\x1a\x1d.google.longrunning.Operation\"\xaa\x01\xca\x41l\n7google.api.servicemanagement.v1.UndeleteServiceResponse\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41\x0cservice_name\x82\xd3\xe4\x93\x02&\"$/v1/services/{service_name}:undelete\x12\xc9\x01\n\x12ListServiceConfigs\x12:.google.api.servicemanagement.v1.ListServiceConfigsRequest\x1a;.google.api.servicemanagement.v1.ListServiceConfigsResponse\":\xda\x41\x0cservice_name\x82\xd3\xe4\x93\x02%\x12#/v1/services/{service_name}/configs\x12\xde\x01\n\x10GetServiceConfig\x12\x38.google.api.servicemanagement.v1.GetServiceConfigRequest\x1a\x13.google.api.Service\"{\xda\x41\x1bservice_name,config_id,view\x82\xd3\xe4\x93\x02W\x12//v1/services/{service_name}/configs/{config_id}Z$\x12\"/v1/services/{service_name}/config\x12\xc2\x01\n\x13\x43reateServiceConfig\x12;.google.api.servicemanagement.v1.CreateServiceConfigRequest\x1a\x13.google.api.Service\"Y\xda\x41\x1bservice_name,service_config\x82\xd3\xe4\x93\x02\x35\"#/v1/services/{service_name}/configs:\x0eservice_config\x12\xc4\x02\n\x12SubmitConfigSource\x12:.google.api.servicemanagement.v1.SubmitConfigSourceRequest\x1a\x1d.google.longrunning.Operation\"\xd2\x01\xca\x41o\n:google.api.servicemanagement.v1.SubmitConfigSourceResponse\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41(service_name,config_source,validate_only\x82\xd3\xe4\x93\x02/\"*/v1/services/{service_name}/configs:submit:\x01*\x12\xd4\x01\n\x13ListServiceRollouts\x12;.google.api.servicemanagement.v1.ListServiceRolloutsRequest\x1a<.google.api.servicemanagement.v1.ListServiceRolloutsResponse\"B\xda\x41\x13service_name,filter\x82\xd3\xe4\x93\x02&\x12$/v1/services/{service_name}/rollouts\x12\xcd\x01\n\x11GetServiceRollout\x12\x39.google.api.servicemanagement.v1.GetServiceRolloutRequest\x1a(.google.api.servicemanagement.v1.Rollout\"S\xda\x41\x17service_name,rollout_id\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/services/{service_name}/rollouts/{rollout_id}\x12\xa1\x02\n\x14\x43reateServiceRollout\x12<.google.api.servicemanagement.v1.CreateServiceRolloutRequest\x1a\x1d.google.longrunning.Operation\"\xab\x01\xca\x41\\\n\'google.api.servicemanagement.v1.Rollout\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41\x14service_name,rollout\x82\xd3\xe4\x93\x02/\"$/v1/services/{service_name}/rollouts:\x07rollout\x12\xd9\x01\n\x14GenerateConfigReport\x12<.google.api.servicemanagement.v1.GenerateConfigReportRequest\x1a=.google.api.servicemanagement.v1.GenerateConfigReportResponse\"D\xda\x41\x15new_config,old_config\x82\xd3\xe4\x93\x02&\"!/v1/services:generateConfigReport:\x01*\x1a\xfd\x01\xca\x41 servicemanagement.googleapis.com\xd2\x41\xd6\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/service.management,https://www.googleapis.com/auth/service.management.readonlyB\x87\x02\n#com.google.api.servicemanagement.v1B\x13ServiceManagerProtoP\x01ZScloud.google.com/go/servicemanagement/apiv1/servicemanagementpb;servicemanagementpb\xa2\x02\x04GASM\xaa\x02!Google.Cloud.ServiceManagement.V1\xca\x02!Google\\Cloud\\ServiceManagement\\V1\xea\x02$Google::Cloud::ServiceManagement::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceManagement + module V1 + ListServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServicesRequest").msgclass + ListServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServicesResponse").msgclass + GetServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GetServiceRequest").msgclass + CreateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.CreateServiceRequest").msgclass + DeleteServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.DeleteServiceRequest").msgclass + UndeleteServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.UndeleteServiceRequest").msgclass + UndeleteServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.UndeleteServiceResponse").msgclass + GetServiceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GetServiceConfigRequest").msgclass + GetServiceConfigRequest::ConfigView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView").enummodule + ListServiceConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceConfigsRequest").msgclass + ListServiceConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceConfigsResponse").msgclass + CreateServiceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.CreateServiceConfigRequest").msgclass + SubmitConfigSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.SubmitConfigSourceRequest").msgclass + SubmitConfigSourceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.SubmitConfigSourceResponse").msgclass + CreateServiceRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.CreateServiceRolloutRequest").msgclass + ListServiceRolloutsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceRolloutsRequest").msgclass + ListServiceRolloutsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceRolloutsResponse").msgclass + GetServiceRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GetServiceRolloutRequest").msgclass + EnableServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.EnableServiceResponse").msgclass + GenerateConfigReportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GenerateConfigReportRequest").msgclass + GenerateConfigReportResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GenerateConfigReportResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_services_pb.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_services_pb.rb new file mode 100644 index 000000000000..12d089c4f77e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_services_pb.rb @@ -0,0 +1,143 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/api/servicemanagement/v1/servicemanager.proto for package 'Google.Cloud.ServiceManagement.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/api/servicemanagement/v1/servicemanager_pb' + +module Google + module Cloud + module ServiceManagement + module V1 + module ServiceManager + # [Google Service Management + # API](https://cloud.google.com/service-infrastructure/docs/overview) + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.api.servicemanagement.v1.ServiceManager' + + # Lists managed services. + # + # Returns all public services. For authenticated users, also returns all + # services the calling user has "servicemanagement.services.get" permission + # for. + rpc :ListServices, ::Google::Cloud::ServiceManagement::V1::ListServicesRequest, ::Google::Cloud::ServiceManagement::V1::ListServicesResponse + # Gets a managed service. Authentication is required unless the service is + # public. + rpc :GetService, ::Google::Cloud::ServiceManagement::V1::GetServiceRequest, ::Google::Cloud::ServiceManagement::V1::ManagedService + # Creates a new managed service. + # + # A managed service is immutable, and is subject to mandatory 30-day + # data retention. You cannot move a service or recreate it within 30 days + # after deletion. + # + # One producer project can own no more than 500 services. For security and + # reliability purposes, a production service should be hosted in a + # dedicated producer project. + # + # Operation + rpc :CreateService, ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, ::Google::Longrunning::Operation + # Deletes a managed service. This method will change the service to the + # `Soft-Delete` state for 30 days. Within this period, service producers may + # call + # [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] + # to restore the service. After 30 days, the service will be permanently + # deleted. + # + # Operation + rpc :DeleteService, ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, ::Google::Longrunning::Operation + # Revives a previously deleted managed service. The method restores the + # service using the configuration at the time the service was deleted. + # The target service must exist and must have been deleted within the + # last 30 days. + # + # Operation + rpc :UndeleteService, ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, ::Google::Longrunning::Operation + # Lists the history of the service configuration for a managed service, + # from the newest to the oldest. + rpc :ListServiceConfigs, ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse + # Gets a service configuration (version) for a managed service. + rpc :GetServiceConfig, ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, ::Google::Api::Service + # Creates a new service configuration (version) for a managed service. + # This method only stores the service configuration. To roll out the service + # configuration to backend systems please call + # [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. + # + # Only the 100 most recent service configurations and ones referenced by + # existing rollouts are kept for each service. The rest will be deleted + # eventually. + rpc :CreateServiceConfig, ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, ::Google::Api::Service + # Creates a new service configuration (version) for a managed service based + # on + # user-supplied configuration source files (for example: OpenAPI + # Specification). This method stores the source configurations as well as the + # generated service configuration. To rollout the service configuration to + # other services, + # please call + # [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. + # + # Only the 100 most recent configuration sources and ones referenced by + # existing service configurtions are kept for each service. The rest will be + # deleted eventually. + # + # Operation + rpc :SubmitConfigSource, ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, ::Google::Longrunning::Operation + # Lists the history of the service configuration rollouts for a managed + # service, from the newest to the oldest. + rpc :ListServiceRollouts, ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse + # Gets a service configuration + # [rollout][google.api.servicemanagement.v1.Rollout]. + rpc :GetServiceRollout, ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, ::Google::Cloud::ServiceManagement::V1::Rollout + # Creates a new service configuration rollout. Based on rollout, the + # Google Service Management will roll out the service configurations to + # different backend services. For example, the logging configuration will be + # pushed to Google Cloud Logging. + # + # Please note that any previous pending and running Rollouts and associated + # Operations will be automatically cancelled so that the latest Rollout will + # not be blocked by previous Rollouts. + # + # Only the 100 most recent (in any state) and the last 10 successful (if not + # already part of the set of 100 most recent) rollouts are kept for each + # service. The rest will be deleted eventually. + # + # Operation + rpc :CreateServiceRollout, ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, ::Google::Longrunning::Operation + # Generates and returns a report (errors, warnings and changes from + # existing configurations) associated with + # GenerateConfigReportRequest.new_value + # + # If GenerateConfigReportRequest.old_value is specified, + # GenerateConfigReportRequest will contain a single ChangeReport based on the + # comparison between GenerateConfigReportRequest.new_value and + # GenerateConfigReportRequest.old_value. + # If GenerateConfigReportRequest.old_value is not specified, this method + # will compare GenerateConfigReportRequest.new_value with the last pushed + # service configuration. + rpc :GenerateConfigReport, ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1.rb new file mode 100644 index 000000000000..741429ff6b3d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/service_management/v1/service_manager" +require "google/cloud/service_management/v1/version" + +module Google + module Cloud + module ServiceManagement + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/service_management/v1" + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/service_management/v1" + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/service_management/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/bindings_override.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/bindings_override.rb new file mode 100644 index 000000000000..8f225f8662b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/bindings_override.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! + +require "gapic/rest" + +module Google + module Cloud + module ServiceManagement + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/service_management/v1/rest" + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceManagement"] + parent_config = while namespace.any? + parent_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.iam.v1.IAMPolicy.GetIamPolicy"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^services/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^services/[^/]+/consumers/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^services/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^services/[^/]+/consumers/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^services/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^services/[^/]+/consumers/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/rest.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/rest.rb new file mode 100644 index 000000000000..76294f210607 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/service_management/v1/service_manager/rest" +require "google/cloud/service_management/v1/bindings_override" +require "google/cloud/service_management/v1/version" + +module Google + module Cloud + module ServiceManagement + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/service_management/v1/rest" + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager.rb new file mode 100644 index 000000000000..675475e70222 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager.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/service_management/v1/version" + +require "google/cloud/service_management/v1/service_manager/credentials" +require "google/cloud/service_management/v1/service_manager/operations" +require "google/cloud/service_management/v1/service_manager/client" +require "google/cloud/service_management/v1/service_manager/rest" + +module Google + module Cloud + module ServiceManagement + module V1 + ## + # [Google Service Management + # API](https://cloud.google.com/service-infrastructure/docs/overview) + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/service_management/v1/service_manager" + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/service_management/v1/service_manager/rest" + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + module ServiceManager + end + end + end + end +end + +helper_path = ::File.join __dir__, "service_manager", "helpers.rb" +require "google/cloud/service_management/v1/service_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb new file mode 100644 index 000000000000..213d744ba0b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb @@ -0,0 +1,1809 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/api/servicemanagement/v1/servicemanager_pb" +require "google/iam/v1" + +module Google + module Cloud + module ServiceManagement + module V1 + module ServiceManager + ## + # Client for the ServiceManager service. + # + # [Google Service Management + # API](https://cloud.google.com/service-infrastructure/docs/overview) + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicemanagement.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :service_manager_stub + + ## + # Configure the ServiceManager Client class. + # + # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServiceManager clients + # ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceManagement", "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 = 10.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServiceManager Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @service_manager_stub.universe_domain + end + + ## + # Create a new ServiceManager client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServiceManager 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/api/servicemanagement/v1/servicemanager_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 + + @service_manager_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ServiceManagement::V1::ServiceManager::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 + ) + + @service_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 + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @service_manager_stub.endpoint + config.universe_domain = @service_manager_stub.universe_domain + config.logger = @service_manager_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ServiceManagement::V1::ServiceManager::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @service_manager_stub.logger + end + + # Service calls + + ## + # Lists managed services. + # + # Returns all public services. For authenticated users, also returns all + # services the calling user has "servicemanagement.services.get" permission + # for. + # + # @overload list_services(request, options = nil) + # Pass arguments to `list_services` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::ListServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::ListServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_services(producer_project_id: nil, page_size: nil, page_token: nil, consumer_id: nil) + # Pass arguments to `list_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param producer_project_id [::String] + # Include services produced by the specified project. + # @param page_size [::Integer] + # The max number of items to include in the response list. Page size is 50 + # if not specified. Maximum value is 500. + # @param page_token [::String] + # Token identifying which result to start with; returned by a previous list + # call. + # @param consumer_id [::String] + # Include services consumed by the specified consumer. + # + # The Google Service Management implementation accepts the following + # forms: + # - project: + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::ListServicesRequest.new + # + # # Call the list_services method. + # result = client.list_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceManagement::V1::ManagedService. + # p item + # end + # + def list_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_services.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :list_services, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @service_manager_stub, :list_services, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a managed service. Authentication is required unless the service is + # public. + # + # @overload get_service(request, options = nil) + # Pass arguments to `get_service` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::GetServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_service(service_name: nil) + # Pass arguments to `get_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the `ServiceManager` overview for + # naming requirements. For example: `example.googleapis.com`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceManagement::V1::ManagedService] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::GetServiceRequest.new + # + # # Call the get_service method. + # result = client.get_service request + # + # # The returned object is of type Google::Cloud::ServiceManagement::V1::ManagedService. + # p result + # + def get_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :get_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new managed service. + # + # A managed service is immutable, and is subject to mandatory 30-day + # data retention. You cannot move a service or recreate it within 30 days + # after deletion. + # + # One producer project can own no more than 500 services. For security and + # reliability purposes, a production service should be hosted in a + # dedicated producer project. + # + # Operation + # + # @overload create_service(request, options = nil) + # Pass arguments to `create_service` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::CreateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_service(service: nil) + # Pass arguments to `create_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service [::Google::Cloud::ServiceManagement::V1::ManagedService, ::Hash] + # Required. Initial values for the service 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/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new + # + # # Call the create_service method. + # result = client.create_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest + + # Converts hash and nil to 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :create_service, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 managed service. This method will change the service to the + # `Soft-Delete` state for 30 days. Within this period, service producers may + # call + # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service UndeleteService} + # to restore the service. After 30 days, the service will be permanently + # deleted. + # + # Operation + # + # @overload delete_service(request, options = nil) + # Pass arguments to `delete_service` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_service(service_name: nil) + # Pass arguments to `delete_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new + # + # # Call the delete_service method. + # result = client.delete_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :delete_service, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Revives a previously deleted managed service. The method restores the + # service using the configuration at the time the service was deleted. + # The target service must exist and must have been deleted within the + # last 30 days. + # + # Operation + # + # @overload undelete_service(request, options = nil) + # Pass arguments to `undelete_service` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_service(service_name: nil) + # Pass arguments to `undelete_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new + # + # # Call the undelete_service method. + # result = client.undelete_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.undelete_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.undelete_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :undelete_service, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 the history of the service configuration for a managed service, + # from the newest to the oldest. + # + # @overload list_service_configs(request, options = nil) + # Pass arguments to `list_service_configs` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_service_configs(service_name: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_service_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param page_token [::String] + # The token of the page to retrieve. + # @param page_size [::Integer] + # The max number of items to include in the response list. Page size is 50 + # if not specified. Maximum value is 100. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Api::Service>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Api::Service>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new + # + # # Call the list_service_configs method. + # result = client.list_service_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Api::Service. + # p item + # end + # + def list_service_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_service_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_service_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_service_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :list_service_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @service_manager_stub, :list_service_configs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a service configuration (version) for a managed service. + # + # @overload get_service_config(request, options = nil) + # Pass arguments to `get_service_config` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_service_config(service_name: nil, config_id: nil, view: nil) + # Pass arguments to `get_service_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 service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param config_id [::String] + # Required. The id of the service configuration resource. + # + # This field must be specified for the server to return all fields, including + # `SourceInfo`. + # @param view [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest::ConfigView] + # Specifies which parts of the Service Config should be returned in the + # response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Api::Service] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Api::Service] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new + # + # # Call the get_service_config method. + # result = client.get_service_config request + # + # # The returned object is of type Google::Api::Service. + # p result + # + def get_service_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_service_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::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + if request.config_id + header_params["config_id"] = request.config_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_service_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_service_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :get_service_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new service configuration (version) for a managed service. + # This method only stores the service configuration. To roll out the service + # configuration to backend systems please call + # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout CreateServiceRollout}. + # + # Only the 100 most recent service configurations and ones referenced by + # existing rollouts are kept for each service. The rest will be deleted + # eventually. + # + # @overload create_service_config(request, options = nil) + # Pass arguments to `create_service_config` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_service_config(service_name: nil, service_config: nil) + # Pass arguments to `create_service_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 service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param service_config [::Google::Api::Service, ::Hash] + # Required. The service configuration resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Api::Service] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Api::Service] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new + # + # # Call the create_service_config method. + # result = client.create_service_config request + # + # # The returned object is of type Google::Api::Service. + # p result + # + def create_service_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest + + # Converts hash and nil to 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_service_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::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_service_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_service_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :create_service_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new service configuration (version) for a managed service based + # on + # user-supplied configuration source files (for example: OpenAPI + # Specification). This method stores the source configurations as well as the + # generated service configuration. To rollout the service configuration to + # other services, + # please call + # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout CreateServiceRollout}. + # + # Only the 100 most recent configuration sources and ones referenced by + # existing service configurtions are kept for each service. The rest will be + # deleted eventually. + # + # Operation + # + # @overload submit_config_source(request, options = nil) + # Pass arguments to `submit_config_source` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload submit_config_source(service_name: nil, config_source: nil, validate_only: nil) + # Pass arguments to `submit_config_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param config_source [::Google::Cloud::ServiceManagement::V1::ConfigSource, ::Hash] + # Required. The source configuration for the service. + # @param validate_only [::Boolean] + # Optional. If set, this will result in the generation of a + # `google.api.Service` configuration based on the `ConfigSource` provided, + # but the generated config and the sources will NOT be persisted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new + # + # # Call the submit_config_source method. + # result = client.submit_config_source request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def submit_config_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.submit_config_source.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.submit_config_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.submit_config_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :submit_config_source, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 the history of the service configuration rollouts for a managed + # service, from the newest to the oldest. + # + # @overload list_service_rollouts(request, options = nil) + # Pass arguments to `list_service_rollouts` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_service_rollouts(service_name: nil, page_token: nil, page_size: nil, filter: nil) + # Pass arguments to `list_service_rollouts` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param page_token [::String] + # The token of the page to retrieve. + # @param page_size [::Integer] + # The max number of items to include in the response list. Page size is 50 + # if not specified. Maximum value is 100. + # @param filter [::String] + # Required. Use `filter` to return subset of rollouts. + # The following filters are supported: + # + # -- By [status] + # [google.api.servicemanagement.v1.Rollout.RolloutStatus]. For example, + # `filter='status=SUCCESS'` + # + # -- By [strategy] + # [google.api.servicemanagement.v1.Rollout.strategy]. For example, + # `filter='strategy=TrafficPercentStrategy'` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new + # + # # Call the list_service_rollouts method. + # result = client.list_service_rollouts request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceManagement::V1::Rollout. + # p item + # end + # + def list_service_rollouts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_service_rollouts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_service_rollouts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_service_rollouts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :list_service_rollouts, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @service_manager_stub, :list_service_rollouts, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a service configuration + # {::Google::Cloud::ServiceManagement::V1::Rollout rollout}. + # + # @overload get_service_rollout(request, options = nil) + # Pass arguments to `get_service_rollout` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_service_rollout(service_name: nil, rollout_id: nil) + # Pass arguments to `get_service_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param rollout_id [::String] + # Required. The id of the rollout resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceManagement::V1::Rollout] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceManagement::V1::Rollout] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new + # + # # Call the get_service_rollout method. + # result = client.get_service_rollout request + # + # # The returned object is of type Google::Cloud::ServiceManagement::V1::Rollout. + # p result + # + def get_service_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_service_rollout.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + if request.rollout_id + header_params["rollout_id"] = request.rollout_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_service_rollout.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_service_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :get_service_rollout, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new service configuration rollout. Based on rollout, the + # Google Service Management will roll out the service configurations to + # different backend services. For example, the logging configuration will be + # pushed to Google Cloud Logging. + # + # Please note that any previous pending and running Rollouts and associated + # Operations will be automatically cancelled so that the latest Rollout will + # not be blocked by previous Rollouts. + # + # Only the 100 most recent (in any state) and the last 10 successful (if not + # already part of the set of 100 most recent) rollouts are kept for each + # service. The rest will be deleted eventually. + # + # Operation + # + # @overload create_service_rollout(request, options = nil) + # Pass arguments to `create_service_rollout` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_service_rollout(service_name: nil, rollout: nil) + # Pass arguments to `create_service_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param rollout [::Google::Cloud::ServiceManagement::V1::Rollout, ::Hash] + # Required. The rollout resource. The `service_name` field is output only. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new + # + # # Call the create_service_rollout method. + # result = client.create_service_rollout request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_service_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest + + # Converts hash and nil to 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_service_rollout.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.service_name + header_params["service_name"] = request.service_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_service_rollout.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_service_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :create_service_rollout, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Generates and returns a report (errors, warnings and changes from + # existing configurations) associated with + # GenerateConfigReportRequest.new_value + # + # If GenerateConfigReportRequest.old_value is specified, + # GenerateConfigReportRequest will contain a single ChangeReport based on the + # comparison between GenerateConfigReportRequest.new_value and + # GenerateConfigReportRequest.old_value. + # If GenerateConfigReportRequest.old_value is not specified, this method + # will compare GenerateConfigReportRequest.new_value with the last pushed + # service configuration. + # + # @overload generate_config_report(request, options = nil) + # Pass arguments to `generate_config_report` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_config_report(new_config: nil, old_config: nil) + # Pass arguments to `generate_config_report` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param new_config [::Google::Protobuf::Any, ::Hash] + # Required. Service configuration for which we want to generate the report. + # For this version of API, the supported types are + # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, + # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, + # and {::Google::Api::Service google.api.Service} + # @param old_config [::Google::Protobuf::Any, ::Hash] + # Optional. Service configuration against which the comparison will be done. + # For this version of API, the supported types are + # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, + # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, + # and {::Google::Api::Service google.api.Service} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new + # + # # Call the generate_config_report method. + # result = client.generate_config_report request + # + # # The returned object is of type Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse. + # p result + # + def generate_config_report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_config_report.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::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.generate_config_report.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_config_report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.call_rpc :generate_config_report, request, 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 ServiceManager API. + # + # This class represents the configuration for ServiceManager, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_services to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_services.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_services.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::ServiceManagement::V1::ServiceManager::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicemanagement.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ServiceManager API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_services + ## + # RPC-specific configuration for `get_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service + ## + # RPC-specific configuration for `create_service` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service + ## + # RPC-specific configuration for `delete_service` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_service + ## + # RPC-specific configuration for `undelete_service` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_service + ## + # RPC-specific configuration for `list_service_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_service_configs + ## + # RPC-specific configuration for `get_service_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service_config + ## + # RPC-specific configuration for `create_service_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service_config + ## + # RPC-specific configuration for `submit_config_source` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_config_source + ## + # RPC-specific configuration for `list_service_rollouts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_service_rollouts + ## + # RPC-specific configuration for `get_service_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service_rollout + ## + # RPC-specific configuration for `create_service_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service_rollout + ## + # RPC-specific configuration for `generate_config_report` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_config_report + + # @private + def initialize parent_rpcs = nil + list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services + @list_services = ::Gapic::Config::Method.new list_services_config + get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service + @get_service = ::Gapic::Config::Method.new get_service_config + create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service + @create_service = ::Gapic::Config::Method.new create_service_config + delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service + @delete_service = ::Gapic::Config::Method.new delete_service_config + undelete_service_config = parent_rpcs.undelete_service if parent_rpcs.respond_to? :undelete_service + @undelete_service = ::Gapic::Config::Method.new undelete_service_config + list_service_configs_config = parent_rpcs.list_service_configs if parent_rpcs.respond_to? :list_service_configs + @list_service_configs = ::Gapic::Config::Method.new list_service_configs_config + get_service_config_config = parent_rpcs.get_service_config if parent_rpcs.respond_to? :get_service_config + @get_service_config = ::Gapic::Config::Method.new get_service_config_config + create_service_config_config = parent_rpcs.create_service_config if parent_rpcs.respond_to? :create_service_config + @create_service_config = ::Gapic::Config::Method.new create_service_config_config + submit_config_source_config = parent_rpcs.submit_config_source if parent_rpcs.respond_to? :submit_config_source + @submit_config_source = ::Gapic::Config::Method.new submit_config_source_config + list_service_rollouts_config = parent_rpcs.list_service_rollouts if parent_rpcs.respond_to? :list_service_rollouts + @list_service_rollouts = ::Gapic::Config::Method.new list_service_rollouts_config + get_service_rollout_config = parent_rpcs.get_service_rollout if parent_rpcs.respond_to? :get_service_rollout + @get_service_rollout = ::Gapic::Config::Method.new get_service_rollout_config + create_service_rollout_config = parent_rpcs.create_service_rollout if parent_rpcs.respond_to? :create_service_rollout + @create_service_rollout = ::Gapic::Config::Method.new create_service_rollout_config + generate_config_report_config = parent_rpcs.generate_config_report if parent_rpcs.respond_to? :generate_config_report + @generate_config_report = ::Gapic::Config::Method.new generate_config_report_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/credentials.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/credentials.rb new file mode 100644 index 000000000000..a4c9815cf939 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/credentials.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 ServiceManagement + module V1 + module ServiceManager + # Credentials for the ServiceManager API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management", + "https://www.googleapis.com/auth/service.management.readonly" + ] + self.env_vars = [ + "SERVICE_MANAGEMENT_CREDENTIALS", + "SERVICE_MANAGEMENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SERVICE_MANAGEMENT_CREDENTIALS_JSON", + "SERVICE_MANAGEMENT_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-service_management-v1/lib/google/cloud/service_management/v1/service_manager/operations.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/operations.rb new file mode 100644 index 000000000000..317a9ec8ac81 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/operations.rb @@ -0,0 +1,833 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 ServiceManagement + module V1 + module ServiceManager + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicemanagement.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ServiceManager 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 ServiceManager 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::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_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::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::ServiceManagement::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::ServiceManagement::V1::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 = "servicemanagement.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest.rb new file mode 100644 index 000000000000..7c6d55e49768 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/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/service_management/v1/version" +require "google/cloud/service_management/v1/bindings_override" + +require "google/cloud/service_management/v1/service_manager/credentials" +require "google/cloud/service_management/v1/service_manager/rest/operations" +require "google/cloud/service_management/v1/service_manager/rest/client" + +module Google + module Cloud + module ServiceManagement + module V1 + ## + # [Google Service Management + # API](https://cloud.google.com/service-infrastructure/docs/overview) + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/service_management/v1/service_manager/rest" + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + module ServiceManager + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/service_management/v1/service_manager/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb new file mode 100644 index 000000000000..66dbe7e1c257 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb @@ -0,0 +1,1701 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/api/servicemanagement/v1/servicemanager_pb" +require "google/cloud/service_management/v1/service_manager/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module ServiceManagement + module V1 + module ServiceManager + module Rest + ## + # REST client for the ServiceManager service. + # + # [Google Service Management + # API](https://cloud.google.com/service-infrastructure/docs/overview) + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicemanagement.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :service_manager_stub + + ## + # Configure the ServiceManager Client class. + # + # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServiceManager clients + # ::Google::Cloud::ServiceManagement::V1::ServiceManager::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", "ServiceManagement", "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 = 10.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServiceManager Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::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 + @service_manager_stub.universe_domain + end + + ## + # Create a new ServiceManager REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServiceManager 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::ServiceManagement::V1::ServiceManager::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 + + @service_manager_stub = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @service_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 + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @service_manager_stub.endpoint + config.universe_domain = @service_manager_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @service_manager_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @service_manager_stub.logger + end + + # Service calls + + ## + # Lists managed services. + # + # Returns all public services. For authenticated users, also returns all + # services the calling user has "servicemanagement.services.get" permission + # for. + # + # @overload list_services(request, options = nil) + # Pass arguments to `list_services` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::ListServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::ListServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_services(producer_project_id: nil, page_size: nil, page_token: nil, consumer_id: nil) + # Pass arguments to `list_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param producer_project_id [::String] + # Include services produced by the specified project. + # @param page_size [::Integer] + # The max number of items to include in the response list. Page size is 50 + # if not specified. Maximum value is 500. + # @param page_token [::String] + # Token identifying which result to start with; returned by a previous list + # call. + # @param consumer_id [::String] + # Include services consumed by the specified consumer. + # + # The Google Service Management implementation accepts the following + # forms: + # - project: + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::ListServicesRequest.new + # + # # Call the list_services method. + # result = client.list_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceManagement::V1::ManagedService. + # p item + # end + # + def list_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_services.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.list_services request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @service_manager_stub, :list_services, "services", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a managed service. Authentication is required unless the service is + # public. + # + # @overload get_service(request, options = nil) + # Pass arguments to `get_service` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::GetServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_service(service_name: nil) + # Pass arguments to `get_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the `ServiceManager` overview for + # naming requirements. For example: `example.googleapis.com`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ManagedService] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::GetServiceRequest.new + # + # # Call the get_service method. + # result = client.get_service request + # + # # The returned object is of type Google::Cloud::ServiceManagement::V1::ManagedService. + # p result + # + def get_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.get_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new managed service. + # + # A managed service is immutable, and is subject to mandatory 30-day + # data retention. You cannot move a service or recreate it within 30 days + # after deletion. + # + # One producer project can own no more than 500 services. For security and + # reliability purposes, a production service should be hosted in a + # dedicated producer project. + # + # Operation + # + # @overload create_service(request, options = nil) + # Pass arguments to `create_service` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::CreateServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_service(service: nil) + # Pass arguments to `create_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service [::Google::Cloud::ServiceManagement::V1::ManagedService, ::Hash] + # Required. Initial values for the service 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/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new + # + # # Call the create_service method. + # result = client.create_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest + + # Converts hash and nil to an 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_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.create_service request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 managed service. This method will change the service to the + # `Soft-Delete` state for 30 days. Within this period, service producers may + # call + # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client#undelete_service UndeleteService} + # to restore the service. After 30 days, the service will be permanently + # deleted. + # + # Operation + # + # @overload delete_service(request, options = nil) + # Pass arguments to `delete_service` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_service(service_name: nil) + # Pass arguments to `delete_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new + # + # # Call the delete_service method. + # result = client.delete_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.delete_service request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Revives a previously deleted managed service. The method restores the + # service using the configuration at the time the service was deleted. + # The target service must exist and must have been deleted within the + # last 30 days. + # + # Operation + # + # @overload undelete_service(request, options = nil) + # Pass arguments to `undelete_service` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_service(service_name: nil) + # Pass arguments to `undelete_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new + # + # # Call the undelete_service method. + # result = client.undelete_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.undelete_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.undelete_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.undelete_service request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the history of the service configuration for a managed service, + # from the newest to the oldest. + # + # @overload list_service_configs(request, options = nil) + # Pass arguments to `list_service_configs` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_service_configs(service_name: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_service_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param page_token [::String] + # The token of the page to retrieve. + # @param page_size [::Integer] + # The max number of items to include in the response list. Page size is 50 + # if not specified. Maximum value is 100. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Api::Service>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Api::Service>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new + # + # # Call the list_service_configs method. + # result = client.list_service_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Api::Service. + # p item + # end + # + def list_service_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_service_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_service_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_service_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.list_service_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @service_manager_stub, :list_service_configs, "service_configs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a service configuration (version) for a managed service. + # + # @overload get_service_config(request, options = nil) + # Pass arguments to `get_service_config` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_service_config(service_name: nil, config_id: nil, view: nil) + # Pass arguments to `get_service_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 service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param config_id [::String] + # Required. The id of the service configuration resource. + # + # This field must be specified for the server to return all fields, including + # `SourceInfo`. + # @param view [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest::ConfigView] + # Specifies which parts of the Service Config should be returned in the + # response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Api::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::Service] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new + # + # # Call the get_service_config method. + # result = client.get_service_config request + # + # # The returned object is of type Google::Api::Service. + # p result + # + def get_service_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_service_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::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_service_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_service_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.get_service_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new service configuration (version) for a managed service. + # This method only stores the service configuration. To roll out the service + # configuration to backend systems please call + # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client#create_service_rollout CreateServiceRollout}. + # + # Only the 100 most recent service configurations and ones referenced by + # existing rollouts are kept for each service. The rest will be deleted + # eventually. + # + # @overload create_service_config(request, options = nil) + # Pass arguments to `create_service_config` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_service_config(service_name: nil, service_config: nil) + # Pass arguments to `create_service_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 service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param service_config [::Google::Api::Service, ::Hash] + # Required. The service configuration resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Api::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::Service] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new + # + # # Call the create_service_config method. + # result = client.create_service_config request + # + # # The returned object is of type Google::Api::Service. + # p result + # + def create_service_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest + + # Converts hash and nil to an 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_service_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::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_service_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_service_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.create_service_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new service configuration (version) for a managed service based + # on + # user-supplied configuration source files (for example: OpenAPI + # Specification). This method stores the source configurations as well as the + # generated service configuration. To rollout the service configuration to + # other services, + # please call + # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client#create_service_rollout CreateServiceRollout}. + # + # Only the 100 most recent configuration sources and ones referenced by + # existing service configurtions are kept for each service. The rest will be + # deleted eventually. + # + # Operation + # + # @overload submit_config_source(request, options = nil) + # Pass arguments to `submit_config_source` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload submit_config_source(service_name: nil, config_source: nil, validate_only: nil) + # Pass arguments to `submit_config_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param config_source [::Google::Cloud::ServiceManagement::V1::ConfigSource, ::Hash] + # Required. The source configuration for the service. + # @param validate_only [::Boolean] + # Optional. If set, this will result in the generation of a + # `google.api.Service` configuration based on the `ConfigSource` provided, + # but the generated config and the sources will NOT be persisted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new + # + # # Call the submit_config_source method. + # result = client.submit_config_source request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def submit_config_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.submit_config_source.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.submit_config_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.submit_config_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.submit_config_source request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the history of the service configuration rollouts for a managed + # service, from the newest to the oldest. + # + # @overload list_service_rollouts(request, options = nil) + # Pass arguments to `list_service_rollouts` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_service_rollouts(service_name: nil, page_token: nil, page_size: nil, filter: nil) + # Pass arguments to `list_service_rollouts` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param page_token [::String] + # The token of the page to retrieve. + # @param page_size [::Integer] + # The max number of items to include in the response list. Page size is 50 + # if not specified. Maximum value is 100. + # @param filter [::String] + # Required. Use `filter` to return subset of rollouts. + # The following filters are supported: + # + # -- By [status] + # [google.api.servicemanagement.v1.Rollout.RolloutStatus]. For example, + # `filter='status=SUCCESS'` + # + # -- By [strategy] + # [google.api.servicemanagement.v1.Rollout.strategy]. For example, + # `filter='strategy=TrafficPercentStrategy'` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new + # + # # Call the list_service_rollouts method. + # result = client.list_service_rollouts request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceManagement::V1::Rollout. + # p item + # end + # + def list_service_rollouts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_service_rollouts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_service_rollouts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_service_rollouts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.list_service_rollouts request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @service_manager_stub, :list_service_rollouts, "rollouts", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a service configuration + # {::Google::Cloud::ServiceManagement::V1::Rollout rollout}. + # + # @overload get_service_rollout(request, options = nil) + # Pass arguments to `get_service_rollout` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_service_rollout(service_name: nil, rollout_id: nil) + # Pass arguments to `get_service_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param rollout_id [::String] + # Required. The id of the rollout resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceManagement::V1::Rollout] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceManagement::V1::Rollout] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new + # + # # Call the get_service_rollout method. + # result = client.get_service_rollout request + # + # # The returned object is of type Google::Cloud::ServiceManagement::V1::Rollout. + # p result + # + def get_service_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_service_rollout.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_service_rollout.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_service_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.get_service_rollout request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new service configuration rollout. Based on rollout, the + # Google Service Management will roll out the service configurations to + # different backend services. For example, the logging configuration will be + # pushed to Google Cloud Logging. + # + # Please note that any previous pending and running Rollouts and associated + # Operations will be automatically cancelled so that the latest Rollout will + # not be blocked by previous Rollouts. + # + # Only the 100 most recent (in any state) and the last 10 successful (if not + # already part of the set of 100 most recent) rollouts are kept for each + # service. The rest will be deleted eventually. + # + # Operation + # + # @overload create_service_rollout(request, options = nil) + # Pass arguments to `create_service_rollout` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_service_rollout(service_name: nil, rollout: nil) + # Pass arguments to `create_service_rollout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param service_name [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @param rollout [::Google::Cloud::ServiceManagement::V1::Rollout, ::Hash] + # Required. The rollout resource. The `service_name` field is output only. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new + # + # # Call the create_service_rollout method. + # result = client.create_service_rollout request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_service_rollout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest + + # Converts hash and nil to an 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_service_rollout.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_service_rollout.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_service_rollout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.create_service_rollout request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Generates and returns a report (errors, warnings and changes from + # existing configurations) associated with + # GenerateConfigReportRequest.new_value + # + # If GenerateConfigReportRequest.old_value is specified, + # GenerateConfigReportRequest will contain a single ChangeReport based on the + # comparison between GenerateConfigReportRequest.new_value and + # GenerateConfigReportRequest.old_value. + # If GenerateConfigReportRequest.old_value is not specified, this method + # will compare GenerateConfigReportRequest.new_value with the last pushed + # service configuration. + # + # @overload generate_config_report(request, options = nil) + # Pass arguments to `generate_config_report` via a request object, either of type + # {::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload generate_config_report(new_config: nil, old_config: nil) + # Pass arguments to `generate_config_report` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param new_config [::Google::Protobuf::Any, ::Hash] + # Required. Service configuration for which we want to generate the report. + # For this version of API, the supported types are + # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, + # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, + # and {::Google::Api::Service google.api.Service} + # @param old_config [::Google::Protobuf::Any, ::Hash] + # Optional. Service configuration against which the comparison will be done. + # For this version of API, the supported types are + # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, + # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, + # and {::Google::Api::Service google.api.Service} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_management/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new + # + # # Call the generate_config_report method. + # result = client.generate_config_report request + # + # # The returned object is of type Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse. + # p result + # + def generate_config_report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.generate_config_report.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.generate_config_report.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_config_report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_manager_stub.generate_config_report request, 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 ServiceManager REST API. + # + # This class represents the configuration for ServiceManager REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_services to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_services.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_services.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "servicemanagement.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 ServiceManager API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_services + ## + # RPC-specific configuration for `get_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service + ## + # RPC-specific configuration for `create_service` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service + ## + # RPC-specific configuration for `delete_service` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_service + ## + # RPC-specific configuration for `undelete_service` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_service + ## + # RPC-specific configuration for `list_service_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_service_configs + ## + # RPC-specific configuration for `get_service_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service_config + ## + # RPC-specific configuration for `create_service_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service_config + ## + # RPC-specific configuration for `submit_config_source` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_config_source + ## + # RPC-specific configuration for `list_service_rollouts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_service_rollouts + ## + # RPC-specific configuration for `get_service_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service_rollout + ## + # RPC-specific configuration for `create_service_rollout` + # @return [::Gapic::Config::Method] + # + attr_reader :create_service_rollout + ## + # RPC-specific configuration for `generate_config_report` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_config_report + + # @private + def initialize parent_rpcs = nil + list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services + @list_services = ::Gapic::Config::Method.new list_services_config + get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service + @get_service = ::Gapic::Config::Method.new get_service_config + create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service + @create_service = ::Gapic::Config::Method.new create_service_config + delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service + @delete_service = ::Gapic::Config::Method.new delete_service_config + undelete_service_config = parent_rpcs.undelete_service if parent_rpcs.respond_to? :undelete_service + @undelete_service = ::Gapic::Config::Method.new undelete_service_config + list_service_configs_config = parent_rpcs.list_service_configs if parent_rpcs.respond_to? :list_service_configs + @list_service_configs = ::Gapic::Config::Method.new list_service_configs_config + get_service_config_config = parent_rpcs.get_service_config if parent_rpcs.respond_to? :get_service_config + @get_service_config = ::Gapic::Config::Method.new get_service_config_config + create_service_config_config = parent_rpcs.create_service_config if parent_rpcs.respond_to? :create_service_config + @create_service_config = ::Gapic::Config::Method.new create_service_config_config + submit_config_source_config = parent_rpcs.submit_config_source if parent_rpcs.respond_to? :submit_config_source + @submit_config_source = ::Gapic::Config::Method.new submit_config_source_config + list_service_rollouts_config = parent_rpcs.list_service_rollouts if parent_rpcs.respond_to? :list_service_rollouts + @list_service_rollouts = ::Gapic::Config::Method.new list_service_rollouts_config + get_service_rollout_config = parent_rpcs.get_service_rollout if parent_rpcs.respond_to? :get_service_rollout + @get_service_rollout = ::Gapic::Config::Method.new get_service_rollout_config + create_service_rollout_config = parent_rpcs.create_service_rollout if parent_rpcs.respond_to? :create_service_rollout + @create_service_rollout = ::Gapic::Config::Method.new create_service_rollout_config + generate_config_report_config = parent_rpcs.generate_config_report if parent_rpcs.respond_to? :generate_config_report + @generate_config_report = ::Gapic::Config::Method.new generate_config_report_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/operations.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/operations.rb new file mode 100644 index 000000000000..980113f33e0a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/operations.rb @@ -0,0 +1,923 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module ServiceManagement + module V1 + module ServiceManager + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "servicemanagement.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ServiceManager 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 ServiceManager 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::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceManagement::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "servicemanagement.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_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/operations", + matches: [] + ) + 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{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb new file mode 100644 index 000000000000..7f7177af359f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.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 "google/api/servicemanagement/v1/servicemanager_pb" + +module Google + module Cloud + module ServiceManagement + module V1 + module ServiceManager + module Rest + ## + # REST service stub for the ServiceManager 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_services REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServicesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ListServicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceManagement::V1::ListServicesResponse] + # A result object deserialized from the server's reply + def list_services request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_services_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_services", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceManagement::V1::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_service REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ManagedService] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] + # A result object deserialized from the server's reply + def get_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceManagement::V1::ManagedService.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_service REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_service REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the undelete_service REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def undelete_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "undelete_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_service_configs REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse] + # A result object deserialized from the server's reply + def list_service_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_service_configs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_service_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_service_config REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::Service] + # A result object deserialized from the server's reply + def get_service_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_service_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_service_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Api::Service.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_service_config REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::Service] + # A result object deserialized from the server's reply + def create_service_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_service_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_service_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Api::Service.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the submit_config_source REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def submit_config_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_submit_config_source_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "submit_config_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_service_rollouts REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse] + # A result object deserialized from the server's reply + def list_service_rollouts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_service_rollouts_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_service_rollouts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_service_rollout REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceManagement::V1::Rollout] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceManagement::V1::Rollout] + # A result object deserialized from the server's reply + def get_service_rollout request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_service_rollout_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_service_rollout", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceManagement::V1::Rollout.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_service_rollout REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_service_rollout request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_service_rollout_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_service_rollout", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the generate_config_report REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] + # A result object deserialized from the server's reply + def generate_config_report request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_config_report_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "generate_config_report", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse.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_services REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServicesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_services_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/services", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_service REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/services/{service_name}", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_service REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceRequest] + # 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_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/services", + body: "service", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_service REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/services/{service_name}", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_service REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/services/{service_name}:undelete", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_service_configs REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_service_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/services/{service_name}/configs", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_service_config REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_service_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/services/{service_name}/configs/{config_id}", + matches: [ + ["service_name", %r{^[^/]+/?$}, false], + ["config_id", %r{^[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/services/{service_name}/config", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_service_config REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest] + # 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_service_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/services/{service_name}/configs", + body: "service_config", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the submit_config_source REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_submit_config_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/services/{service_name}/configs:submit", + body: "*", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_service_rollouts REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_service_rollouts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/services/{service_name}/rollouts", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_service_rollout REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_service_rollout_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/services/{service_name}/rollouts/{rollout_id}", + matches: [ + ["service_name", %r{^[^/]+/?$}, false], + ["rollout_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_service_rollout REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest] + # 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_service_rollout_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/services/{service_name}/rollouts", + body: "rollout", + matches: [ + ["service_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_config_report REST call + # + # @param request_pb [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_generate_config_report_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/services:generateConfigReport", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/version.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/version.rb new file mode 100644 index 000000000000..b07821095257 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceManagement + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/README.md new file mode 100644 index 000000000000..b2331f606235 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Service Management 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-service_management-v1/proto_docs/google/api/auth.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/auth.rb new file mode 100644 index 000000000000..2f1afd9a7f19 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/auth.rb @@ -0,0 +1,259 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # `Authentication` defines the authentication configuration for API methods + # provided by an API service. + # + # Example: + # + # name: calendar.googleapis.com + # authentication: + # providers: + # - id: google_calendar_auth + # jwks_uri: https://www.googleapis.com/oauth2/v1/certs + # issuer: https://securetoken.google.com + # rules: + # - selector: "*" + # requirements: + # provider_id: google_calendar_auth + # - selector: google.calendar.Delegate + # oauth: + # canonical_scopes: https://www.googleapis.com/auth/calendar.read + # @!attribute [rw] rules + # @return [::Array<::Google::Api::AuthenticationRule>] + # A list of authentication rules that apply to individual API methods. + # + # **NOTE:** All service configuration rules follow "last one wins" order. + # @!attribute [rw] providers + # @return [::Array<::Google::Api::AuthProvider>] + # Defines a set of authentication providers that a service supports. + class Authentication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Authentication rules for the service. + # + # By default, if a method has any authentication requirements, every request + # must include a valid credential matching one of the requirements. + # It's an error to include more than one kind of credential in a single + # request. + # + # If a method doesn't have any auth requirements, request credentials will be + # ignored. + # @!attribute [rw] selector + # @return [::String] + # Selects the methods to which this rule applies. + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # @!attribute [rw] oauth + # @return [::Google::Api::OAuthRequirements] + # The requirements for OAuth credentials. + # @!attribute [rw] allow_without_credential + # @return [::Boolean] + # If true, the service accepts API keys without any other credential. + # This flag only applies to HTTP and gRPC requests. + # @!attribute [rw] requirements + # @return [::Array<::Google::Api::AuthRequirement>] + # Requirements for additional authentication providers. + class AuthenticationRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies a location to extract JWT from an API request. + # @!attribute [rw] header + # @return [::String] + # Specifies HTTP header name to extract JWT token. + # + # Note: The following fields are mutually exclusive: `header`, `query`, `cookie`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] query + # @return [::String] + # Specifies URL query parameter name to extract JWT token. + # + # Note: The following fields are mutually exclusive: `query`, `header`, `cookie`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] cookie + # @return [::String] + # Specifies cookie name to extract JWT token. + # + # Note: The following fields are mutually exclusive: `cookie`, `header`, `query`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] value_prefix + # @return [::String] + # The value prefix. The value format is "value_prefix\\{token}" + # Only applies to "in" header type. Must be empty for "in" query type. + # If not empty, the header value has to match (case sensitive) this prefix. + # If not matched, JWT will not be extracted. If matched, JWT will be + # extracted after the prefix is removed. + # + # For example, for "Authorization: Bearer \\{JWT}", + # value_prefix="Bearer " with a space at the end. + class JwtLocation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for an authentication provider, including support for + # [JSON Web Token + # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + # @!attribute [rw] id + # @return [::String] + # The unique identifier of the auth provider. It will be referred to by + # `AuthRequirement.provider_id`. + # + # Example: "bookstore_auth". + # @!attribute [rw] issuer + # @return [::String] + # Identifies the principal that issued the JWT. See + # https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + # Usually a URL or an email address. + # + # Example: https://securetoken.google.com + # Example: 1234567-compute@developer.gserviceaccount.com + # @!attribute [rw] jwks_uri + # @return [::String] + # URL of the provider's public key set to validate signature of the JWT. See + # [OpenID + # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + # Optional if the key set document: + # - can be retrieved from + # [OpenID + # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + # of the issuer. + # - can be inferred from the email domain of the issuer (e.g. a Google + # service account). + # + # Example: https://www.googleapis.com/oauth2/v1/certs + # @!attribute [rw] audiences + # @return [::String] + # The list of JWT + # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + # that are allowed to access. A JWT containing any of these audiences will + # be accepted. When this setting is absent, JWTs with audiences: + # - "https://[service.name]/[google.protobuf.Api.name]" + # - "https://[service.name]/" + # will be accepted. + # For example, if no audiences are in the setting, LibraryService API will + # accept JWTs with the following audiences: + # - + # https://library-example.googleapis.com/google.example.library.v1.LibraryService + # - https://library-example.googleapis.com/ + # + # Example: + # + # audiences: bookstore_android.apps.googleusercontent.com, + # bookstore_web.apps.googleusercontent.com + # @!attribute [rw] authorization_url + # @return [::String] + # Redirect URL if JWT token is required but not present or is expired. + # Implement authorizationUrl of securityDefinitions in OpenAPI spec. + # @!attribute [rw] jwt_locations + # @return [::Array<::Google::Api::JwtLocation>] + # Defines the locations to extract the JWT. For now it is only used by the + # Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] + # (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + # + # JWT locations can be one of HTTP headers, URL query parameters or + # cookies. The rule is that the first match wins. + # + # If not specified, default to use following 3 locations: + # 1) Authorization: Bearer + # 2) x-goog-iap-jwt-assertion + # 3) access_token query parameter + # + # Default locations can be specified as followings: + # jwt_locations: + # - header: Authorization + # value_prefix: "Bearer " + # - header: x-goog-iap-jwt-assertion + # - query: access_token + class AuthProvider + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # OAuth scopes are a way to define data and permissions on data. For example, + # there are scopes defined for "Read-only access to Google Calendar" and + # "Access to Cloud Platform". Users can consent to a scope for an application, + # giving it permission to access that data on their behalf. + # + # OAuth scope specifications should be fairly coarse grained; a user will need + # to see and understand the text description of what your scope means. + # + # In most cases: use one or at most two OAuth scopes for an entire family of + # products. If your product has multiple APIs, you should probably be sharing + # the OAuth scope across all of those APIs. + # + # When you need finer grained OAuth consent screens: talk with your product + # management about how developers will use them in practice. + # + # Please note that even though each of the canonical scopes is enough for a + # request to be accepted and passed to the backend, a request can still fail + # due to the backend requiring additional scopes or permissions. + # @!attribute [rw] canonical_scopes + # @return [::String] + # The list of publicly documented OAuth scopes that are allowed access. An + # OAuth token containing any of these scopes will be accepted. + # + # + # Example: + # + # canonical_scopes: https://www.googleapis.com/auth/calendar, + # https://www.googleapis.com/auth/calendar.read + class OAuthRequirements + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # User-defined authentication requirements, including support for + # [JSON Web Token + # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + # @!attribute [rw] provider_id + # @return [::String] + # {::Google::Api::AuthProvider#id id} from authentication provider. + # + # Example: + # + # provider_id: bookstore_auth + # @!attribute [rw] audiences + # @return [::String] + # NOTE: This will be deprecated soon, once AuthProvider.audiences is + # implemented and accepted in all the runtime components. + # + # The list of JWT + # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + # that are allowed to access. A JWT containing any of these audiences will + # be accepted. When this setting is absent, only JWTs with audience + # "https://{::Google::Api::Service#name Service_name}/{::Google::Protobuf::Api#name API_name}" + # will be accepted. For example, if no audiences are in the setting, + # LibraryService API will only accept JWTs with the following audience + # "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + # + # Example: + # + # audiences: bookstore_android.apps.googleusercontent.com, + # bookstore_web.apps.googleusercontent.com + class AuthRequirement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/backend.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/backend.rb new file mode 100644 index 000000000000..7d69596fe349 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/backend.rb @@ -0,0 +1,199 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # `Backend` defines the backend configuration for a service. + # @!attribute [rw] rules + # @return [::Array<::Google::Api::BackendRule>] + # A list of API backend rules that apply to individual API methods. + # + # **NOTE:** All service configuration rules follow "last one wins" order. + class Backend + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A backend rule provides configuration for an individual API element. + # @!attribute [rw] selector + # @return [::String] + # Selects the methods to which this rule applies. + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # @!attribute [rw] address + # @return [::String] + # The address of the API backend. + # + # The scheme is used to determine the backend protocol and security. + # The following schemes are accepted: + # + # SCHEME PROTOCOL SECURITY + # http:// HTTP None + # https:// HTTP TLS + # grpc:// gRPC None + # grpcs:// gRPC TLS + # + # It is recommended to explicitly include a scheme. Leaving out the scheme + # may cause constrasting behaviors across platforms. + # + # If the port is unspecified, the default is: + # - 80 for schemes without TLS + # - 443 for schemes with TLS + # + # For HTTP backends, use {::Google::Api::BackendRule#protocol protocol} + # to specify the protocol version. + # @!attribute [rw] deadline + # @return [::Float] + # The number of seconds to wait for a response from a request. The default + # varies based on the request protocol and deployment environment. + # @!attribute [rw] min_deadline + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Float] + # Deprecated, do not use. + # @!attribute [rw] operation_deadline + # @return [::Float] + # The number of seconds to wait for the completion of a long running + # operation. The default is no deadline. + # @!attribute [rw] path_translation + # @return [::Google::Api::BackendRule::PathTranslation] + # Path translation specifies how to combine the backend address with the + # request path in order to produce the appropriate forwarding URL for the + # request. See {::Google::Api::BackendRule::PathTranslation PathTranslation} for + # more details. + # @!attribute [rw] jwt_audience + # @return [::String] + # The JWT audience is used when generating a JWT ID token for the backend. + # This ID token will be added in the HTTP "authorization" header, and sent + # to the backend. + # + # Note: The following fields are mutually exclusive: `jwt_audience`, `disable_auth`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] disable_auth + # @return [::Boolean] + # When disable_auth is true, a JWT ID token won't be generated and the + # original "Authorization" HTTP header will be preserved. If the header is + # used to carry the original token and is expected by the backend, this + # field must be set to true to preserve the header. + # + # Note: The following fields are mutually exclusive: `disable_auth`, `jwt_audience`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] protocol + # @return [::String] + # The protocol used for sending a request to the backend. + # The supported values are "http/1.1" and "h2". + # + # The default value is inferred from the scheme in the + # {::Google::Api::BackendRule#address address} field: + # + # SCHEME PROTOCOL + # http:// http/1.1 + # https:// http/1.1 + # grpc:// h2 + # grpcs:// h2 + # + # For secure HTTP backends (https://) that support HTTP/2, set this field + # to "h2" for improved performance. + # + # Configuring this field to non-default values is only supported for secure + # HTTP backends. This field will be ignored for all other backends. + # + # See + # https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + # for more details on the supported values. + # @!attribute [rw] overrides_by_request_protocol + # @return [::Google::Protobuf::Map{::String => ::Google::Api::BackendRule}] + # The map between request protocol and the backend address. + # @!attribute [rw] load_balancing_policy + # @return [::String] + # The load balancing policy used for connection to the application backend. + # + # Defined as an arbitrary string to accomondate custom load balancing + # policies supported by the underlying channel, but suggest most users use + # one of the standard policies, such as the default, "RoundRobin". + class BackendRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Api::BackendRule] + class OverridesByRequestProtocolEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Path Translation specifies how to combine the backend address with the + # request path in order to produce the appropriate forwarding URL for the + # request. + # + # Path Translation is applicable only to HTTP-based backends. Backends which + # do not accept requests over HTTP/HTTPS should leave `path_translation` + # unspecified. + module PathTranslation + PATH_TRANSLATION_UNSPECIFIED = 0 + + # Use the backend address as-is, with no modification to the path. If the + # URL pattern contains variables, the variable names and values will be + # appended to the query string. If a query string parameter and a URL + # pattern variable have the same name, this may result in duplicate keys in + # the query string. + # + # # Examples + # + # Given the following operation config: + # + # Method path: /api/company/{cid}/user/{uid} + # Backend address: https://example.cloudfunctions.net/getUser + # + # Requests to the following request paths will call the backend at the + # translated path: + # + # Request path: /api/company/widgetworks/user/johndoe + # Translated: + # https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe + # + # Request path: /api/company/widgetworks/user/johndoe?timezone=EST + # Translated: + # https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe + CONSTANT_ADDRESS = 1 + + # The request path will be appended to the backend address. + # + # # Examples + # + # Given the following operation config: + # + # Method path: /api/company/{cid}/user/{uid} + # Backend address: https://example.appspot.com + # + # Requests to the following request paths will call the backend at the + # translated path: + # + # Request path: /api/company/widgetworks/user/johndoe + # Translated: + # https://example.appspot.com/api/company/widgetworks/user/johndoe + # + # Request path: /api/company/widgetworks/user/johndoe?timezone=EST + # Translated: + # https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST + APPEND_PATH_TO_ADDRESS = 2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/billing.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/billing.rb new file mode 100644 index 000000000000..75d55089e3a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/billing.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Billing related configuration of the service. + # + # The following example shows how to configure monitored resources and metrics + # for billing, `consumer_destinations` is the only supported destination and + # the monitored resources need at least one label key + # `cloud.googleapis.com/location` to indicate the location of the billing + # usage, using different monitored resources between monitoring and billing is + # recommended so they can be evolved independently: + # + # + # monitored_resources: + # - type: library.googleapis.com/billing_branch + # labels: + # - key: cloud.googleapis.com/location + # description: | + # Predefined label to support billing location restriction. + # - key: city + # description: | + # Custom label to define the city where the library branch is located + # in. + # - key: name + # description: Custom label to define the name of the library branch. + # metrics: + # - name: library.googleapis.com/book/borrowed_count + # metric_kind: DELTA + # value_type: INT64 + # unit: "1" + # billing: + # consumer_destinations: + # - monitored_resource: library.googleapis.com/billing_branch + # metrics: + # - library.googleapis.com/book/borrowed_count + # @!attribute [rw] consumer_destinations + # @return [::Array<::Google::Api::Billing::BillingDestination>] + # Billing configurations for sending metrics to the consumer project. + # There can be multiple consumer destinations per service, each one must have + # a different monitored resource type. A metric can be used in at most + # one consumer destination. + class Billing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of a specific billing destination (Currently only support + # bill against consumer project). + # @!attribute [rw] monitored_resource + # @return [::String] + # The monitored resource type. The type must be defined in + # {::Google::Api::Service#monitored_resources Service.monitored_resources} + # section. + # @!attribute [rw] metrics + # @return [::Array<::String>] + # Names of the metrics to report to this billing destination. + # Each name must be defined in + # {::Google::Api::Service#metrics Service.metrics} section. + class BillingDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/config_change.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/config_change.rb new file mode 100644 index 000000000000..ca20a231d6b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/config_change.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 Api + # Output generated from semantically comparing two versions of a service + # configuration. + # + # Includes detailed information about a field that have changed with + # applicable advice about potential consequences for the change, such as + # backwards-incompatibility. + # @!attribute [rw] element + # @return [::String] + # Object hierarchy path to the change, with levels separated by a '.' + # character. For repeated fields, an applicable unique identifier field is + # used for the index (usually selector, name, or id). For maps, the term + # 'key' is used. If the field has no unique identifier, the numeric index + # is used. + # Examples: + # - visibility.rules[selector=="google.LibraryService.ListBooks"].restriction + # - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value + # - logging.producer_destinations[0] + # @!attribute [rw] old_value + # @return [::String] + # Value of the changed object in the old Service configuration, + # in JSON format. This field will not be populated if ChangeType == ADDED. + # @!attribute [rw] new_value + # @return [::String] + # Value of the changed object in the new Service configuration, + # in JSON format. This field will not be populated if ChangeType == REMOVED. + # @!attribute [rw] change_type + # @return [::Google::Api::ChangeType] + # The type for this change, either ADDED, REMOVED, or MODIFIED. + # @!attribute [rw] advices + # @return [::Array<::Google::Api::Advice>] + # Collection of advice provided for this change, useful for determining the + # possible impact of this change. + class ConfigChange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Generated advice about this change, used for providing more + # information about how a change will affect the existing service. + # @!attribute [rw] description + # @return [::String] + # Useful description for why this advice was applied and what actions should + # be taken to mitigate any implied risks. + class Advice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Classifies set of possible modifications to an object in the service + # configuration. + module ChangeType + # No value was provided. + CHANGE_TYPE_UNSPECIFIED = 0 + + # The changed object exists in the 'new' service configuration, but not + # in the 'old' service configuration. + ADDED = 1 + + # The changed object exists in the 'old' service configuration, but not + # in the 'new' service configuration. + REMOVED = 2 + + # The changed object exists in both service configurations, but its value + # is different. + MODIFIED = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/context.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/context.rb new file mode 100644 index 000000000000..871ef9830982 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/context.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # `Context` defines which contexts an API requests. + # + # Example: + # + # context: + # rules: + # - selector: "*" + # requested: + # - google.rpc.context.ProjectContext + # - google.rpc.context.OriginContext + # + # The above specifies that all methods in the API request + # `google.rpc.context.ProjectContext` and + # `google.rpc.context.OriginContext`. + # + # Available context types are defined in package + # `google.rpc.context`. + # + # This also provides mechanism to allowlist any protobuf message extension that + # can be sent in grpc metadata using “x-goog-ext--bin” and + # “x-goog-ext--jspb” format. For example, list any service + # specific protobuf types that can appear in grpc metadata as follows in your + # yaml file: + # + # Example: + # + # context: + # rules: + # - selector: "google.example.library.v1.LibraryService.CreateBook" + # allowed_request_extensions: + # - google.foo.v1.NewExtension + # allowed_response_extensions: + # - google.foo.v1.NewExtension + # + # You can also specify extension ID instead of fully qualified extension name + # here. + # @!attribute [rw] rules + # @return [::Array<::Google::Api::ContextRule>] + # A list of RPC context rules that apply to individual API methods. + # + # **NOTE:** All service configuration rules follow "last one wins" order. + class Context + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A context rule provides information about the context for an individual API + # element. + # @!attribute [rw] selector + # @return [::String] + # Selects the methods to which this rule applies. + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # @!attribute [rw] requested + # @return [::Array<::String>] + # A list of full type names of requested contexts, only the requested context + # will be made available to the backend. + # @!attribute [rw] provided + # @return [::Array<::String>] + # A list of full type names of provided contexts. It is used to support + # propagating HTTP headers and ETags from the response extension. + # @!attribute [rw] allowed_request_extensions + # @return [::Array<::String>] + # A list of full type names or extension IDs of extensions allowed in grpc + # side channel from client to backend. + # @!attribute [rw] allowed_response_extensions + # @return [::Array<::String>] + # A list of full type names or extension IDs of extensions allowed in grpc + # side channel from backend to client. + class ContextRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/control.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/control.rb new file mode 100644 index 000000000000..ad857f7a1157 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/control.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Selects and configures the service controller used by the service. + # + # Example: + # + # control: + # environment: servicecontrol.googleapis.com + # @!attribute [rw] environment + # @return [::String] + # The service controller environment to use. If empty, no control plane + # features (like quota and billing) will be enabled. The recommended value + # for most services is servicecontrol.googleapis.com. + # @!attribute [rw] method_policies + # @return [::Array<::Google::Api::MethodPolicy>] + # Defines policies applying to the API methods of the service. + class Control + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb new file mode 100644 index 000000000000..ccefcdf22809 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/documentation.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! + + +module Google + module Api + # `Documentation` provides the information for describing a service. + # + # Example: + #
documentation:
+    #   summary: >
+    #     The Google Calendar API gives access
+    #     to most calendar features.
+    #   pages:
+    #   - name: Overview
+    #     content: (== include google/foo/overview.md ==)
+    #   - name: Tutorial
+    #     content: (== include google/foo/tutorial.md ==)
+    #     subpages:
+    #     - name: Java
+    #       content: (== include google/foo/tutorial_java.md ==)
+    #   rules:
+    #   - selector: google.calendar.Calendar.Get
+    #     description: >
+    #       ...
+    #   - selector: google.calendar.Calendar.Put
+    #     description: >
+    #       ...
+    # 
+ # Documentation is provided in markdown syntax. In addition to + # standard markdown features, definition lists, tables and fenced + # code blocks are supported. Section headers can be provided and are + # interpreted relative to the section nesting of the context where + # a documentation fragment is embedded. + # + # Documentation from the IDL is merged with documentation defined + # via the config at normalization time, where documentation provided + # by config rules overrides IDL provided. + # + # A number of constructs specific to the API platform are supported + # in documentation text. + # + # In order to reference a proto element, the following + # notation can be used: + #
[fully.qualified.proto.name][]
+ # To override the display text used for the link, this can be used: + #
[display text][fully.qualified.proto.name]
+ # Text can be excluded from doc using the following notation: + #
(-- internal comment --)
+ # + # A few directives are available in documentation. Note that + # directives must appear on a single line to be properly + # identified. The `include` directive includes a markdown file from + # an external source: + #
(== include path/to/file ==)
+ # The `resource_for` directive marks a message to be the resource of + # a collection in REST view. If it is not specified, tools attempt + # to infer the resource from the operations in a collection: + #
(== resource_for v1.shelves.books ==)
+ # The directive `suppress_warning` does not directly affect documentation + # and is documented together with service config validation. + # @!attribute [rw] summary + # @return [::String] + # A short description of what the service does. The summary must be plain + # text. It becomes the overview of the service displayed in Google Cloud + # Console. + # NOTE: This field is equivalent to the standard field `description`. + # @!attribute [rw] pages + # @return [::Array<::Google::Api::Page>] + # The top level pages for the documentation set. + # @!attribute [rw] rules + # @return [::Array<::Google::Api::DocumentationRule>] + # A list of documentation rules that apply to individual API elements. + # + # **NOTE:** All service configuration rules follow "last one wins" order. + # @!attribute [rw] documentation_root_url + # @return [::String] + # The URL to the root of documentation. + # @!attribute [rw] service_root_url + # @return [::String] + # Specifies the service root url if the default one (the service name + # from the yaml file) is not suitable. This can be seen in any fully + # specified service urls as well as sections that show a base that other + # urls are relative to. + # @!attribute [rw] overview + # @return [::String] + # Declares a single overview page. For example: + #
documentation:
+    #       summary: ...
+    #       overview: (== include overview.md ==)
+    #     
+ # This is a shortcut for the following declaration (using pages style): + #
documentation:
+    #       summary: ...
+    #       pages:
+    #       - name: Overview
+    #         content: (== include overview.md ==)
+    #     
+ # Note: you cannot specify both `overview` field and `pages` field. + class Documentation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A documentation rule provides information about individual API elements. + # @!attribute [rw] selector + # @return [::String] + # The selector is a comma-separated list of patterns for any element such as + # a method, a field, an enum value. Each pattern is a qualified name of the + # element which may end in "*", indicating a wildcard. Wildcards are only + # allowed at the end and for a whole component of the qualified name, + # i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match + # one or more components. To specify a default for all applicable elements, + # the whole pattern "*" is used. + # @!attribute [rw] description + # @return [::String] + # Description of the selected proto element (e.g. a message, a method, a + # 'service' definition, or a field). Defaults to leading & trailing comments + # taken from the proto source definition of the proto element. + # @!attribute [rw] deprecation_description + # @return [::String] + # Deprecation description of the selected element(s). It can be provided if + # an element is marked as `deprecated`. + class DocumentationRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a documentation page. A page can contain subpages to represent + # nested documentation set structure. + # @!attribute [rw] name + # @return [::String] + # The name of the page. It will be used as an identity of the page to + # generate URI of the page, text of the link to this page in navigation, + # etc. The full page name (start from the root page name to this page + # concatenated with `.`) can be used as reference to the page in your + # documentation. For example: + #
pages:
+    #     - name: Tutorial
+    #       content: (== include tutorial.md ==)
+    #       subpages:
+    #       - name: Java
+    #         content: (== include tutorial_java.md ==)
+    #     
+ # You can reference `Java` page using Markdown reference link syntax: + # `[Java][Tutorial.Java]`. + # @!attribute [rw] content + # @return [::String] + # The Markdown content of the page. You can use ```(== include {path} + # ==)``` to include content from a Markdown file. The content can be used + # to produce the documentation page such as HTML format page. + # @!attribute [rw] subpages + # @return [::Array<::Google::Api::Page>] + # Subpages of this page. The order of subpages specified here will be + # honored in the generated docset. + class Page + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb new file mode 100644 index 000000000000..57d040a793ab --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/endpoint.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 + # `Endpoint` describes a network address of a service that serves a set of + # APIs. It is commonly known as a service endpoint. A service may expose + # any number of service endpoints, and all service endpoints share the same + # service definition, such as quota limits and monitoring metrics. + # + # Example: + # + # type: google.api.Service + # name: library-example.googleapis.com + # endpoints: + # # Declares network address `https://library-example.googleapis.com` + # # for service `library-example.googleapis.com`. The `https` scheme + # # is implicit for all service endpoints. Other schemes may be + # # supported in the future. + # - name: library-example.googleapis.com + # allow_cors: false + # - name: content-staging-library-example.googleapis.com + # # Allows HTTP OPTIONS calls to be passed to the API frontend, for it + # # to decide whether the subsequent cross-origin request is allowed + # # to proceed. + # allow_cors: true + # @!attribute [rw] name + # @return [::String] + # The canonical name of this endpoint. + # @!attribute [rw] aliases + # @return [::Array<::String>] + # Aliases for this endpoint, these will be served by the same UrlMap as the + # parent endpoint, and will be provisioned in the GCP stack for the Regional + # Endpoints. + # @!attribute [rw] target + # @return [::String] + # The specification of an Internet routable address of API frontend that will + # handle requests to this [API + # Endpoint](https://cloud.google.com/apis/design/glossary). It should be + # either a valid IPv4 address or a fully-qualified domain name. For example, + # "8.8.8.8" or "myservice.appspot.com". + # @!attribute [rw] allow_cors + # @return [::Boolean] + # Allowing + # [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + # cross-domain traffic, would allow the backends served from this endpoint to + # receive and respond to HTTP OPTIONS requests. The response will be used by + # the browser to determine whether the subsequent cross-origin request is + # allowed to proceed. + class Endpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/label.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/label.rb new file mode 100644 index 000000000000..02d2f8d451f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/label.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 Api + # A description of a label. + # @!attribute [rw] key + # @return [::String] + # The label key. + # @!attribute [rw] value_type + # @return [::Google::Api::LabelDescriptor::ValueType] + # The type of data that can be assigned to the label. + # @!attribute [rw] description + # @return [::String] + # A human-readable description for the label. + class LabelDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Value types that can be used as label values. + module ValueType + # A variable-length string. This is the default. + STRING = 0 + + # Boolean; true or false. + BOOL = 1 + + # A 64-bit signed integer. + INT64 = 2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/log.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/log.rb new file mode 100644 index 000000000000..e977a6844da3 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/log.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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 description of a log type. Example in YAML format: + # + # - name: library.googleapis.com/activity_history + # description: The history of borrowing and returning library items. + # display_name: Activity + # labels: + # - key: /customer_id + # description: Identifier of a library customer + # @!attribute [rw] name + # @return [::String] + # The name of the log. It must be less than 512 characters long and can + # include the following characters: upper- and lower-case alphanumeric + # characters [A-Za-z0-9], and punctuation characters including + # slash, underscore, hyphen, period [/_-.]. + # @!attribute [rw] labels + # @return [::Array<::Google::Api::LabelDescriptor>] + # The set of labels that are available to describe a specific log entry. + # Runtime requests that contain labels not specified here are + # considered invalid. + # @!attribute [rw] description + # @return [::String] + # A human-readable description of this log. This information appears in + # the documentation and can contain details. + # @!attribute [rw] display_name + # @return [::String] + # The human-readable name for this log. This information appears on + # the user interface and should be concise. + class LogDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/logging.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/logging.rb new file mode 100644 index 000000000000..7a784dd32332 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/logging.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Logging configuration of the service. + # + # The following example shows how to configure logs to be sent to the + # producer and consumer projects. In the example, the `activity_history` + # log is sent to both the producer and consumer projects, whereas the + # `purchase_history` log is only sent to the producer project. + # + # monitored_resources: + # - type: library.googleapis.com/branch + # labels: + # - key: /city + # description: The city where the library branch is located in. + # - key: /name + # description: The name of the branch. + # logs: + # - name: activity_history + # labels: + # - key: /customer_id + # - name: purchase_history + # logging: + # producer_destinations: + # - monitored_resource: library.googleapis.com/branch + # logs: + # - activity_history + # - purchase_history + # consumer_destinations: + # - monitored_resource: library.googleapis.com/branch + # logs: + # - activity_history + # @!attribute [rw] producer_destinations + # @return [::Array<::Google::Api::Logging::LoggingDestination>] + # Logging configurations for sending logs to the producer project. + # There can be multiple producer destinations, each one must have a + # different monitored resource type. A log can be used in at most + # one producer destination. + # @!attribute [rw] consumer_destinations + # @return [::Array<::Google::Api::Logging::LoggingDestination>] + # Logging configurations for sending logs to the consumer project. + # There can be multiple consumer destinations, each one must have a + # different monitored resource type. A log can be used in at most + # one consumer destination. + class Logging + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of a specific logging destination (the producer project + # or the consumer project). + # @!attribute [rw] monitored_resource + # @return [::String] + # The monitored resource type. The type must be defined in the + # {::Google::Api::Service#monitored_resources Service.monitored_resources} + # section. + # @!attribute [rw] logs + # @return [::Array<::String>] + # Names of the logs to be sent to this destination. Each name must + # be defined in the {::Google::Api::Service#logs Service.logs} section. If the + # log name is not a domain scoped name, it will be automatically prefixed + # with the service name followed by "/". + class LoggingDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/metric.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/metric.rb new file mode 100644 index 000000000000..329058c374d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/metric.rb @@ -0,0 +1,299 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Defines a metric type and its schema. Once a metric descriptor is created, + # deleting or altering it stops data collection and makes the metric type's + # existing data unusable. + # @!attribute [rw] name + # @return [::String] + # The resource name of the metric descriptor. + # @!attribute [rw] type + # @return [::String] + # The metric type, including its DNS name prefix. The type is not + # URL-encoded. All user-defined metric types have the DNS name + # `custom.googleapis.com` or `external.googleapis.com`. Metric types should + # use a natural hierarchical grouping. For example: + # + # "custom.googleapis.com/invoice/paid/amount" + # "external.googleapis.com/prometheus/up" + # "appengine.googleapis.com/http/server/response_latencies" + # @!attribute [rw] labels + # @return [::Array<::Google::Api::LabelDescriptor>] + # The set of labels that can be used to describe a specific + # instance of this metric type. For example, the + # `appengine.googleapis.com/http/server/response_latencies` metric + # type has a label for the HTTP response code, `response_code`, so + # you can look at latencies for successful responses or just + # for responses that failed. + # @!attribute [rw] metric_kind + # @return [::Google::Api::MetricDescriptor::MetricKind] + # Whether the metric records instantaneous values, changes to a value, etc. + # Some combinations of `metric_kind` and `value_type` might not be supported. + # @!attribute [rw] value_type + # @return [::Google::Api::MetricDescriptor::ValueType] + # Whether the measurement is an integer, a floating-point number, etc. + # Some combinations of `metric_kind` and `value_type` might not be supported. + # @!attribute [rw] unit + # @return [::String] + # The units in which the metric value is reported. It is only applicable + # if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` + # defines the representation of the stored metric values. + # + # Different systems might scale the values to be more easily displayed (so a + # value of `0.02kBy` _might_ be displayed as `20By`, and a value of + # `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is + # `kBy`, then the value of the metric is always in thousands of bytes, no + # matter how it might be displayed. + # + # If you want a custom metric to record the exact number of CPU-seconds used + # by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is + # `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 + # CPU-seconds, then the value is written as `12005`. + # + # Alternatively, if you want a custom metric to record data in a more + # granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is + # `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), + # or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + # + # The supported units are a subset of [The Unified Code for Units of + # Measure](https://unitsofmeasure.org/ucum.html) standard: + # + # **Basic units (UNIT)** + # + # * `bit` bit + # * `By` byte + # * `s` second + # * `min` minute + # * `h` hour + # * `d` day + # * `1` dimensionless + # + # **Prefixes (PREFIX)** + # + # * `k` kilo (10^3) + # * `M` mega (10^6) + # * `G` giga (10^9) + # * `T` tera (10^12) + # * `P` peta (10^15) + # * `E` exa (10^18) + # * `Z` zetta (10^21) + # * `Y` yotta (10^24) + # + # * `m` milli (10^-3) + # * `u` micro (10^-6) + # * `n` nano (10^-9) + # * `p` pico (10^-12) + # * `f` femto (10^-15) + # * `a` atto (10^-18) + # * `z` zepto (10^-21) + # * `y` yocto (10^-24) + # + # * `Ki` kibi (2^10) + # * `Mi` mebi (2^20) + # * `Gi` gibi (2^30) + # * `Ti` tebi (2^40) + # * `Pi` pebi (2^50) + # + # **Grammar** + # + # The grammar also includes these connectors: + # + # * `/` division or ratio (as an infix operator). For examples, + # `kBy/{email}` or `MiBy/10ms` (although you should almost never + # have `/s` in a metric `unit`; rates should always be computed at + # query time from the underlying cumulative or delta value). + # * `.` multiplication or composition (as an infix operator). For + # examples, `GBy.d` or `k{watt}.h`. + # + # The grammar for a unit is as follows: + # + # Expression = Component { "." Component } { "/" Component } ; + # + # Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + # | Annotation + # | "1" + # ; + # + # Annotation = "{" NAME "}" ; + # + # Notes: + # + # * `Annotation` is just a comment if it follows a `UNIT`. If the annotation + # is used alone, then the unit is equivalent to `1`. For examples, + # `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + # * `NAME` is a sequence of non-blank printable ASCII characters not + # containing `{` or `}`. + # * `1` represents a unitary [dimensionless + # unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + # as in `1/s`. It is typically used when none of the basic units are + # appropriate. For example, "new users per day" can be represented as + # `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + # users). Alternatively, "thousands of page views per day" would be + # represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + # value of `5.3` would mean "5300 page views per day"). + # * `%` represents dimensionless value of 1/100, and annotates values giving + # a percentage (so the metric values are typically in the range of 0..100, + # and a metric value `3` means "3 percent"). + # * `10^2.%` indicates a metric contains a ratio, typically in the range + # 0..1, that will be multiplied by 100 and displayed as a percentage + # (so a metric value `0.03` means "3 percent"). + # @!attribute [rw] description + # @return [::String] + # A detailed description of the metric, which can be used in documentation. + # @!attribute [rw] display_name + # @return [::String] + # A concise name for the metric, which can be displayed in user interfaces. + # Use sentence case without an ending period, for example "Request count". + # This field is optional but it is recommended to be set for any metrics + # associated with user-visible concepts, such as Quota. + # @!attribute [rw] metadata + # @return [::Google::Api::MetricDescriptor::MetricDescriptorMetadata] + # Optional. Metadata which can be used to guide usage of the metric. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Optional. The launch stage of the metric definition. + # @!attribute [rw] monitored_resource_types + # @return [::Array<::String>] + # Read-only. If present, then a [time + # series][google.monitoring.v3.TimeSeries], which is identified partially by + # a metric type and a + # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor}, that + # is associated with this metric type can only be associated with one of the + # monitored resource types listed here. + class MetricDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Additional annotations that can be used to guide the usage of a metric. + # @!attribute [rw] launch_stage + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Api::LaunchStage] + # Deprecated. Must use the + # {::Google::Api::MetricDescriptor#launch_stage MetricDescriptor.launch_stage} + # instead. + # @!attribute [rw] sample_period + # @return [::Google::Protobuf::Duration] + # The sampling period of metric data points. For metrics which are written + # periodically, consecutive data points are stored at this time interval, + # excluding data loss due to errors. Metrics with a higher granularity have + # a smaller sampling period. + # @!attribute [rw] ingest_delay + # @return [::Google::Protobuf::Duration] + # The delay of data points caused by ingestion. Data points older than this + # age are guaranteed to be ingested and available to be read, excluding + # data loss due to errors. + # @!attribute [rw] time_series_resource_hierarchy_level + # @return [::Array<::Google::Api::MetricDescriptor::MetricDescriptorMetadata::TimeSeriesResourceHierarchyLevel>] + # The scope of the timeseries data of the metric. + class MetricDescriptorMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The resource hierarchy level of the timeseries data of a metric. + module TimeSeriesResourceHierarchyLevel + # Do not use this default value. + TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0 + + # Scopes a metric to a project. + PROJECT = 1 + + # Scopes a metric to an organization. + ORGANIZATION = 2 + + # Scopes a metric to a folder. + FOLDER = 3 + end + end + + # The kind of measurement. It describes how the data is reported. + # For information on setting the start time and end time based on + # the MetricKind, see [TimeInterval][google.monitoring.v3.TimeInterval]. + module MetricKind + # Do not use this default value. + METRIC_KIND_UNSPECIFIED = 0 + + # An instantaneous measurement of a value. + GAUGE = 1 + + # The change in a value during a time interval. + DELTA = 2 + + # A value accumulated over a time interval. Cumulative + # measurements in a time series should have the same start time + # and increasing end times, until an event resets the cumulative + # value to zero and sets a new start time for the following + # points. + CUMULATIVE = 3 + end + + # The value type of a metric. + module ValueType + # Do not use this default value. + VALUE_TYPE_UNSPECIFIED = 0 + + # The value is a boolean. + # This value type can be used only if the metric kind is `GAUGE`. + BOOL = 1 + + # The value is a signed 64-bit integer. + INT64 = 2 + + # The value is a double precision floating point number. + DOUBLE = 3 + + # The value is a text string. + # This value type can be used only if the metric kind is `GAUGE`. + STRING = 4 + + # The value is a [`Distribution`][google.api.Distribution]. + DISTRIBUTION = 5 + + # The value is money. + MONEY = 6 + end + end + + # A specific metric, identified by specifying values for all of the + # labels of a {::Google::Api::MetricDescriptor `MetricDescriptor`}. + # @!attribute [rw] type + # @return [::String] + # An existing metric type, see + # {::Google::Api::MetricDescriptor google.api.MetricDescriptor}. For example, + # `custom.googleapis.com/invoice/paid/amount`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The set of label values that uniquely identify this metric. All + # labels listed in the `MetricDescriptor` must be assigned values. + class Metric + 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 + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb new file mode 100644 index 000000000000..4d1ec410ddac --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb @@ -0,0 +1,150 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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 object that describes the schema of a + # {::Google::Api::MonitoredResource MonitoredResource} object using a type name + # and a set of labels. For example, the monitored resource descriptor for + # Google Compute Engine VM instances has a type of + # `"gce_instance"` and specifies the use of the labels `"instance_id"` and + # `"zone"` to identify particular VM instances. + # + # Different APIs can support different monitored resource types. APIs generally + # provide a `list` method that returns the monitored resource descriptors used + # by the API. + # @!attribute [rw] name + # @return [::String] + # Optional. The resource name of the monitored resource descriptor: + # `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where + # \\{type} is the value of the `type` field in this object and + # \\{project_id} is a project ID that provides API-specific context for + # accessing the type. APIs that do not use project information can use the + # resource name format `"monitoredResourceDescriptors/{type}"`. + # @!attribute [rw] type + # @return [::String] + # Required. The monitored resource type. For example, the type + # `"cloudsql_database"` represents databases in Google Cloud SQL. + # For a list of types, see [Monitored resource + # types](https://cloud.google.com/monitoring/api/resources) + # and [Logging resource + # types](https://cloud.google.com/logging/docs/api/v2/resource-list). + # @!attribute [rw] display_name + # @return [::String] + # Optional. A concise name for the monitored resource type that might be + # displayed in user interfaces. It should be a Title Cased Noun Phrase, + # without any article or other determiners. For example, + # `"Google Cloud SQL Database"`. + # @!attribute [rw] description + # @return [::String] + # Optional. A detailed description of the monitored resource type that might + # be used in documentation. + # @!attribute [rw] labels + # @return [::Array<::Google::Api::LabelDescriptor>] + # Required. A set of labels used to describe instances of this monitored + # resource type. For example, an individual Google Cloud SQL database is + # identified by values for the labels `"database_id"` and `"zone"`. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Optional. The launch stage of the monitored resource definition. + class MonitoredResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An object representing a resource that can be used for monitoring, logging, + # billing, or other purposes. Examples include virtual machine instances, + # databases, and storage devices such as disks. The `type` field identifies a + # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} object + # that describes the resource's schema. Information in the `labels` field + # identifies the actual resource and its attributes according to the schema. + # For example, a particular Compute Engine VM instance could be represented by + # the following object, because the + # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} for + # `"gce_instance"` has labels + # `"project_id"`, `"instance_id"` and `"zone"`: + # + # { "type": "gce_instance", + # "labels": { "project_id": "my-project", + # "instance_id": "12345678901234", + # "zone": "us-central1-a" }} + # @!attribute [rw] type + # @return [::String] + # Required. The monitored resource type. This field must match + # the `type` field of a + # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} + # object. For example, the type of a Compute Engine VM instance is + # `gce_instance`. Some descriptors include the service name in the type; for + # example, the type of a Datastream stream is + # `datastream.googleapis.com/Stream`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Required. Values for all of the labels listed in the associated monitored + # resource descriptor. For example, Compute Engine VM instances use the + # labels `"project_id"`, `"instance_id"`, and `"zone"`. + class MonitoredResource + 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 + + # Auxiliary metadata for a {::Google::Api::MonitoredResource MonitoredResource} + # object. {::Google::Api::MonitoredResource MonitoredResource} objects contain the + # minimum set of information to uniquely identify a monitored resource + # instance. There is some other useful auxiliary metadata. Monitoring and + # Logging use an ingestion pipeline to extract metadata for cloud resources of + # all types, and store the metadata in this message. + # @!attribute [rw] system_labels + # @return [::Google::Protobuf::Struct] + # Output only. Values for predefined system metadata labels. + # System labels are a kind of metadata extracted by Google, including + # "machine_image", "vpc", "subnet_id", + # "security_group", "name", etc. + # System label values can be only strings, Boolean values, or a list of + # strings. For example: + # + # { "name": "my-test-instance", + # "security_group": ["a", "b", "c"], + # "spot_instance": false } + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. A map of user-defined metadata labels. + class MonitoredResourceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitoring.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitoring.rb new file mode 100644 index 000000000000..09aaf1885816 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitoring.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Monitoring configuration of the service. + # + # The example below shows how to configure monitored resources and metrics + # for monitoring. In the example, a monitored resource and two metrics are + # defined. The `library.googleapis.com/book/returned_count` metric is sent + # to both producer and consumer projects, whereas the + # `library.googleapis.com/book/num_overdue` metric is only sent to the + # consumer project. + # + # monitored_resources: + # - type: library.googleapis.com/Branch + # display_name: "Library Branch" + # description: "A branch of a library." + # launch_stage: GA + # labels: + # - key: resource_container + # description: "The Cloud container (ie. project id) for the Branch." + # - key: location + # description: "The location of the library branch." + # - key: branch_id + # description: "The id of the branch." + # metrics: + # - name: library.googleapis.com/book/returned_count + # display_name: "Books Returned" + # description: "The count of books that have been returned." + # launch_stage: GA + # metric_kind: DELTA + # value_type: INT64 + # unit: "1" + # labels: + # - key: customer_id + # description: "The id of the customer." + # - name: library.googleapis.com/book/num_overdue + # display_name: "Books Overdue" + # description: "The current number of overdue books." + # launch_stage: GA + # metric_kind: GAUGE + # value_type: INT64 + # unit: "1" + # labels: + # - key: customer_id + # description: "The id of the customer." + # monitoring: + # producer_destinations: + # - monitored_resource: library.googleapis.com/Branch + # metrics: + # - library.googleapis.com/book/returned_count + # consumer_destinations: + # - monitored_resource: library.googleapis.com/Branch + # metrics: + # - library.googleapis.com/book/returned_count + # - library.googleapis.com/book/num_overdue + # @!attribute [rw] producer_destinations + # @return [::Array<::Google::Api::Monitoring::MonitoringDestination>] + # Monitoring configurations for sending metrics to the producer project. + # There can be multiple producer destinations. A monitored resource type may + # appear in multiple monitoring destinations if different aggregations are + # needed for different sets of metrics associated with that monitored + # resource type. A monitored resource and metric pair may only be used once + # in the Monitoring configuration. + # @!attribute [rw] consumer_destinations + # @return [::Array<::Google::Api::Monitoring::MonitoringDestination>] + # Monitoring configurations for sending metrics to the consumer project. + # There can be multiple consumer destinations. A monitored resource type may + # appear in multiple monitoring destinations if different aggregations are + # needed for different sets of metrics associated with that monitored + # resource type. A monitored resource and metric pair may only be used once + # in the Monitoring configuration. + class Monitoring + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of a specific monitoring destination (the producer project + # or the consumer project). + # @!attribute [rw] monitored_resource + # @return [::String] + # The monitored resource type. The type must be defined in + # {::Google::Api::Service#monitored_resources Service.monitored_resources} + # section. + # @!attribute [rw] metrics + # @return [::Array<::String>] + # Types of the metrics to report to this monitoring destination. + # Each type must be defined in + # {::Google::Api::Service#metrics Service.metrics} section. + class MonitoringDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/policy.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/policy.rb new file mode 100644 index 000000000000..eb5db26fc933 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/policy.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 Api + # Google API Policy Annotation + # + # This message defines a simple API policy annotation that can be used to + # annotate API request and response message fields with applicable policies. + # One field may have multiple applicable policies that must all be satisfied + # before a request can be processed. This policy annotation is used to + # generate the overall policy that will be used for automatic runtime + # policy enforcement and documentation generation. + # @!attribute [rw] selector + # @return [::String] + # Selects one or more request or response message fields to apply this + # `FieldPolicy`. + # + # When a `FieldPolicy` is used in proto annotation, the selector must + # be left as empty. The service config generator will automatically fill + # the correct value. + # + # When a `FieldPolicy` is used in service config, the selector must be a + # comma-separated string with valid request or response field paths, + # such as "foo.bar" or "foo.bar,foo.baz". + # @!attribute [rw] resource_permission + # @return [::String] + # Specifies the required permission(s) for the resource referred to by the + # field. It requires the field contains a valid resource reference, and + # the request must pass the permission checks to proceed. For example, + # "resourcemanager.projects.get". + # @!attribute [rw] resource_type + # @return [::String] + # Specifies the resource type for the resource referred to by the field. + class FieldPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines policies applying to an RPC method. + # @!attribute [rw] selector + # @return [::String] + # Selects a method to which these policies should be enforced, for example, + # "google.pubsub.v1.Subscriber.CreateSubscription". + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # + # NOTE: This field must not be set in the proto annotation. It will be + # automatically filled by the service config compiler . + # @!attribute [rw] request_policies + # @return [::Array<::Google::Api::FieldPolicy>] + # Policies that are applicable to the request message. + class MethodPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/quota.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/quota.rb new file mode 100644 index 000000000000..606c3036c888 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/quota.rb @@ -0,0 +1,208 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Quota configuration helps to achieve fairness and budgeting in service + # usage. + # + # The metric based quota configuration works this way: + # - The service configuration defines a set of metrics. + # - For API calls, the quota.metric_rules maps methods to metrics with + # corresponding costs. + # - The quota.limits defines limits on the metrics, which will be used for + # quota checks at runtime. + # + # An example quota configuration in yaml format: + # + # quota: + # limits: + # + # - name: apiWriteQpsPerProject + # metric: library.googleapis.com/write_calls + # unit: "1/min/\\{project}" # rate limit for consumer projects + # values: + # STANDARD: 10000 + # + # + # (The metric rules bind all methods to the read_calls metric, + # except for the UpdateBook and DeleteBook methods. These two methods + # are mapped to the write_calls metric, with the UpdateBook method + # consuming at twice rate as the DeleteBook method.) + # metric_rules: + # - selector: "*" + # metric_costs: + # library.googleapis.com/read_calls: 1 + # - selector: google.example.library.v1.LibraryService.UpdateBook + # metric_costs: + # library.googleapis.com/write_calls: 2 + # - selector: google.example.library.v1.LibraryService.DeleteBook + # metric_costs: + # library.googleapis.com/write_calls: 1 + # + # Corresponding Metric definition: + # + # metrics: + # - name: library.googleapis.com/read_calls + # display_name: Read requests + # metric_kind: DELTA + # value_type: INT64 + # + # - name: library.googleapis.com/write_calls + # display_name: Write requests + # metric_kind: DELTA + # value_type: INT64 + # @!attribute [rw] limits + # @return [::Array<::Google::Api::QuotaLimit>] + # List of QuotaLimit definitions for the service. + # @!attribute [rw] metric_rules + # @return [::Array<::Google::Api::MetricRule>] + # List of MetricRule definitions, each one mapping a selected method to one + # or more metrics. + class Quota + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Bind API methods to metrics. Binding a method to a metric causes that + # metric's configured quota behaviors to apply to the method call. + # @!attribute [rw] selector + # @return [::String] + # Selects the methods to which this rule applies. + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # @!attribute [rw] metric_costs + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # Metrics to update when the selected methods are called, and the associated + # cost applied to each metric. + # + # The key of the map is the metric name, and the values are the amount + # increased for the metric against which the quota limits are defined. + # The value must not be negative. + class MetricRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class MetricCostsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `QuotaLimit` defines a specific limit that applies over a specified duration + # for a limit type. There can be at most one limit for a duration and limit + # type combination defined within a `QuotaGroup`. + # @!attribute [rw] name + # @return [::String] + # Name of the quota limit. + # + # The name must be provided, and it must be unique within the service. The + # name can only include alphanumeric characters as well as '-'. + # + # The maximum length of the limit name is 64 characters. + # @!attribute [rw] description + # @return [::String] + # Optional. User-visible, extended description for this quota limit. + # Should be used only when more context is needed to understand this limit + # than provided by the limit's display name (see: `display_name`). + # @!attribute [rw] default_limit + # @return [::Integer] + # Default number of tokens that can be consumed during the specified + # duration. This is the number of tokens assigned when a client + # application developer activates the service for his/her project. + # + # Specifying a value of 0 will block all requests. This can be used if you + # are provisioning quota to selected consumers and blocking others. + # Similarly, a value of -1 will indicate an unlimited quota. No other + # negative values are allowed. + # + # Used by group-based quotas only. + # @!attribute [rw] max_limit + # @return [::Integer] + # Maximum number of tokens that can be consumed during the specified + # duration. Client application developers can override the default limit up + # to this maximum. If specified, this value cannot be set to a value less + # than the default limit. If not specified, it is set to the default limit. + # + # To allow clients to apply overrides with no upper bound, set this to -1, + # indicating unlimited maximum quota. + # + # Used by group-based quotas only. + # @!attribute [rw] free_tier + # @return [::Integer] + # Free tier value displayed in the Developers Console for this limit. + # The free tier is the number of tokens that will be subtracted from the + # billed amount when billing is enabled. + # This field can only be set on a limit with duration "1d", in a billable + # group; it is invalid on any other limit. If this field is not set, it + # defaults to 0, indicating that there is no free tier for this service. + # + # Used by group-based quotas only. + # @!attribute [rw] duration + # @return [::String] + # Duration of this limit in textual notation. Must be "100s" or "1d". + # + # Used by group-based quotas only. + # @!attribute [rw] metric + # @return [::String] + # The name of the metric this quota limit applies to. The quota limits with + # the same metric will be checked together during runtime. The metric must be + # defined within the service config. + # @!attribute [rw] unit + # @return [::String] + # Specify the unit of the quota limit. It uses the same syntax as + # {::Google::Api::MetricDescriptor#unit MetricDescriptor.unit}. The supported + # unit kinds are determined by the quota backend system. + # + # Here are some examples: + # * "1/min/\\{project}" for quota per minute per project. + # + # Note: the order of unit components is insignificant. + # The "1" at the beginning is required to follow the metric unit syntax. + # @!attribute [rw] values + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # Tiered limit values. You must specify this as a key:value pair, with an + # integer value that is the maximum number of requests allowed for the + # specified unit. Currently only STANDARD is supported. + # @!attribute [rw] display_name + # @return [::String] + # User-visible display name for this limit. + # Optional. If not set, the UI will provide a default display name based on + # the quota configuration. This field can be used to override the default + # display name generated from the configuration. + class QuotaLimit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class ValuesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/service.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/service.rb new file mode 100644 index 000000000000..49f36f188207 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/service.rb @@ -0,0 +1,170 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # `Service` is the root object of Google API service configuration (service + # config). It describes the basic information about a logical service, + # such as the service name and the user-facing title, and delegates other + # aspects to sub-sections. Each sub-section is either a proto message or a + # repeated proto message that configures a specific aspect, such as auth. + # For more information, see each proto message definition. + # + # Example: + # + # type: google.api.Service + # name: calendar.googleapis.com + # title: Google Calendar API + # apis: + # - name: google.calendar.v3.Calendar + # + # visibility: + # rules: + # - selector: "google.calendar.v3.*" + # restriction: PREVIEW + # backend: + # rules: + # - selector: "google.calendar.v3.*" + # address: calendar.example.com + # + # authentication: + # providers: + # - id: google_calendar_auth + # jwks_uri: https://www.googleapis.com/oauth2/v1/certs + # issuer: https://securetoken.google.com + # rules: + # - selector: "*" + # requirements: + # provider_id: google_calendar_auth + # @!attribute [rw] name + # @return [::String] + # The service name, which is a DNS-like logical identifier for the + # service, such as `calendar.googleapis.com`. The service name + # typically goes through DNS verification to make sure the owner + # of the service also owns the DNS name. + # @!attribute [rw] title + # @return [::String] + # The product title for this service, it is the name displayed in Google + # Cloud Console. + # @!attribute [rw] producer_project_id + # @return [::String] + # The Google project that owns this service. + # @!attribute [rw] id + # @return [::String] + # A unique ID for a specific instance of this message, typically assigned + # by the client for tracking purpose. Must be no longer than 63 characters + # and only lower case letters, digits, '.', '_' and '-' are allowed. If + # empty, the server may choose to generate one instead. + # @!attribute [rw] apis + # @return [::Array<::Google::Protobuf::Api>] + # A list of API interfaces exported by this service. Only the `name` field + # of the {::Google::Protobuf::Api google.protobuf.Api} needs to be provided by + # the configuration author, as the remaining fields will be derived from the + # IDL during the normalization process. It is an error to specify an API + # interface here which cannot be resolved against the associated IDL files. + # @!attribute [rw] types + # @return [::Array<::Google::Protobuf::Type>] + # A list of all proto message types included in this API service. + # Types referenced directly or indirectly by the `apis` are automatically + # included. Messages which are not referenced but shall be included, such as + # types used by the `google.protobuf.Any` type, should be listed here by + # name by the configuration author. Example: + # + # types: + # - name: google.protobuf.Int32 + # @!attribute [rw] enums + # @return [::Array<::Google::Protobuf::Enum>] + # A list of all enum types included in this API service. Enums referenced + # directly or indirectly by the `apis` are automatically included. Enums + # which are not referenced but shall be included should be listed here by + # name by the configuration author. Example: + # + # enums: + # - name: google.someapi.v1.SomeEnum + # @!attribute [rw] documentation + # @return [::Google::Api::Documentation] + # Additional API documentation. + # @!attribute [rw] backend + # @return [::Google::Api::Backend] + # API backend configuration. + # @!attribute [rw] http + # @return [::Google::Api::Http] + # HTTP configuration. + # @!attribute [rw] quota + # @return [::Google::Api::Quota] + # Quota configuration. + # @!attribute [rw] authentication + # @return [::Google::Api::Authentication] + # Auth configuration. + # @!attribute [rw] context + # @return [::Google::Api::Context] + # Context configuration. + # @!attribute [rw] usage + # @return [::Google::Api::Usage] + # Configuration controlling usage of this service. + # @!attribute [rw] endpoints + # @return [::Array<::Google::Api::Endpoint>] + # Configuration for network endpoints. If this is empty, then an endpoint + # with the same name as the service is automatically generated to service all + # defined APIs. + # @!attribute [rw] control + # @return [::Google::Api::Control] + # Configuration for the service control plane. + # @!attribute [rw] logs + # @return [::Array<::Google::Api::LogDescriptor>] + # Defines the logs used by this service. + # @!attribute [rw] metrics + # @return [::Array<::Google::Api::MetricDescriptor>] + # Defines the metrics used by this service. + # @!attribute [rw] monitored_resources + # @return [::Array<::Google::Api::MonitoredResourceDescriptor>] + # Defines the monitored resources used by this service. This is required + # by the `Service.monitoring` and `Service.logging` configurations. + # @!attribute [rw] billing + # @return [::Google::Api::Billing] + # Billing configuration. + # @!attribute [rw] logging + # @return [::Google::Api::Logging] + # Logging configuration. + # @!attribute [rw] monitoring + # @return [::Google::Api::Monitoring] + # Monitoring configuration. + # @!attribute [rw] system_parameters + # @return [::Google::Api::SystemParameters] + # System parameter configuration. + # @!attribute [rw] source_info + # @return [::Google::Api::SourceInfo] + # Output only. The source information for this configuration if available. + # @!attribute [rw] publishing + # @return [::Google::Api::Publishing] + # Settings for [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from APIs defined as protocol buffers. + # @!attribute [rw] config_version + # @return [::Google::Protobuf::UInt32Value] + # Obsolete. Do not use. + # + # This field has no semantic meaning. The service config compiler always + # sets this field to `3`. + class Service + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/resources.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/resources.rb new file mode 100644 index 000000000000..a314ecbf57fa --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/resources.rb @@ -0,0 +1,332 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceManagement + module V1 + # The full representation of a Service that is managed by + # Google Service Management. + # @!attribute [rw] service_name + # @return [::String] + # The name of the service. See the + # [overview](https://cloud.google.com/service-infrastructure/docs/overview) + # for naming requirements. + # @!attribute [rw] producer_project_id + # @return [::String] + # ID of the project that produces and owns this service. + class ManagedService + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metadata associated with a long running operation resource. + # @!attribute [rw] resource_names + # @return [::Array<::String>] + # The full name of the resources that this operation is directly + # associated with. + # @!attribute [rw] steps + # @return [::Array<::Google::Cloud::ServiceManagement::V1::OperationMetadata::Step>] + # Detailed status information for each step. The order is undetermined. + # @!attribute [rw] progress_percentage + # @return [::Integer] + # Percentage of completion of this operation, ranging from 0 to 100. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The start time of the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the status of one operation step. + # @!attribute [rw] description + # @return [::String] + # The short description of the step. + # @!attribute [rw] status + # @return [::Google::Cloud::ServiceManagement::V1::OperationMetadata::Status] + # The status code. + class Step + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Code describes the status of the operation (or one of its steps). + module Status + # Unspecifed code. + STATUS_UNSPECIFIED = 0 + + # The operation or step has completed without errors. + DONE = 1 + + # The operation or step has not started yet. + NOT_STARTED = 2 + + # The operation or step is in progress. + IN_PROGRESS = 3 + + # The operation or step has completed with errors. If the operation is + # rollbackable, the rollback completed with errors too. + FAILED = 4 + + # The operation or step has completed with cancellation. + CANCELLED = 5 + end + end + + # Represents a diagnostic message (error or warning) + # @!attribute [rw] location + # @return [::String] + # File name and line number of the error or warning. + # @!attribute [rw] kind + # @return [::Google::Cloud::ServiceManagement::V1::Diagnostic::Kind] + # The kind of diagnostic information provided. + # @!attribute [rw] message + # @return [::String] + # Message describing the error or warning. + class Diagnostic + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The kind of diagnostic information possible. + module Kind + # Warnings and errors + WARNING = 0 + + # Only errors + ERROR = 1 + end + end + + # Represents a source file which is used to generate the service configuration + # defined by `google.api.Service`. + # @!attribute [rw] id + # @return [::String] + # A unique ID for a specific instance of this message, typically assigned + # by the client for tracking purpose. If empty, the server may choose to + # generate one instead. + # @!attribute [rw] files + # @return [::Array<::Google::Cloud::ServiceManagement::V1::ConfigFile>] + # Set of source configuration files that are used to generate a service + # configuration (`google.api.Service`). + class ConfigSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Generic specification of a source configuration file + # @!attribute [rw] file_path + # @return [::String] + # The file name of the configuration file (full or relative path). + # @!attribute [rw] file_contents + # @return [::String] + # The bytes that constitute the file. + # @!attribute [rw] file_type + # @return [::Google::Cloud::ServiceManagement::V1::ConfigFile::FileType] + # The type of configuration file this represents. + class ConfigFile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module FileType + # Unknown file type. + FILE_TYPE_UNSPECIFIED = 0 + + # YAML-specification of service. + SERVICE_CONFIG_YAML = 1 + + # OpenAPI specification, serialized in JSON. + OPEN_API_JSON = 2 + + # OpenAPI specification, serialized in YAML. + OPEN_API_YAML = 3 + + # FileDescriptorSet, generated by protoc. + # + # To generate, use protoc with imports and source info included. + # For an example test.proto file, the following command would put the value + # in a new file named out.pb. + # + # $protoc --include_imports --include_source_info test.proto -o out.pb + FILE_DESCRIPTOR_SET_PROTO = 4 + + # Uncompiled Proto file. Used for storage and display purposes only, + # currently server-side compilation is not supported. Should match the + # inputs to 'protoc' command used to generated FILE_DESCRIPTOR_SET_PROTO. A + # file of this type can only be included if at least one file of type + # FILE_DESCRIPTOR_SET_PROTO is included. + PROTO_FILE = 6 + end + end + + # Represents a service configuration with its name and id. + # @!attribute [rw] name + # @return [::String] + # Resource name of a service config. It must have the following + # format: "services/\\{service name}/configs/\\{config id}". + class ConfigRef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Change report associated with a particular service configuration. + # + # It contains a list of ConfigChanges based on the comparison between + # two service configurations. + # @!attribute [rw] config_changes + # @return [::Array<::Google::Api::ConfigChange>] + # List of changes between two service configurations. + # The changes will be alphabetically sorted based on the identifier + # of each change. + # A ConfigChange identifier is a dot separated path to the configuration. + # Example: visibility.rules[selector='LibraryService.CreateBook'].restriction + class ChangeReport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A rollout resource that defines how service configuration versions are pushed + # to control plane systems. Typically, you create a new version of the + # service config, and then create a Rollout to push the service config. + # @!attribute [rw] rollout_id + # @return [::String] + # Optional. Unique identifier of this Rollout. Must be no longer than 63 + # characters and only lower case letters, digits, '.', '_' and '-' are + # allowed. + # + # If not specified by client, the server will generate one. The generated id + # will have the form of , where "date" is the create + # date in ISO 8601 format. "revision number" is a monotonically increasing + # positive number that is reset every day for each service. + # An example of the generated rollout_id is '2016-02-16r1' + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Creation time of the rollout. Readonly. + # @!attribute [rw] created_by + # @return [::String] + # The user who created the Rollout. Readonly. + # @!attribute [rw] status + # @return [::Google::Cloud::ServiceManagement::V1::Rollout::RolloutStatus] + # The status of this rollout. Readonly. In case of a failed rollout, + # the system will automatically rollback to the current Rollout + # version. Readonly. + # @!attribute [rw] traffic_percent_strategy + # @return [::Google::Cloud::ServiceManagement::V1::Rollout::TrafficPercentStrategy] + # Google Service Control selects service configurations based on + # traffic percentage. + # + # Note: The following fields are mutually exclusive: `traffic_percent_strategy`, `delete_service_strategy`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_service_strategy + # @return [::Google::Cloud::ServiceManagement::V1::Rollout::DeleteServiceStrategy] + # The strategy associated with a rollout to delete a `ManagedService`. + # Readonly. + # + # Note: The following fields are mutually exclusive: `delete_service_strategy`, `traffic_percent_strategy`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] service_name + # @return [::String] + # The name of the service associated with this Rollout. + class Rollout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Strategy that specifies how clients of Google Service Controller want to + # send traffic to use different config versions. This is generally + # used by API proxy to split traffic based on your configured percentage for + # each config version. + # + # One example of how to gradually rollout a new service configuration using + # this + # strategy: + # Day 1 + # + # Rollout { + # id: "example.googleapis.com/rollout_20160206" + # traffic_percent_strategy { + # percentages: { + # "example.googleapis.com/20160201": 70.00 + # "example.googleapis.com/20160206": 30.00 + # } + # } + # } + # + # Day 2 + # + # Rollout { + # id: "example.googleapis.com/rollout_20160207" + # traffic_percent_strategy: { + # percentages: { + # "example.googleapis.com/20160206": 100.00 + # } + # } + # } + # @!attribute [rw] percentages + # @return [::Google::Protobuf::Map{::String => ::Float}] + # Maps service configuration IDs to their corresponding traffic percentage. + # Key is the service configuration ID, Value is the traffic percentage + # which must be greater than 0.0 and the sum must equal to 100.0. + class TrafficPercentStrategy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Float] + class PercentagesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Strategy used to delete a service. This strategy is a placeholder only + # used by the system generated rollout to delete a service. + class DeleteServiceStrategy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Status of a Rollout. + module RolloutStatus + # No status specified. + ROLLOUT_STATUS_UNSPECIFIED = 0 + + # The Rollout is in progress. + IN_PROGRESS = 1 + + # The Rollout has completed successfully. + SUCCESS = 2 + + # The Rollout has been cancelled. This can happen if you have overlapping + # Rollout pushes, and the previous ones will be cancelled. + CANCELLED = 3 + + # The Rollout has failed and the rollback attempt has failed too. + FAILED = 4 + + # The Rollout has not started yet and is pending for execution. + PENDING = 5 + + # The Rollout has failed and rolled back to the previous successful + # Rollout. + FAILED_ROLLED_BACK = 6 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/servicemanager.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/servicemanager.rb new file mode 100644 index 000000000000..8d0f61c93e76 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/servicemanager.rb @@ -0,0 +1,334 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceManagement + module V1 + # Request message for `ListServices` method. + # @!attribute [rw] producer_project_id + # @return [::String] + # Include services produced by the specified project. + # @!attribute [rw] page_size + # @return [::Integer] + # The max number of items to include in the response list. Page size is 50 + # if not specified. Maximum value is 500. + # @!attribute [rw] page_token + # @return [::String] + # Token identifying which result to start with; returned by a previous list + # call. + # @!attribute [rw] consumer_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Include services consumed by the specified consumer. + # + # The Google Service Management implementation accepts the following + # forms: + # - project: + class ListServicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `ListServices` method. + # @!attribute [rw] services + # @return [::Array<::Google::Cloud::ServiceManagement::V1::ManagedService>] + # The returned services will only have the name field set. + # @!attribute [rw] next_page_token + # @return [::String] + # Token that can be passed to `ListServices` to resume a paginated query. + class ListServicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetService` method. + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the `ServiceManager` overview for + # naming requirements. For example: `example.googleapis.com`. + class GetServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateService method. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] + # Required. Initial values for the service resource. + class CreateServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteService method. + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + class DeleteServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UndeleteService method. + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + class UndeleteServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for UndeleteService method. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] + # Revived service resource. + class UndeleteServiceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetServiceConfig method. + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @!attribute [rw] config_id + # @return [::String] + # Required. The id of the service configuration resource. + # + # This field must be specified for the server to return all fields, including + # `SourceInfo`. + # @!attribute [rw] view + # @return [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest::ConfigView] + # Specifies which parts of the Service Config should be returned in the + # response. + class GetServiceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module ConfigView + # Server response includes all fields except SourceInfo. + BASIC = 0 + + # Server response includes all fields including SourceInfo. + # SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile' + # and are only available for configs created using the + # SubmitConfigSource method. + FULL = 1 + end + end + + # Request message for ListServiceConfigs method. + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @!attribute [rw] page_token + # @return [::String] + # The token of the page to retrieve. + # @!attribute [rw] page_size + # @return [::Integer] + # The max number of items to include in the response list. Page size is 50 + # if not specified. Maximum value is 100. + class ListServiceConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListServiceConfigs method. + # @!attribute [rw] service_configs + # @return [::Array<::Google::Api::Service>] + # The list of service configuration resources. + # @!attribute [rw] next_page_token + # @return [::String] + # The token of the next page of results. + class ListServiceConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateServiceConfig method. + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @!attribute [rw] service_config + # @return [::Google::Api::Service] + # Required. The service configuration resource. + class CreateServiceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for SubmitConfigSource method. + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @!attribute [rw] config_source + # @return [::Google::Cloud::ServiceManagement::V1::ConfigSource] + # Required. The source configuration for the service. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, this will result in the generation of a + # `google.api.Service` configuration based on the `ConfigSource` provided, + # but the generated config and the sources will NOT be persisted. + class SubmitConfigSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for SubmitConfigSource method. + # @!attribute [rw] service_config + # @return [::Google::Api::Service] + # The generated service configuration. + class SubmitConfigSourceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateServiceRollout' + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @!attribute [rw] rollout + # @return [::Google::Cloud::ServiceManagement::V1::Rollout] + # Required. The rollout resource. The `service_name` field is output only. + class CreateServiceRolloutRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListServiceRollouts' + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @!attribute [rw] page_token + # @return [::String] + # The token of the page to retrieve. + # @!attribute [rw] page_size + # @return [::Integer] + # The max number of items to include in the response list. Page size is 50 + # if not specified. Maximum value is 100. + # @!attribute [rw] filter + # @return [::String] + # Required. Use `filter` to return subset of rollouts. + # The following filters are supported: + # + # -- By [status] + # [google.api.servicemanagement.v1.Rollout.RolloutStatus]. For example, + # `filter='status=SUCCESS'` + # + # -- By [strategy] + # [google.api.servicemanagement.v1.Rollout.strategy]. For example, + # `filter='strategy=TrafficPercentStrategy'` + class ListServiceRolloutsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListServiceRollouts method. + # @!attribute [rw] rollouts + # @return [::Array<::Google::Cloud::ServiceManagement::V1::Rollout>] + # The list of rollout resources. + # @!attribute [rw] next_page_token + # @return [::String] + # The token of the next page of results. + class ListServiceRolloutsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetServiceRollout method. + # @!attribute [rw] service_name + # @return [::String] + # Required. The name of the service. See the + # [overview](https://cloud.google.com/service-management/overview) for naming + # requirements. For example: `example.googleapis.com`. + # @!attribute [rw] rollout_id + # @return [::String] + # Required. The id of the rollout resource. + class GetServiceRolloutRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Operation payload for EnableService method. + class EnableServiceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GenerateConfigReport method. + # @!attribute [rw] new_config + # @return [::Google::Protobuf::Any] + # Required. Service configuration for which we want to generate the report. + # For this version of API, the supported types are + # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, + # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, + # and {::Google::Api::Service google.api.Service} + # @!attribute [rw] old_config + # @return [::Google::Protobuf::Any] + # Optional. Service configuration against which the comparison will be done. + # For this version of API, the supported types are + # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, + # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, + # and {::Google::Api::Service google.api.Service} + class GenerateConfigReportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for GenerateConfigReport method. + # @!attribute [rw] service_name + # @return [::String] + # Name of the service this report belongs to. + # @!attribute [rw] id + # @return [::String] + # ID of the service configuration this report belongs to. + # @!attribute [rw] change_reports + # @return [::Array<::Google::Cloud::ServiceManagement::V1::ChangeReport>] + # list of ChangeReport, each corresponding to comparison between two + # service configurations. + # @!attribute [rw] diagnostics + # @return [::Array<::Google::Cloud::ServiceManagement::V1::Diagnostic>] + # Errors / Linter warnings associated with the service definition this + # report + # belongs to. + class GenerateConfigReportResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/source_info.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/source_info.rb new file mode 100644 index 000000000000..c7bfc8db0769 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/source_info.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Source information used to create a Service Config + # @!attribute [rw] source_files + # @return [::Array<::Google::Protobuf::Any>] + # All files used during config generation. + class SourceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/system_parameter.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/system_parameter.rb new file mode 100644 index 000000000000..4bb72da7b22c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/system_parameter.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # ### System parameter configuration + # + # A system parameter is a special kind of parameter defined by the API + # system, not by an individual API. It is typically mapped to an HTTP header + # and/or a URL query parameter. This configuration specifies which methods + # change the names of the system parameters. + # @!attribute [rw] rules + # @return [::Array<::Google::Api::SystemParameterRule>] + # Define system parameters. + # + # The parameters defined here will override the default parameters + # implemented by the system. If this field is missing from the service + # config, default system parameters will be used. Default system parameters + # and names is implementation-dependent. + # + # Example: define api key for all methods + # + # system_parameters + # rules: + # - selector: "*" + # parameters: + # - name: api_key + # url_query_parameter: api_key + # + # + # Example: define 2 api key names for a specific method. + # + # system_parameters + # rules: + # - selector: "/ListShelves" + # parameters: + # - name: api_key + # http_header: Api-Key1 + # - name: api_key + # http_header: Api-Key2 + # + # **NOTE:** All service configuration rules follow "last one wins" order. + class SystemParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Define a system parameter rule mapping system parameter definitions to + # methods. + # @!attribute [rw] selector + # @return [::String] + # Selects the methods to which this rule applies. Use '*' to indicate all + # methods in all APIs. + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # @!attribute [rw] parameters + # @return [::Array<::Google::Api::SystemParameter>] + # Define parameters. Multiple names may be defined for a parameter. + # For a given method call, only one of them should be used. If multiple + # names are used the behavior is implementation-dependent. + # If none of the specified names are present the behavior is + # parameter-dependent. + class SystemParameterRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Define a parameter's name and location. The parameter may be passed as either + # an HTTP header or a URL query parameter, and if both are passed the behavior + # is implementation-dependent. + # @!attribute [rw] name + # @return [::String] + # Define the name of the parameter, such as "api_key" . It is case sensitive. + # @!attribute [rw] http_header + # @return [::String] + # Define the HTTP header name to use for the parameter. It is case + # insensitive. + # @!attribute [rw] url_query_parameter + # @return [::String] + # Define the URL query parameter name to use for the parameter. It is case + # sensitive. + class SystemParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/usage.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/usage.rb new file mode 100644 index 000000000000..42ed23536d71 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/usage.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Configuration controlling usage of a service. + # @!attribute [rw] requirements + # @return [::Array<::String>] + # Requirements that must be satisfied before a consumer project can use the + # service. Each requirement is of the form /; + # for example 'serviceusage.googleapis.com/billing-enabled'. + # + # For Google APIs, a Terms of Service requirement must be included here. + # Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". + # Other Google APIs should include + # "serviceusage.googleapis.com/tos/universal". Additional ToS can be + # included based on the business needs. + # @!attribute [rw] rules + # @return [::Array<::Google::Api::UsageRule>] + # A list of usage rules that apply to individual API methods. + # + # **NOTE:** All service configuration rules follow "last one wins" order. + # @!attribute [rw] producer_notification_channel + # @return [::String] + # The full resource name of a channel used for sending notifications to the + # service producer. + # + # Google Service Management currently only supports + # [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + # channel. To use Google Cloud Pub/Sub as the channel, this must be the name + # of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format + # documented in https://cloud.google.com/pubsub/docs/overview. + class Usage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Usage configuration rules for the service. + # @!attribute [rw] selector + # @return [::String] + # Selects the methods to which this rule applies. Use '*' to indicate all + # methods in all APIs. + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # @!attribute [rw] allow_unregistered_calls + # @return [::Boolean] + # Use this rule to configure unregistered calls for the service. Unregistered + # calls are calls that do not contain consumer project identity. + # (Example: calls that do not contain an API key). + # + # WARNING: By default, API methods do not allow unregistered calls, and each + # method call must be identified by a consumer project identity. + # @!attribute [rw] skip_service_control + # @return [::Boolean] + # If true, the selected method should skip service control and the control + # plane features, such as quota and billing, will not be available. + # This flag is used by Google Cloud Endpoints to bypass checks for internal + # methods, such as service health check methods. + class UsageRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-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-service_management-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/api.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/api.rb new file mode 100644 index 000000000000..9817de10b446 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/api.rb @@ -0,0 +1,194 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Api is a light-weight descriptor for an API Interface. + # + # Interfaces are also described as "protocol buffer services" in some contexts, + # such as by the "service" keyword in a .proto file, but they are different + # from API Services, which represent a concrete implementation of an interface + # as opposed to simply a description of methods and bindings. They are also + # sometimes simply referred to as "APIs" in other contexts, such as the name of + # this message itself. See https://cloud.google.com/apis/design/glossary for + # detailed terminology. + # @!attribute [rw] name + # @return [::String] + # The fully qualified name of this interface, including package name + # followed by the interface's simple name. + # @!attribute [rw] methods + # @return [::Array<::Google::Protobuf::Method>] + # The methods of this interface, in unspecified order. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # Any metadata attached to the interface. + # @!attribute [rw] version + # @return [::String] + # A version string for this interface. If specified, must have the form + # `major-version.minor-version`, as in `1.10`. If the minor version is + # omitted, it defaults to zero. If the entire version field is empty, the + # major version is derived from the package name, as outlined below. If the + # field is not empty, the version in the package name will be verified to be + # consistent with what is provided here. + # + # The versioning schema uses [semantic + # versioning](http://semver.org) where the major version number + # indicates a breaking change and the minor version an additive, + # non-breaking change. Both version numbers are signals to users + # what to expect from different versions, and should be carefully + # chosen based on the product plan. + # + # The major version is also reflected in the package name of the + # interface, which must end in `v`, as in + # `google.feature.v1`. For major versions 0 and 1, the suffix can + # be omitted. Zero major versions must only be used for + # experimental, non-GA interfaces. + # @!attribute [rw] source_context + # @return [::Google::Protobuf::SourceContext] + # Source context for the protocol buffer service represented by this + # message. + # @!attribute [rw] mixins + # @return [::Array<::Google::Protobuf::Mixin>] + # Included interfaces. See [Mixin][]. + # @!attribute [rw] syntax + # @return [::Google::Protobuf::Syntax] + # The source syntax of the service. + class Api + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Method represents a method of an API interface. + # @!attribute [rw] name + # @return [::String] + # The simple name of this method. + # @!attribute [rw] request_type_url + # @return [::String] + # A URL of the input message type. + # @!attribute [rw] request_streaming + # @return [::Boolean] + # If true, the request is streamed. + # @!attribute [rw] response_type_url + # @return [::String] + # The URL of the output message type. + # @!attribute [rw] response_streaming + # @return [::Boolean] + # If true, the response is streamed. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # Any metadata attached to the method. + # @!attribute [rw] syntax + # @return [::Google::Protobuf::Syntax] + # The source syntax of this method. + class Method + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Declares an API Interface to be included in this interface. The including + # interface must redeclare all the methods from the included interface, but + # documentation and options are inherited as follows: + # + # - If after comment and whitespace stripping, the documentation + # string of the redeclared method is empty, it will be inherited + # from the original method. + # + # - Each annotation belonging to the service config (http, + # visibility) which is not set in the redeclared method will be + # inherited. + # + # - If an http annotation is inherited, the path pattern will be + # modified as follows. Any version prefix will be replaced by the + # version of the including interface plus the [root][] path if + # specified. + # + # Example of a simple mixin: + # + # package google.acl.v1; + # service AccessControl { + # // Get the underlying ACL object. + # rpc GetAcl(GetAclRequest) returns (Acl) { + # option (google.api.http).get = "/v1/{resource=**}:getAcl"; + # } + # } + # + # package google.storage.v2; + # service Storage { + # rpc GetAcl(GetAclRequest) returns (Acl); + # + # // Get a data record. + # rpc GetData(GetDataRequest) returns (Data) { + # option (google.api.http).get = "/v2/{resource=**}"; + # } + # } + # + # Example of a mixin configuration: + # + # apis: + # - name: google.storage.v2.Storage + # mixins: + # - name: google.acl.v1.AccessControl + # + # The mixin construct implies that all methods in `AccessControl` are + # also declared with same name and request/response types in + # `Storage`. A documentation generator or annotation processor will + # see the effective `Storage.GetAcl` method after inheriting + # documentation and annotations as follows: + # + # service Storage { + # // Get the underlying ACL object. + # rpc GetAcl(GetAclRequest) returns (Acl) { + # option (google.api.http).get = "/v2/{resource=**}:getAcl"; + # } + # ... + # } + # + # Note how the version in the path pattern changed from `v1` to `v2`. + # + # If the `root` field in the mixin is specified, it should be a + # relative path under which inherited HTTP paths are placed. Example: + # + # apis: + # - name: google.storage.v2.Storage + # mixins: + # - name: google.acl.v1.AccessControl + # root: acls + # + # This implies the following inherited HTTP annotation: + # + # service Storage { + # // Get the underlying ACL object. + # rpc GetAcl(GetAclRequest) returns (Acl) { + # option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + # } + # ... + # } + # @!attribute [rw] name + # @return [::String] + # The fully qualified name of the interface which is included. + # @!attribute [rw] root + # @return [::String] + # If non-empty specifies a path under which inherited HTTP paths + # are rooted. + class Mixin + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/source_context.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/source_context.rb new file mode 100644 index 000000000000..1bc7c0900aec --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/source_context.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `SourceContext` represents information about the source of a + # protobuf element, like the file in which it is defined. + # @!attribute [rw] file_name + # @return [::String] + # The path-qualified name of the .proto file that contained the associated + # protobuf element. For example: `"google/protobuf/source_context.proto"`. + class SourceContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/type.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/type.rb new file mode 100644 index 000000000000..f61674e32d16 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/type.rb @@ -0,0 +1,232 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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 protocol buffer message type. + # @!attribute [rw] name + # @return [::String] + # The fully qualified message name. + # @!attribute [rw] fields + # @return [::Array<::Google::Protobuf::Field>] + # The list of fields. + # @!attribute [rw] oneofs + # @return [::Array<::String>] + # The list of types appearing in `oneof` definitions in this type. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # The protocol buffer options. + # @!attribute [rw] source_context + # @return [::Google::Protobuf::SourceContext] + # The source context. + # @!attribute [rw] syntax + # @return [::Google::Protobuf::Syntax] + # The source syntax. + # @!attribute [rw] edition + # @return [::String] + # The source edition string, only valid when syntax is SYNTAX_EDITIONS. + class Type + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A single field of a message type. + # @!attribute [rw] kind + # @return [::Google::Protobuf::Field::Kind] + # The field type. + # @!attribute [rw] cardinality + # @return [::Google::Protobuf::Field::Cardinality] + # The field cardinality. + # @!attribute [rw] number + # @return [::Integer] + # The field number. + # @!attribute [rw] name + # @return [::String] + # The field name. + # @!attribute [rw] type_url + # @return [::String] + # The field type URL, without the scheme, for message or enumeration + # types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + # @!attribute [rw] oneof_index + # @return [::Integer] + # The index of the field type in `Type.oneofs`, for message or enumeration + # types. The first type has index 1; zero means the type is not in the list. + # @!attribute [rw] packed + # @return [::Boolean] + # Whether to use alternative packed wire representation. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # The protocol buffer options. + # @!attribute [rw] json_name + # @return [::String] + # The field JSON name. + # @!attribute [rw] default_value + # @return [::String] + # The string value of the default value of this field. Proto2 syntax only. + class Field + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Basic field types. + module Kind + # Field type unknown. + TYPE_UNKNOWN = 0 + + # Field type double. + TYPE_DOUBLE = 1 + + # Field type float. + TYPE_FLOAT = 2 + + # Field type int64. + TYPE_INT64 = 3 + + # Field type uint64. + TYPE_UINT64 = 4 + + # Field type int32. + TYPE_INT32 = 5 + + # Field type fixed64. + TYPE_FIXED64 = 6 + + # Field type fixed32. + TYPE_FIXED32 = 7 + + # Field type bool. + TYPE_BOOL = 8 + + # Field type string. + TYPE_STRING = 9 + + # Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10 + + # Field type message. + TYPE_MESSAGE = 11 + + # Field type bytes. + TYPE_BYTES = 12 + + # Field type uint32. + TYPE_UINT32 = 13 + + # Field type enum. + TYPE_ENUM = 14 + + # Field type sfixed32. + TYPE_SFIXED32 = 15 + + # Field type sfixed64. + TYPE_SFIXED64 = 16 + + # Field type sint32. + TYPE_SINT32 = 17 + + # Field type sint64. + TYPE_SINT64 = 18 + end + + # Whether a field is optional, required, or repeated. + module Cardinality + # For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0 + + # For optional fields. + CARDINALITY_OPTIONAL = 1 + + # For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2 + + # For repeated fields. + CARDINALITY_REPEATED = 3 + end + end + + # Enum type definition. + # @!attribute [rw] name + # @return [::String] + # Enum type name. + # @!attribute [rw] enumvalue + # @return [::Array<::Google::Protobuf::EnumValue>] + # Enum value definitions. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # Protocol buffer options. + # @!attribute [rw] source_context + # @return [::Google::Protobuf::SourceContext] + # The source context. + # @!attribute [rw] syntax + # @return [::Google::Protobuf::Syntax] + # The source syntax. + # @!attribute [rw] edition + # @return [::String] + # The source edition string, only valid when syntax is SYNTAX_EDITIONS. + class Enum + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enum value definition. + # @!attribute [rw] name + # @return [::String] + # Enum value name. + # @!attribute [rw] number + # @return [::Integer] + # Enum value number. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # Protocol buffer options. + class EnumValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A protocol buffer option, which can be attached to a message, field, + # enumeration, etc. + # @!attribute [rw] name + # @return [::String] + # The option's name. For protobuf built-in options (options defined in + # descriptor.proto), this is the short name. For example, `"map_entry"`. + # For custom options, it should be the fully-qualified name. For example, + # `"google.api.http"`. + # @!attribute [rw] value + # @return [::Google::Protobuf::Any] + # The option's value packed in an Any message. If the value is a primitive, + # the corresponding wrapper type defined in google/protobuf/wrappers.proto + # should be used. If the value is an enum, it should be stored as an int32 + # value using the google.protobuf.Int32Value type. + class Option + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The syntax in which a protocol buffer element is defined. + module Syntax + # Syntax `proto2`. + SYNTAX_PROTO2 = 0 + + # Syntax `proto3`. + SYNTAX_PROTO3 = 1 + + # Syntax `editions`. + SYNTAX_EDITIONS = 2 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..9a7c0269fa42 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_management-v1/snippets/Gemfile new file mode 100644 index 000000000000..c216e7e1548e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-service_management-v1", path: "../" +else + gem "google-cloud-service_management-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service.rb new file mode 100644 index 000000000000..1c68ff74701c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_CreateService_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the create_service call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service. +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new + + # Call the create_service method. + result = client.create_service request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END servicemanagement_v1_generated_ServiceManager_CreateService_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb new file mode 100644 index 000000000000..11c36e9ef1af --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_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 servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the create_service_config call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_config. +# +def create_service_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new + + # Call the create_service_config method. + result = client.create_service_config request + + # The returned object is of type Google::Api::Service. + p result +end +# [END servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb new file mode 100644 index 000000000000..3676dfc62845 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the create_service_rollout call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout. +# +def create_service_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new + + # Call the create_service_rollout method. + result = client.create_service_rollout request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb new file mode 100644 index 000000000000..510fb8a4ad39 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_DeleteService_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the delete_service call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#delete_service. +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new + + # Call the delete_service method. + result = client.delete_service request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END servicemanagement_v1_generated_ServiceManager_DeleteService_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb new file mode 100644 index 000000000000..842fe0c160e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the generate_config_report call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#generate_config_report. +# +def generate_config_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new + + # Call the generate_config_report method. + result = client.generate_config_report request + + # The returned object is of type Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse. + p result +end +# [END servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service.rb new file mode 100644 index 000000000000..467349ad1ee9 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_GetService_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the get_service call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service. +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::GetServiceRequest.new + + # Call the get_service method. + result = client.get_service request + + # The returned object is of type Google::Cloud::ServiceManagement::V1::ManagedService. + p result +end +# [END servicemanagement_v1_generated_ServiceManager_GetService_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb new file mode 100644 index 000000000000..610df5b47573 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_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 servicemanagement_v1_generated_ServiceManager_GetServiceConfig_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the get_service_config call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_config. +# +def get_service_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new + + # Call the get_service_config method. + result = client.get_service_config request + + # The returned object is of type Google::Api::Service. + p result +end +# [END servicemanagement_v1_generated_ServiceManager_GetServiceConfig_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb new file mode 100644 index 000000000000..3dda230e49fb --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_GetServiceRollout_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the get_service_rollout call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_rollout. +# +def get_service_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new + + # Call the get_service_rollout method. + result = client.get_service_rollout request + + # The returned object is of type Google::Cloud::ServiceManagement::V1::Rollout. + p result +end +# [END servicemanagement_v1_generated_ServiceManager_GetServiceRollout_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb new file mode 100644 index 000000000000..eeb38ca2aff8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the list_service_configs call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_configs. +# +def list_service_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new + + # Call the list_service_configs method. + result = client.list_service_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Api::Service. + p item + end +end +# [END servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb new file mode 100644 index 000000000000..589785deffe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the list_service_rollouts call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_rollouts. +# +def list_service_rollouts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new + + # Call the list_service_rollouts method. + result = client.list_service_rollouts request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceManagement::V1::Rollout. + p item + end +end +# [END servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_services.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_services.rb new file mode 100644 index 000000000000..eb978eb8fc46 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_services.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_ListServices_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the list_services call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_services. +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::ListServicesRequest.new + + # Call the list_services method. + result = client.list_services request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceManagement::V1::ManagedService. + p item + end +end +# [END servicemanagement_v1_generated_ServiceManager_ListServices_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb new file mode 100644 index 000000000000..329b0d68e2f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the submit_config_source call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#submit_config_source. +# +def submit_config_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new + + # Call the submit_config_source method. + result = client.submit_config_source request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb new file mode 100644 index 000000000000..e6831d656f74 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START servicemanagement_v1_generated_ServiceManager_UndeleteService_sync] +require "google/cloud/service_management/v1" + +## +# Snippet for the undelete_service call in the ServiceManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service. +# +def undelete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new + + # Call the undelete_service method. + result = client.undelete_service request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END servicemanagement_v1_generated_ServiceManager_UndeleteService_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json b/owl-bot-staging/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json new file mode 100644 index 000000000000..6e3a8680e282 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json @@ -0,0 +1,535 @@ +{ + "client_library": { + "name": "google-cloud-service_management-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.api.servicemanagement.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_ListServices_sync", + "title": "Snippet for the list_services call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_services.", + "file": "service_manager/list_services.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_services", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_services", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::ListServicesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceManagement::V1::ListServicesResponse", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "ListServices", + "full_name": "google.api.servicemanagement.v1.ServiceManager.ListServices", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_GetService_sync", + "title": "Snippet for the get_service call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service.", + "file": "service_manager/get_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_service", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::GetServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceManagement::V1::ManagedService", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "GetService", + "full_name": "google.api.servicemanagement.v1.ServiceManager.GetService", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_CreateService_sync", + "title": "Snippet for the create_service call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service.", + "file": "service_manager/create_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_service", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::CreateServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "CreateService", + "full_name": "google.api.servicemanagement.v1.ServiceManager.CreateService", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_DeleteService_sync", + "title": "Snippet for the delete_service call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#delete_service.", + "file": "service_manager/delete_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_service", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#delete_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "DeleteService", + "full_name": "google.api.servicemanagement.v1.ServiceManager.DeleteService", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_UndeleteService_sync", + "title": "Snippet for the undelete_service call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service.", + "file": "service_manager/undelete_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_service", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "UndeleteService", + "full_name": "google.api.servicemanagement.v1.ServiceManager.UndeleteService", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_sync", + "title": "Snippet for the list_service_configs call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_configs.", + "file": "service_manager/list_service_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_service_configs", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "ListServiceConfigs", + "full_name": "google.api.servicemanagement.v1.ServiceManager.ListServiceConfigs", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_GetServiceConfig_sync", + "title": "Snippet for the get_service_config call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_config.", + "file": "service_manager/get_service_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_service_config", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Api::Service", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "GetServiceConfig", + "full_name": "google.api.servicemanagement.v1.ServiceManager.GetServiceConfig", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_sync", + "title": "Snippet for the create_service_config call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_config.", + "file": "service_manager/create_service_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_service_config", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Api::Service", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "CreateServiceConfig", + "full_name": "google.api.servicemanagement.v1.ServiceManager.CreateServiceConfig", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_sync", + "title": "Snippet for the submit_config_source call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#submit_config_source.", + "file": "service_manager/submit_config_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "submit_config_source", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#submit_config_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "SubmitConfigSource", + "full_name": "google.api.servicemanagement.v1.ServiceManager.SubmitConfigSource", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_sync", + "title": "Snippet for the list_service_rollouts call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_rollouts.", + "file": "service_manager/list_service_rollouts.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_service_rollouts", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_rollouts", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "ListServiceRollouts", + "full_name": "google.api.servicemanagement.v1.ServiceManager.ListServiceRollouts", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_GetServiceRollout_sync", + "title": "Snippet for the get_service_rollout call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_rollout.", + "file": "service_manager/get_service_rollout.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_service_rollout", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_rollout", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceManagement::V1::Rollout", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "GetServiceRollout", + "full_name": "google.api.servicemanagement.v1.ServiceManager.GetServiceRollout", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_sync", + "title": "Snippet for the create_service_rollout call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout.", + "file": "service_manager/create_service_rollout.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_service_rollout", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "CreateServiceRollout", + "full_name": "google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_sync", + "title": "Snippet for the generate_config_report call in the ServiceManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#generate_config_report.", + "file": "service_manager/generate_config_report.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_config_report", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#generate_config_report", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse", + "client": { + "short_name": "ServiceManager::Client", + "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" + }, + "method": { + "short_name": "GenerateConfigReport", + "full_name": "google.api.servicemanagement.v1.ServiceManager.GenerateConfigReport", + "service": { + "short_name": "ServiceManager", + "full_name": "google.api.servicemanagement.v1.ServiceManager" + } + } + }, + "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-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb b/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb new file mode 100644 index 000000000000..ccf9ee00c27f --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_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/api/servicemanagement/v1/servicemanager_pb" +require "google/api/servicemanagement/v1/servicemanager_services_pb" +require "google/cloud/service_management/v1/service_manager" + +class ::Google::Cloud::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb b/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb new file mode 100644 index 000000000000..7f671841fe11 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb @@ -0,0 +1,817 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/api/servicemanagement/v1/servicemanager_pb" +require "google/cloud/service_management/v1/service_manager/rest" + + +class ::Google::Cloud::ServiceManagement::V1::ServiceManager::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_services + # Create test objects. + client_result = ::Google::Cloud::ServiceManagement::V1::ListServicesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + producer_project_id = "hello world" + page_size = 42 + page_token = "hello world" + consumer_id = "hello world" + + list_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_list_services_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_services({ producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_services producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_services ::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new(producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_services({ producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_services(::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new(producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_services_client_stub.call_count + end + end + end + + def test_get_service + # Create test objects. + client_result = ::Google::Cloud::ServiceManagement::V1::ManagedService.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + + get_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_get_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_service({ service_name: service_name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_service service_name: service_name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_service ::Google::Cloud::ServiceManagement::V1::GetServiceRequest.new(service_name: service_name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_service({ service_name: service_name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_service(::Google::Cloud::ServiceManagement::V1::GetServiceRequest.new(service_name: service_name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_service_client_stub.call_count + end + end + end + + def test_create_service + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service = {} + + create_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_create_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_service({ service: service }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_service service: service do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_service ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new(service: service) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_service({ service: service }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_service(::Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new(service: service), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_service_client_stub.call_count + end + end + end + + def test_delete_service + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + + delete_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_delete_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_service({ service_name: service_name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_service service_name: service_name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_service ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new(service_name: service_name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_service({ service_name: service_name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_service(::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new(service_name: service_name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_service_client_stub.call_count + end + end + end + + def test_undelete_service + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + + undelete_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_undelete_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_service({ service_name: service_name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_service service_name: service_name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_service ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new(service_name: service_name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_service({ service_name: service_name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_service(::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new(service_name: service_name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_service_client_stub.call_count + end + end + end + + def test_list_service_configs + # Create test objects. + client_result = ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + page_token = "hello world" + page_size = 42 + + list_service_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_list_service_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_service_configs_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_service_configs({ service_name: service_name, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_service_configs service_name: service_name, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_service_configs ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_service_configs({ service_name: service_name, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_service_configs(::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_service_configs_client_stub.call_count + end + end + end + + def test_get_service_config + # Create test objects. + client_result = ::Google::Api::Service.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + config_id = "hello world" + view = :BASIC + + get_service_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::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_get_service_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_service_config_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_service_config({ service_name: service_name, config_id: config_id, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_service_config service_name: service_name, config_id: config_id, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_service_config ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new(service_name: service_name, config_id: config_id, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_service_config({ service_name: service_name, config_id: config_id, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_service_config(::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new(service_name: service_name, config_id: config_id, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_service_config_client_stub.call_count + end + end + end + + def test_create_service_config + # Create test objects. + client_result = ::Google::Api::Service.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + service_config = {} + + create_service_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::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_create_service_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_service_config_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_service_config({ service_name: service_name, service_config: service_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_service_config service_name: service_name, service_config: service_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_service_config ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new(service_name: service_name, service_config: service_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_service_config({ service_name: service_name, service_config: service_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_service_config(::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new(service_name: service_name, service_config: service_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_service_config_client_stub.call_count + end + end + end + + def test_submit_config_source + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + config_source = {} + validate_only = true + + submit_config_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_submit_config_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, submit_config_source_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.submit_config_source({ service_name: service_name, config_source: config_source, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.submit_config_source service_name: service_name, config_source: config_source, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.submit_config_source ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new(service_name: service_name, config_source: config_source, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.submit_config_source({ service_name: service_name, config_source: config_source, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.submit_config_source(::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new(service_name: service_name, config_source: config_source, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, submit_config_source_client_stub.call_count + end + end + end + + def test_list_service_rollouts + # Create test objects. + client_result = ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + page_token = "hello world" + page_size = 42 + filter = "hello world" + + list_service_rollouts_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_list_service_rollouts_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_service_rollouts_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_service_rollouts({ service_name: service_name, page_token: page_token, page_size: page_size, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_service_rollouts service_name: service_name, page_token: page_token, page_size: page_size, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_service_rollouts ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_service_rollouts({ service_name: service_name, page_token: page_token, page_size: page_size, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_service_rollouts(::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_service_rollouts_client_stub.call_count + end + end + end + + def test_get_service_rollout + # Create test objects. + client_result = ::Google::Cloud::ServiceManagement::V1::Rollout.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + rollout_id = "hello world" + + get_service_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_get_service_rollout_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_service_rollout_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_service_rollout({ service_name: service_name, rollout_id: rollout_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_service_rollout service_name: service_name, rollout_id: rollout_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_service_rollout ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new(service_name: service_name, rollout_id: rollout_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_service_rollout({ service_name: service_name, rollout_id: rollout_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_service_rollout(::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new(service_name: service_name, rollout_id: rollout_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_service_rollout_client_stub.call_count + end + end + end + + def test_create_service_rollout + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + rollout = {} + + create_service_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_create_service_rollout_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_service_rollout_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_service_rollout({ service_name: service_name, rollout: rollout }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_service_rollout service_name: service_name, rollout: rollout do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_service_rollout ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new(service_name: service_name, rollout: rollout) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_service_rollout({ service_name: service_name, rollout: rollout }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_service_rollout(::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new(service_name: service_name, rollout: rollout), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_service_rollout_client_stub.call_count + end + end + end + + def test_generate_config_report + # Create test objects. + client_result = ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + new_config = {} + old_config = {} + + generate_config_report_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_generate_config_report_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_config_report_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_config_report({ new_config: new_config, old_config: old_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_config_report new_config: new_config, old_config: old_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_config_report ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new(new_config: new_config, old_config: old_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_config_report({ new_config: new_config, old_config: old_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_config_report(::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new(new_config: new_config, old_config: old_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_config_report_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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb b/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb new file mode 100644 index 000000000000..6c812136dedd --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb @@ -0,0 +1,944 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/api/servicemanagement/v1/servicemanager_pb" +require "google/cloud/service_management/v1/service_manager" + +class ::Google::Cloud::ServiceManagement::V1::ServiceManager::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_services + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceManagement::V1::ListServicesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + producer_project_id = "hello world" + page_size = 42 + page_token = "hello world" + consumer_id = "hello world" + + list_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_services, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::ListServicesRequest, request + assert_equal "hello world", request["producer_project_id"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["consumer_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_services({ producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_services producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_services ::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new(producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_services({ producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_services(::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new(producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_services_client_stub.call_rpc_count + end + end + + def test_get_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceManagement::V1::ManagedService.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + + get_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_service, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::GetServiceRequest, request + assert_equal "hello world", request["service_name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_service({ service_name: service_name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_service service_name: service_name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_service ::Google::Cloud::ServiceManagement::V1::GetServiceRequest.new(service_name: service_name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_service({ service_name: service_name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_service(::Google::Cloud::ServiceManagement::V1::GetServiceRequest.new(service_name: service_name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_service_client_stub.call_rpc_count + end + end + + def test_create_service + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service = {} + + create_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_service, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceManagement::V1::ManagedService), request["service"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_service({ service: service }) do |response, 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_service service: service do |response, 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_service ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new(service: service) do |response, operation| + assert_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_service({ service: service }, grpc_options) do |response, operation| + assert_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_service(::Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new(service: service), grpc_options) do |response, operation| + assert_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_service_client_stub.call_rpc_count + end + end + + def test_delete_service + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + + delete_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_service, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, request + assert_equal "hello world", request["service_name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_service({ service_name: service_name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_service service_name: service_name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_service ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new(service_name: service_name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_service({ service_name: service_name }, grpc_options) do |response, operation| + assert_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_service(::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new(service_name: service_name), grpc_options) do |response, operation| + assert_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_service_client_stub.call_rpc_count + end + end + + def test_undelete_service + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + + undelete_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_service, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, request + assert_equal "hello world", request["service_name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_service({ service_name: service_name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undelete_service service_name: service_name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undelete_service ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new(service_name: service_name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undelete_service({ service_name: service_name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undelete_service(::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new(service_name: service_name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, undelete_service_client_stub.call_rpc_count + end + end + + def test_list_service_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + page_token = "hello world" + page_size = 42 + + list_service_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_service_configs, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, request + assert_equal "hello world", request["service_name"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_service_configs_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_service_configs({ service_name: service_name, page_token: page_token, page_size: page_size }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_service_configs service_name: service_name, page_token: page_token, page_size: page_size do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_service_configs ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_service_configs({ service_name: service_name, page_token: page_token, page_size: page_size }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_service_configs(::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_service_configs_client_stub.call_rpc_count + end + end + + def test_get_service_config + # Create GRPC objects. + grpc_response = ::Google::Api::Service.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + config_id = "hello world" + view = :BASIC + + get_service_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_service_config, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, request + assert_equal "hello world", request["service_name"] + assert_equal "hello world", request["config_id"] + assert_equal :BASIC, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_service_config_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_service_config({ service_name: service_name, config_id: config_id, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_service_config service_name: service_name, config_id: config_id, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_service_config ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new(service_name: service_name, config_id: config_id, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_service_config({ service_name: service_name, config_id: config_id, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_service_config(::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new(service_name: service_name, config_id: config_id, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_service_config_client_stub.call_rpc_count + end + end + + def test_create_service_config + # Create GRPC objects. + grpc_response = ::Google::Api::Service.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + service_config = {} + + create_service_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_service_config, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, request + assert_equal "hello world", request["service_name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Api::Service), request["service_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_service_config_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_service_config({ service_name: service_name, service_config: service_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_service_config service_name: service_name, service_config: service_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_service_config ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new(service_name: service_name, service_config: service_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_service_config({ service_name: service_name, service_config: service_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_service_config(::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new(service_name: service_name, service_config: service_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_service_config_client_stub.call_rpc_count + end + end + + def test_submit_config_source + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + config_source = {} + validate_only = true + + submit_config_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :submit_config_source, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, request + assert_equal "hello world", request["service_name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceManagement::V1::ConfigSource), request["config_source"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, submit_config_source_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.submit_config_source({ service_name: service_name, config_source: config_source, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.submit_config_source service_name: service_name, config_source: config_source, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.submit_config_source ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new(service_name: service_name, config_source: config_source, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.submit_config_source({ service_name: service_name, config_source: config_source, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.submit_config_source(::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new(service_name: service_name, config_source: config_source, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, submit_config_source_client_stub.call_rpc_count + end + end + + def test_list_service_rollouts + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + page_token = "hello world" + page_size = 42 + filter = "hello world" + + list_service_rollouts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_service_rollouts, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, request + assert_equal "hello world", request["service_name"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_service_rollouts_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_service_rollouts({ service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts({ service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts(::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts_client_stub.call_rpc_count + end + end + + def test_get_service_rollout + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceManagement::V1::Rollout.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + rollout_id = "hello world" + + get_service_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_service_rollout, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, request + assert_equal "hello world", request["service_name"] + assert_equal "hello world", request["rollout_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_service_rollout_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_service_rollout({ service_name: service_name, rollout_id: rollout_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_service_rollout service_name: service_name, rollout_id: rollout_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_service_rollout ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new(service_name: service_name, rollout_id: rollout_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_service_rollout({ service_name: service_name, rollout_id: rollout_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_service_rollout(::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new(service_name: service_name, rollout_id: rollout_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_service_rollout_client_stub.call_rpc_count + end + end + + def test_create_service_rollout + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + service_name = "hello world" + rollout = {} + + create_service_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_service_rollout, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, request + assert_equal "hello world", request["service_name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceManagement::V1::Rollout), request["rollout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_service_rollout_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_service_rollout({ service_name: service_name, rollout: rollout }) do |response, 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_service_rollout service_name: service_name, rollout: rollout do |response, 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_service_rollout ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new(service_name: service_name, rollout: rollout) do |response, operation| + assert_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_service_rollout({ service_name: service_name, rollout: rollout }, grpc_options) do |response, operation| + assert_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_service_rollout(::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new(service_name: service_name, rollout: rollout), grpc_options) do |response, operation| + assert_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_service_rollout_client_stub.call_rpc_count + end + end + + def test_generate_config_report + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + new_config = {} + old_config = {} + + generate_config_report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_config_report, name + assert_kind_of ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Any), request["new_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Any), request["old_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_config_report_client_stub do + # Create client + client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_config_report({ new_config: new_config, old_config: old_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_config_report new_config: new_config, old_config: old_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_config_report ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new(new_config: new_config, old_config: old_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_config_report({ new_config: new_config, old_config: old_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_config_report(::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new(new_config: new_config, old_config: old_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_config_report_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::ServiceManagement::V1::ServiceManager::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-service_management-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_management-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_management-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_usage-v1/.gitignore b/owl-bot-staging/google-cloud-service_usage-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_usage-v1/.repo-metadata.json new file mode 100644 index 000000000000..8e59ad13577b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "serviceusage.googleapis.com", + "api_shortname": "serviceusage", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_usage-v1/latest", + "distribution_name": "google-cloud-service_usage-v1", + "is_cloud": true, + "language": "ruby", + "name": "serviceusage", + "name_pretty": "Service Usage V1 API", + "product_documentation": "https://cloud.google.com/service-usage/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Service Usage is an infrastructure service of Google Cloud that lets you list and manage other APIs and services in your Cloud projects. You can list and manage Google Cloud services and their APIs, as well as services created using Cloud Endpoints. Note that google-cloud-service_usage-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_usage instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SERVICE_USAGE", + "ruby-cloud-product-url": "https://cloud.google.com/service-usage/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-service_usage-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_usage-v1/.rubocop.yml new file mode 100644 index 000000000000..e4a9da8eab3b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-service_usage-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-service_usage-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_usage-v1/.toys.rb b/owl-bot-staging/google-cloud-service_usage-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/.yardopts b/owl-bot-staging/google-cloud-service_usage-v1/.yardopts new file mode 100644 index 000000000000..082c42437dcc --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Service Usage 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-service_usage-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_usage-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..ac6fd4e7ead4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-service_usage-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-service_usage-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/service_usage/v1" + +client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/service_usage/v1" + +::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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-service_usage-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/service_usage/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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-service_usage-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_usage-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-service_usage-v1/Gemfile b/owl-bot-staging/google-cloud-service_usage-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_usage-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_usage-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/README.md b/owl-bot-staging/google-cloud-service_usage-v1/README.md new file mode 100644 index 000000000000..29cfef487663 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Service Usage V1 API + +Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use. + +Service Usage is an infrastructure service of Google Cloud that lets you list and manage other APIs and services in your Cloud projects. You can list and manage Google Cloud services and their APIs, as well as services created using Cloud Endpoints. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Service Usage V1 API. Most users should consider using +the main client gem, +[google-cloud-service_usage](https://rubygems.org/gems/google-cloud-service_usage). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-service_usage-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/serviceusage.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/service_usage/v1" + +client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new +request = ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new # (request fields as keyword arguments...) +response = client.enable_service request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_usage-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/service-usage/) +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/service_usage/v1" +require "logger" + +client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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-service_usage`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-service_usage-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-service_usage`. +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-service_usage-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-service_usage-v1/Rakefile b/owl-bot-staging/google-cloud-service_usage-v1/Rakefile new file mode 100644 index 000000000000..aa26e213bd12 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SERVICE_USAGE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SERVICE_USAGE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SERVICE_USAGE_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 SERVICE_USAGE_TEST_PROJECT=test123 SERVICE_USAGE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/service_usage/v1/service_usage/credentials" + ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SERVICE_USAGE_PROJECT"] = project + ENV["SERVICE_USAGE_TEST_PROJECT"] = project + ENV["SERVICE_USAGE_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-service_usage-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-service_usage-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-service_usage-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-service_usage-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-service_usage-v1" + header "google-cloud-service_usage-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-service_usage-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-service_usage-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-service_usage-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-service_usage-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-service_usage-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_usage-v1/gapic_metadata.json new file mode 100644 index 000000000000..343aa839bde6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/gapic_metadata.json @@ -0,0 +1,48 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.api.serviceusage.v1", + "libraryPackage": "::Google::Cloud::ServiceUsage::V1", + "services": { + "ServiceUsage": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client", + "rpcs": { + "EnableService": { + "methods": [ + "enable_service" + ] + }, + "DisableService": { + "methods": [ + "disable_service" + ] + }, + "GetService": { + "methods": [ + "get_service" + ] + }, + "ListServices": { + "methods": [ + "list_services" + ] + }, + "BatchEnableServices": { + "methods": [ + "batch_enable_services" + ] + }, + "BatchGetServices": { + "methods": [ + "batch_get_services" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-service_usage-v1/google-cloud-service_usage-v1.gemspec b/owl-bot-staging/google-cloud-service_usage-v1/google-cloud-service_usage-v1.gemspec new file mode 100644 index 000000000000..419faf5175ef --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/google-cloud-service_usage-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/service_usage/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-service_usage-v1" + gem.version = Google::Cloud::ServiceUsage::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Service Usage is an infrastructure service of Google Cloud that lets you list and manage other APIs and services in your Cloud projects. You can list and manage Google Cloud services and their APIs, as well as services created using Cloud Endpoints. Note that google-cloud-service_usage-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_usage instead. See the readme for more details." + gem.summary = "Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google-cloud-service_usage-v1.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google-cloud-service_usage-v1.rb new file mode 100644 index 000000000000..024e67974bb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google-cloud-service_usage-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/service_usage/v1" diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/resources_pb.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/resources_pb.rb new file mode 100644 index 000000000000..9c7b8777ba6e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/resources_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/serviceusage/v1/resources.proto + +require 'google/protobuf' + +require 'google/api/auth_pb' +require 'google/api/documentation_pb' +require 'google/api/endpoint_pb' +require 'google/api/monitored_resource_pb' +require 'google/api/monitoring_pb' +require 'google/api/quota_pb' +require 'google/api/resource_pb' +require 'google/api/usage_pb' +require 'google/protobuf/api_pb' + + +descriptor_data = "\n*google/api/serviceusage/v1/resources.proto\x12\x1agoogle.api.serviceusage.v1\x1a\x15google/api/auth.proto\x1a\x1egoogle/api/documentation.proto\x1a\x19google/api/endpoint.proto\x1a#google/api/monitored_resource.proto\x1a\x1bgoogle/api/monitoring.proto\x1a\x16google/api/quota.proto\x1a\x19google/api/resource.proto\x1a\x16google/api/usage.proto\x1a\x19google/protobuf/api.proto\"\xbd\x02\n\x07Service\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12\x39\n\x06\x63onfig\x18\x02 \x01(\x0b\x32).google.api.serviceusage.v1.ServiceConfig\x12\x30\n\x05state\x18\x04 \x01(\x0e\x32!.google.api.serviceusage.v1.State:\xa6\x01\xea\x41\xa2\x01\n#serviceusage.googleapis.com/Service\x12%projects/{project}/services/{service}\x12#folders/{folder}/services/{service}\x12/organizations/{organization}/services/{service}\"\x95\x03\n\rServiceConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\"\n\x04\x61pis\x18\x03 \x03(\x0b\x32\x14.google.protobuf.Api\x12\x30\n\rdocumentation\x18\x06 \x01(\x0b\x32\x19.google.api.Documentation\x12 \n\x05quota\x18\n \x01(\x0b\x32\x11.google.api.Quota\x12\x32\n\x0e\x61uthentication\x18\x0b \x01(\x0b\x32\x1a.google.api.Authentication\x12 \n\x05usage\x18\x0f \x01(\x0b\x32\x11.google.api.Usage\x12\'\n\tendpoints\x18\x12 \x03(\x0b\x32\x14.google.api.Endpoint\x12\x44\n\x13monitored_resources\x18\x19 \x03(\x0b\x32\'.google.api.MonitoredResourceDescriptor\x12*\n\nmonitoring\x18\x1c \x01(\x0b\x32\x16.google.api.Monitoring\"+\n\x11OperationMetadata\x12\x16\n\x0eresource_names\x18\x02 \x03(\t*9\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x42\xd8\x01\n\x1e\x63om.google.api.serviceusage.v1B\x0eResourcesProtoP\x01ZDcloud.google.com/go/serviceusage/apiv1/serviceusagepb;serviceusagepb\xaa\x02\x1cGoogle.Cloud.ServiceUsage.V1\xca\x02\x1cGoogle\\Cloud\\ServiceUsage\\V1\xea\x02\x1fGoogle::Cloud::ServiceUsage::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceUsage + module V1 + Service = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.Service").msgclass + ServiceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.ServiceConfig").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.OperationMetadata").msgclass + State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_pb.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_pb.rb new file mode 100644 index 000000000000..3a926161d952 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_pb.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/serviceusage/v1/serviceusage.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/serviceusage/v1/resources_pb' +require 'google/longrunning/operations_pb' + + +descriptor_data = "\n-google/api/serviceusage/v1/serviceusage.proto\x12\x1agoogle.api.serviceusage.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a*google/api/serviceusage/v1/resources.proto\x1a#google/longrunning/operations.proto\"$\n\x14\x45nableServiceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"M\n\x15\x45nableServiceResponse\x12\x34\n\x07service\x18\x01 \x01(\x0b\x32#.google.api.serviceusage.v1.Service\"\x92\x02\n\x15\x44isableServiceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\"\n\x1a\x64isable_dependent_services\x18\x02 \x01(\x08\x12l\n\x1a\x63heck_if_service_has_usage\x18\x03 \x01(\x0e\x32H.google.api.serviceusage.v1.DisableServiceRequest.CheckIfServiceHasUsage\"Y\n\x16\x43heckIfServiceHasUsage\x12*\n&CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED\x10\x00\x12\x08\n\x04SKIP\x10\x01\x12\t\n\x05\x43HECK\x10\x02\"N\n\x16\x44isableServiceResponse\x12\x34\n\x07service\x18\x01 \x01(\x0b\x32#.google.api.serviceusage.v1.Service\"!\n\x11GetServiceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\\\n\x13ListServicesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\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\"f\n\x14ListServicesResponse\x12\x35\n\x08services\x18\x01 \x03(\x0b\x32#.google.api.serviceusage.v1.Service\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"A\n\x1a\x42\x61tchEnableServicesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x13\n\x0bservice_ids\x18\x02 \x03(\t\"\xe9\x01\n\x1b\x42\x61tchEnableServicesResponse\x12\x35\n\x08services\x18\x01 \x03(\x0b\x32#.google.api.serviceusage.v1.Service\x12W\n\x08\x66\x61ilures\x18\x02 \x03(\x0b\x32\x45.google.api.serviceusage.v1.BatchEnableServicesResponse.EnableFailure\x1a:\n\rEnableFailure\x12\x12\n\nservice_id\x18\x01 \x01(\t\x12\x15\n\rerror_message\x18\x02 \x01(\t\"8\n\x17\x42\x61tchGetServicesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\r\n\x05names\x18\x02 \x03(\t\"Q\n\x18\x42\x61tchGetServicesResponse\x12\x35\n\x08services\x18\x01 \x03(\x0b\x32#.google.api.serviceusage.v1.Service2\xe8\t\n\x0cServiceUsage\x12\xba\x01\n\rEnableService\x12\x30.google.api.serviceusage.v1.EnableServiceRequest\x1a\x1d.google.longrunning.Operation\"X\xca\x41*\n\x15\x45nableServiceResponse\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02%\" /v1/{name=*/*/services/*}:enable:\x01*\x12\xbe\x01\n\x0e\x44isableService\x12\x31.google.api.serviceusage.v1.DisableServiceRequest\x1a\x1d.google.longrunning.Operation\"Z\xca\x41+\n\x16\x44isableServiceResponse\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02&\"!/v1/{name=*/*/services/*}:disable:\x01*\x12\x83\x01\n\nGetService\x12-.google.api.serviceusage.v1.GetServiceRequest\x1a#.google.api.serviceusage.v1.Service\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/{name=*/*/services/*}\x12\x94\x01\n\x0cListServices\x12/.google.api.serviceusage.v1.ListServicesRequest\x1a\x30.google.api.serviceusage.v1.ListServicesResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/{parent=*/*}/services\x12\xd1\x01\n\x13\x42\x61tchEnableServices\x12\x36.google.api.serviceusage.v1.BatchEnableServicesRequest\x1a\x1d.google.longrunning.Operation\"c\xca\x41\x30\n\x1b\x42\x61tchEnableServicesResponse\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02*\"%/v1/{parent=*/*}/services:batchEnable:\x01*\x12\xa9\x01\n\x10\x42\x61tchGetServices\x12\x33.google.api.serviceusage.v1.BatchGetServicesRequest\x1a\x34.google.api.serviceusage.v1.BatchGetServicesResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v1/{parent=*/*}/services:batchGet\x1a\xbc\x01\xca\x41\x1bserviceusage.googleapis.com\xd2\x41\x9a\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/service.managementB\xdb\x01\n\x1e\x63om.google.api.serviceusage.v1B\x11ServiceUsageProtoP\x01ZDcloud.google.com/go/serviceusage/apiv1/serviceusagepb;serviceusagepb\xaa\x02\x1cGoogle.Cloud.ServiceUsage.V1\xca\x02\x1cGoogle\\Cloud\\ServiceUsage\\V1\xea\x02\x1fGoogle::Cloud::ServiceUsage::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module ServiceUsage + module V1 + EnableServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.EnableServiceRequest").msgclass + EnableServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.EnableServiceResponse").msgclass + DisableServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.DisableServiceRequest").msgclass + DisableServiceRequest::CheckIfServiceHasUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.DisableServiceRequest.CheckIfServiceHasUsage").enummodule + DisableServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.DisableServiceResponse").msgclass + GetServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.GetServiceRequest").msgclass + ListServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.ListServicesRequest").msgclass + ListServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.ListServicesResponse").msgclass + BatchEnableServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchEnableServicesRequest").msgclass + BatchEnableServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchEnableServicesResponse").msgclass + BatchEnableServicesResponse::EnableFailure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchEnableServicesResponse.EnableFailure").msgclass + BatchGetServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchGetServicesRequest").msgclass + BatchGetServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchGetServicesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_services_pb.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_services_pb.rb new file mode 100644 index 000000000000..77a57299004d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_services_pb.rb @@ -0,0 +1,80 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/api/serviceusage/v1/serviceusage.proto for package 'Google.Cloud.ServiceUsage.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/api/serviceusage/v1/serviceusage_pb' + +module Google + module Cloud + module ServiceUsage + module V1 + module ServiceUsage + # Enables services that service consumers want to use on Google Cloud Platform, + # lists the available or enabled services, or disables services that service + # consumers no longer use. + # + # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.api.serviceusage.v1.ServiceUsage' + + # Enable a service so that it can be used with a project. + rpc :EnableService, ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest, ::Google::Longrunning::Operation + # Disable a service so that it can no longer be used with a project. + # This prevents unintended usage that may cause unexpected billing + # charges or security leaks. + # + # It is not valid to call the disable method on a service that is not + # currently enabled. Callers will receive a `FAILED_PRECONDITION` status if + # the target service is not currently enabled. + rpc :DisableService, ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest, ::Google::Longrunning::Operation + # Returns the service configuration and enabled state for a given service. + rpc :GetService, ::Google::Cloud::ServiceUsage::V1::GetServiceRequest, ::Google::Cloud::ServiceUsage::V1::Service + # List all services available to the specified project, and the current + # state of those services with respect to the project. The list includes + # all public services, all services for which the calling user has the + # `servicemanagement.services.bind` permission, and all services that have + # already been enabled on the project. The list can be filtered to + # only include services in a specific state, for example to only include + # services enabled on the project. + # + # WARNING: If you need to query enabled services frequently or across + # an organization, you should use + # [Cloud Asset Inventory + # API](https://cloud.google.com/asset-inventory/docs/apis), which provides + # higher throughput and richer filtering capability. + rpc :ListServices, ::Google::Cloud::ServiceUsage::V1::ListServicesRequest, ::Google::Cloud::ServiceUsage::V1::ListServicesResponse + # Enable multiple services on a project. The operation is atomic: if enabling + # any service fails, then the entire batch fails, and no state changes occur. + # To enable a single service, use the `EnableService` method instead. + rpc :BatchEnableServices, ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest, ::Google::Longrunning::Operation + # Returns the service configurations and enabled states for a given list of + # services. + rpc :BatchGetServices, ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest, ::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1.rb new file mode 100644 index 000000000000..6574d05185b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/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/service_usage/v1/service_usage" +require "google/cloud/service_usage/v1/version" + +module Google + module Cloud + module ServiceUsage + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/service_usage/v1" + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/service_usage/v1" + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/service_usage/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/rest.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/rest.rb new file mode 100644 index 000000000000..30771378b1cd --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/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/service_usage/v1/service_usage/rest" +require "google/cloud/service_usage/v1/version" + +module Google + module Cloud + module ServiceUsage + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/service_usage/v1/rest" + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage.rb new file mode 100644 index 000000000000..47ad7fc9b613 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage.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/service_usage/v1/version" + +require "google/cloud/service_usage/v1/service_usage/credentials" +require "google/cloud/service_usage/v1/service_usage/operations" +require "google/cloud/service_usage/v1/service_usage/client" +require "google/cloud/service_usage/v1/service_usage/rest" + +module Google + module Cloud + module ServiceUsage + module V1 + ## + # Enables services that service consumers want to use on Google Cloud Platform, + # lists the available or enabled services, or disables services that service + # consumers no longer use. + # + # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/service_usage/v1/service_usage" + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/service_usage/v1/service_usage/rest" + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + module ServiceUsage + end + end + end + end +end + +helper_path = ::File.join __dir__, "service_usage", "helpers.rb" +require "google/cloud/service_usage/v1/service_usage/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/client.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/client.rb new file mode 100644 index 000000000000..e6a65a0df8cb --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/client.rb @@ -0,0 +1,1075 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/api/serviceusage/v1/serviceusage_pb" + +module Google + module Cloud + module ServiceUsage + module V1 + module ServiceUsage + ## + # Client for the ServiceUsage service. + # + # Enables services that service consumers want to use on Google Cloud Platform, + # lists the available or enabled services, or disables services that service + # consumers no longer use. + # + # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "serviceusage.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :service_usage_stub + + ## + # Configure the ServiceUsage Client class. + # + # See {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServiceUsage clients + # ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "ServiceUsage", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServiceUsage Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @service_usage_stub.universe_domain + end + + ## + # Create a new ServiceUsage client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServiceUsage 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/api/serviceusage/v1/serviceusage_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 + + @service_usage_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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 + ) + + @service_usage_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::ServiceUsage::V1::ServiceUsage::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @service_usage_stub.logger + end + + # Service calls + + ## + # Enable a service so that it can be used with a project. + # + # @overload enable_service(request, options = nil) + # Pass arguments to `enable_service` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::EnableServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::EnableServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload enable_service(name: nil) + # Pass arguments to `enable_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the consumer and service to enable the service on. + # + # The `EnableService` and `DisableService` methods currently only support + # projects. + # + # Enabling a service requires that the service is public or is shared with + # the user enabling the service. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new + # + # # Call the enable_service method. + # result = client.enable_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def enable_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.enable_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.call_rpc :enable_service, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disable a service so that it can no longer be used with a project. + # This prevents unintended usage that may cause unexpected billing + # charges or security leaks. + # + # It is not valid to call the disable method on a service that is not + # currently enabled. Callers will receive a `FAILED_PRECONDITION` status if + # the target service is not currently enabled. + # + # @overload disable_service(request, options = nil) + # Pass arguments to `disable_service` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::DisableServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_service(name: nil, disable_dependent_services: nil, check_if_service_has_usage: nil) + # Pass arguments to `disable_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the consumer and service to disable the service on. + # + # The enable and disable methods currently only support projects. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # @param disable_dependent_services [::Boolean] + # Indicates if services that are enabled and which depend on this service + # should also be disabled. If not set, an error will be generated if any + # enabled services depend on the service to be disabled. When set, the + # service, and any enabled services that depend on it, will be disabled + # together. + # @param check_if_service_has_usage [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest::CheckIfServiceHasUsage] + # Defines the behavior for checking service usage when disabling a service. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new + # + # # Call the disable_service method. + # result = client.disable_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def disable_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.call_rpc :disable_service, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the service configuration and enabled state for a given service. + # + # @overload get_service(request, options = nil) + # Pass arguments to `get_service` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::GetServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::GetServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_service(name: nil) + # Pass arguments to `get_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the consumer and service to get the `ConsumerState` for. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceUsage::V1::Service] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceUsage::V1::Service] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::GetServiceRequest.new + # + # # Call the get_service method. + # result = client.get_service request + # + # # The returned object is of type Google::Cloud::ServiceUsage::V1::Service. + # p result + # + def get_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::GetServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_service.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.call_rpc :get_service, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all services available to the specified project, and the current + # state of those services with respect to the project. The list includes + # all public services, all services for which the calling user has the + # `servicemanagement.services.bind` permission, and all services that have + # already been enabled on the project. The list can be filtered to + # only include services in a specific state, for example to only include + # services enabled on the project. + # + # WARNING: If you need to query enabled services frequently or across + # an organization, you should use + # [Cloud Asset Inventory + # API](https://cloud.google.com/asset-inventory/docs/apis), which provides + # higher throughput and richer filtering capability. + # + # @overload list_services(request, options = nil) + # Pass arguments to `list_services` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::ListServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::ListServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent to search for services on. + # + # An example name would be: + # `projects/123` where `123` is the project number. + # @param page_size [::Integer] + # Requested size of the next page of data. + # Requested page size cannot exceed 200. + # If not set, the default page size is 50. + # @param page_token [::String] + # Token identifying which result to start with, which is returned by a + # previous list call. + # @param filter [::String] + # Only list services that conform to the given filter. + # The allowed filter strings are `state:ENABLED` and `state:DISABLED`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceUsage::V1::Service>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceUsage::V1::Service>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::ListServicesRequest.new + # + # # Call the list_services method. + # result = client.list_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceUsage::V1::Service. + # p item + # end + # + def list_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::ListServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_services.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.call_rpc :list_services, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @service_usage_stub, :list_services, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enable multiple services on a project. The operation is atomic: if enabling + # any service fails, then the entire batch fails, and no state changes occur. + # To enable a single service, use the `EnableService` method instead. + # + # @overload batch_enable_services(request, options = nil) + # Pass arguments to `batch_enable_services` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_enable_services(parent: nil, service_ids: nil) + # Pass arguments to `batch_enable_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent to enable services on. + # + # An example name would be: + # `projects/123` where `123` is the project number. + # + # The `BatchEnableServices` method currently only supports projects. + # @param service_ids [::Array<::String>] + # The identifiers of the services to enable on the project. + # + # A valid identifier would be: + # serviceusage.googleapis.com + # + # Enabling services requires that each service is public or is shared with + # the user enabling the service. + # + # A single request can enable a maximum of 20 services at a time. If more + # than 20 services are specified, the request will fail, and no state changes + # will occur. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new + # + # # Call the batch_enable_services method. + # result = client.batch_enable_services request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_enable_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_enable_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_enable_services.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_enable_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.call_rpc :batch_enable_services, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the service configurations and enabled states for a given list of + # services. + # + # @overload batch_get_services(request, options = nil) + # Pass arguments to `batch_get_services` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_get_services(parent: nil, names: nil) + # Pass arguments to `batch_get_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent to retrieve services from. + # If this is set, the parent of all of the services specified in `names` must + # match this field. An example name would be: `projects/123` where `123` is + # the project number. The `BatchGetServices` method currently only supports + # projects. + # @param names [::Array<::String>] + # Names of the services to retrieve. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # A single request can get a maximum of 30 services at a time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new + # + # # Call the batch_get_services method. + # result = client.batch_get_services request + # + # # The returned object is of type Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse. + # p result + # + def batch_get_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_get_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_get_services.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_get_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.call_rpc :batch_get_services, request, 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 ServiceUsage API. + # + # This class represents the configuration for ServiceUsage, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # enable_service to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.enable_service.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.enable_service.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::ServiceUsage::V1::ServiceUsage::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "serviceusage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ServiceUsage API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `enable_service` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_service + ## + # RPC-specific configuration for `disable_service` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_service + ## + # RPC-specific configuration for `get_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service + ## + # RPC-specific configuration for `list_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_services + ## + # RPC-specific configuration for `batch_enable_services` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_enable_services + ## + # RPC-specific configuration for `batch_get_services` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_get_services + + # @private + def initialize parent_rpcs = nil + enable_service_config = parent_rpcs.enable_service if parent_rpcs.respond_to? :enable_service + @enable_service = ::Gapic::Config::Method.new enable_service_config + disable_service_config = parent_rpcs.disable_service if parent_rpcs.respond_to? :disable_service + @disable_service = ::Gapic::Config::Method.new disable_service_config + get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service + @get_service = ::Gapic::Config::Method.new get_service_config + list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services + @list_services = ::Gapic::Config::Method.new list_services_config + batch_enable_services_config = parent_rpcs.batch_enable_services if parent_rpcs.respond_to? :batch_enable_services + @batch_enable_services = ::Gapic::Config::Method.new batch_enable_services_config + batch_get_services_config = parent_rpcs.batch_get_services if parent_rpcs.respond_to? :batch_get_services + @batch_get_services = ::Gapic::Config::Method.new batch_get_services_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/credentials.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/credentials.rb new file mode 100644 index 000000000000..d29b072c389d --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/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 ServiceUsage + module V1 + module ServiceUsage + # Credentials for the ServiceUsage API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/service.management" + ] + self.env_vars = [ + "SERVICE_USAGE_CREDENTIALS", + "SERVICE_USAGE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SERVICE_USAGE_CREDENTIALS_JSON", + "SERVICE_USAGE_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-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/operations.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/operations.rb new file mode 100644 index 000000000000..9fa297e0d3da --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/operations.rb @@ -0,0 +1,833 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 ServiceUsage + module V1 + module ServiceUsage + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "serviceusage.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ServiceUsage 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 ServiceUsage 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::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_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::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::ServiceUsage::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::ServiceUsage::V1::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 = "serviceusage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest.rb new file mode 100644 index 000000000000..33ff36f88f2c --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/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/service_usage/v1/version" + +require "google/cloud/service_usage/v1/service_usage/credentials" +require "google/cloud/service_usage/v1/service_usage/rest/operations" +require "google/cloud/service_usage/v1/service_usage/rest/client" + +module Google + module Cloud + module ServiceUsage + module V1 + ## + # Enables services that service consumers want to use on Google Cloud Platform, + # lists the available or enabled services, or disables services that service + # consumers no longer use. + # + # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/service_usage/v1/service_usage/rest" + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + module ServiceUsage + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/service_usage/v1/service_usage/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/client.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/client.rb new file mode 100644 index 000000000000..f4ccd17b3e88 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/client.rb @@ -0,0 +1,990 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/api/serviceusage/v1/serviceusage_pb" +require "google/cloud/service_usage/v1/service_usage/rest/service_stub" + +module Google + module Cloud + module ServiceUsage + module V1 + module ServiceUsage + module Rest + ## + # REST client for the ServiceUsage service. + # + # Enables services that service consumers want to use on Google Cloud Platform, + # lists the available or enabled services, or disables services that service + # consumers no longer use. + # + # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "serviceusage.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :service_usage_stub + + ## + # Configure the ServiceUsage Client class. + # + # See {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServiceUsage clients + # ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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", "ServiceUsage", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServiceUsage Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::ServiceUsage::V1::ServiceUsage::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 + @service_usage_stub.universe_domain + end + + ## + # Create a new ServiceUsage REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServiceUsage 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::ServiceUsage::V1::ServiceUsage::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 + + @service_usage_stub = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @service_usage_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::ServiceUsage::V1::ServiceUsage::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @service_usage_stub.logger + end + + # Service calls + + ## + # Enable a service so that it can be used with a project. + # + # @overload enable_service(request, options = nil) + # Pass arguments to `enable_service` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::EnableServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::EnableServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload enable_service(name: nil) + # Pass arguments to `enable_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the consumer and service to enable the service on. + # + # The `EnableService` and `DisableService` methods currently only support + # projects. + # + # Enabling a service requires that the service is public or is shared with + # the user enabling the service. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new + # + # # Call the enable_service method. + # result = client.enable_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def enable_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.enable_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.enable_service request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disable a service so that it can no longer be used with a project. + # This prevents unintended usage that may cause unexpected billing + # charges or security leaks. + # + # It is not valid to call the disable method on a service that is not + # currently enabled. Callers will receive a `FAILED_PRECONDITION` status if + # the target service is not currently enabled. + # + # @overload disable_service(request, options = nil) + # Pass arguments to `disable_service` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::DisableServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload disable_service(name: nil, disable_dependent_services: nil, check_if_service_has_usage: nil) + # Pass arguments to `disable_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the consumer and service to disable the service on. + # + # The enable and disable methods currently only support projects. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # @param disable_dependent_services [::Boolean] + # Indicates if services that are enabled and which depend on this service + # should also be disabled. If not set, an error will be generated if any + # enabled services depend on the service to be disabled. When set, the + # service, and any enabled services that depend on it, will be disabled + # together. + # @param check_if_service_has_usage [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest::CheckIfServiceHasUsage] + # Defines the behavior for checking service usage when disabling a service. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new + # + # # Call the disable_service method. + # result = client.disable_service request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def disable_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.disable_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.disable_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.disable_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.disable_service request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the service configuration and enabled state for a given service. + # + # @overload get_service(request, options = nil) + # Pass arguments to `get_service` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::GetServiceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::GetServiceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_service(name: nil) + # Pass arguments to `get_service` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the consumer and service to get the `ConsumerState` for. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceUsage::V1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceUsage::V1::Service] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::GetServiceRequest.new + # + # # Call the get_service method. + # result = client.get_service request + # + # # The returned object is of type Google::Cloud::ServiceUsage::V1::Service. + # p result + # + def get_service request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::GetServiceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_service.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_service.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_service.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.get_service request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all services available to the specified project, and the current + # state of those services with respect to the project. The list includes + # all public services, all services for which the calling user has the + # `servicemanagement.services.bind` permission, and all services that have + # already been enabled on the project. The list can be filtered to + # only include services in a specific state, for example to only include + # services enabled on the project. + # + # WARNING: If you need to query enabled services frequently or across + # an organization, you should use + # [Cloud Asset Inventory + # API](https://cloud.google.com/asset-inventory/docs/apis), which provides + # higher throughput and richer filtering capability. + # + # @overload list_services(request, options = nil) + # Pass arguments to `list_services` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::ListServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::ListServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent to search for services on. + # + # An example name would be: + # `projects/123` where `123` is the project number. + # @param page_size [::Integer] + # Requested size of the next page of data. + # Requested page size cannot exceed 200. + # If not set, the default page size is 50. + # @param page_token [::String] + # Token identifying which result to start with, which is returned by a + # previous list call. + # @param filter [::String] + # Only list services that conform to the given filter. + # The allowed filter strings are `state:ENABLED` and `state:DISABLED`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceUsage::V1::Service>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceUsage::V1::Service>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::ListServicesRequest.new + # + # # Call the list_services method. + # result = client.list_services request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::ServiceUsage::V1::Service. + # p item + # end + # + def list_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::ListServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_services.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.list_services request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @service_usage_stub, :list_services, "services", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enable multiple services on a project. The operation is atomic: if enabling + # any service fails, then the entire batch fails, and no state changes occur. + # To enable a single service, use the `EnableService` method instead. + # + # @overload batch_enable_services(request, options = nil) + # Pass arguments to `batch_enable_services` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_enable_services(parent: nil, service_ids: nil) + # Pass arguments to `batch_enable_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent to enable services on. + # + # An example name would be: + # `projects/123` where `123` is the project number. + # + # The `BatchEnableServices` method currently only supports projects. + # @param service_ids [::Array<::String>] + # The identifiers of the services to enable on the project. + # + # A valid identifier would be: + # serviceusage.googleapis.com + # + # Enabling services requires that each service is public or is shared with + # the user enabling the service. + # + # A single request can enable a maximum of 20 services at a time. If more + # than 20 services are specified, the request will fail, and no state changes + # will occur. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new + # + # # Call the batch_enable_services method. + # result = client.batch_enable_services request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_enable_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_enable_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_enable_services.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_enable_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.batch_enable_services request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the service configurations and enabled states for a given list of + # services. + # + # @overload batch_get_services(request, options = nil) + # Pass arguments to `batch_get_services` via a request object, either of type + # {::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_get_services(parent: nil, names: nil) + # Pass arguments to `batch_get_services` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent to retrieve services from. + # If this is set, the parent of all of the services specified in `names` must + # match this field. An example name would be: `projects/123` where `123` is + # the project number. The `BatchGetServices` method currently only supports + # projects. + # @param names [::Array<::String>] + # Names of the services to retrieve. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # A single request can get a maximum of 30 services at a time. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/service_usage/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new + # + # # Call the batch_get_services method. + # result = client.batch_get_services request + # + # # The returned object is of type Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse. + # p result + # + def batch_get_services request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_get_services.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_get_services.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_get_services.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @service_usage_stub.batch_get_services request, 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 ServiceUsage REST API. + # + # This class represents the configuration for ServiceUsage REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # enable_service to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.enable_service.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.enable_service.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "serviceusage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ServiceUsage API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `enable_service` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_service + ## + # RPC-specific configuration for `disable_service` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_service + ## + # RPC-specific configuration for `get_service` + # @return [::Gapic::Config::Method] + # + attr_reader :get_service + ## + # RPC-specific configuration for `list_services` + # @return [::Gapic::Config::Method] + # + attr_reader :list_services + ## + # RPC-specific configuration for `batch_enable_services` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_enable_services + ## + # RPC-specific configuration for `batch_get_services` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_get_services + + # @private + def initialize parent_rpcs = nil + enable_service_config = parent_rpcs.enable_service if parent_rpcs.respond_to? :enable_service + @enable_service = ::Gapic::Config::Method.new enable_service_config + disable_service_config = parent_rpcs.disable_service if parent_rpcs.respond_to? :disable_service + @disable_service = ::Gapic::Config::Method.new disable_service_config + get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service + @get_service = ::Gapic::Config::Method.new get_service_config + list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services + @list_services = ::Gapic::Config::Method.new list_services_config + batch_enable_services_config = parent_rpcs.batch_enable_services if parent_rpcs.respond_to? :batch_enable_services + @batch_enable_services = ::Gapic::Config::Method.new batch_enable_services_config + batch_get_services_config = parent_rpcs.batch_get_services if parent_rpcs.respond_to? :batch_get_services + @batch_get_services = ::Gapic::Config::Method.new batch_get_services_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/operations.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/operations.rb new file mode 100644 index 000000000000..af0e31380254 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/operations.rb @@ -0,0 +1,923 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module ServiceUsage + module V1 + module ServiceUsage + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "serviceusage.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ServiceUsage 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 ServiceUsage 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::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceUsage::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "serviceusage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_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/operations", + matches: [] + ) + 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{^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-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb new file mode 100644 index 000000000000..c4a05bd4b705 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/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/api/serviceusage/v1/serviceusage_pb" + +module Google + module Cloud + module ServiceUsage + module V1 + module ServiceUsage + module Rest + ## + # REST service stub for the ServiceUsage 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 enable_service REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::EnableServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def enable_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "enable_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the disable_service REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def disable_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_disable_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "disable_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_service REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::GetServiceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceUsage::V1::Service] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceUsage::V1::Service] + # A result object deserialized from the server's reply + def get_service request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_service_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_service", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceUsage::V1::Service.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_services REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::ListServicesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceUsage::V1::ListServicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceUsage::V1::ListServicesResponse] + # A result object deserialized from the server's reply + def list_services request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_services_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_services", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceUsage::V1::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_enable_services REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_enable_services request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_enable_services_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_enable_services", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_get_services REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] + # A result object deserialized from the server's reply + def batch_get_services request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_get_services_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_get_services", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse.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 enable_service REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::EnableServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:enable", + body: "*", + matches: [ + ["name", %r{^[^/]+/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the disable_service REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_disable_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:disable", + body: "*", + matches: [ + ["name", %r{^[^/]+/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_service REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::GetServiceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_service_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^[^/]+/[^/]+/services/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_services REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::ListServicesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_services_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/services", + matches: [ + ["parent", %r{^[^/]+/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_enable_services REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_enable_services_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/services:batchEnable", + body: "*", + matches: [ + ["parent", %r{^[^/]+/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_get_services REST call + # + # @param request_pb [::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_get_services_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/services:batchGet", + matches: [ + ["parent", %r{^[^/]+/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/version.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/version.rb new file mode 100644 index 000000000000..6a3e3ab95ccd --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/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 ServiceUsage + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/README.md new file mode 100644 index 000000000000..a60825fd97db --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Service Usage 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-service_usage-v1/proto_docs/google/api/auth.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb new file mode 100644 index 000000000000..c71d3c7421d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb @@ -0,0 +1,259 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # `Authentication` defines the authentication configuration for API methods + # provided by an API service. + # + # Example: + # + # name: calendar.googleapis.com + # authentication: + # providers: + # - id: google_calendar_auth + # jwks_uri: https://www.googleapis.com/oauth2/v1/certs + # issuer: https://securetoken.google.com + # rules: + # - selector: "*" + # requirements: + # provider_id: google_calendar_auth + # - selector: google.calendar.Delegate + # oauth: + # canonical_scopes: https://www.googleapis.com/auth/calendar.read + # @!attribute [rw] rules + # @return [::Array<::Google::Api::AuthenticationRule>] + # A list of authentication rules that apply to individual API methods. + # + # **NOTE:** All service configuration rules follow "last one wins" order. + # @!attribute [rw] providers + # @return [::Array<::Google::Api::AuthProvider>] + # Defines a set of authentication providers that a service supports. + class Authentication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Authentication rules for the service. + # + # By default, if a method has any authentication requirements, every request + # must include a valid credential matching one of the requirements. + # It's an error to include more than one kind of credential in a single + # request. + # + # If a method doesn't have any auth requirements, request credentials will be + # ignored. + # @!attribute [rw] selector + # @return [::String] + # Selects the methods to which this rule applies. + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # @!attribute [rw] oauth + # @return [::Google::Api::OAuthRequirements] + # The requirements for OAuth credentials. + # @!attribute [rw] allow_without_credential + # @return [::Boolean] + # If true, the service accepts API keys without any other credential. + # This flag only applies to HTTP and gRPC requests. + # @!attribute [rw] requirements + # @return [::Array<::Google::Api::AuthRequirement>] + # Requirements for additional authentication providers. + class AuthenticationRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies a location to extract JWT from an API request. + # @!attribute [rw] header + # @return [::String] + # Specifies HTTP header name to extract JWT token. + # + # Note: The following fields are mutually exclusive: `header`, `query`, `cookie`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] query + # @return [::String] + # Specifies URL query parameter name to extract JWT token. + # + # Note: The following fields are mutually exclusive: `query`, `header`, `cookie`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] cookie + # @return [::String] + # Specifies cookie name to extract JWT token. + # + # Note: The following fields are mutually exclusive: `cookie`, `header`, `query`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] value_prefix + # @return [::String] + # The value prefix. The value format is "value_prefix\\{token}" + # Only applies to "in" header type. Must be empty for "in" query type. + # If not empty, the header value has to match (case sensitive) this prefix. + # If not matched, JWT will not be extracted. If matched, JWT will be + # extracted after the prefix is removed. + # + # For example, for "Authorization: Bearer \\{JWT}", + # value_prefix="Bearer " with a space at the end. + class JwtLocation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for an authentication provider, including support for + # [JSON Web Token + # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + # @!attribute [rw] id + # @return [::String] + # The unique identifier of the auth provider. It will be referred to by + # `AuthRequirement.provider_id`. + # + # Example: "bookstore_auth". + # @!attribute [rw] issuer + # @return [::String] + # Identifies the principal that issued the JWT. See + # https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + # Usually a URL or an email address. + # + # Example: https://securetoken.google.com + # Example: 1234567-compute@developer.gserviceaccount.com + # @!attribute [rw] jwks_uri + # @return [::String] + # URL of the provider's public key set to validate signature of the JWT. See + # [OpenID + # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + # Optional if the key set document: + # - can be retrieved from + # [OpenID + # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + # of the issuer. + # - can be inferred from the email domain of the issuer (e.g. a Google + # service account). + # + # Example: https://www.googleapis.com/oauth2/v1/certs + # @!attribute [rw] audiences + # @return [::String] + # The list of JWT + # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + # that are allowed to access. A JWT containing any of these audiences will + # be accepted. When this setting is absent, JWTs with audiences: + # - "https://[service.name]/[google.protobuf.Api.name]" + # - "https://[service.name]/" + # will be accepted. + # For example, if no audiences are in the setting, LibraryService API will + # accept JWTs with the following audiences: + # - + # https://library-example.googleapis.com/google.example.library.v1.LibraryService + # - https://library-example.googleapis.com/ + # + # Example: + # + # audiences: bookstore_android.apps.googleusercontent.com, + # bookstore_web.apps.googleusercontent.com + # @!attribute [rw] authorization_url + # @return [::String] + # Redirect URL if JWT token is required but not present or is expired. + # Implement authorizationUrl of securityDefinitions in OpenAPI spec. + # @!attribute [rw] jwt_locations + # @return [::Array<::Google::Api::JwtLocation>] + # Defines the locations to extract the JWT. For now it is only used by the + # Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] + # (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + # + # JWT locations can be one of HTTP headers, URL query parameters or + # cookies. The rule is that the first match wins. + # + # If not specified, default to use following 3 locations: + # 1) Authorization: Bearer + # 2) x-goog-iap-jwt-assertion + # 3) access_token query parameter + # + # Default locations can be specified as followings: + # jwt_locations: + # - header: Authorization + # value_prefix: "Bearer " + # - header: x-goog-iap-jwt-assertion + # - query: access_token + class AuthProvider + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # OAuth scopes are a way to define data and permissions on data. For example, + # there are scopes defined for "Read-only access to Google Calendar" and + # "Access to Cloud Platform". Users can consent to a scope for an application, + # giving it permission to access that data on their behalf. + # + # OAuth scope specifications should be fairly coarse grained; a user will need + # to see and understand the text description of what your scope means. + # + # In most cases: use one or at most two OAuth scopes for an entire family of + # products. If your product has multiple APIs, you should probably be sharing + # the OAuth scope across all of those APIs. + # + # When you need finer grained OAuth consent screens: talk with your product + # management about how developers will use them in practice. + # + # Please note that even though each of the canonical scopes is enough for a + # request to be accepted and passed to the backend, a request can still fail + # due to the backend requiring additional scopes or permissions. + # @!attribute [rw] canonical_scopes + # @return [::String] + # The list of publicly documented OAuth scopes that are allowed access. An + # OAuth token containing any of these scopes will be accepted. + # + # + # Example: + # + # canonical_scopes: https://www.googleapis.com/auth/calendar, + # https://www.googleapis.com/auth/calendar.read + class OAuthRequirements + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # User-defined authentication requirements, including support for + # [JSON Web Token + # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + # @!attribute [rw] provider_id + # @return [::String] + # {::Google::Api::AuthProvider#id id} from authentication provider. + # + # Example: + # + # provider_id: bookstore_auth + # @!attribute [rw] audiences + # @return [::String] + # NOTE: This will be deprecated soon, once AuthProvider.audiences is + # implemented and accepted in all the runtime components. + # + # The list of JWT + # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + # that are allowed to access. A JWT containing any of these audiences will + # be accepted. When this setting is absent, only JWTs with audience + # "https://[Service_name][google.api.Service.name]/{::Google::Protobuf::Api#name API_name}" + # will be accepted. For example, if no audiences are in the setting, + # LibraryService API will only accept JWTs with the following audience + # "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + # + # Example: + # + # audiences: bookstore_android.apps.googleusercontent.com, + # bookstore_web.apps.googleusercontent.com + class AuthRequirement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb new file mode 100644 index 000000000000..ccefcdf22809 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/documentation.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! + + +module Google + module Api + # `Documentation` provides the information for describing a service. + # + # Example: + #
documentation:
+    #   summary: >
+    #     The Google Calendar API gives access
+    #     to most calendar features.
+    #   pages:
+    #   - name: Overview
+    #     content: (== include google/foo/overview.md ==)
+    #   - name: Tutorial
+    #     content: (== include google/foo/tutorial.md ==)
+    #     subpages:
+    #     - name: Java
+    #       content: (== include google/foo/tutorial_java.md ==)
+    #   rules:
+    #   - selector: google.calendar.Calendar.Get
+    #     description: >
+    #       ...
+    #   - selector: google.calendar.Calendar.Put
+    #     description: >
+    #       ...
+    # 
+ # Documentation is provided in markdown syntax. In addition to + # standard markdown features, definition lists, tables and fenced + # code blocks are supported. Section headers can be provided and are + # interpreted relative to the section nesting of the context where + # a documentation fragment is embedded. + # + # Documentation from the IDL is merged with documentation defined + # via the config at normalization time, where documentation provided + # by config rules overrides IDL provided. + # + # A number of constructs specific to the API platform are supported + # in documentation text. + # + # In order to reference a proto element, the following + # notation can be used: + #
[fully.qualified.proto.name][]
+ # To override the display text used for the link, this can be used: + #
[display text][fully.qualified.proto.name]
+ # Text can be excluded from doc using the following notation: + #
(-- internal comment --)
+ # + # A few directives are available in documentation. Note that + # directives must appear on a single line to be properly + # identified. The `include` directive includes a markdown file from + # an external source: + #
(== include path/to/file ==)
+ # The `resource_for` directive marks a message to be the resource of + # a collection in REST view. If it is not specified, tools attempt + # to infer the resource from the operations in a collection: + #
(== resource_for v1.shelves.books ==)
+ # The directive `suppress_warning` does not directly affect documentation + # and is documented together with service config validation. + # @!attribute [rw] summary + # @return [::String] + # A short description of what the service does. The summary must be plain + # text. It becomes the overview of the service displayed in Google Cloud + # Console. + # NOTE: This field is equivalent to the standard field `description`. + # @!attribute [rw] pages + # @return [::Array<::Google::Api::Page>] + # The top level pages for the documentation set. + # @!attribute [rw] rules + # @return [::Array<::Google::Api::DocumentationRule>] + # A list of documentation rules that apply to individual API elements. + # + # **NOTE:** All service configuration rules follow "last one wins" order. + # @!attribute [rw] documentation_root_url + # @return [::String] + # The URL to the root of documentation. + # @!attribute [rw] service_root_url + # @return [::String] + # Specifies the service root url if the default one (the service name + # from the yaml file) is not suitable. This can be seen in any fully + # specified service urls as well as sections that show a base that other + # urls are relative to. + # @!attribute [rw] overview + # @return [::String] + # Declares a single overview page. For example: + #
documentation:
+    #       summary: ...
+    #       overview: (== include overview.md ==)
+    #     
+ # This is a shortcut for the following declaration (using pages style): + #
documentation:
+    #       summary: ...
+    #       pages:
+    #       - name: Overview
+    #         content: (== include overview.md ==)
+    #     
+ # Note: you cannot specify both `overview` field and `pages` field. + class Documentation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A documentation rule provides information about individual API elements. + # @!attribute [rw] selector + # @return [::String] + # The selector is a comma-separated list of patterns for any element such as + # a method, a field, an enum value. Each pattern is a qualified name of the + # element which may end in "*", indicating a wildcard. Wildcards are only + # allowed at the end and for a whole component of the qualified name, + # i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match + # one or more components. To specify a default for all applicable elements, + # the whole pattern "*" is used. + # @!attribute [rw] description + # @return [::String] + # Description of the selected proto element (e.g. a message, a method, a + # 'service' definition, or a field). Defaults to leading & trailing comments + # taken from the proto source definition of the proto element. + # @!attribute [rw] deprecation_description + # @return [::String] + # Deprecation description of the selected element(s). It can be provided if + # an element is marked as `deprecated`. + class DocumentationRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a documentation page. A page can contain subpages to represent + # nested documentation set structure. + # @!attribute [rw] name + # @return [::String] + # The name of the page. It will be used as an identity of the page to + # generate URI of the page, text of the link to this page in navigation, + # etc. The full page name (start from the root page name to this page + # concatenated with `.`) can be used as reference to the page in your + # documentation. For example: + #
pages:
+    #     - name: Tutorial
+    #       content: (== include tutorial.md ==)
+    #       subpages:
+    #       - name: Java
+    #         content: (== include tutorial_java.md ==)
+    #     
+ # You can reference `Java` page using Markdown reference link syntax: + # `[Java][Tutorial.Java]`. + # @!attribute [rw] content + # @return [::String] + # The Markdown content of the page. You can use ```(== include {path} + # ==)``` to include content from a Markdown file. The content can be used + # to produce the documentation page such as HTML format page. + # @!attribute [rw] subpages + # @return [::Array<::Google::Api::Page>] + # Subpages of this page. The order of subpages specified here will be + # honored in the generated docset. + class Page + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb new file mode 100644 index 000000000000..57d040a793ab --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.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 + # `Endpoint` describes a network address of a service that serves a set of + # APIs. It is commonly known as a service endpoint. A service may expose + # any number of service endpoints, and all service endpoints share the same + # service definition, such as quota limits and monitoring metrics. + # + # Example: + # + # type: google.api.Service + # name: library-example.googleapis.com + # endpoints: + # # Declares network address `https://library-example.googleapis.com` + # # for service `library-example.googleapis.com`. The `https` scheme + # # is implicit for all service endpoints. Other schemes may be + # # supported in the future. + # - name: library-example.googleapis.com + # allow_cors: false + # - name: content-staging-library-example.googleapis.com + # # Allows HTTP OPTIONS calls to be passed to the API frontend, for it + # # to decide whether the subsequent cross-origin request is allowed + # # to proceed. + # allow_cors: true + # @!attribute [rw] name + # @return [::String] + # The canonical name of this endpoint. + # @!attribute [rw] aliases + # @return [::Array<::String>] + # Aliases for this endpoint, these will be served by the same UrlMap as the + # parent endpoint, and will be provisioned in the GCP stack for the Regional + # Endpoints. + # @!attribute [rw] target + # @return [::String] + # The specification of an Internet routable address of API frontend that will + # handle requests to this [API + # Endpoint](https://cloud.google.com/apis/design/glossary). It should be + # either a valid IPv4 address or a fully-qualified domain name. For example, + # "8.8.8.8" or "myservice.appspot.com". + # @!attribute [rw] allow_cors + # @return [::Boolean] + # Allowing + # [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + # cross-domain traffic, would allow the backends served from this endpoint to + # receive and respond to HTTP OPTIONS requests. The response will be used by + # the browser to determine whether the subsequent cross-origin request is + # allowed to proceed. + class Endpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/api/label.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/label.rb new file mode 100644 index 000000000000..02d2f8d451f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/label.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 Api + # A description of a label. + # @!attribute [rw] key + # @return [::String] + # The label key. + # @!attribute [rw] value_type + # @return [::Google::Api::LabelDescriptor::ValueType] + # The type of data that can be assigned to the label. + # @!attribute [rw] description + # @return [::String] + # A human-readable description for the label. + class LabelDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Value types that can be used as label values. + module ValueType + # A variable-length string. This is the default. + STRING = 0 + + # Boolean; true or false. + BOOL = 1 + + # A 64-bit signed integer. + INT64 = 2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/api/monitored_resource.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb new file mode 100644 index 000000000000..4d1ec410ddac --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb @@ -0,0 +1,150 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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 object that describes the schema of a + # {::Google::Api::MonitoredResource MonitoredResource} object using a type name + # and a set of labels. For example, the monitored resource descriptor for + # Google Compute Engine VM instances has a type of + # `"gce_instance"` and specifies the use of the labels `"instance_id"` and + # `"zone"` to identify particular VM instances. + # + # Different APIs can support different monitored resource types. APIs generally + # provide a `list` method that returns the monitored resource descriptors used + # by the API. + # @!attribute [rw] name + # @return [::String] + # Optional. The resource name of the monitored resource descriptor: + # `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where + # \\{type} is the value of the `type` field in this object and + # \\{project_id} is a project ID that provides API-specific context for + # accessing the type. APIs that do not use project information can use the + # resource name format `"monitoredResourceDescriptors/{type}"`. + # @!attribute [rw] type + # @return [::String] + # Required. The monitored resource type. For example, the type + # `"cloudsql_database"` represents databases in Google Cloud SQL. + # For a list of types, see [Monitored resource + # types](https://cloud.google.com/monitoring/api/resources) + # and [Logging resource + # types](https://cloud.google.com/logging/docs/api/v2/resource-list). + # @!attribute [rw] display_name + # @return [::String] + # Optional. A concise name for the monitored resource type that might be + # displayed in user interfaces. It should be a Title Cased Noun Phrase, + # without any article or other determiners. For example, + # `"Google Cloud SQL Database"`. + # @!attribute [rw] description + # @return [::String] + # Optional. A detailed description of the monitored resource type that might + # be used in documentation. + # @!attribute [rw] labels + # @return [::Array<::Google::Api::LabelDescriptor>] + # Required. A set of labels used to describe instances of this monitored + # resource type. For example, an individual Google Cloud SQL database is + # identified by values for the labels `"database_id"` and `"zone"`. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Optional. The launch stage of the monitored resource definition. + class MonitoredResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An object representing a resource that can be used for monitoring, logging, + # billing, or other purposes. Examples include virtual machine instances, + # databases, and storage devices such as disks. The `type` field identifies a + # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} object + # that describes the resource's schema. Information in the `labels` field + # identifies the actual resource and its attributes according to the schema. + # For example, a particular Compute Engine VM instance could be represented by + # the following object, because the + # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} for + # `"gce_instance"` has labels + # `"project_id"`, `"instance_id"` and `"zone"`: + # + # { "type": "gce_instance", + # "labels": { "project_id": "my-project", + # "instance_id": "12345678901234", + # "zone": "us-central1-a" }} + # @!attribute [rw] type + # @return [::String] + # Required. The monitored resource type. This field must match + # the `type` field of a + # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} + # object. For example, the type of a Compute Engine VM instance is + # `gce_instance`. Some descriptors include the service name in the type; for + # example, the type of a Datastream stream is + # `datastream.googleapis.com/Stream`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Required. Values for all of the labels listed in the associated monitored + # resource descriptor. For example, Compute Engine VM instances use the + # labels `"project_id"`, `"instance_id"`, and `"zone"`. + class MonitoredResource + 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 + + # Auxiliary metadata for a {::Google::Api::MonitoredResource MonitoredResource} + # object. {::Google::Api::MonitoredResource MonitoredResource} objects contain the + # minimum set of information to uniquely identify a monitored resource + # instance. There is some other useful auxiliary metadata. Monitoring and + # Logging use an ingestion pipeline to extract metadata for cloud resources of + # all types, and store the metadata in this message. + # @!attribute [rw] system_labels + # @return [::Google::Protobuf::Struct] + # Output only. Values for predefined system metadata labels. + # System labels are a kind of metadata extracted by Google, including + # "machine_image", "vpc", "subnet_id", + # "security_group", "name", etc. + # System label values can be only strings, Boolean values, or a list of + # strings. For example: + # + # { "name": "my-test-instance", + # "security_group": ["a", "b", "c"], + # "spot_instance": false } + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. A map of user-defined metadata labels. + class MonitoredResourceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitoring.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitoring.rb new file mode 100644 index 000000000000..666ca63971d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitoring.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Monitoring configuration of the service. + # + # The example below shows how to configure monitored resources and metrics + # for monitoring. In the example, a monitored resource and two metrics are + # defined. The `library.googleapis.com/book/returned_count` metric is sent + # to both producer and consumer projects, whereas the + # `library.googleapis.com/book/num_overdue` metric is only sent to the + # consumer project. + # + # monitored_resources: + # - type: library.googleapis.com/Branch + # display_name: "Library Branch" + # description: "A branch of a library." + # launch_stage: GA + # labels: + # - key: resource_container + # description: "The Cloud container (ie. project id) for the Branch." + # - key: location + # description: "The location of the library branch." + # - key: branch_id + # description: "The id of the branch." + # metrics: + # - name: library.googleapis.com/book/returned_count + # display_name: "Books Returned" + # description: "The count of books that have been returned." + # launch_stage: GA + # metric_kind: DELTA + # value_type: INT64 + # unit: "1" + # labels: + # - key: customer_id + # description: "The id of the customer." + # - name: library.googleapis.com/book/num_overdue + # display_name: "Books Overdue" + # description: "The current number of overdue books." + # launch_stage: GA + # metric_kind: GAUGE + # value_type: INT64 + # unit: "1" + # labels: + # - key: customer_id + # description: "The id of the customer." + # monitoring: + # producer_destinations: + # - monitored_resource: library.googleapis.com/Branch + # metrics: + # - library.googleapis.com/book/returned_count + # consumer_destinations: + # - monitored_resource: library.googleapis.com/Branch + # metrics: + # - library.googleapis.com/book/returned_count + # - library.googleapis.com/book/num_overdue + # @!attribute [rw] producer_destinations + # @return [::Array<::Google::Api::Monitoring::MonitoringDestination>] + # Monitoring configurations for sending metrics to the producer project. + # There can be multiple producer destinations. A monitored resource type may + # appear in multiple monitoring destinations if different aggregations are + # needed for different sets of metrics associated with that monitored + # resource type. A monitored resource and metric pair may only be used once + # in the Monitoring configuration. + # @!attribute [rw] consumer_destinations + # @return [::Array<::Google::Api::Monitoring::MonitoringDestination>] + # Monitoring configurations for sending metrics to the consumer project. + # There can be multiple consumer destinations. A monitored resource type may + # appear in multiple monitoring destinations if different aggregations are + # needed for different sets of metrics associated with that monitored + # resource type. A monitored resource and metric pair may only be used once + # in the Monitoring configuration. + class Monitoring + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of a specific monitoring destination (the producer project + # or the consumer project). + # @!attribute [rw] monitored_resource + # @return [::String] + # The monitored resource type. The type must be defined in + # [Service.monitored_resources][google.api.Service.monitored_resources] + # section. + # @!attribute [rw] metrics + # @return [::Array<::String>] + # Types of the metrics to report to this monitoring destination. + # Each type must be defined in + # [Service.metrics][google.api.Service.metrics] section. + class MonitoringDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb new file mode 100644 index 000000000000..410251c03d80 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb @@ -0,0 +1,208 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Quota configuration helps to achieve fairness and budgeting in service + # usage. + # + # The metric based quota configuration works this way: + # - The service configuration defines a set of metrics. + # - For API calls, the quota.metric_rules maps methods to metrics with + # corresponding costs. + # - The quota.limits defines limits on the metrics, which will be used for + # quota checks at runtime. + # + # An example quota configuration in yaml format: + # + # quota: + # limits: + # + # - name: apiWriteQpsPerProject + # metric: library.googleapis.com/write_calls + # unit: "1/min/\\{project}" # rate limit for consumer projects + # values: + # STANDARD: 10000 + # + # + # (The metric rules bind all methods to the read_calls metric, + # except for the UpdateBook and DeleteBook methods. These two methods + # are mapped to the write_calls metric, with the UpdateBook method + # consuming at twice rate as the DeleteBook method.) + # metric_rules: + # - selector: "*" + # metric_costs: + # library.googleapis.com/read_calls: 1 + # - selector: google.example.library.v1.LibraryService.UpdateBook + # metric_costs: + # library.googleapis.com/write_calls: 2 + # - selector: google.example.library.v1.LibraryService.DeleteBook + # metric_costs: + # library.googleapis.com/write_calls: 1 + # + # Corresponding Metric definition: + # + # metrics: + # - name: library.googleapis.com/read_calls + # display_name: Read requests + # metric_kind: DELTA + # value_type: INT64 + # + # - name: library.googleapis.com/write_calls + # display_name: Write requests + # metric_kind: DELTA + # value_type: INT64 + # @!attribute [rw] limits + # @return [::Array<::Google::Api::QuotaLimit>] + # List of QuotaLimit definitions for the service. + # @!attribute [rw] metric_rules + # @return [::Array<::Google::Api::MetricRule>] + # List of MetricRule definitions, each one mapping a selected method to one + # or more metrics. + class Quota + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Bind API methods to metrics. Binding a method to a metric causes that + # metric's configured quota behaviors to apply to the method call. + # @!attribute [rw] selector + # @return [::String] + # Selects the methods to which this rule applies. + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # @!attribute [rw] metric_costs + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # Metrics to update when the selected methods are called, and the associated + # cost applied to each metric. + # + # The key of the map is the metric name, and the values are the amount + # increased for the metric against which the quota limits are defined. + # The value must not be negative. + class MetricRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class MetricCostsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `QuotaLimit` defines a specific limit that applies over a specified duration + # for a limit type. There can be at most one limit for a duration and limit + # type combination defined within a `QuotaGroup`. + # @!attribute [rw] name + # @return [::String] + # Name of the quota limit. + # + # The name must be provided, and it must be unique within the service. The + # name can only include alphanumeric characters as well as '-'. + # + # The maximum length of the limit name is 64 characters. + # @!attribute [rw] description + # @return [::String] + # Optional. User-visible, extended description for this quota limit. + # Should be used only when more context is needed to understand this limit + # than provided by the limit's display name (see: `display_name`). + # @!attribute [rw] default_limit + # @return [::Integer] + # Default number of tokens that can be consumed during the specified + # duration. This is the number of tokens assigned when a client + # application developer activates the service for his/her project. + # + # Specifying a value of 0 will block all requests. This can be used if you + # are provisioning quota to selected consumers and blocking others. + # Similarly, a value of -1 will indicate an unlimited quota. No other + # negative values are allowed. + # + # Used by group-based quotas only. + # @!attribute [rw] max_limit + # @return [::Integer] + # Maximum number of tokens that can be consumed during the specified + # duration. Client application developers can override the default limit up + # to this maximum. If specified, this value cannot be set to a value less + # than the default limit. If not specified, it is set to the default limit. + # + # To allow clients to apply overrides with no upper bound, set this to -1, + # indicating unlimited maximum quota. + # + # Used by group-based quotas only. + # @!attribute [rw] free_tier + # @return [::Integer] + # Free tier value displayed in the Developers Console for this limit. + # The free tier is the number of tokens that will be subtracted from the + # billed amount when billing is enabled. + # This field can only be set on a limit with duration "1d", in a billable + # group; it is invalid on any other limit. If this field is not set, it + # defaults to 0, indicating that there is no free tier for this service. + # + # Used by group-based quotas only. + # @!attribute [rw] duration + # @return [::String] + # Duration of this limit in textual notation. Must be "100s" or "1d". + # + # Used by group-based quotas only. + # @!attribute [rw] metric + # @return [::String] + # The name of the metric this quota limit applies to. The quota limits with + # the same metric will be checked together during runtime. The metric must be + # defined within the service config. + # @!attribute [rw] unit + # @return [::String] + # Specify the unit of the quota limit. It uses the same syntax as + # [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported + # unit kinds are determined by the quota backend system. + # + # Here are some examples: + # * "1/min/\\{project}" for quota per minute per project. + # + # Note: the order of unit components is insignificant. + # The "1" at the beginning is required to follow the metric unit syntax. + # @!attribute [rw] values + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # Tiered limit values. You must specify this as a key:value pair, with an + # integer value that is the maximum number of requests allowed for the + # specified unit. Currently only STANDARD is supported. + # @!attribute [rw] display_name + # @return [::String] + # User-visible display name for this limit. + # Optional. If not set, the UI will provide a default display name based on + # the quota configuration. This field can be used to override the default + # display name generated from the configuration. + class QuotaLimit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class ValuesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/api/serviceusage/v1/resources.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/resources.rb new file mode 100644 index 000000000000..7895c440ea25 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/resources.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceUsage + module V1 + # A service that is available for use by the consumer. + # @!attribute [rw] name + # @return [::String] + # The resource name of the consumer and service. + # + # A valid name would be: + # - projects/123/services/serviceusage.googleapis.com + # @!attribute [rw] parent + # @return [::String] + # The resource name of the consumer. + # + # A valid name would be: + # - projects/123 + # @!attribute [rw] config + # @return [::Google::Cloud::ServiceUsage::V1::ServiceConfig] + # The service configuration of the available service. + # Some fields may be filtered out of the configuration in responses to + # the `ListServices` method. These fields are present only in responses to + # the `GetService` method. + # @!attribute [rw] state + # @return [::Google::Cloud::ServiceUsage::V1::State] + # Whether or not the service has been enabled for use by the consumer. + class Service + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The configuration of the service. + # @!attribute [rw] name + # @return [::String] + # The DNS address at which this service is available. + # + # An example DNS address would be: + # `calendar.googleapis.com`. + # @!attribute [rw] title + # @return [::String] + # The product title for this service. + # @!attribute [rw] apis + # @return [::Array<::Google::Protobuf::Api>] + # A list of API interfaces exported by this service. Contains only the names, + # versions, and method names of the interfaces. + # @!attribute [rw] documentation + # @return [::Google::Api::Documentation] + # Additional API documentation. Contains only the summary and the + # documentation URL. + # @!attribute [rw] quota + # @return [::Google::Api::Quota] + # Quota configuration. + # @!attribute [rw] authentication + # @return [::Google::Api::Authentication] + # Auth configuration. Contains only the OAuth rules. + # @!attribute [rw] usage + # @return [::Google::Api::Usage] + # Configuration controlling usage of this service. + # @!attribute [rw] endpoints + # @return [::Array<::Google::Api::Endpoint>] + # Configuration for network endpoints. Contains only the names and aliases + # of the endpoints. + # @!attribute [rw] monitored_resources + # @return [::Array<::Google::Api::MonitoredResourceDescriptor>] + # Defines the monitored resources used by this service. This is required + # by the [Service.monitoring][google.api.Service.monitoring] and + # [Service.logging][google.api.Service.logging] configurations. + # @!attribute [rw] monitoring + # @return [::Google::Api::Monitoring] + # Monitoring configuration. + # This should not include the 'producer_destinations' field. + class ServiceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The operation metadata returned for the batchend services operation. + # @!attribute [rw] resource_names + # @return [::Array<::String>] + # The full name of the resources that this operation is directly + # associated with. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Whether or not a service has been enabled for use by a consumer. + module State + # The default value, which indicates that the enabled state of the service + # is unspecified or not meaningful. Currently, all consumers other than + # projects (such as folders and organizations) are always in this state. + STATE_UNSPECIFIED = 0 + + # The service cannot be used by this consumer. It has either been explicitly + # disabled, or has never been enabled. + DISABLED = 1 + + # The service has been explicitly enabled for use by this consumer. + ENABLED = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/serviceusage.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/serviceusage.rb new file mode 100644 index 000000000000..ac900c98b599 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/serviceusage.rb @@ -0,0 +1,242 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module ServiceUsage + module V1 + # Request message for the `EnableService` method. + # @!attribute [rw] name + # @return [::String] + # Name of the consumer and service to enable the service on. + # + # The `EnableService` and `DisableService` methods currently only support + # projects. + # + # Enabling a service requires that the service is public or is shared with + # the user enabling the service. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + class EnableServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `EnableService` method. + # This response message is assigned to the `response` field of the returned + # Operation when that operation is done. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceUsage::V1::Service] + # The new state of the service after enabling. + class EnableServiceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `DisableService` method. + # @!attribute [rw] name + # @return [::String] + # Name of the consumer and service to disable the service on. + # + # The enable and disable methods currently only support projects. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # @!attribute [rw] disable_dependent_services + # @return [::Boolean] + # Indicates if services that are enabled and which depend on this service + # should also be disabled. If not set, an error will be generated if any + # enabled services depend on the service to be disabled. When set, the + # service, and any enabled services that depend on it, will be disabled + # together. + # @!attribute [rw] check_if_service_has_usage + # @return [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest::CheckIfServiceHasUsage] + # Defines the behavior for checking service usage when disabling a service. + class DisableServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to determine if service usage should be checked when disabling a + # service. + module CheckIfServiceHasUsage + # When unset, the default behavior is used, which is SKIP. + CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED = 0 + + # If set, skip checking service usage when disabling a service. + SKIP = 1 + + # If set, service usage is checked when disabling the service. If a + # service, or its dependents, has usage in the last 30 days, the request + # returns a FAILED_PRECONDITION error. + CHECK = 2 + end + end + + # Response message for the `DisableService` method. + # This response message is assigned to the `response` field of the returned + # Operation when that operation is done. + # @!attribute [rw] service + # @return [::Google::Cloud::ServiceUsage::V1::Service] + # The new state of the service after disabling. + class DisableServiceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GetService` method. + # @!attribute [rw] name + # @return [::String] + # Name of the consumer and service to get the `ConsumerState` for. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + class GetServiceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListServices` method. + # @!attribute [rw] parent + # @return [::String] + # Parent to search for services on. + # + # An example name would be: + # `projects/123` where `123` is the project number. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested size of the next page of data. + # Requested page size cannot exceed 200. + # If not set, the default page size is 50. + # @!attribute [rw] page_token + # @return [::String] + # Token identifying which result to start with, which is returned by a + # previous list call. + # @!attribute [rw] filter + # @return [::String] + # Only list services that conform to the given filter. + # The allowed filter strings are `state:ENABLED` and `state:DISABLED`. + class ListServicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListServices` method. + # @!attribute [rw] services + # @return [::Array<::Google::Cloud::ServiceUsage::V1::Service>] + # The available services for the requested project. + # @!attribute [rw] next_page_token + # @return [::String] + # Token that can be passed to `ListServices` to resume a paginated + # query. + class ListServicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `BatchEnableServices` method. + # @!attribute [rw] parent + # @return [::String] + # Parent to enable services on. + # + # An example name would be: + # `projects/123` where `123` is the project number. + # + # The `BatchEnableServices` method currently only supports projects. + # @!attribute [rw] service_ids + # @return [::Array<::String>] + # The identifiers of the services to enable on the project. + # + # A valid identifier would be: + # serviceusage.googleapis.com + # + # Enabling services requires that each service is public or is shared with + # the user enabling the service. + # + # A single request can enable a maximum of 20 services at a time. If more + # than 20 services are specified, the request will fail, and no state changes + # will occur. + class BatchEnableServicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `BatchEnableServices` method. + # This response message is assigned to the `response` field of the returned + # Operation when that operation is done. + # @!attribute [rw] services + # @return [::Array<::Google::Cloud::ServiceUsage::V1::Service>] + # The new state of the services after enabling. + # @!attribute [rw] failures + # @return [::Array<::Google::Cloud::ServiceUsage::V1::BatchEnableServicesResponse::EnableFailure>] + # If allow_partial_success is true, and one or more services could not be + # enabled, this field contains the details about each failure. + class BatchEnableServicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Provides error messages for the failing services. + # @!attribute [rw] service_id + # @return [::String] + # The service id of a service that could not be enabled. + # @!attribute [rw] error_message + # @return [::String] + # An error message describing why the service could not be enabled. + class EnableFailure + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for the `BatchGetServices` method. + # @!attribute [rw] parent + # @return [::String] + # Parent to retrieve services from. + # If this is set, the parent of all of the services specified in `names` must + # match this field. An example name would be: `projects/123` where `123` is + # the project number. The `BatchGetServices` method currently only supports + # projects. + # @!attribute [rw] names + # @return [::Array<::String>] + # Names of the services to retrieve. + # + # An example name would be: + # `projects/123/services/serviceusage.googleapis.com` where `123` is the + # project number. + # A single request can get a maximum of 30 services at a time. + class BatchGetServicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `BatchGetServices` method. + # @!attribute [rw] services + # @return [::Array<::Google::Cloud::ServiceUsage::V1::Service>] + # The requested Service states. + class BatchGetServicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb new file mode 100644 index 000000000000..42ed23536d71 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Configuration controlling usage of a service. + # @!attribute [rw] requirements + # @return [::Array<::String>] + # Requirements that must be satisfied before a consumer project can use the + # service. Each requirement is of the form /; + # for example 'serviceusage.googleapis.com/billing-enabled'. + # + # For Google APIs, a Terms of Service requirement must be included here. + # Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". + # Other Google APIs should include + # "serviceusage.googleapis.com/tos/universal". Additional ToS can be + # included based on the business needs. + # @!attribute [rw] rules + # @return [::Array<::Google::Api::UsageRule>] + # A list of usage rules that apply to individual API methods. + # + # **NOTE:** All service configuration rules follow "last one wins" order. + # @!attribute [rw] producer_notification_channel + # @return [::String] + # The full resource name of a channel used for sending notifications to the + # service producer. + # + # Google Service Management currently only supports + # [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + # channel. To use Google Cloud Pub/Sub as the channel, this must be the name + # of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format + # documented in https://cloud.google.com/pubsub/docs/overview. + class Usage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Usage configuration rules for the service. + # @!attribute [rw] selector + # @return [::String] + # Selects the methods to which this rule applies. Use '*' to indicate all + # methods in all APIs. + # + # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax + # details. + # @!attribute [rw] allow_unregistered_calls + # @return [::Boolean] + # Use this rule to configure unregistered calls for the service. Unregistered + # calls are calls that do not contain consumer project identity. + # (Example: calls that do not contain an API key). + # + # WARNING: By default, API methods do not allow unregistered calls, and each + # method call must be identified by a consumer project identity. + # @!attribute [rw] skip_service_control + # @return [::Boolean] + # If true, the selected method should skip service control and the control + # plane features, such as quota and billing, will not be available. + # This flag is used by Google Cloud Endpoints to bypass checks for internal + # methods, such as service health check methods. + class UsageRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/api.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/api.rb new file mode 100644 index 000000000000..9817de10b446 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/api.rb @@ -0,0 +1,194 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Api is a light-weight descriptor for an API Interface. + # + # Interfaces are also described as "protocol buffer services" in some contexts, + # such as by the "service" keyword in a .proto file, but they are different + # from API Services, which represent a concrete implementation of an interface + # as opposed to simply a description of methods and bindings. They are also + # sometimes simply referred to as "APIs" in other contexts, such as the name of + # this message itself. See https://cloud.google.com/apis/design/glossary for + # detailed terminology. + # @!attribute [rw] name + # @return [::String] + # The fully qualified name of this interface, including package name + # followed by the interface's simple name. + # @!attribute [rw] methods + # @return [::Array<::Google::Protobuf::Method>] + # The methods of this interface, in unspecified order. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # Any metadata attached to the interface. + # @!attribute [rw] version + # @return [::String] + # A version string for this interface. If specified, must have the form + # `major-version.minor-version`, as in `1.10`. If the minor version is + # omitted, it defaults to zero. If the entire version field is empty, the + # major version is derived from the package name, as outlined below. If the + # field is not empty, the version in the package name will be verified to be + # consistent with what is provided here. + # + # The versioning schema uses [semantic + # versioning](http://semver.org) where the major version number + # indicates a breaking change and the minor version an additive, + # non-breaking change. Both version numbers are signals to users + # what to expect from different versions, and should be carefully + # chosen based on the product plan. + # + # The major version is also reflected in the package name of the + # interface, which must end in `v`, as in + # `google.feature.v1`. For major versions 0 and 1, the suffix can + # be omitted. Zero major versions must only be used for + # experimental, non-GA interfaces. + # @!attribute [rw] source_context + # @return [::Google::Protobuf::SourceContext] + # Source context for the protocol buffer service represented by this + # message. + # @!attribute [rw] mixins + # @return [::Array<::Google::Protobuf::Mixin>] + # Included interfaces. See [Mixin][]. + # @!attribute [rw] syntax + # @return [::Google::Protobuf::Syntax] + # The source syntax of the service. + class Api + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Method represents a method of an API interface. + # @!attribute [rw] name + # @return [::String] + # The simple name of this method. + # @!attribute [rw] request_type_url + # @return [::String] + # A URL of the input message type. + # @!attribute [rw] request_streaming + # @return [::Boolean] + # If true, the request is streamed. + # @!attribute [rw] response_type_url + # @return [::String] + # The URL of the output message type. + # @!attribute [rw] response_streaming + # @return [::Boolean] + # If true, the response is streamed. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # Any metadata attached to the method. + # @!attribute [rw] syntax + # @return [::Google::Protobuf::Syntax] + # The source syntax of this method. + class Method + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Declares an API Interface to be included in this interface. The including + # interface must redeclare all the methods from the included interface, but + # documentation and options are inherited as follows: + # + # - If after comment and whitespace stripping, the documentation + # string of the redeclared method is empty, it will be inherited + # from the original method. + # + # - Each annotation belonging to the service config (http, + # visibility) which is not set in the redeclared method will be + # inherited. + # + # - If an http annotation is inherited, the path pattern will be + # modified as follows. Any version prefix will be replaced by the + # version of the including interface plus the [root][] path if + # specified. + # + # Example of a simple mixin: + # + # package google.acl.v1; + # service AccessControl { + # // Get the underlying ACL object. + # rpc GetAcl(GetAclRequest) returns (Acl) { + # option (google.api.http).get = "/v1/{resource=**}:getAcl"; + # } + # } + # + # package google.storage.v2; + # service Storage { + # rpc GetAcl(GetAclRequest) returns (Acl); + # + # // Get a data record. + # rpc GetData(GetDataRequest) returns (Data) { + # option (google.api.http).get = "/v2/{resource=**}"; + # } + # } + # + # Example of a mixin configuration: + # + # apis: + # - name: google.storage.v2.Storage + # mixins: + # - name: google.acl.v1.AccessControl + # + # The mixin construct implies that all methods in `AccessControl` are + # also declared with same name and request/response types in + # `Storage`. A documentation generator or annotation processor will + # see the effective `Storage.GetAcl` method after inheriting + # documentation and annotations as follows: + # + # service Storage { + # // Get the underlying ACL object. + # rpc GetAcl(GetAclRequest) returns (Acl) { + # option (google.api.http).get = "/v2/{resource=**}:getAcl"; + # } + # ... + # } + # + # Note how the version in the path pattern changed from `v1` to `v2`. + # + # If the `root` field in the mixin is specified, it should be a + # relative path under which inherited HTTP paths are placed. Example: + # + # apis: + # - name: google.storage.v2.Storage + # mixins: + # - name: google.acl.v1.AccessControl + # root: acls + # + # This implies the following inherited HTTP annotation: + # + # service Storage { + # // Get the underlying ACL object. + # rpc GetAcl(GetAclRequest) returns (Acl) { + # option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + # } + # ... + # } + # @!attribute [rw] name + # @return [::String] + # The fully qualified name of the interface which is included. + # @!attribute [rw] root + # @return [::String] + # If non-empty specifies a path under which inherited HTTP paths + # are rooted. + class Mixin + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/source_context.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/source_context.rb new file mode 100644 index 000000000000..1bc7c0900aec --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/source_context.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `SourceContext` represents information about the source of a + # protobuf element, like the file in which it is defined. + # @!attribute [rw] file_name + # @return [::String] + # The path-qualified name of the .proto file that contained the associated + # protobuf element. For example: `"google/protobuf/source_context.proto"`. + class SourceContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/type.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/type.rb new file mode 100644 index 000000000000..f61674e32d16 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/type.rb @@ -0,0 +1,232 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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 protocol buffer message type. + # @!attribute [rw] name + # @return [::String] + # The fully qualified message name. + # @!attribute [rw] fields + # @return [::Array<::Google::Protobuf::Field>] + # The list of fields. + # @!attribute [rw] oneofs + # @return [::Array<::String>] + # The list of types appearing in `oneof` definitions in this type. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # The protocol buffer options. + # @!attribute [rw] source_context + # @return [::Google::Protobuf::SourceContext] + # The source context. + # @!attribute [rw] syntax + # @return [::Google::Protobuf::Syntax] + # The source syntax. + # @!attribute [rw] edition + # @return [::String] + # The source edition string, only valid when syntax is SYNTAX_EDITIONS. + class Type + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A single field of a message type. + # @!attribute [rw] kind + # @return [::Google::Protobuf::Field::Kind] + # The field type. + # @!attribute [rw] cardinality + # @return [::Google::Protobuf::Field::Cardinality] + # The field cardinality. + # @!attribute [rw] number + # @return [::Integer] + # The field number. + # @!attribute [rw] name + # @return [::String] + # The field name. + # @!attribute [rw] type_url + # @return [::String] + # The field type URL, without the scheme, for message or enumeration + # types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + # @!attribute [rw] oneof_index + # @return [::Integer] + # The index of the field type in `Type.oneofs`, for message or enumeration + # types. The first type has index 1; zero means the type is not in the list. + # @!attribute [rw] packed + # @return [::Boolean] + # Whether to use alternative packed wire representation. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # The protocol buffer options. + # @!attribute [rw] json_name + # @return [::String] + # The field JSON name. + # @!attribute [rw] default_value + # @return [::String] + # The string value of the default value of this field. Proto2 syntax only. + class Field + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Basic field types. + module Kind + # Field type unknown. + TYPE_UNKNOWN = 0 + + # Field type double. + TYPE_DOUBLE = 1 + + # Field type float. + TYPE_FLOAT = 2 + + # Field type int64. + TYPE_INT64 = 3 + + # Field type uint64. + TYPE_UINT64 = 4 + + # Field type int32. + TYPE_INT32 = 5 + + # Field type fixed64. + TYPE_FIXED64 = 6 + + # Field type fixed32. + TYPE_FIXED32 = 7 + + # Field type bool. + TYPE_BOOL = 8 + + # Field type string. + TYPE_STRING = 9 + + # Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10 + + # Field type message. + TYPE_MESSAGE = 11 + + # Field type bytes. + TYPE_BYTES = 12 + + # Field type uint32. + TYPE_UINT32 = 13 + + # Field type enum. + TYPE_ENUM = 14 + + # Field type sfixed32. + TYPE_SFIXED32 = 15 + + # Field type sfixed64. + TYPE_SFIXED64 = 16 + + # Field type sint32. + TYPE_SINT32 = 17 + + # Field type sint64. + TYPE_SINT64 = 18 + end + + # Whether a field is optional, required, or repeated. + module Cardinality + # For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0 + + # For optional fields. + CARDINALITY_OPTIONAL = 1 + + # For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2 + + # For repeated fields. + CARDINALITY_REPEATED = 3 + end + end + + # Enum type definition. + # @!attribute [rw] name + # @return [::String] + # Enum type name. + # @!attribute [rw] enumvalue + # @return [::Array<::Google::Protobuf::EnumValue>] + # Enum value definitions. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # Protocol buffer options. + # @!attribute [rw] source_context + # @return [::Google::Protobuf::SourceContext] + # The source context. + # @!attribute [rw] syntax + # @return [::Google::Protobuf::Syntax] + # The source syntax. + # @!attribute [rw] edition + # @return [::String] + # The source edition string, only valid when syntax is SYNTAX_EDITIONS. + class Enum + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enum value definition. + # @!attribute [rw] name + # @return [::String] + # Enum value name. + # @!attribute [rw] number + # @return [::Integer] + # Enum value number. + # @!attribute [rw] options + # @return [::Array<::Google::Protobuf::Option>] + # Protocol buffer options. + class EnumValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A protocol buffer option, which can be attached to a message, field, + # enumeration, etc. + # @!attribute [rw] name + # @return [::String] + # The option's name. For protobuf built-in options (options defined in + # descriptor.proto), this is the short name. For example, `"map_entry"`. + # For custom options, it should be the fully-qualified name. For example, + # `"google.api.http"`. + # @!attribute [rw] value + # @return [::Google::Protobuf::Any] + # The option's value packed in an Any message. If the value is a primitive, + # the corresponding wrapper type defined in google/protobuf/wrappers.proto + # should be used. If the value is an enum, it should be stored as an int32 + # value using the google.protobuf.Int32Value type. + class Option + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The syntax in which a protocol buffer element is defined. + module Syntax + # Syntax `proto2`. + SYNTAX_PROTO2 = 0 + + # Syntax `proto3`. + SYNTAX_PROTO3 = 1 + + # Syntax `editions`. + SYNTAX_EDITIONS = 2 + end + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_usage-v1/snippets/Gemfile new file mode 100644 index 000000000000..d5e54b2240b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1", path: "../" +else + gem "google-cloud-service_usage-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-service_usage-v1/snippets/service_usage/batch_enable_services.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb new file mode 100644 index 000000000000..3dca1ec69065 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START serviceusage_v1_generated_ServiceUsage_BatchEnableServices_sync] +require "google/cloud/service_usage/v1" + +## +# Snippet for the batch_enable_services call in the ServiceUsage service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_enable_services. +# +def batch_enable_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new + + # Call the batch_enable_services method. + result = client.batch_enable_services request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END serviceusage_v1_generated_ServiceUsage_BatchEnableServices_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb new file mode 100644 index 000000000000..86456494e1ce --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START serviceusage_v1_generated_ServiceUsage_BatchGetServices_sync] +require "google/cloud/service_usage/v1" + +## +# Snippet for the batch_get_services call in the ServiceUsage service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_get_services. +# +def batch_get_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new + + # Call the batch_get_services method. + result = client.batch_get_services request + + # The returned object is of type Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse. + p result +end +# [END serviceusage_v1_generated_ServiceUsage_BatchGetServices_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb new file mode 100644 index 000000000000..5bc9366a51e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START serviceusage_v1_generated_ServiceUsage_DisableService_sync] +require "google/cloud/service_usage/v1" + +## +# Snippet for the disable_service call in the ServiceUsage service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#disable_service. +# +def disable_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new + + # Call the disable_service method. + result = client.disable_service request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END serviceusage_v1_generated_ServiceUsage_DisableService_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb new file mode 100644 index 000000000000..9d41562dd5d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START serviceusage_v1_generated_ServiceUsage_EnableService_sync] +require "google/cloud/service_usage/v1" + +## +# Snippet for the enable_service call in the ServiceUsage service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#enable_service. +# +def enable_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new + + # Call the enable_service method. + result = client.enable_service request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END serviceusage_v1_generated_ServiceUsage_EnableService_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb new file mode 100644 index 000000000000..81f2e0dc7fb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START serviceusage_v1_generated_ServiceUsage_GetService_sync] +require "google/cloud/service_usage/v1" + +## +# Snippet for the get_service call in the ServiceUsage service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#get_service. +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::GetServiceRequest.new + + # Call the get_service method. + result = client.get_service request + + # The returned object is of type Google::Cloud::ServiceUsage::V1::Service. + p result +end +# [END serviceusage_v1_generated_ServiceUsage_GetService_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb new file mode 100644 index 000000000000..13e90b729e12 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START serviceusage_v1_generated_ServiceUsage_ListServices_sync] +require "google/cloud/service_usage/v1" + +## +# Snippet for the list_services call in the ServiceUsage service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#list_services. +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::ListServicesRequest.new + + # Call the list_services method. + result = client.list_services request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::ServiceUsage::V1::Service. + p item + end +end +# [END serviceusage_v1_generated_ServiceUsage_ListServices_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json b/owl-bot-staging/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json new file mode 100644 index 000000000000..633aac1aafdf --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json @@ -0,0 +1,255 @@ +{ + "client_library": { + "name": "google-cloud-service_usage-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.api.serviceusage.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "serviceusage_v1_generated_ServiceUsage_EnableService_sync", + "title": "Snippet for the enable_service call in the ServiceUsage service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#enable_service.", + "file": "service_usage/enable_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_service", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#enable_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceUsage::V1::EnableServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ServiceUsage::Client", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" + }, + "method": { + "short_name": "EnableService", + "full_name": "google.api.serviceusage.v1.ServiceUsage.EnableService", + "service": { + "short_name": "ServiceUsage", + "full_name": "google.api.serviceusage.v1.ServiceUsage" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "serviceusage_v1_generated_ServiceUsage_DisableService_sync", + "title": "Snippet for the disable_service call in the ServiceUsage service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#disable_service.", + "file": "service_usage/disable_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_service", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#disable_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceUsage::V1::DisableServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ServiceUsage::Client", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" + }, + "method": { + "short_name": "DisableService", + "full_name": "google.api.serviceusage.v1.ServiceUsage.DisableService", + "service": { + "short_name": "ServiceUsage", + "full_name": "google.api.serviceusage.v1.ServiceUsage" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "serviceusage_v1_generated_ServiceUsage_GetService_sync", + "title": "Snippet for the get_service call in the ServiceUsage service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#get_service.", + "file": "service_usage/get_service.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_service", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#get_service", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceUsage::V1::GetServiceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceUsage::V1::Service", + "client": { + "short_name": "ServiceUsage::Client", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" + }, + "method": { + "short_name": "GetService", + "full_name": "google.api.serviceusage.v1.ServiceUsage.GetService", + "service": { + "short_name": "ServiceUsage", + "full_name": "google.api.serviceusage.v1.ServiceUsage" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "serviceusage_v1_generated_ServiceUsage_ListServices_sync", + "title": "Snippet for the list_services call in the ServiceUsage service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#list_services.", + "file": "service_usage/list_services.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_services", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#list_services", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceUsage::V1::ListServicesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceUsage::V1::ListServicesResponse", + "client": { + "short_name": "ServiceUsage::Client", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" + }, + "method": { + "short_name": "ListServices", + "full_name": "google.api.serviceusage.v1.ServiceUsage.ListServices", + "service": { + "short_name": "ServiceUsage", + "full_name": "google.api.serviceusage.v1.ServiceUsage" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "serviceusage_v1_generated_ServiceUsage_BatchEnableServices_sync", + "title": "Snippet for the batch_enable_services call in the ServiceUsage service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_enable_services.", + "file": "service_usage/batch_enable_services.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_enable_services", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_enable_services", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ServiceUsage::Client", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" + }, + "method": { + "short_name": "BatchEnableServices", + "full_name": "google.api.serviceusage.v1.ServiceUsage.BatchEnableServices", + "service": { + "short_name": "ServiceUsage", + "full_name": "google.api.serviceusage.v1.ServiceUsage" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "serviceusage_v1_generated_ServiceUsage_BatchGetServices_sync", + "title": "Snippet for the batch_get_services call in the ServiceUsage service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_get_services.", + "file": "service_usage/batch_get_services.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_get_services", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_get_services", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse", + "client": { + "short_name": "ServiceUsage::Client", + "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" + }, + "method": { + "short_name": "BatchGetServices", + "full_name": "google.api.serviceusage.v1.ServiceUsage.BatchGetServices", + "service": { + "short_name": "ServiceUsage", + "full_name": "google.api.serviceusage.v1.ServiceUsage" + } + } + }, + "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-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb b/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb new file mode 100644 index 000000000000..efdf44506000 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_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/api/serviceusage/v1/serviceusage_pb" +require "google/api/serviceusage/v1/serviceusage_services_pb" +require "google/cloud/service_usage/v1/service_usage" + +class ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb b/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb new file mode 100644 index 000000000000..038fd69ceef7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb @@ -0,0 +1,430 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/api/serviceusage/v1/serviceusage_pb" +require "google/cloud/service_usage/v1/service_usage/rest" + + +class ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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_enable_service + # Create test objects. + 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" + + enable_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_enable_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.enable_service({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.enable_service name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.enable_service ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.enable_service({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.enable_service(::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_service_client_stub.call_count + end + end + end + + def test_disable_service + # Create test objects. + 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" + disable_dependent_services = true + check_if_service_has_usage = :CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED + + disable_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_disable_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, disable_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.disable_service({ name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.disable_service name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.disable_service ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new(name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.disable_service({ name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.disable_service(::Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new(name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, disable_service_client_stub.call_count + end + end + end + + def test_get_service + # Create test objects. + client_result = ::Google::Cloud::ServiceUsage::V1::Service.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_get_service_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_service({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_service name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_service ::Google::Cloud::ServiceUsage::V1::GetServiceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_service({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_service(::Google::Cloud::ServiceUsage::V1::GetServiceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_service_client_stub.call_count + end + end + end + + def test_list_services + # Create test objects. + client_result = ::Google::Cloud::ServiceUsage::V1::ListServicesResponse.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_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_list_services_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_services({ 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_services 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_services ::Google::Cloud::ServiceUsage::V1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceUsage::V1::ListServicesRequest.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_services_client_stub.call_count + end + end + end + + def test_batch_enable_services + # Create test objects. + 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" + service_ids = ["hello world"] + + batch_enable_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_batch_enable_services_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_enable_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_enable_services({ parent: parent, service_ids: service_ids }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_enable_services parent: parent, service_ids: service_ids do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_enable_services ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new(parent: parent, service_ids: service_ids) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_enable_services({ parent: parent, service_ids: service_ids }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_enable_services(::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new(parent: parent, service_ids: service_ids), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_enable_services_client_stub.call_count + end + end + end + + def test_batch_get_services + # Create test objects. + client_result = ::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + names = ["hello world"] + + batch_get_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_batch_get_services_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_get_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_get_services({ parent: parent, names: names }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_get_services parent: parent, names: names do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_get_services ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new(parent: parent, names: names) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_get_services({ parent: parent, names: names }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_get_services(::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new(parent: parent, names: names), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_get_services_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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb b/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb new file mode 100644 index 000000000000..aa0dff757696 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb @@ -0,0 +1,500 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/api/serviceusage/v1/serviceusage_pb" +require "google/cloud/service_usage/v1/service_usage" + +class ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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_enable_service + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + enable_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_service, name + assert_kind_of ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.enable_service({ name: 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.enable_service name: 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.enable_service ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.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.enable_service({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.enable_service(::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.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, enable_service_client_stub.call_rpc_count + end + end + + def test_disable_service + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + disable_dependent_services = true + check_if_service_has_usage = :CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED + + disable_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_service, name + assert_kind_of ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["disable_dependent_services"] + assert_equal :CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED, request["check_if_service_has_usage"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_service({ name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_service name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_service ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new(name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_service({ name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.disable_service(::Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new(name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, disable_service_client_stub.call_rpc_count + end + end + + def test_get_service + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceUsage::V1::Service.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_service, name + assert_kind_of ::Google::Cloud::ServiceUsage::V1::GetServiceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_service_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_service({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_service name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_service ::Google::Cloud::ServiceUsage::V1::GetServiceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_service({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_service(::Google::Cloud::ServiceUsage::V1::GetServiceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_service_client_stub.call_rpc_count + end + end + + def test_list_services + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceUsage::V1::ListServicesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_services, name + assert_kind_of ::Google::Cloud::ServiceUsage::V1::ListServicesRequest, 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_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_services({ 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_services 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_services ::Google::Cloud::ServiceUsage::V1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceUsage::V1::ListServicesRequest.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_services_client_stub.call_rpc_count + end + end + + def test_batch_enable_services + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + service_ids = ["hello world"] + + batch_enable_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_enable_services, name + assert_kind_of ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["service_ids"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_enable_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_enable_services({ parent: parent, service_ids: service_ids }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_enable_services parent: parent, service_ids: service_ids do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_enable_services ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new(parent: parent, service_ids: service_ids) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_enable_services({ parent: parent, service_ids: service_ids }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_enable_services(::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new(parent: parent, service_ids: service_ids), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_enable_services_client_stub.call_rpc_count + end + end + + def test_batch_get_services + # Create GRPC objects. + grpc_response = ::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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"] + + batch_get_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_get_services, name + assert_kind_of ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["names"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_get_services_client_stub do + # Create client + client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_get_services({ parent: parent, names: names }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_get_services parent: parent, names: names do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_get_services ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.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.batch_get_services({ 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.batch_get_services(::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.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, batch_get_services_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_usage-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-service_usage-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-shell-v1/.gitignore b/owl-bot-staging/google-cloud-shell-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-shell-v1/.repo-metadata.json new file mode 100644 index 000000000000..928c50bb2ebd --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudshell.googleapis.com", + "api_shortname": "cloudshell", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-shell-v1/latest", + "distribution_name": "google-cloud-shell-v1", + "is_cloud": true, + "language": "ruby", + "name": "cloudshell", + "name_pretty": "Cloud Shell V1 API", + "product_documentation": "https://cloud.google.com/shell/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Shell is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser. Note that google-cloud-shell-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-shell instead. See the readme for more details.", + "ruby-cloud-env-prefix": "CLOUD_SHELL", + "ruby-cloud-product-url": "https://cloud.google.com/shell/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-shell-v1/.rubocop.yml b/owl-bot-staging/google-cloud-shell-v1/.rubocop.yml new file mode 100644 index 000000000000..63ca4175e823 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-shell-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-shell-v1.rb" diff --git a/owl-bot-staging/google-cloud-shell-v1/.toys.rb b/owl-bot-staging/google-cloud-shell-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/.yardopts b/owl-bot-staging/google-cloud-shell-v1/.yardopts new file mode 100644 index 000000000000..eac9d9000676 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Shell 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-shell-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-shell-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..4d8d9081cbb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-shell-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-shell-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/shell/v1" + +client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/shell/v1" + +::Google::Cloud::Shell::V1::CloudShellService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Shell::V1::CloudShellService::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-shell-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/shell/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Shell::V1::CloudShellService::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-shell-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-shell-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-shell-v1/Gemfile b/owl-bot-staging/google-cloud-shell-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-shell-v1/LICENSE.md b/owl-bot-staging/google-cloud-shell-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/README.md b/owl-bot-staging/google-cloud-shell-v1/README.md new file mode 100644 index 000000000000..35be9a650ba7 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Shell V1 API + +Allows users to start, configure, and connect to interactive shell sessions running in the cloud. + +Cloud Shell is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser. + +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 Shell V1 API. Most users should consider using +the main client gem, +[google-cloud-shell](https://rubygems.org/gems/google-cloud-shell). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-shell-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/cloudshell.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/shell/v1" + +client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new +request = ::Google::Cloud::Shell::V1::GetEnvironmentRequest.new # (request fields as keyword arguments...) +response = client.get_environment request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-shell-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/shell/) +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/shell/v1" +require "logger" + +client = ::Google::Cloud::Shell::V1::CloudShellService::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-shell`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-shell-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-shell`. +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-shell-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-shell-v1/Rakefile b/owl-bot-staging/google-cloud-shell-v1/Rakefile new file mode 100644 index 000000000000..fec628dc4e26 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["CLOUD_SHELL_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["CLOUD_SHELL_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["CLOUD_SHELL_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 CLOUD_SHELL_TEST_PROJECT=test123 CLOUD_SHELL_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/shell/v1/cloud_shell_service/credentials" + ::Google::Cloud::Shell::V1::CloudShellService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["CLOUD_SHELL_PROJECT"] = project + ENV["CLOUD_SHELL_TEST_PROJECT"] = project + ENV["CLOUD_SHELL_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-shell-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-shell-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-shell-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-shell-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-shell-v1" + header "google-cloud-shell-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-shell-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-shell-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-shell-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-shell-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-shell-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-shell-v1/gapic_metadata.json new file mode 100644 index 000000000000..23f6c55881ac --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.shell.v1", + "libraryPackage": "::Google::Cloud::Shell::V1", + "services": { + "CloudShellService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Shell::V1::CloudShellService::Client", + "rpcs": { + "GetEnvironment": { + "methods": [ + "get_environment" + ] + }, + "StartEnvironment": { + "methods": [ + "start_environment" + ] + }, + "AuthorizeEnvironment": { + "methods": [ + "authorize_environment" + ] + }, + "AddPublicKey": { + "methods": [ + "add_public_key" + ] + }, + "RemovePublicKey": { + "methods": [ + "remove_public_key" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-shell-v1/google-cloud-shell-v1.gemspec b/owl-bot-staging/google-cloud-shell-v1/google-cloud-shell-v1.gemspec new file mode 100644 index 000000000000..7a2b913037be --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/google-cloud-shell-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/shell/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-shell-v1" + gem.version = Google::Cloud::Shell::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Shell is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser. Note that google-cloud-shell-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-shell instead. See the readme for more details." + gem.summary = "Allows users to start, configure, and connect to interactive shell sessions running in the cloud." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google-cloud-shell-v1.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google-cloud-shell-v1.rb new file mode 100644 index 000000000000..4f94ddb87d3e --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google-cloud-shell-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/shell/v1" diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1.rb new file mode 100644 index 000000000000..c94c21ed2929 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/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/shell/v1/cloud_shell_service" +require "google/cloud/shell/v1/version" + +module Google + module Cloud + module Shell + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/shell/v1" + # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/shell/v1" + # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/shell/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service.rb new file mode 100644 index 000000000000..7e5d994d8637 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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/shell/v1/version" + +require "google/cloud/shell/v1/cloud_shell_service/credentials" +require "google/cloud/shell/v1/cloud_shell_service/paths" +require "google/cloud/shell/v1/cloud_shell_service/operations" +require "google/cloud/shell/v1/cloud_shell_service/client" +require "google/cloud/shell/v1/cloud_shell_service/rest" + +module Google + module Cloud + module Shell + module V1 + ## + # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at + # least one environment, which has the ID "default". Environment consists of a + # Docker image defining what is installed on the environment and a home + # directory containing the user's data that will remain across sessions. + # Clients use this API to start and fetch information about their environment, + # which can then be used to connect to that environment via a separate SSH + # client. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/shell/v1/cloud_shell_service" + # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/shell/v1/cloud_shell_service/rest" + # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + module CloudShellService + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_shell_service", "helpers.rb" +require "google/cloud/shell/v1/cloud_shell_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/client.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/client.rb new file mode 100644 index 000000000000..c1a4f329a844 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/client.rb @@ -0,0 +1,954 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/shell/v1/cloudshell_pb" + +module Google + module Cloud + module Shell + module V1 + module CloudShellService + ## + # Client for the CloudShellService service. + # + # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at + # least one environment, which has the ID "default". Environment consists of a + # Docker image defining what is installed on the environment and a home + # directory containing the user's data that will remain across sessions. + # Clients use this API to start and fetch information about their environment, + # which can then be used to connect to that environment via a separate SSH + # client. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudshell.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_shell_service_stub + + ## + # Configure the CloudShellService Client class. + # + # See {::Google::Cloud::Shell::V1::CloudShellService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudShellService clients + # ::Google::Cloud::Shell::V1::CloudShellService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Shell", "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.get_environment.timeout = 60.0 + default_config.rpcs.get_environment.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config.rpcs.start_environment.timeout = 60.0 + + default_config.rpcs.authorize_environment.timeout = 60.0 + + default_config.rpcs.add_public_key.timeout = 60.0 + + default_config.rpcs.remove_public_key.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudShellService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Shell::V1::CloudShellService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam 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_shell_service_stub.universe_domain + end + + ## + # Create a new CloudShellService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudShellService 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/shell/v1/cloudshell_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_shell_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Shell::V1::CloudShellService::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_shell_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::Shell::V1::CloudShellService::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_shell_service_stub.logger + end + + # Service calls + + ## + # Gets an environment. Returns NOT_FOUND if the environment does not exist. + # + # @overload get_environment(request, options = nil) + # Pass arguments to `get_environment` via a request object, either of type + # {::Google::Cloud::Shell::V1::GetEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::GetEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_environment(name: nil) + # Pass arguments to `get_environment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the requested resource, for example `users/me/environments/default` + # or `users/someone@example.com/environments/default`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Shell::V1::Environment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Shell::V1::Environment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::GetEnvironmentRequest.new + # + # # Call the get_environment method. + # result = client.get_environment request + # + # # The returned object is of type Google::Cloud::Shell::V1::Environment. + # p result + # + def get_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::GetEnvironmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Shell::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_environment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.call_rpc :get_environment, request, 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 an existing environment, allowing clients to connect to it. The + # returned operation will contain an instance of StartEnvironmentMetadata in + # its metadata field. Users can wait for the environment to start by polling + # this operation via GetOperation. Once the environment has finished starting + # and is ready to accept connections, the operation will contain a + # StartEnvironmentResponse in its response field. + # + # @overload start_environment(request, options = nil) + # Pass arguments to `start_environment` via a request object, either of type + # {::Google::Cloud::Shell::V1::StartEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::StartEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_environment(name: nil, access_token: nil, public_keys: nil) + # Pass arguments to `start_environment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the resource that should be started, for example + # `users/me/environments/default` or + # `users/someone@example.com/environments/default`. + # @param access_token [::String] + # The initial access token passed to the environment. If this is present and + # valid, the environment will be pre-authenticated with gcloud so that the + # user can run gcloud commands in Cloud Shell without having to log in. This + # code can be updated later by calling AuthorizeEnvironment. + # @param public_keys [::Array<::String>] + # Public keys that should be added to the environment before it is started. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::StartEnvironmentRequest.new + # + # # Call the start_environment method. + # result = client.start_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def start_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::StartEnvironmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.start_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Shell::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.start_environment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.call_rpc :start_environment, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sends OAuth credentials to a running environment on behalf of a user. When + # this completes, the environment will be authorized to run various Google + # Cloud command line tools without requiring the user to manually + # authenticate. + # + # @overload authorize_environment(request, options = nil) + # Pass arguments to `authorize_environment` via a request object, either of type + # {::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload authorize_environment(name: nil, access_token: nil, id_token: nil, expire_time: nil) + # Pass arguments to `authorize_environment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the resource that should receive the credentials, for example + # `users/me/environments/default` or + # `users/someone@example.com/environments/default`. + # @param access_token [::String] + # The OAuth access token that should be sent to the environment. + # @param id_token [::String] + # The OAuth ID token that should be sent to the environment. + # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the credentials expire. If not set, defaults to one hour from + # when the server received the request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new + # + # # Call the authorize_environment method. + # result = client.authorize_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def authorize_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.authorize_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Shell::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.authorize_environment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.authorize_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.call_rpc :authorize_environment, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds a public SSH key to an environment, allowing clients with the + # corresponding private key to connect to that environment via SSH. If a key + # with the same content already exists, this will error with ALREADY_EXISTS. + # + # @overload add_public_key(request, options = nil) + # Pass arguments to `add_public_key` via a request object, either of type + # {::Google::Cloud::Shell::V1::AddPublicKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::AddPublicKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_key(environment: nil, key: nil) + # Pass arguments to `add_public_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 environment [::String] + # Environment this key should be added to, e.g. + # `users/me/environments/default`. + # @param key [::String] + # Key that should be added to the environment. Supported formats are + # `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` + # (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and + # `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as + # <format> <content>, where <content> part is encoded with + # Base64. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::AddPublicKeyRequest.new + # + # # Call the add_public_key method. + # result = client.add_public_key request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def add_public_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::AddPublicKeyRequest + + # Converts hash and nil to 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_public_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::Shell::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.environment + header_params["environment"] = request.environment + end + + request_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_public_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_public_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.call_rpc :add_public_key, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Removes a public SSH key from an environment. Clients will no longer be + # able to connect to the environment using the corresponding private key. + # If a key with the same content is not present, this will error with + # NOT_FOUND. + # + # @overload remove_public_key(request, options = nil) + # Pass arguments to `remove_public_key` via a request object, either of type + # {::Google::Cloud::Shell::V1::RemovePublicKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::RemovePublicKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_key(environment: nil, key: nil) + # Pass arguments to `remove_public_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 environment [::String] + # Environment this key should be removed from, e.g. + # `users/me/environments/default`. + # @param key [::String] + # Key that should be removed from the environment. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::RemovePublicKeyRequest.new + # + # # Call the remove_public_key method. + # result = client.remove_public_key request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def remove_public_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::RemovePublicKeyRequest + + # Converts hash and nil to 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_public_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::Shell::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.environment + header_params["environment"] = request.environment + end + + request_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_public_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_public_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.call_rpc :remove_public_key, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudShellService API. + # + # This class represents the configuration for CloudShellService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Shell::V1::CloudShellService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_environment to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Shell::V1::CloudShellService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_environment.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_environment.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Shell::V1::CloudShellService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudshell.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CloudShellService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_environment + ## + # RPC-specific configuration for `start_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :start_environment + ## + # RPC-specific configuration for `authorize_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :authorize_environment + ## + # RPC-specific configuration for `add_public_key` + # @return [::Gapic::Config::Method] + # + attr_reader :add_public_key + ## + # RPC-specific configuration for `remove_public_key` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_public_key + + # @private + def initialize parent_rpcs = nil + get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment + @get_environment = ::Gapic::Config::Method.new get_environment_config + start_environment_config = parent_rpcs.start_environment if parent_rpcs.respond_to? :start_environment + @start_environment = ::Gapic::Config::Method.new start_environment_config + authorize_environment_config = parent_rpcs.authorize_environment if parent_rpcs.respond_to? :authorize_environment + @authorize_environment = ::Gapic::Config::Method.new authorize_environment_config + add_public_key_config = parent_rpcs.add_public_key if parent_rpcs.respond_to? :add_public_key + @add_public_key = ::Gapic::Config::Method.new add_public_key_config + remove_public_key_config = parent_rpcs.remove_public_key if parent_rpcs.respond_to? :remove_public_key + @remove_public_key = ::Gapic::Config::Method.new remove_public_key_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/credentials.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/credentials.rb new file mode 100644 index 000000000000..c19294dbdf8e --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_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 Shell + module V1 + module CloudShellService + # Credentials for the CloudShellService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "CLOUD_SHELL_CREDENTIALS", + "CLOUD_SHELL_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "CLOUD_SHELL_CREDENTIALS_JSON", + "CLOUD_SHELL_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-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/operations.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/operations.rb new file mode 100644 index 000000000000..1e26fee8ef5a --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_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 Shell + module V1 + module CloudShellService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudshell.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudShellService 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 CloudShellService 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::Shell::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Shell::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Shell::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Shell::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::Shell::V1::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 = "cloudshell.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/paths.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/paths.rb new file mode 100644 index 000000000000..f03f93ba390f --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/paths.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Shell + module V1 + module CloudShellService + # Path helper methods for the CloudShellService API. + module Paths + ## + # Create a fully-qualified Environment resource string. + # + # The resource will be in the following format: + # + # `users/{user}/environments/{environment}` + # + # @param user [String] + # @param environment [String] + # + # @return [::String] + def environment_path user:, environment: + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "users/#{user}/environments/#{environment}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest.rb new file mode 100644 index 000000000000..478c24d2218a --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/shell/v1/version" + +require "google/cloud/shell/v1/cloud_shell_service/credentials" +require "google/cloud/shell/v1/cloud_shell_service/paths" +require "google/cloud/shell/v1/cloud_shell_service/rest/operations" +require "google/cloud/shell/v1/cloud_shell_service/rest/client" + +module Google + module Cloud + module Shell + module V1 + ## + # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at + # least one environment, which has the ID "default". Environment consists of a + # Docker image defining what is installed on the environment and a home + # directory containing the user's data that will remain across sessions. + # Clients use this API to start and fetch information about their environment, + # which can then be used to connect to that environment via a separate SSH + # client. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/shell/v1/cloud_shell_service/rest" + # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + module CloudShellService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/shell/v1/cloud_shell_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/client.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/client.rb new file mode 100644 index 000000000000..5973f25dd87c --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/client.rb @@ -0,0 +1,876 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/shell/v1/cloudshell_pb" +require "google/cloud/shell/v1/cloud_shell_service/rest/service_stub" + +module Google + module Cloud + module Shell + module V1 + module CloudShellService + module Rest + ## + # REST client for the CloudShellService service. + # + # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at + # least one environment, which has the ID "default". Environment consists of a + # Docker image defining what is installed on the environment and a home + # directory containing the user's data that will remain across sessions. + # Clients use this API to start and fetch information about their environment, + # which can then be used to connect to that environment via a separate SSH + # client. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudshell.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_shell_service_stub + + ## + # Configure the CloudShellService Client class. + # + # See {::Google::Cloud::Shell::V1::CloudShellService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudShellService clients + # ::Google::Cloud::Shell::V1::CloudShellService::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", "Shell", "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.get_environment.timeout = 60.0 + default_config.rpcs.get_environment.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config.rpcs.start_environment.timeout = 60.0 + + default_config.rpcs.authorize_environment.timeout = 60.0 + + default_config.rpcs.add_public_key.timeout = 60.0 + + default_config.rpcs.remove_public_key.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudShellService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Shell::V1::CloudShellService::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_shell_service_stub.universe_domain + end + + ## + # Create a new CloudShellService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudShellService 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::Shell::V1::CloudShellService::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_shell_service_stub = ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_shell_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::Shell::V1::CloudShellService::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_shell_service_stub.logger + end + + # Service calls + + ## + # Gets an environment. Returns NOT_FOUND if the environment does not exist. + # + # @overload get_environment(request, options = nil) + # Pass arguments to `get_environment` via a request object, either of type + # {::Google::Cloud::Shell::V1::GetEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::GetEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_environment(name: nil) + # Pass arguments to `get_environment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the requested resource, for example `users/me/environments/default` + # or `users/someone@example.com/environments/default`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Shell::V1::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Shell::V1::Environment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::GetEnvironmentRequest.new + # + # # Call the get_environment method. + # result = client.get_environment request + # + # # The returned object is of type Google::Cloud::Shell::V1::Environment. + # p result + # + def get_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::GetEnvironmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Shell::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_environment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.get_environment request, 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 an existing environment, allowing clients to connect to it. The + # returned operation will contain an instance of StartEnvironmentMetadata in + # its metadata field. Users can wait for the environment to start by polling + # this operation via GetOperation. Once the environment has finished starting + # and is ready to accept connections, the operation will contain a + # StartEnvironmentResponse in its response field. + # + # @overload start_environment(request, options = nil) + # Pass arguments to `start_environment` via a request object, either of type + # {::Google::Cloud::Shell::V1::StartEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::StartEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload start_environment(name: nil, access_token: nil, public_keys: nil) + # Pass arguments to `start_environment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the resource that should be started, for example + # `users/me/environments/default` or + # `users/someone@example.com/environments/default`. + # @param access_token [::String] + # The initial access token passed to the environment. If this is present and + # valid, the environment will be pre-authenticated with gcloud so that the + # user can run gcloud commands in Cloud Shell without having to log in. This + # code can be updated later by calling AuthorizeEnvironment. + # @param public_keys [::Array<::String>] + # Public keys that should be added to the environment before it is started. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::StartEnvironmentRequest.new + # + # # Call the start_environment method. + # result = client.start_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def start_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::StartEnvironmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.start_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Shell::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.start_environment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.start_environment request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sends OAuth credentials to a running environment on behalf of a user. When + # this completes, the environment will be authorized to run various Google + # Cloud command line tools without requiring the user to manually + # authenticate. + # + # @overload authorize_environment(request, options = nil) + # Pass arguments to `authorize_environment` via a request object, either of type + # {::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload authorize_environment(name: nil, access_token: nil, id_token: nil, expire_time: nil) + # Pass arguments to `authorize_environment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Name of the resource that should receive the credentials, for example + # `users/me/environments/default` or + # `users/someone@example.com/environments/default`. + # @param access_token [::String] + # The OAuth access token that should be sent to the environment. + # @param id_token [::String] + # The OAuth ID token that should be sent to the environment. + # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] + # The time when the credentials expire. If not set, defaults to one hour from + # when the server received the request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new + # + # # Call the authorize_environment method. + # result = client.authorize_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def authorize_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.authorize_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Shell::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.authorize_environment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.authorize_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.authorize_environment request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds a public SSH key to an environment, allowing clients with the + # corresponding private key to connect to that environment via SSH. If a key + # with the same content already exists, this will error with ALREADY_EXISTS. + # + # @overload add_public_key(request, options = nil) + # Pass arguments to `add_public_key` via a request object, either of type + # {::Google::Cloud::Shell::V1::AddPublicKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::AddPublicKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_key(environment: nil, key: nil) + # Pass arguments to `add_public_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 environment [::String] + # Environment this key should be added to, e.g. + # `users/me/environments/default`. + # @param key [::String] + # Key that should be added to the environment. Supported formats are + # `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` + # (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and + # `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as + # <format> <content>, where <content> part is encoded with + # Base64. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::AddPublicKeyRequest.new + # + # # Call the add_public_key method. + # result = client.add_public_key request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def add_public_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::AddPublicKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_public_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Shell::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_public_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_public_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.add_public_key request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Removes a public SSH key from an environment. Clients will no longer be + # able to connect to the environment using the corresponding private key. + # If a key with the same content is not present, this will error with + # NOT_FOUND. + # + # @overload remove_public_key(request, options = nil) + # Pass arguments to `remove_public_key` via a request object, either of type + # {::Google::Cloud::Shell::V1::RemovePublicKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Shell::V1::RemovePublicKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_key(environment: nil, key: nil) + # Pass arguments to `remove_public_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 environment [::String] + # Environment this key should be removed from, e.g. + # `users/me/environments/default`. + # @param key [::String] + # Key that should be removed from the environment. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/shell/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Shell::V1::RemovePublicKeyRequest.new + # + # # Call the remove_public_key method. + # result = client.remove_public_key request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def remove_public_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::RemovePublicKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.remove_public_key.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Shell::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.remove_public_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_public_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_shell_service_stub.remove_public_key request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudShellService REST API. + # + # This class represents the configuration for CloudShellService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Shell::V1::CloudShellService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_environment to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_environment.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_environment.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudshell.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CloudShellService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_environment + ## + # RPC-specific configuration for `start_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :start_environment + ## + # RPC-specific configuration for `authorize_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :authorize_environment + ## + # RPC-specific configuration for `add_public_key` + # @return [::Gapic::Config::Method] + # + attr_reader :add_public_key + ## + # RPC-specific configuration for `remove_public_key` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_public_key + + # @private + def initialize parent_rpcs = nil + get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment + @get_environment = ::Gapic::Config::Method.new get_environment_config + start_environment_config = parent_rpcs.start_environment if parent_rpcs.respond_to? :start_environment + @start_environment = ::Gapic::Config::Method.new start_environment_config + authorize_environment_config = parent_rpcs.authorize_environment if parent_rpcs.respond_to? :authorize_environment + @authorize_environment = ::Gapic::Config::Method.new authorize_environment_config + add_public_key_config = parent_rpcs.add_public_key if parent_rpcs.respond_to? :add_public_key + @add_public_key = ::Gapic::Config::Method.new add_public_key_config + remove_public_key_config = parent_rpcs.remove_public_key if parent_rpcs.respond_to? :remove_public_key + @remove_public_key = ::Gapic::Config::Method.new remove_public_key_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/operations.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/operations.rb new file mode 100644 index 000000000000..43a883613944 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/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 Shell + module V1 + module CloudShellService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudshell.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudShellService 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 CloudShellService 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::Shell::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Shell::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Shell::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Shell::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "cloudshell.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb new file mode 100644 index 000000000000..6b15a0548b64 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.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! + +require "google/cloud/shell/v1/cloudshell_pb" + +module Google + module Cloud + module Shell + module V1 + module CloudShellService + module Rest + ## + # REST service stub for the CloudShellService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_environment REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::GetEnvironmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Shell::V1::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Shell::V1::Environment] + # A result object deserialized from the server's reply + def get_environment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_environment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_environment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Shell::V1::Environment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the start_environment REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::StartEnvironmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def start_environment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_environment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "start_environment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the authorize_environment REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def authorize_environment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_authorize_environment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "authorize_environment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_public_key REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::AddPublicKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def add_public_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_public_key_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_public_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the remove_public_key REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::RemovePublicKeyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def remove_public_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_public_key_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "remove_public_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_environment REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::GetEnvironmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_environment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^users/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_environment REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::StartEnvironmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_start_environment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:start", + body: "*", + matches: [ + ["name", %r{^users/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the authorize_environment REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_authorize_environment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:authorize", + body: "*", + matches: [ + ["name", %r{^users/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_public_key REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::AddPublicKeyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_public_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{environment}:addPublicKey", + body: "*", + matches: [ + ["environment", %r{^users/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_public_key REST call + # + # @param request_pb [::Google::Cloud::Shell::V1::RemovePublicKeyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_public_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{environment}:removePublicKey", + body: "*", + matches: [ + ["environment", %r{^users/[^/]+/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb new file mode 100644 index 000000000000..553b989af184 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/shell/v1/cloudshell.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/timestamp_pb' + + +descriptor_data = "\n&google/cloud/shell/v1/cloudshell.proto\x12\x15google.cloud.shell.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\x1fgoogle/protobuf/timestamp.proto\"\xb3\x03\n\x0b\x45nvironment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x0c\x64ocker_image\x18\x03 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12<\n\x05state\x18\x04 \x01(\x0e\x32(.google.cloud.shell.v1.Environment.StateB\x03\xe0\x41\x03\x12\x15\n\x08web_host\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cssh_username\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08ssh_host\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08ssh_port\x18\x07 \x01(\x05\x42\x03\xe0\x41\x03\x12\x18\n\x0bpublic_keys\x18\x08 \x03(\tB\x03\xe0\x41\x03\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tSUSPENDED\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:S\xea\x41P\n%cloudshell.googleapis.com/Environment\x12\'users/{user}/environments/{environment}\"T\n\x15GetEnvironmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudshell.googleapis.com/Environment\"\x1b\n\x19\x43reateEnvironmentMetadata\"\x1b\n\x19\x44\x65leteEnvironmentMetadata\"R\n\x17StartEnvironmentRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x02 \x01(\t\x12\x13\n\x0bpublic_keys\x18\x03 \x03(\t\"\x84\x01\n\x1b\x41uthorizeEnvironmentRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x02 \x01(\t\x12\x10\n\x08id_token\x18\x04 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x1e\n\x1c\x41uthorizeEnvironmentResponse\"\x1e\n\x1c\x41uthorizeEnvironmentMetadata\"\xd2\x01\n\x18StartEnvironmentMetadata\x12\x44\n\x05state\x18\x01 \x01(\x0e\x32\x35.google.cloud.shell.v1.StartEnvironmentMetadata.State\"p\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STARTING\x10\x01\x12\x14\n\x10UNARCHIVING_DISK\x10\x02\x12\x1e\n\x1a\x41WAITING_COMPUTE_RESOURCES\x10\x04\x12\x0c\n\x08\x46INISHED\x10\x03\"S\n\x18StartEnvironmentResponse\x12\x37\n\x0b\x65nvironment\x18\x01 \x01(\x0b\x32\".google.cloud.shell.v1.Environment\"7\n\x13\x41\x64\x64PublicKeyRequest\x12\x13\n\x0b\x65nvironment\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\"#\n\x14\x41\x64\x64PublicKeyResponse\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x16\n\x14\x41\x64\x64PublicKeyMetadata\":\n\x16RemovePublicKeyRequest\x12\x13\n\x0b\x65nvironment\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\"\x19\n\x17RemovePublicKeyResponse\"\x19\n\x17RemovePublicKeyMetadata\"\x9e\x02\n\x16\x43loudShellErrorDetails\x12O\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x41.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode\"\xb2\x01\n\x13\x43loudShellErrorCode\x12&\n\"CLOUD_SHELL_ERROR_CODE_UNSPECIFIED\x10\x00\x12\x15\n\x11IMAGE_UNAVAILABLE\x10\x01\x12\x18\n\x14\x43LOUD_SHELL_DISABLED\x10\x02\x12\x11\n\rTOS_VIOLATION\x10\x04\x12\x12\n\x0eQUOTA_EXCEEDED\x10\x05\x12\x1b\n\x17\x45NVIRONMENT_UNAVAILABLE\x10\x06\x32\xd4\x08\n\x11\x43loudShellService\x12\x94\x01\n\x0eGetEnvironment\x12,.google.cloud.shell.v1.GetEnvironmentRequest\x1a\".google.cloud.shell.v1.Environment\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=users/*/environments/*}\x12\xcc\x01\n\x10StartEnvironment\x12..google.cloud.shell.v1.StartEnvironmentRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41\x34\n\x18StartEnvironmentResponse\x12\x18StartEnvironmentMetadata\x82\xd3\xe4\x93\x02,\"\'/v1/{name=users/*/environments/*}:start:\x01*\x12\xe0\x01\n\x14\x41uthorizeEnvironment\x12\x32.google.cloud.shell.v1.AuthorizeEnvironmentRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41<\n\x1c\x41uthorizeEnvironmentResponse\x12\x1c\x41uthorizeEnvironmentMetadata\x82\xd3\xe4\x93\x02\x30\"+/v1/{name=users/*/environments/*}:authorize:\x01*\x12\xca\x01\n\x0c\x41\x64\x64PublicKey\x12*.google.cloud.shell.v1.AddPublicKeyRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41,\n\x14\x41\x64\x64PublicKeyResponse\x12\x14\x41\x64\x64PublicKeyMetadata\x82\xd3\xe4\x93\x02:\"5/v1/{environment=users/*/environments/*}:addPublicKey:\x01*\x12\xd9\x01\n\x0fRemovePublicKey\x12-.google.cloud.shell.v1.RemovePublicKeyRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x32\n\x17RemovePublicKeyResponse\x12\x17RemovePublicKeyMetadata\x82\xd3\xe4\x93\x02=\"8/v1/{environment=users/*/environments/*}:removePublicKey:\x01*\x1aM\xca\x41\x19\x63loudshell.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB_\n\x19\x63om.google.cloud.shell.v1B\x0f\x43loudShellProtoP\x01Z/cloud.google.com/go/shell/apiv1/shellpb;shellpbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Shell + module V1 + Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.Environment").msgclass + Environment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.Environment.State").enummodule + GetEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.GetEnvironmentRequest").msgclass + CreateEnvironmentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.CreateEnvironmentMetadata").msgclass + DeleteEnvironmentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.DeleteEnvironmentMetadata").msgclass + StartEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.StartEnvironmentRequest").msgclass + AuthorizeEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AuthorizeEnvironmentRequest").msgclass + AuthorizeEnvironmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AuthorizeEnvironmentResponse").msgclass + AuthorizeEnvironmentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AuthorizeEnvironmentMetadata").msgclass + StartEnvironmentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.StartEnvironmentMetadata").msgclass + StartEnvironmentMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.StartEnvironmentMetadata.State").enummodule + StartEnvironmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.StartEnvironmentResponse").msgclass + AddPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AddPublicKeyRequest").msgclass + AddPublicKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AddPublicKeyResponse").msgclass + AddPublicKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AddPublicKeyMetadata").msgclass + RemovePublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.RemovePublicKeyRequest").msgclass + RemovePublicKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.RemovePublicKeyResponse").msgclass + RemovePublicKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.RemovePublicKeyMetadata").msgclass + CloudShellErrorDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.CloudShellErrorDetails").msgclass + CloudShellErrorDetails::CloudShellErrorCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_services_pb.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_services_pb.rb new file mode 100644 index 000000000000..a9cf73ced654 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_services_pb.rb @@ -0,0 +1,72 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/shell/v1/cloudshell.proto for package 'google.cloud.shell.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/shell/v1/cloudshell_pb' + +module Google + module Cloud + module Shell + module V1 + module CloudShellService + # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at + # least one environment, which has the ID "default". Environment consists of a + # Docker image defining what is installed on the environment and a home + # directory containing the user's data that will remain across sessions. + # Clients use this API to start and fetch information about their environment, + # which can then be used to connect to that environment via a separate SSH + # client. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.shell.v1.CloudShellService' + + # Gets an environment. Returns NOT_FOUND if the environment does not exist. + rpc :GetEnvironment, ::Google::Cloud::Shell::V1::GetEnvironmentRequest, ::Google::Cloud::Shell::V1::Environment + # Starts an existing environment, allowing clients to connect to it. The + # returned operation will contain an instance of StartEnvironmentMetadata in + # its metadata field. Users can wait for the environment to start by polling + # this operation via GetOperation. Once the environment has finished starting + # and is ready to accept connections, the operation will contain a + # StartEnvironmentResponse in its response field. + rpc :StartEnvironment, ::Google::Cloud::Shell::V1::StartEnvironmentRequest, ::Google::Longrunning::Operation + # Sends OAuth credentials to a running environment on behalf of a user. When + # this completes, the environment will be authorized to run various Google + # Cloud command line tools without requiring the user to manually + # authenticate. + rpc :AuthorizeEnvironment, ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest, ::Google::Longrunning::Operation + # Adds a public SSH key to an environment, allowing clients with the + # corresponding private key to connect to that environment via SSH. If a key + # with the same content already exists, this will error with ALREADY_EXISTS. + rpc :AddPublicKey, ::Google::Cloud::Shell::V1::AddPublicKeyRequest, ::Google::Longrunning::Operation + # Removes a public SSH key from an environment. Clients will no longer be + # able to connect to the environment using the corresponding private key. + # If a key with the same content is not present, this will error with + # NOT_FOUND. + rpc :RemovePublicKey, ::Google::Cloud::Shell::V1::RemovePublicKeyRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/rest.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/rest.rb new file mode 100644 index 000000000000..a29fd5893233 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/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/shell/v1/cloud_shell_service/rest" +require "google/cloud/shell/v1/version" + +module Google + module Cloud + module Shell + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/shell/v1/rest" + # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb new file mode 100644 index 000000000000..b3e028a7b6d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/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 Shell + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-shell-v1/proto_docs/README.md new file mode 100644 index 000000000000..b2196eb48b44 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Shell 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-shell-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb new file mode 100644 index 000000000000..56848a1f0233 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb @@ -0,0 +1,331 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Shell + module V1 + # A Cloud Shell environment, which is defined as the combination of a Docker + # image specifying what is installed on the environment and a home directory + # containing the user's data that will remain across sessions. Each user has + # at least an environment with the ID "default". + # @!attribute [rw] name + # @return [::String] + # Immutable. Full name of this resource, in the format + # `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the + # email address of the user to whom this environment belongs, and + # `{environment_id}` is the identifier of this environment. For example, + # `users/someone@example.com/environments/default`. + # @!attribute [r] id + # @return [::String] + # Output only. The environment's identifier, unique among the user's + # environments. + # @!attribute [rw] docker_image + # @return [::String] + # Required. Immutable. Full path to the Docker image used to run this environment, e.g. + # "gcr.io/dev-con/cloud-devshell:latest". + # @!attribute [r] state + # @return [::Google::Cloud::Shell::V1::Environment::State] + # Output only. Current execution state of this environment. + # @!attribute [r] web_host + # @return [::String] + # Output only. Host to which clients can connect to initiate HTTPS or WSS + # connections with the environment. + # @!attribute [r] ssh_username + # @return [::String] + # Output only. Username that clients should use when initiating SSH sessions + # with the environment. + # @!attribute [r] ssh_host + # @return [::String] + # Output only. Host to which clients can connect to initiate SSH sessions + # with the environment. + # @!attribute [r] ssh_port + # @return [::Integer] + # Output only. Port to which clients can connect to initiate SSH sessions + # with the environment. + # @!attribute [r] public_keys + # @return [::Array<::String>] + # Output only. Public keys associated with the environment. Clients can + # connect to this environment via SSH only if they possess a private key + # corresponding to at least one of these public keys. Keys can be added to or + # removed from the environment using the AddPublicKey and RemovePublicKey + # methods. + class Environment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible execution states for an environment. + module State + # The environment's states is unknown. + STATE_UNSPECIFIED = 0 + + # The environment is not running and can't be connected to. Starting the + # environment will transition it to the PENDING state. + SUSPENDED = 1 + + # The environment is being started but is not yet ready to accept + # connections. + PENDING = 2 + + # The environment is running and ready to accept connections. It will + # automatically transition back to DISABLED after a period of inactivity or + # if another environment is started. + RUNNING = 3 + + # The environment is being deleted and can't be connected to. + DELETING = 4 + end + end + + # Request message for + # {::Google::Cloud::Shell::V1::CloudShellService::Client#get_environment GetEnvironment}. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the requested resource, for example `users/me/environments/default` + # or `users/someone@example.com/environments/default`. + class GetEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message included in the metadata field of operations returned from + # [CreateEnvironment][google.cloud.shell.v1.CloudShellService.CreateEnvironment]. + class CreateEnvironmentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message included in the metadata field of operations returned from + # [DeleteEnvironment][google.cloud.shell.v1.CloudShellService.DeleteEnvironment]. + class DeleteEnvironmentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment StartEnvironment}. + # @!attribute [rw] name + # @return [::String] + # Name of the resource that should be started, for example + # `users/me/environments/default` or + # `users/someone@example.com/environments/default`. + # @!attribute [rw] access_token + # @return [::String] + # The initial access token passed to the environment. If this is present and + # valid, the environment will be pre-authenticated with gcloud so that the + # user can run gcloud commands in Cloud Shell without having to log in. This + # code can be updated later by calling AuthorizeEnvironment. + # @!attribute [rw] public_keys + # @return [::Array<::String>] + # Public keys that should be added to the environment before it is started. + class StartEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment AuthorizeEnvironment}. + # @!attribute [rw] name + # @return [::String] + # Name of the resource that should receive the credentials, for example + # `users/me/environments/default` or + # `users/someone@example.com/environments/default`. + # @!attribute [rw] access_token + # @return [::String] + # The OAuth access token that should be sent to the environment. + # @!attribute [rw] id_token + # @return [::String] + # The OAuth ID token that should be sent to the environment. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # The time when the credentials expire. If not set, defaults to one hour from + # when the server received the request. + class AuthorizeEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment AuthorizeEnvironment}. + class AuthorizeEnvironmentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message included in the metadata field of operations returned from + # {::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment AuthorizeEnvironment}. + class AuthorizeEnvironmentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message included in the metadata field of operations returned from + # {::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment StartEnvironment}. + # @!attribute [rw] state + # @return [::Google::Cloud::Shell::V1::StartEnvironmentMetadata::State] + # Current state of the environment being started. + class StartEnvironmentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states an environment might transition between during startup. + # These states are not normally actionable by clients, but may be used to + # show a progress message to the user. An environment won't necessarily go + # through all of these states when starting. More states are likely to be + # added in the future. + module State + # The environment's start state is unknown. + STATE_UNSPECIFIED = 0 + + # The environment is in the process of being started, but no additional + # details are available. + STARTING = 1 + + # Startup is waiting for the user's disk to be unarchived. This can happen + # when the user returns to Cloud Shell after not having used it for a + # while, and suggests that startup will take longer than normal. + UNARCHIVING_DISK = 2 + + # Startup is waiting for compute resources to be assigned to the + # environment. This should normally happen very quickly, but an environment + # might stay in this state for an extended period of time if the system is + # experiencing heavy load. + AWAITING_COMPUTE_RESOURCES = 4 + + # Startup has completed. If the start operation was successful, the user + # should be able to establish an SSH connection to their environment. + # Otherwise, the operation will contain details of the failure. + FINISHED = 3 + end + end + + # Message included in the response field of operations returned from + # {::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment StartEnvironment} + # once the operation is complete. + # @!attribute [rw] environment + # @return [::Google::Cloud::Shell::V1::Environment] + # Environment that was started. + class StartEnvironmentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key AddPublicKey}. + # @!attribute [rw] environment + # @return [::String] + # Environment this key should be added to, e.g. + # `users/me/environments/default`. + # @!attribute [rw] key + # @return [::String] + # Key that should be added to the environment. Supported formats are + # `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` + # (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and + # `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as + # <format> <content>, where <content> part is encoded with + # Base64. + class AddPublicKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key AddPublicKey}. + # @!attribute [rw] key + # @return [::String] + # Key that was added to the environment. + class AddPublicKeyResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message included in the metadata field of operations returned from + # {::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key AddPublicKey}. + class AddPublicKeyMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key RemovePublicKey}. + # @!attribute [rw] environment + # @return [::String] + # Environment this key should be removed from, e.g. + # `users/me/environments/default`. + # @!attribute [rw] key + # @return [::String] + # Key that should be removed from the environment. + class RemovePublicKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key RemovePublicKey}. + class RemovePublicKeyResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message included in the metadata field of operations returned from + # {::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key RemovePublicKey}. + class RemovePublicKeyMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cloud-shell specific information that will be included as details in failure + # responses. + # @!attribute [rw] code + # @return [::Google::Cloud::Shell::V1::CloudShellErrorDetails::CloudShellErrorCode] + # Code indicating the specific error the occurred. + class CloudShellErrorDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Set of possible errors returned from API calls. + module CloudShellErrorCode + # An unknown error occurred. + CLOUD_SHELL_ERROR_CODE_UNSPECIFIED = 0 + + # The image used by the Cloud Shell environment either does not exist or + # the user does not have access to it. + IMAGE_UNAVAILABLE = 1 + + # Cloud Shell has been disabled by an administrator for the user making the + # request. + CLOUD_SHELL_DISABLED = 2 + + # Cloud Shell has been permanently disabled due to a Terms of Service + # violation by the user. + TOS_VIOLATION = 4 + + # The user has exhausted their weekly Cloud Shell quota, and Cloud Shell + # will be disabled until the quota resets. + QUOTA_EXCEEDED = 5 + + # The Cloud Shell environment is unavailable and cannot be connected to at + # the moment. + ENVIRONMENT_UNAVAILABLE = 6 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-shell-v1/snippets/Gemfile new file mode 100644 index 000000000000..bf1674af9c6d --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-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-shell-v1", path: "../" +else + gem "google-cloud-shell-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-shell-v1/snippets/cloud_shell_service/add_public_key.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb new file mode 100644 index 000000000000..da6e75c81361 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudshell_v1_generated_CloudShellService_AddPublicKey_sync] +require "google/cloud/shell/v1" + +## +# Snippet for the add_public_key call in the CloudShellService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key. +# +def add_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::AddPublicKeyRequest.new + + # Call the add_public_key method. + result = client.add_public_key request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudshell_v1_generated_CloudShellService_AddPublicKey_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb new file mode 100644 index 000000000000..b16bf5d9babc --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudshell_v1_generated_CloudShellService_AuthorizeEnvironment_sync] +require "google/cloud/shell/v1" + +## +# Snippet for the authorize_environment call in the CloudShellService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment. +# +def authorize_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new + + # Call the authorize_environment method. + result = client.authorize_environment request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudshell_v1_generated_CloudShellService_AuthorizeEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb new file mode 100644 index 000000000000..c36b2f501286 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudshell_v1_generated_CloudShellService_GetEnvironment_sync] +require "google/cloud/shell/v1" + +## +# Snippet for the get_environment call in the CloudShellService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#get_environment. +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::GetEnvironmentRequest.new + + # Call the get_environment method. + result = client.get_environment request + + # The returned object is of type Google::Cloud::Shell::V1::Environment. + p result +end +# [END cloudshell_v1_generated_CloudShellService_GetEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb new file mode 100644 index 000000000000..aefbd90a0735 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudshell_v1_generated_CloudShellService_RemovePublicKey_sync] +require "google/cloud/shell/v1" + +## +# Snippet for the remove_public_key call in the CloudShellService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key. +# +def remove_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::RemovePublicKeyRequest.new + + # Call the remove_public_key method. + result = client.remove_public_key request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudshell_v1_generated_CloudShellService_RemovePublicKey_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb new file mode 100644 index 000000000000..4f91952a7a8c --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudshell_v1_generated_CloudShellService_StartEnvironment_sync] +require "google/cloud/shell/v1" + +## +# Snippet for the start_environment call in the CloudShellService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#start_environment. +# +def start_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::StartEnvironmentRequest.new + + # Call the start_environment method. + result = client.start_environment request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END cloudshell_v1_generated_CloudShellService_StartEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json b/owl-bot-staging/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json new file mode 100644 index 000000000000..5f8796a64fec --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json @@ -0,0 +1,215 @@ +{ + "client_library": { + "name": "google-cloud-shell-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.shell.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudshell_v1_generated_CloudShellService_GetEnvironment_sync", + "title": "Snippet for the get_environment call in the CloudShellService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#get_environment.", + "file": "cloud_shell_service/get_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_environment", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#get_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Shell::V1::GetEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Shell::V1::Environment", + "client": { + "short_name": "CloudShellService::Client", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" + }, + "method": { + "short_name": "GetEnvironment", + "full_name": "google.cloud.shell.v1.CloudShellService.GetEnvironment", + "service": { + "short_name": "CloudShellService", + "full_name": "google.cloud.shell.v1.CloudShellService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudshell_v1_generated_CloudShellService_StartEnvironment_sync", + "title": "Snippet for the start_environment call in the CloudShellService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#start_environment.", + "file": "cloud_shell_service/start_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_environment", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Shell::V1::StartEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudShellService::Client", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" + }, + "method": { + "short_name": "StartEnvironment", + "full_name": "google.cloud.shell.v1.CloudShellService.StartEnvironment", + "service": { + "short_name": "CloudShellService", + "full_name": "google.cloud.shell.v1.CloudShellService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudshell_v1_generated_CloudShellService_AuthorizeEnvironment_sync", + "title": "Snippet for the authorize_environment call in the CloudShellService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment.", + "file": "cloud_shell_service/authorize_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "authorize_environment", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudShellService::Client", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" + }, + "method": { + "short_name": "AuthorizeEnvironment", + "full_name": "google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment", + "service": { + "short_name": "CloudShellService", + "full_name": "google.cloud.shell.v1.CloudShellService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudshell_v1_generated_CloudShellService_AddPublicKey_sync", + "title": "Snippet for the add_public_key call in the CloudShellService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key.", + "file": "cloud_shell_service/add_public_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_public_key", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Shell::V1::AddPublicKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudShellService::Client", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" + }, + "method": { + "short_name": "AddPublicKey", + "full_name": "google.cloud.shell.v1.CloudShellService.AddPublicKey", + "service": { + "short_name": "CloudShellService", + "full_name": "google.cloud.shell.v1.CloudShellService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudshell_v1_generated_CloudShellService_RemovePublicKey_sync", + "title": "Snippet for the remove_public_key call in the CloudShellService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key.", + "file": "cloud_shell_service/remove_public_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_public_key", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Shell::V1::RemovePublicKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudShellService::Client", + "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" + }, + "method": { + "short_name": "RemovePublicKey", + "full_name": "google.cloud.shell.v1.CloudShellService.RemovePublicKey", + "service": { + "short_name": "CloudShellService", + "full_name": "google.cloud.shell.v1.CloudShellService" + } + } + }, + "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-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb new file mode 100644 index 000000000000..35d81fe7c8d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_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/shell/v1/cloudshell_pb" +require "google/cloud/shell/v1/cloudshell_services_pb" +require "google/cloud/shell/v1/cloud_shell_service" + +class ::Google::Cloud::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb new file mode 100644 index 000000000000..04962e8b8cea --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_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/shell/v1/cloud_shell_service" + +class ::Google::Cloud::Shell::V1::CloudShellService::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_environment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.environment_path user: "value0", environment: "value1" + assert_equal "users/value0/environments/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb new file mode 100644 index 000000000000..bd16feaeb6cd --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb @@ -0,0 +1,376 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/shell/v1/cloudshell_pb" +require "google/cloud/shell/v1/cloud_shell_service/rest" + + +class ::Google::Cloud::Shell::V1::CloudShellService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_environment + # Create test objects. + client_result = ::Google::Cloud::Shell::V1::Environment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_environment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_get_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_environment_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_environment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_environment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_environment ::Google::Cloud::Shell::V1::GetEnvironmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_environment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_environment(::Google::Cloud::Shell::V1::GetEnvironmentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_environment_client_stub.call_count + end + end + end + + def test_start_environment + # Create test objects. + 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" + access_token = "hello world" + public_keys = ["hello world"] + + start_environment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_start_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_environment_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_environment({ name: name, access_token: access_token, public_keys: public_keys }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_environment name: name, access_token: access_token, public_keys: public_keys do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_environment ::Google::Cloud::Shell::V1::StartEnvironmentRequest.new(name: name, access_token: access_token, public_keys: public_keys) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_environment({ name: name, access_token: access_token, public_keys: public_keys }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.start_environment(::Google::Cloud::Shell::V1::StartEnvironmentRequest.new(name: name, access_token: access_token, public_keys: public_keys), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_environment_client_stub.call_count + end + end + end + + def test_authorize_environment + # Create test objects. + 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" + access_token = "hello world" + id_token = "hello world" + expire_time = {} + + authorize_environment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_authorize_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, authorize_environment_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.authorize_environment({ name: name, access_token: access_token, id_token: id_token, expire_time: expire_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.authorize_environment name: name, access_token: access_token, id_token: id_token, expire_time: expire_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.authorize_environment ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new(name: name, access_token: access_token, id_token: id_token, expire_time: expire_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.authorize_environment({ name: name, access_token: access_token, id_token: id_token, expire_time: expire_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.authorize_environment(::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new(name: name, access_token: access_token, id_token: id_token, expire_time: expire_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, authorize_environment_client_stub.call_count + end + end + end + + def test_add_public_key + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + environment = "hello world" + key = "hello world" + + add_public_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_add_public_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_public_key_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_public_key({ environment: environment, key: key }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_public_key environment: environment, key: key do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_public_key ::Google::Cloud::Shell::V1::AddPublicKeyRequest.new(environment: environment, key: key) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_public_key({ environment: environment, key: key }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_public_key(::Google::Cloud::Shell::V1::AddPublicKeyRequest.new(environment: environment, key: key), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_public_key_client_stub.call_count + end + end + end + + def test_remove_public_key + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + environment = "hello world" + key = "hello world" + + remove_public_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_remove_public_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_public_key_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_public_key({ environment: environment, key: key }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_public_key environment: environment, key: key do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_public_key ::Google::Cloud::Shell::V1::RemovePublicKeyRequest.new(environment: environment, key: key) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_public_key({ environment: environment, key: key }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_public_key(::Google::Cloud::Shell::V1::RemovePublicKeyRequest.new(environment: environment, key: key), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_public_key_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb new file mode 100644 index 000000000000..c419fa31b991 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb @@ -0,0 +1,442 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/shell/v1/cloudshell_pb" +require "google/cloud/shell/v1/cloud_shell_service" + +class ::Google::Cloud::Shell::V1::CloudShellService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_environment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Shell::V1::Environment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_environment, name + assert_kind_of ::Google::Cloud::Shell::V1::GetEnvironmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_environment_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_environment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_environment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_environment ::Google::Cloud::Shell::V1::GetEnvironmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_environment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_environment(::Google::Cloud::Shell::V1::GetEnvironmentRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_environment_client_stub.call_rpc_count + end + end + + def test_start_environment + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + access_token = "hello world" + public_keys = ["hello world"] + + start_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_environment, name + assert_kind_of ::Google::Cloud::Shell::V1::StartEnvironmentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["access_token"] + assert_equal ["hello world"], request["public_keys"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_environment_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_environment({ name: name, access_token: access_token, public_keys: public_keys }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.start_environment name: name, access_token: access_token, public_keys: public_keys do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.start_environment ::Google::Cloud::Shell::V1::StartEnvironmentRequest.new(name: name, access_token: access_token, public_keys: public_keys) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.start_environment({ name: name, access_token: access_token, public_keys: public_keys }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.start_environment(::Google::Cloud::Shell::V1::StartEnvironmentRequest.new(name: name, access_token: access_token, public_keys: public_keys), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, start_environment_client_stub.call_rpc_count + end + end + + def test_authorize_environment + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + access_token = "hello world" + id_token = "hello world" + expire_time = {} + + authorize_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :authorize_environment, name + assert_kind_of ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["access_token"] + assert_equal "hello world", request["id_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["expire_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, authorize_environment_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.authorize_environment({ name: name, access_token: access_token, id_token: id_token, expire_time: expire_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.authorize_environment name: name, access_token: access_token, id_token: id_token, expire_time: expire_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.authorize_environment ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new(name: name, access_token: access_token, id_token: id_token, expire_time: expire_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.authorize_environment({ name: name, access_token: access_token, id_token: id_token, expire_time: expire_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.authorize_environment(::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new(name: name, access_token: access_token, id_token: id_token, expire_time: expire_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, authorize_environment_client_stub.call_rpc_count + end + end + + def test_add_public_key + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + environment = "hello world" + key = "hello world" + + add_public_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_public_key, name + assert_kind_of ::Google::Cloud::Shell::V1::AddPublicKeyRequest, request + assert_equal "hello world", request["environment"] + assert_equal "hello world", request["key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_public_key_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_public_key({ environment: environment, key: key }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_public_key environment: environment, key: key do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_public_key ::Google::Cloud::Shell::V1::AddPublicKeyRequest.new(environment: environment, key: key) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_public_key({ environment: environment, key: key }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_public_key(::Google::Cloud::Shell::V1::AddPublicKeyRequest.new(environment: environment, key: key), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_public_key_client_stub.call_rpc_count + end + end + + def test_remove_public_key + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + environment = "hello world" + key = "hello world" + + remove_public_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_public_key, name + assert_kind_of ::Google::Cloud::Shell::V1::RemovePublicKeyRequest, request + assert_equal "hello world", request["environment"] + assert_equal "hello world", request["key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_public_key_client_stub do + # Create client + client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_public_key({ environment: environment, key: key }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.remove_public_key environment: environment, key: key do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.remove_public_key ::Google::Cloud::Shell::V1::RemovePublicKeyRequest.new(environment: environment, key: key) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.remove_public_key({ environment: environment, key: key }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.remove_public_key(::Google::Cloud::Shell::V1::RemovePublicKeyRequest.new(environment: environment, key: key), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, remove_public_key_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Shell::V1::CloudShellService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-shell-v1/test/helper.rb b/owl-bot-staging/google-cloud-shell-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-shell-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.repo-metadata.json new file mode 100644 index 000000000000..e3f41ff59e96 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "spanner.googleapis.com", + "api_shortname": "spanner", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-database-v1/latest", + "distribution_name": "google-cloud-spanner-admin-database-v1", + "is_cloud": true, + "language": "ruby", + "name": "spanner", + "name_pretty": "Cloud Spanner Database Admin V1 API", + "product_documentation": "https://cloud.google.com/spanner", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-admin-database-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SPANNER", + "ruby-cloud-product-url": "https://cloud.google.com/spanner", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.rubocop.yml new file mode 100644 index 000000000000..7278d0340d48 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-spanner-admin-database-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-spanner-admin-database-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.yardopts new file mode 100644 index 000000000000..11ef47976a02 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Spanner Database Admin 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-spanner-admin-database-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..dff234acc315 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-spanner-admin-database-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-spanner-admin-database-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/spanner/admin/database/v1" + +client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/spanner/admin/database/v1" + +::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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-spanner-admin-database-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/spanner/admin/database/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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-spanner-admin-database-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-database-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/README.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/README.md new file mode 100644 index 000000000000..ccb56c65fc6d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Spanner Database Admin V1 API + +Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. + + +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 Spanner Database Admin V1 API. Most users should consider using +the main client gem, +[google-cloud-spanner](https://rubygems.org/gems/google-cloud-spanner). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-spanner-admin-database-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/spanner.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/spanner/admin/database/v1" + +client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +request = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new # (request fields as keyword arguments...) +response = client.list_databases request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-database-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/spanner) +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/spanner/admin/database/v1" +require "logger" + +client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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-spanner`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-spanner-admin-database-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-spanner`. +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-spanner-admin-database-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-spanner-admin-database-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-admin-database-v1/Rakefile new file mode 100644 index 000000000000..49214abd44ec --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SPANNER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SPANNER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SPANNER_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 SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/spanner/admin/database/v1/database_admin/credentials" + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SPANNER_PROJECT"] = project + ENV["SPANNER_TEST_PROJECT"] = project + ENV["SPANNER_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-spanner-admin-database-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-spanner-admin-database-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-spanner-admin-database-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-spanner-admin-database-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-spanner-admin-database-v1" + header "google-cloud-spanner-admin-database-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-spanner-admin-database-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-spanner-admin-database-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-spanner-admin-database-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-spanner-admin-database-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-spanner-admin-database-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-admin-database-v1/gapic_metadata.json new file mode 100644 index 000000000000..d7aa9420ad18 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/gapic_metadata.json @@ -0,0 +1,153 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.spanner.admin.database.v1", + "libraryPackage": "::Google::Cloud::Spanner::Admin::Database::V1", + "services": { + "DatabaseAdmin": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client", + "rpcs": { + "ListDatabases": { + "methods": [ + "list_databases" + ] + }, + "CreateDatabase": { + "methods": [ + "create_database" + ] + }, + "GetDatabase": { + "methods": [ + "get_database" + ] + }, + "UpdateDatabase": { + "methods": [ + "update_database" + ] + }, + "UpdateDatabaseDdl": { + "methods": [ + "update_database_ddl" + ] + }, + "DropDatabase": { + "methods": [ + "drop_database" + ] + }, + "GetDatabaseDdl": { + "methods": [ + "get_database_ddl" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "CreateBackup": { + "methods": [ + "create_backup" + ] + }, + "CopyBackup": { + "methods": [ + "copy_backup" + ] + }, + "GetBackup": { + "methods": [ + "get_backup" + ] + }, + "UpdateBackup": { + "methods": [ + "update_backup" + ] + }, + "DeleteBackup": { + "methods": [ + "delete_backup" + ] + }, + "ListBackups": { + "methods": [ + "list_backups" + ] + }, + "RestoreDatabase": { + "methods": [ + "restore_database" + ] + }, + "ListDatabaseOperations": { + "methods": [ + "list_database_operations" + ] + }, + "ListBackupOperations": { + "methods": [ + "list_backup_operations" + ] + }, + "ListDatabaseRoles": { + "methods": [ + "list_database_roles" + ] + }, + "AddSplitPoints": { + "methods": [ + "add_split_points" + ] + }, + "CreateBackupSchedule": { + "methods": [ + "create_backup_schedule" + ] + }, + "GetBackupSchedule": { + "methods": [ + "get_backup_schedule" + ] + }, + "UpdateBackupSchedule": { + "methods": [ + "update_backup_schedule" + ] + }, + "DeleteBackupSchedule": { + "methods": [ + "delete_backup_schedule" + ] + }, + "ListBackupSchedules": { + "methods": [ + "list_backup_schedules" + ] + }, + "InternalUpdateGraphOperation": { + "methods": [ + "internal_update_graph_operation" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/google-cloud-spanner-admin-database-v1.gemspec b/owl-bot-staging/google-cloud-spanner-admin-database-v1/google-cloud-spanner-admin-database-v1.gemspec new file mode 100644 index 000000000000..731bba82b5c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/google-cloud-spanner-admin-database-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/spanner/admin/database/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-spanner-admin-database-v1" + gem.version = Google::Cloud::Spanner::Admin::Database::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-admin-database-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details." + gem.summary = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google-cloud-spanner-admin-database-v1.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google-cloud-spanner-admin-database-v1.rb new file mode 100644 index 000000000000..4a1420305d7f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google-cloud-spanner-admin-database-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/spanner/admin/database/v1" diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1.rb new file mode 100644 index 000000000000..ab4f375dca61 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1.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 "google/cloud/spanner/admin/database/v1/database_admin" +require "google/cloud/spanner/admin/database/v1/version" + +module Google + module Cloud + module Spanner + module Admin + module Database + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/spanner/admin/database/v1" + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/spanner/admin/database/v1" + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + module V1 + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/spanner/admin/database/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin.rb new file mode 100644 index 000000000000..31d5189b1b85 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/spanner/admin/database/v1/version" + +require "google/cloud/spanner/admin/database/v1/database_admin/credentials" +require "google/cloud/spanner/admin/database/v1/database_admin/paths" +require "google/cloud/spanner/admin/database/v1/database_admin/operations" +require "google/cloud/spanner/admin/database/v1/database_admin/client" +require "google/cloud/spanner/admin/database/v1/database_admin/rest" + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + ## + # Cloud Spanner Database Admin API + # + # The Cloud Spanner Database Admin API can be used to: + # * create, drop, and list databases + # * update the schema of pre-existing databases + # * create, delete, copy and list backups for a database + # * restore a database from an existing backup + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/spanner/admin/database/v1/database_admin" + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/spanner/admin/database/v1/database_admin/rest" + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + module DatabaseAdmin + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "database_admin", "helpers.rb" +require "google/cloud/spanner/admin/database/v1/database_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb new file mode 100644 index 000000000000..3b17fcbd5a6b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb @@ -0,0 +1,3658 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/spanner/admin/database/v1/spanner_database_admin_pb" + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + module DatabaseAdmin + ## + # Client for the DatabaseAdmin service. + # + # Cloud Spanner Database Admin API + # + # The Cloud Spanner Database Admin API can be used to: + # * create, drop, and list databases + # * update the schema of pre-existing databases + # * create, delete, copy and list backups for a database + # * restore a database from an existing backup + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :database_admin_stub + + ## + # Configure the DatabaseAdmin Client class. + # + # See {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DatabaseAdmin clients + # ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Spanner", "Admin", "Database", "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_databases.timeout = 3600.0 + default_config.rpcs.list_databases.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_database.timeout = 3600.0 + + default_config.rpcs.get_database.timeout = 3600.0 + default_config.rpcs.get_database.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_database.timeout = 3600.0 + default_config.rpcs.update_database.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_database_ddl.timeout = 3600.0 + default_config.rpcs.update_database_ddl.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.drop_database.timeout = 3600.0 + default_config.rpcs.drop_database.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_database_ddl.timeout = 3600.0 + default_config.rpcs.get_database_ddl.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.set_iam_policy.timeout = 30.0 + + default_config.rpcs.get_iam_policy.timeout = 30.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.test_iam_permissions.timeout = 30.0 + + default_config.rpcs.create_backup.timeout = 3600.0 + + default_config.rpcs.copy_backup.timeout = 3600.0 + + default_config.rpcs.get_backup.timeout = 3600.0 + default_config.rpcs.get_backup.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_backup.timeout = 3600.0 + default_config.rpcs.update_backup.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_backup.timeout = 3600.0 + default_config.rpcs.delete_backup.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_backups.timeout = 3600.0 + default_config.rpcs.list_backups.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.restore_database.timeout = 3600.0 + + default_config.rpcs.list_database_operations.timeout = 3600.0 + default_config.rpcs.list_database_operations.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_backup_operations.timeout = 3600.0 + default_config.rpcs.list_backup_operations.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_database_roles.timeout = 3600.0 + default_config.rpcs.list_database_roles.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.add_split_points.timeout = 3600.0 + default_config.rpcs.add_split_points.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_backup_schedule.timeout = 3600.0 + default_config.rpcs.create_backup_schedule.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_backup_schedule.timeout = 3600.0 + default_config.rpcs.get_backup_schedule.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_backup_schedule.timeout = 3600.0 + default_config.rpcs.update_backup_schedule.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_backup_schedule.timeout = 3600.0 + default_config.rpcs.delete_backup_schedule.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_backup_schedules.timeout = 3600.0 + default_config.rpcs.list_backup_schedules.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DatabaseAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @database_admin_stub.universe_domain + end + + ## + # Create a new DatabaseAdmin client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DatabaseAdmin 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/spanner/admin/database/v1/spanner_database_admin_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 + + @database_admin_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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 + ) + + @database_admin_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::Spanner::Admin::Database::V1::DatabaseAdmin::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @database_admin_stub.logger + end + + # Service calls + + ## + # Lists Cloud Spanner databases. + # + # @overload list_databases(request, options = nil) + # Pass arguments to `list_databases` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_databases(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_databases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance whose databases should be listed. + # Values are of the form `projects//instances/`. + # @param page_size [::Integer] + # Number of databases to be returned in the response. If 0 or less, + # defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new + # + # # Call the list_databases method. + # result = client.list_databases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Database. + # p item + # end + # + def list_databases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_databases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_databases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_databases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :list_databases, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_databases, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new Cloud Spanner database and starts to prepare it for serving. + # The returned {::Google::Longrunning::Operation long-running operation} will + # have a name of the format `/operations/` and + # can be used to track preparation of the database. The + # {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata CreateDatabaseMetadata}. + # The {::Google::Longrunning::Operation#response response} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful. + # + # @overload create_database(request, options = nil) + # Pass arguments to `create_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_database(parent: nil, create_statement: nil, extra_statements: nil, encryption_config: nil, database_dialect: nil, proto_descriptors: nil) + # Pass arguments to `create_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance that will serve the new database. + # Values are of the form `projects//instances/`. + # @param create_statement [::String] + # Required. A `CREATE DATABASE` statement, which specifies the ID of the + # new database. The database ID must conform to the regular expression + # `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. + # If the database ID is a reserved word or if it contains a hyphen, the + # database ID must be enclosed in backticks (`` ` ``). + # @param extra_statements [::Array<::String>] + # Optional. A list of DDL statements to run inside the newly created + # database. Statements can create tables, indexes, etc. These + # statements execute atomically with the creation of the database: + # if there is an error in any statement, the database is not created. + # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig, ::Hash] + # Optional. The encryption configuration for the database. If this field is + # not specified, Cloud Spanner will encrypt/decrypt all data at rest using + # Google default encryption. + # @param database_dialect [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] + # Optional. The dialect of the Cloud Spanner Database. + # @param proto_descriptors [::String] + # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in + # 'extra_statements' above. + # Contains a protobuf-serialized + # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + # To generate it, [install](https://grpc.io/docs/protoc-installation/) and + # run `protoc` with --include_imports and --descriptor_set_out. For example, + # to generate for moon/shot/app.proto, run + # ``` + # $protoc --proto_path=/app_path --proto_path=/lib_path \ + # --include_imports \ + # --descriptor_set_out=descriptors.data \ + # moon/shot/app.proto + # ``` + # For more details, see protobuffer [self + # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new + # + # # Call the create_database method. + # result = client.create_database request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest + + # Converts hash and nil to 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_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :create_database, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 state of a Cloud Spanner database. + # + # @overload get_database(request, options = nil) + # Pass arguments to `get_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_database(name: nil) + # Pass arguments to `get_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 database. Values are of the form + # `projects//instances//databases/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::Database] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new + # + # # Call the get_database method. + # result = client.get_database request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Database. + # p result + # + def get_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :get_database, request, 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 Cloud Spanner database. The returned + # {::Google::Longrunning::Operation long-running operation} can be used to track + # the progress of updating the database. If the named database does not + # exist, returns `NOT_FOUND`. + # + # While the operation is pending: + # + # * The database's + # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling} + # field is set to true. + # * Cancelling the operation is best-effort. If the cancellation succeeds, + # the operation metadata's + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata#cancel_time cancel_time} + # is set, the updates are reverted, and the operation terminates with a + # `CANCELLED` status. + # * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error + # until the pending operation is done (returns successfully or with + # error). + # * Reading the database via the API continues to give the pre-request + # values. + # + # Upon completion of the returned operation: + # + # * The new values are in effect and readable via the API. + # * The database's + # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling} + # field becomes false. + # + # The returned {::Google::Longrunning::Operation long-running operation} will + # have a name of the format + # `projects//instances//databases//operations/` + # and can be used to track the database modification. The + # {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata UpdateDatabaseMetadata}. + # The {::Google::Longrunning::Operation#response response} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful. + # + # @overload update_database(request, options = nil) + # Pass arguments to `update_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_database(database: nil, update_mask: nil) + # Pass arguments to `update_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::Google::Cloud::Spanner::Admin::Database::V1::Database, ::Hash] + # Required. The database to update. + # The `name` field of the database is of the form + # `projects//instances//databases/`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. Currently, only + # `enable_drop_protection` field can be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new + # + # # Call the update_database method. + # result = client.update_database request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest + + # Converts hash and nil to 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_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database&.name + header_params["database.name"] = request.database.name + end + + request_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_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :update_database, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 schema of a Cloud Spanner database by + # creating/altering/dropping tables, columns, indexes, etc. The returned + # {::Google::Longrunning::Operation long-running operation} will have a name of + # the format `/operations/` and can be used to + # track execution of the schema change(s). The + # {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlMetadata UpdateDatabaseDdlMetadata}. + # The operation has no response. + # + # @overload update_database_ddl(request, options = nil) + # Pass arguments to `update_database_ddl` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_database_ddl(database: nil, statements: nil, operation_id: nil, proto_descriptors: nil, throughput_mode: nil) + # Pass arguments to `update_database_ddl` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database to update. + # @param statements [::Array<::String>] + # Required. DDL statements to be applied to the database. + # @param operation_id [::String] + # If empty, the new update request is assigned an + # automatically-generated operation ID. Otherwise, `operation_id` + # is used to construct the name of the resulting + # {::Google::Longrunning::Operation Operation}. + # + # Specifying an explicit operation ID simplifies determining + # whether the statements were executed in the event that the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} + # call is replayed, or the return value is otherwise lost: the + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database} + # and `operation_id` fields can be combined to form the + # {::Google::Longrunning::Operation#name name} of the resulting + # {::Google::Longrunning::Operation longrunning.Operation}: + # `/operations/`. + # + # `operation_id` should be unique within the database, and must be + # a valid identifier: `[a-z][a-z0-9_]*`. Note that + # automatically-generated operation IDs always begin with an + # underscore. If the named operation already exists, + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} + # returns `ALREADY_EXISTS`. + # @param proto_descriptors [::String] + # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. + # Contains a protobuf-serialized + # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + # To generate it, [install](https://grpc.io/docs/protoc-installation/) and + # run `protoc` with --include_imports and --descriptor_set_out. For example, + # to generate for moon/shot/app.proto, run + # ``` + # $protoc --proto_path=/app_path --proto_path=/lib_path \ + # --include_imports \ + # --descriptor_set_out=descriptors.data \ + # moon/shot/app.proto + # ``` + # For more details, see protobuffer [self + # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + # @param throughput_mode [::Boolean] + # Optional. This field is exposed to be used by the Spanner Migration Tool. + # For more details, see + # [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new + # + # # Call the update_database_ddl method. + # result = client.update_database_ddl request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_database_ddl request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest + + # Converts hash and nil to 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_database_ddl.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_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_database_ddl.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_database_ddl.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :update_database_ddl, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Drops (aka deletes) a Cloud Spanner database. + # Completed backups for the database will be retained according to their + # `expire_time`. + # Note: Cloud Spanner might continue to accept requests for a few seconds + # after the database has been deleted. + # + # @overload drop_database(request, options = nil) + # Pass arguments to `drop_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload drop_database(database: nil) + # Pass arguments to `drop_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database to be dropped. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new + # + # # Call the drop_database method. + # result = client.drop_database request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def drop_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.drop_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.drop_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.drop_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :drop_database, request, 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 schema of a Cloud Spanner database as a list of formatted + # DDL statements. This method does not show pending schema updates, those may + # be queried using the Operations API. + # + # @overload get_database_ddl(request, options = nil) + # Pass arguments to `get_database_ddl` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_database_ddl(database: nil) + # Pass arguments to `get_database_ddl` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database whose schema we wish to get. + # Values are of the form + # `projects//instances//databases/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new + # + # # Call the get_database_ddl method. + # result = client.get_database_ddl request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse. + # p result + # + def get_database_ddl request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_database_ddl.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_database_ddl.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_database_ddl.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :get_database_ddl, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on a database or backup resource. + # Replaces any existing policy. + # + # Authorization requires `spanner.databases.setIamPolicy` + # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + # For backups, authorization requires `spanner.backups.setIamPolicy` + # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a database or backup resource. + # Returns an empty policy if a database or backup exists but does not have a + # policy set. + # + # Authorization requires `spanner.databases.getIamPolicy` permission on + # [resource][google.iam.v1.GetIamPolicyRequest.resource]. + # For backups, authorization requires `spanner.backups.getIamPolicy` + # permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that the caller has on the specified database or backup + # resource. + # + # Attempting this RPC on a non-existent Cloud Spanner database will + # result in a NOT_FOUND error if the user has + # `spanner.databases.list` permission on the containing Cloud + # Spanner instance. Otherwise returns an empty set of permissions. + # Calling this method on a backup that does not exist will + # result in a NOT_FOUND error if the user has + # `spanner.backups.list` permission on the containing instance. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts creating a new Cloud Spanner Backup. + # The returned backup {::Google::Longrunning::Operation long-running operation} + # will have a name of the format + # `projects//instances//backups//operations/` + # and can be used to track creation of the backup. The + # {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. + # The {::Google::Longrunning::Operation#response response} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. + # Cancelling the returned operation will stop the creation and delete the + # backup. There can be only one pending backup creation per database. Backup + # creation of different databases can run concurrently. + # + # @overload create_backup(request, options = nil) + # Pass arguments to `create_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_backup(parent: nil, backup_id: nil, backup: nil, encryption_config: nil) + # Pass arguments to `create_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 parent [::String] + # Required. The name of the instance in which the backup will be + # created. This must be the same instance that contains the database the + # backup will be created from. The backup will be stored in the + # location(s) specified in the instance configuration of this + # instance. Values are of the form + # `projects//instances/`. + # @param backup_id [::String] + # Required. The id of the backup to be created. The `backup_id` appended to + # `parent` forms the full backup name of the form + # `projects//instances//backups/`. + # @param backup [::Google::Cloud::Spanner::Admin::Database::V1::Backup, ::Hash] + # Required. The backup to create. + # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig, ::Hash] + # Optional. The encryption configuration used to encrypt the backup. If this + # field is not specified, the backup will use the same encryption + # configuration as the database by default, namely + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} + # = `USE_DATABASE_ENCRYPTION`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new + # + # # Call the create_backup method. + # result = client.create_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 create_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest + + # Converts hash and nil to 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_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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :create_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 + + ## + # Starts copying a Cloud Spanner Backup. + # The returned backup {::Google::Longrunning::Operation long-running operation} + # will have a name of the format + # `projects//instances//backups//operations/` + # and can be used to track copying of the backup. The operation is associated + # with the destination backup. + # The {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. + # The {::Google::Longrunning::Operation#response response} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. + # Cancelling the returned operation will stop the copying and delete the + # destination backup. Concurrent CopyBackup requests can run on the same + # source backup. + # + # @overload copy_backup(request, options = nil) + # Pass arguments to `copy_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload copy_backup(parent: nil, backup_id: nil, source_backup: nil, expire_time: nil, encryption_config: nil) + # Pass arguments to `copy_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 parent [::String] + # Required. The name of the destination instance that will contain the backup + # copy. Values are of the form: `projects//instances/`. + # @param backup_id [::String] + # Required. The id of the backup copy. + # The `backup_id` appended to `parent` forms the full backup_uri of the form + # `projects//instances//backups/`. + # @param source_backup [::String] + # Required. The source backup to be copied. + # The source backup needs to be in READY state for it to be copied. + # Once CopyBackup is in progress, the source backup cannot be deleted or + # cleaned up on expiration until CopyBackup is finished. + # Values are of the form: + # `projects//instances//backups/`. + # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The expiration time of the backup in microsecond granularity. + # The expiration time must be at least 6 hours and at most 366 days + # from the `create_time` of the source backup. Once the `expire_time` has + # passed, the backup is eligible to be automatically deleted by Cloud Spanner + # to free the resources used by the backup. + # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig, ::Hash] + # Optional. The encryption configuration used to encrypt the backup. If this + # field is not specified, the backup will use the same encryption + # configuration as the source backup by default, namely + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} + # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new + # + # # Call the copy_backup method. + # result = client.copy_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 copy_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.copy_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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.copy_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.copy_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :copy_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 + + ## + # Gets metadata on a pending or completed + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::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. Name of the backup. + # Values are of the form + # `projects//instances//backups/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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 + + @database_admin_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 + + ## + # Updates a pending or completed + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. + # + # @overload update_backup(request, options = nil) + # Pass arguments to `update_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_backup(backup: nil, update_mask: nil) + # Pass arguments to `update_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 backup [::Google::Cloud::Spanner::Admin::Database::V1::Backup, ::Hash] + # Required. The backup to update. `backup.name`, and the fields to be updated + # as specified by `update_mask` are required. Other fields are ignored. + # Update is only supported for the following fields: + # * `backup.expire_time`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields (e.g. `expire_time`) in the + # Backup resource should be updated. This mask is relative to the Backup + # resource, not to the request message. The field mask must always be + # specified; this prevents any future fields from being erased accidentally + # by clients that do not know about them. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new + # + # # Call the update_backup method. + # result = client.update_backup request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. + # p result + # + def update_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest + + # Converts hash and nil to 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_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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.backup&.name + header_params["backup.name"] = request.backup.name + end + + request_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_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :update_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 pending or completed + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::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) + # 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. Name of the backup to delete. + # Values are of the form + # `projects//instances//backups/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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 + + @database_admin_stub.call_rpc :delete_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 + + ## + # Lists completed and pending backups. + # Backups returned are ordered by `create_time` in descending order, + # starting from the most recent `create_time`. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::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, filter: 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 instance to list backups from. Values are of the + # form `projects//instances/`. + # @param filter [::String] + # An expression that filters the list of returned backups. + # + # A filter expression consists of a field name, a comparison operator, and a + # value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup} are eligible for + # filtering: + # + # * `name` + # * `database` + # * `state` + # * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + # * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + # * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + # * `size_bytes` + # * `backup_schedules` + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic, but + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `name:Howl` - The backup's name contains the string "howl". + # * `database:prod` + # - The database's name contains the string "prod". + # * `state:CREATING` - The backup is pending creation. + # * `state:READY` - The backup is fully created and ready for use. + # * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + # - The backup name contains the string "howl" and `create_time` + # of the backup is before 2018-03-28T14:50:00Z. + # * `expire_time < \"2018-03-28T14:50:00Z\"` + # - The backup `expire_time` is before 2018-03-28T14:50:00Z. + # * `size_bytes > 10000000000` - The backup's size is greater than 10GB + # * `backup_schedules:daily` + # - The backup is created from a schedule with "daily" in its name. + # @param page_size [::Integer] + # Number of backups to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse ListBackupsResponse} + # to the same `parent` and with the same `filter`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_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 + + @database_admin_stub.call_rpc :list_backups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @database_admin_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 + + ## + # Create a new database by restoring from a completed backup. The new + # database must be in the same project and in an instance with the same + # instance configuration as the instance containing + # the backup. The returned database [long-running + # operation][google.longrunning.Operation] has a name of the format + # `projects//instances//databases//operations/`, + # and can be used to track the progress of the operation, and to cancel it. + # The {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. + # The {::Google::Longrunning::Operation#response response} type + # is {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if + # successful. Cancelling the returned operation will stop the restore and + # delete the database. + # There can be only one database being restored into an instance at a time. + # Once the restore operation completes, a new restore operation can be + # initiated, without waiting for the optimize operation associated with the + # first restore to complete. + # + # @overload restore_database(request, options = nil) + # Pass arguments to `restore_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload restore_database(parent: nil, database_id: nil, backup: nil, encryption_config: nil) + # Pass arguments to `restore_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance in which to create the + # restored database. This instance must be in the same project and + # have the same instance configuration as the instance containing + # the source backup. Values are of the form + # `projects//instances/`. + # @param database_id [::String] + # Required. The id of the database to create and restore to. This + # database must not already exist. The `database_id` appended to + # `parent` forms the full database name of the form + # `projects//instances//databases/`. + # @param backup [::String] + # Name of the backup from which to restore. Values are of the form + # `projects//instances//backups/`. + # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig, ::Hash] + # Optional. An encryption configuration describing the encryption type and + # key resources in Cloud KMS used to encrypt/decrypt the database to restore + # to. If this field is not specified, the restored database will use the same + # encryption configuration as the backup by default, namely + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} + # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new + # + # # Call the restore_database method. + # result = client.restore_database request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def restore_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.restore_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.restore_database.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :restore_database, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 database {::Google::Longrunning::Operation longrunning-operations}. + # A database operation has a name of the form + # `projects//instances//databases//operations/`. + # The long-running operation + # {::Google::Longrunning::Operation#metadata metadata} field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. + # + # @overload list_database_operations(request, options = nil) + # Pass arguments to `list_database_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_database_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_database_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance of the database operations. + # Values are of the form `projects//instances/`. + # @param filter [::String] + # An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the {::Google::Longrunning::Operation Operation} + # are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} + # is + # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ + # `(metadata.source_type:BACKUP) AND` \ + # `(metadata.backup_info.backup:backup_howl) AND` \ + # `(metadata.name:restored_howl) AND` \ + # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. + # * The database is restored from a backup. + # * The backup name contains "backup_howl". + # * The restored database's name contains "restored_howl". + # * The operation started before 2018-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse ListDatabaseOperationsResponse} + # to the same `parent` and with the same `filter`. + # + # @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/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new + # + # # Call the list_database_operations method. + # result = client.list_database_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_database_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_database_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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_database_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_database_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :list_database_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_database_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 + + ## + # Lists the backup {::Google::Longrunning::Operation long-running operations} in + # the given instance. A backup operation has a name of the form + # `projects//instances//backups//operations/`. + # The long-running operation + # {::Google::Longrunning::Operation#metadata metadata} field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.progress.start_time` in descending order starting + # from the most recently started operation. + # + # @overload list_backup_operations(request, options = nil) + # Pass arguments to `list_backup_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance of the backup operations. Values are of + # the form `projects//instances/`. + # @param filter [::String] + # An expression that filters the list of returned backup operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the {::Google::Longrunning::Operation operation} + # are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} + # is + # `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic, but + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + # `metadata.database:prod` - Returns operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. + # * The source database name of backup contains the string "prod". + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + # `(metadata.name:howl) AND` \ + # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Returns operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. + # * The backup name contains the string "howl". + # * The operation started before 2018-03-28T14:50:00Z. + # * The operation resulted in an error. + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ + # `(metadata.source_backup:test) AND` \ + # `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ + # `(error:*)` - Returns operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. + # * The source backup name contains the string "test". + # * The operation started before 2022-01-18T14:50:00Z. + # * The operation resulted in an error. + # * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + # `(metadata.database:test_db)) OR` \ + # `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) + # AND` \ + # `(metadata.source_backup:test_bkp)) AND` \ + # `(error:*)` - Returns operations where: + # * The operation's metadata matches either of criteria: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} + # AND the source database name of the backup contains the string + # "test_db" + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata} + # AND the source backup name contains the string "test_bkp" + # * The operation resulted in an error. + # @param page_size [::Integer] + # Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse ListBackupOperationsResponse} + # to the same `parent` and with the same `filter`. + # + # @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/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new + # + # # Call the list_backup_operations method. + # result = client.list_backup_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_backup_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest + + # Converts hash and nil to an 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_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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_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_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :list_backup_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_backup_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 + + ## + # Lists Cloud Spanner database roles. + # + # @overload list_database_roles(request, options = nil) + # Pass arguments to `list_database_roles` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_database_roles(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_database_roles` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The database whose roles should be listed. + # Values are of the form + # `projects//instances//databases/`. + # @param page_size [::Integer] + # Number of database roles to be returned in the response. If 0 or less, + # defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse ListDatabaseRolesResponse}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new + # + # # Call the list_database_roles method. + # result = client.list_database_roles request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole. + # p item + # end + # + def list_database_roles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_database_roles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_database_roles.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_database_roles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :list_database_roles, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_database_roles, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds split points to specified tables, indexes of a database. + # + # @overload add_split_points(request, options = nil) + # Pass arguments to `add_split_points` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_split_points(database: nil, split_points: nil, initiator: nil) + # Pass arguments to `add_split_points` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database on whose tables/indexes split points are to be + # added. Values are of the form + # `projects//instances//databases/`. + # @param split_points [::Array<::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints, ::Hash>] + # Required. The split points to add. + # @param initiator [::String] + # Optional. A user-supplied tag associated with the split points. + # For example, "intital_data_load", "special_event_1". + # Defaults to "CloudAddSplitPointsAPI" if not specified. + # The length of the tag must not exceed 50 characters,else will be trimmed. + # Only valid UTF8 characters are allowed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new + # + # # Call the add_split_points method. + # result = client.add_split_points request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse. + # p result + # + def add_split_points request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest + + # Converts hash and nil to 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_split_points.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_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_split_points.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_split_points.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :add_split_points, request, 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 backup schedule. + # + # @overload create_backup_schedule(request, options = nil) + # Pass arguments to `create_backup_schedule` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_backup_schedule(parent: nil, backup_schedule_id: nil, backup_schedule: nil) + # Pass arguments to `create_backup_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 database that this backup schedule applies to. + # @param backup_schedule_id [::String] + # Required. The Id to use for the backup schedule. The `backup_schedule_id` + # appended to `parent` forms the full backup schedule name of the form + # `projects//instances//databases//backupSchedules/`. + # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash] + # Required. The backup schedule to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new + # + # # Call the create_backup_schedule method. + # result = client.create_backup_schedule request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + # p result + # + def create_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest + + # Converts hash and nil to 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_backup_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :create_backup_schedule, request, 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 backup schedule for the input schedule name. + # + # @overload get_backup_schedule(request, options = nil) + # Pass arguments to `get_backup_schedule` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_schedule(name: nil) + # Pass arguments to `get_backup_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 schedule to retrieve. + # Values are of the form + # `projects//instances//databases//backupSchedules/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new + # + # # Call the get_backup_schedule method. + # result = client.get_backup_schedule request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + # p result + # + def get_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest + + # Converts hash and nil to an 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_schedule.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :get_backup_schedule, request, 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 backup schedule. + # + # @overload update_backup_schedule(request, options = nil) + # Pass arguments to `update_backup_schedule` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_backup_schedule(backup_schedule: nil, update_mask: nil) + # Pass arguments to `update_backup_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash] + # Required. The backup schedule to update. `backup_schedule.name`, and the + # fields to be updated as specified by `update_mask` are required. Other + # fields are ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in the BackupSchedule resource + # should be updated. This mask is relative to the BackupSchedule resource, + # not to the request message. The field mask must always be + # specified; this prevents any future fields from being erased + # accidentally. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new + # + # # Call the update_backup_schedule method. + # result = client.update_backup_schedule request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + # p result + # + def update_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest + + # Converts hash and nil to 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.backup_schedule&.name + header_params["backup_schedule.name"] = request.backup_schedule.name + end + + request_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_backup_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :update_backup_schedule, request, 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 backup schedule. + # + # @overload delete_backup_schedule(request, options = nil) + # Pass arguments to `delete_backup_schedule` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_schedule(name: nil) + # Pass arguments to `delete_backup_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 schedule to delete. + # Values are of the form + # `projects//instances//databases//backupSchedules/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new + # + # # Call the delete_backup_schedule method. + # result = client.delete_backup_schedule request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest + + # Converts hash and nil to an 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_schedule.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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_schedule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :delete_backup_schedule, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the backup schedules for the database. + # + # @overload list_backup_schedules(request, options = nil) + # Pass arguments to `list_backup_schedules` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_schedules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_schedules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Database is the parent resource whose backup schedules should be + # listed. Values are of the form + # projects//instances//databases/ + # @param page_size [::Integer] + # Optional. Number of backup schedules to be returned in the response. If 0 + # or less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # Optional. If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse ListBackupSchedulesResponse} + # to the same `parent`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.new + # + # # Call the list_backup_schedules method. + # result = client.list_backup_schedules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + # p item + # end + # + def list_backup_schedules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest + + # Converts hash and nil to an 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_schedules.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_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_schedules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_schedules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :list_backup_schedules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_backup_schedules, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # This is an internal API called by Spanner Graph jobs. You should never need + # to call this API directly. + # + # @overload internal_update_graph_operation(request, options = nil) + # Pass arguments to `internal_update_graph_operation` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload internal_update_graph_operation(database: nil, operation_id: nil, vm_identity_token: nil, progress: nil, status: nil) + # Pass arguments to `internal_update_graph_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Internal field, do not use directly. + # @param operation_id [::String] + # Internal field, do not use directly. + # @param vm_identity_token [::String] + # Internal field, do not use directly. + # @param progress [::Float] + # Internal field, do not use directly. + # @param status [::Google::Rpc::Status, ::Hash] + # Internal field, do not use directly. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest.new + # + # # Call the internal_update_graph_operation method. + # result = client.internal_update_graph_operation request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse. + # p result + # + def internal_update_graph_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.internal_update_graph_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::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.internal_update_graph_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.internal_update_graph_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.call_rpc :internal_update_graph_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 + + ## + # Configuration class for the DatabaseAdmin API. + # + # This class represents the configuration for DatabaseAdmin, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_databases to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_databases.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_databases.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DatabaseAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_databases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_databases + ## + # RPC-specific configuration for `create_database` + # @return [::Gapic::Config::Method] + # + attr_reader :create_database + ## + # RPC-specific configuration for `get_database` + # @return [::Gapic::Config::Method] + # + attr_reader :get_database + ## + # RPC-specific configuration for `update_database` + # @return [::Gapic::Config::Method] + # + attr_reader :update_database + ## + # RPC-specific configuration for `update_database_ddl` + # @return [::Gapic::Config::Method] + # + attr_reader :update_database_ddl + ## + # RPC-specific configuration for `drop_database` + # @return [::Gapic::Config::Method] + # + attr_reader :drop_database + ## + # RPC-specific configuration for `get_database_ddl` + # @return [::Gapic::Config::Method] + # + attr_reader :get_database_ddl + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `create_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup + ## + # RPC-specific configuration for `copy_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :copy_backup + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `update_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `restore_database` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_database + ## + # RPC-specific configuration for `list_database_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_database_operations + ## + # RPC-specific configuration for `list_backup_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_operations + ## + # RPC-specific configuration for `list_database_roles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_database_roles + ## + # RPC-specific configuration for `add_split_points` + # @return [::Gapic::Config::Method] + # + attr_reader :add_split_points + ## + # RPC-specific configuration for `create_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_schedule + ## + # RPC-specific configuration for `get_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_schedule + ## + # RPC-specific configuration for `update_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_schedule + ## + # RPC-specific configuration for `delete_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_schedule + ## + # RPC-specific configuration for `list_backup_schedules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_schedules + ## + # RPC-specific configuration for `internal_update_graph_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :internal_update_graph_operation + + # @private + def initialize parent_rpcs = nil + list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases + @list_databases = ::Gapic::Config::Method.new list_databases_config + create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database + @create_database = ::Gapic::Config::Method.new create_database_config + get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database + @get_database = ::Gapic::Config::Method.new get_database_config + update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database + @update_database = ::Gapic::Config::Method.new update_database_config + update_database_ddl_config = parent_rpcs.update_database_ddl if parent_rpcs.respond_to? :update_database_ddl + @update_database_ddl = ::Gapic::Config::Method.new update_database_ddl_config + drop_database_config = parent_rpcs.drop_database if parent_rpcs.respond_to? :drop_database + @drop_database = ::Gapic::Config::Method.new drop_database_config + get_database_ddl_config = parent_rpcs.get_database_ddl if parent_rpcs.respond_to? :get_database_ddl + @get_database_ddl = ::Gapic::Config::Method.new get_database_ddl_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup + @create_backup = ::Gapic::Config::Method.new create_backup_config + copy_backup_config = parent_rpcs.copy_backup if parent_rpcs.respond_to? :copy_backup + @copy_backup = ::Gapic::Config::Method.new copy_backup_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup + @update_backup = ::Gapic::Config::Method.new update_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 + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database + @restore_database = ::Gapic::Config::Method.new restore_database_config + list_database_operations_config = parent_rpcs.list_database_operations if parent_rpcs.respond_to? :list_database_operations + @list_database_operations = ::Gapic::Config::Method.new list_database_operations_config + list_backup_operations_config = parent_rpcs.list_backup_operations if parent_rpcs.respond_to? :list_backup_operations + @list_backup_operations = ::Gapic::Config::Method.new list_backup_operations_config + list_database_roles_config = parent_rpcs.list_database_roles if parent_rpcs.respond_to? :list_database_roles + @list_database_roles = ::Gapic::Config::Method.new list_database_roles_config + add_split_points_config = parent_rpcs.add_split_points if parent_rpcs.respond_to? :add_split_points + @add_split_points = ::Gapic::Config::Method.new add_split_points_config + create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule + @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config + get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule + @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config + update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule + @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config + delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule + @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config + list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules + @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config + internal_update_graph_operation_config = parent_rpcs.internal_update_graph_operation if parent_rpcs.respond_to? :internal_update_graph_operation + @internal_update_graph_operation = ::Gapic::Config::Method.new internal_update_graph_operation_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-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/credentials.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/credentials.rb new file mode 100644 index 000000000000..b3c941a3dbff --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/credentials.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 "googleauth" + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + module DatabaseAdmin + # Credentials for the DatabaseAdmin API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ] + self.env_vars = [ + "SPANNER_CREDENTIALS", + "SPANNER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPANNER_CREDENTIALS_JSON", + "SPANNER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb new file mode 100644 index 000000000000..f89774ba724e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb @@ -0,0 +1,845 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 Spanner + module Admin + module Database + module V1 + module DatabaseAdmin + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the DatabaseAdmin 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 DatabaseAdmin 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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Spanner::Admin::Database::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::Spanner::Admin::Database::V1::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 = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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 +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb new file mode 100644 index 000000000000..ca3d3e310737 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.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! + + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + module DatabaseAdmin + # Path helper methods for the DatabaseAdmin API. + module Paths + ## + # Create a fully-qualified Backup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/backups/{backup}` + # + # @param project [String] + # @param instance [String] + # @param backup [String] + # + # @return [::String] + def backup_path project:, instance:, backup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/backups/#{backup}" + end + + ## + # Create a fully-qualified BackupSchedule resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}` + # + # @param project [String] + # @param instance [String] + # @param database [String] + # @param schedule [String] + # + # @return [::String] + def backup_schedule_path project:, instance:, database:, schedule: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/databases/#{database}/backupSchedules/#{schedule}" + 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 Database resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/databases/{database}` + # + # @param project [String] + # @param instance [String] + # @param database [String] + # + # @return [::String] + def database_path project:, instance:, database: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/databases/#{database}" + end + + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}` + # + # @param project [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/instances/#{instance}" + end + + ## + # Create a fully-qualified InstancePartition resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + # + # @param project [String] + # @param instance [String] + # @param instance_partition [String] + # + # @return [::String] + def instance_partition_path project:, instance:, instance_partition: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/instancePartitions/#{instance_partition}" + end + + extend self + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest.rb new file mode 100644 index 000000000000..1d9a8d24707b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/spanner/admin/database/v1/version" + +require "google/cloud/spanner/admin/database/v1/database_admin/credentials" +require "google/cloud/spanner/admin/database/v1/database_admin/paths" +require "google/cloud/spanner/admin/database/v1/database_admin/rest/operations" +require "google/cloud/spanner/admin/database/v1/database_admin/rest/client" + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + ## + # Cloud Spanner Database Admin API + # + # The Cloud Spanner Database Admin API can be used to: + # * create, drop, and list databases + # * update the schema of pre-existing databases + # * create, delete, copy and list backups for a database + # * restore a database from an existing backup + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/spanner/admin/database/v1/database_admin/rest" + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + module DatabaseAdmin + # Client for the REST transport + module Rest + end + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/spanner/admin/database/v1/database_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb new file mode 100644 index 000000000000..666baf6f1c37 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb @@ -0,0 +1,3338 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/spanner/admin/database/v1/spanner_database_admin_pb" +require "google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub" + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + module DatabaseAdmin + module Rest + ## + # REST client for the DatabaseAdmin service. + # + # Cloud Spanner Database Admin API + # + # The Cloud Spanner Database Admin API can be used to: + # * create, drop, and list databases + # * update the schema of pre-existing databases + # * create, delete, copy and list backups for a database + # * restore a database from an existing backup + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :database_admin_stub + + ## + # Configure the DatabaseAdmin Client class. + # + # See {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DatabaseAdmin clients + # ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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", "Spanner", "Admin", "Database", "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_databases.timeout = 3600.0 + default_config.rpcs.list_databases.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_database.timeout = 3600.0 + + default_config.rpcs.get_database.timeout = 3600.0 + default_config.rpcs.get_database.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_database.timeout = 3600.0 + default_config.rpcs.update_database.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_database_ddl.timeout = 3600.0 + default_config.rpcs.update_database_ddl.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.drop_database.timeout = 3600.0 + default_config.rpcs.drop_database.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_database_ddl.timeout = 3600.0 + default_config.rpcs.get_database_ddl.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.set_iam_policy.timeout = 30.0 + + default_config.rpcs.get_iam_policy.timeout = 30.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.test_iam_permissions.timeout = 30.0 + + default_config.rpcs.create_backup.timeout = 3600.0 + + default_config.rpcs.copy_backup.timeout = 3600.0 + + default_config.rpcs.get_backup.timeout = 3600.0 + default_config.rpcs.get_backup.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_backup.timeout = 3600.0 + default_config.rpcs.update_backup.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_backup.timeout = 3600.0 + default_config.rpcs.delete_backup.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_backups.timeout = 3600.0 + default_config.rpcs.list_backups.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.restore_database.timeout = 3600.0 + + default_config.rpcs.list_database_operations.timeout = 3600.0 + default_config.rpcs.list_database_operations.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_backup_operations.timeout = 3600.0 + default_config.rpcs.list_backup_operations.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_database_roles.timeout = 3600.0 + default_config.rpcs.list_database_roles.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.add_split_points.timeout = 3600.0 + default_config.rpcs.add_split_points.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_backup_schedule.timeout = 3600.0 + default_config.rpcs.create_backup_schedule.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_backup_schedule.timeout = 3600.0 + default_config.rpcs.get_backup_schedule.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_backup_schedule.timeout = 3600.0 + default_config.rpcs.update_backup_schedule.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_backup_schedule.timeout = 3600.0 + default_config.rpcs.delete_backup_schedule.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_backup_schedules.timeout = 3600.0 + default_config.rpcs.list_backup_schedules.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DatabaseAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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 + @database_admin_stub.universe_domain + end + + ## + # Create a new DatabaseAdmin REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DatabaseAdmin 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::Spanner::Admin::Database::V1::DatabaseAdmin::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 + + @database_admin_stub = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @database_admin_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @database_admin_stub.logger + end + + # Service calls + + ## + # Lists Cloud Spanner databases. + # + # @overload list_databases(request, options = nil) + # Pass arguments to `list_databases` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_databases(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_databases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance whose databases should be listed. + # Values are of the form `projects//instances/`. + # @param page_size [::Integer] + # Number of databases to be returned in the response. If 0 or less, + # defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new + # + # # Call the list_databases method. + # result = client.list_databases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Database. + # p item + # end + # + def list_databases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_databases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_databases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_databases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.list_databases request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_databases, "databases", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new Cloud Spanner database and starts to prepare it for serving. + # The returned {::Google::Longrunning::Operation long-running operation} will + # have a name of the format `/operations/` and + # can be used to track preparation of the database. The + # {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata CreateDatabaseMetadata}. + # The {::Google::Longrunning::Operation#response response} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful. + # + # @overload create_database(request, options = nil) + # Pass arguments to `create_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_database(parent: nil, create_statement: nil, extra_statements: nil, encryption_config: nil, database_dialect: nil, proto_descriptors: nil) + # Pass arguments to `create_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance that will serve the new database. + # Values are of the form `projects//instances/`. + # @param create_statement [::String] + # Required. A `CREATE DATABASE` statement, which specifies the ID of the + # new database. The database ID must conform to the regular expression + # `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. + # If the database ID is a reserved word or if it contains a hyphen, the + # database ID must be enclosed in backticks (`` ` ``). + # @param extra_statements [::Array<::String>] + # Optional. A list of DDL statements to run inside the newly created + # database. Statements can create tables, indexes, etc. These + # statements execute atomically with the creation of the database: + # if there is an error in any statement, the database is not created. + # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig, ::Hash] + # Optional. The encryption configuration for the database. If this field is + # not specified, Cloud Spanner will encrypt/decrypt all data at rest using + # Google default encryption. + # @param database_dialect [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] + # Optional. The dialect of the Cloud Spanner Database. + # @param proto_descriptors [::String] + # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in + # 'extra_statements' above. + # Contains a protobuf-serialized + # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + # To generate it, [install](https://grpc.io/docs/protoc-installation/) and + # run `protoc` with --include_imports and --descriptor_set_out. For example, + # to generate for moon/shot/app.proto, run + # ``` + # $protoc --proto_path=/app_path --proto_path=/lib_path \ + # --include_imports \ + # --descriptor_set_out=descriptors.data \ + # moon/shot/app.proto + # ``` + # For more details, see protobuffer [self + # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new + # + # # Call the create_database method. + # result = client.create_database request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest + + # Converts hash and nil to an 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_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.create_database request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 state of a Cloud Spanner database. + # + # @overload get_database(request, options = nil) + # Pass arguments to `get_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_database(name: nil) + # Pass arguments to `get_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 database. Values are of the form + # `projects//instances//databases/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Database] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new + # + # # Call the get_database method. + # result = client.get_database request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Database. + # p result + # + def get_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.get_database request, 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 Cloud Spanner database. The returned + # {::Google::Longrunning::Operation long-running operation} can be used to track + # the progress of updating the database. If the named database does not + # exist, returns `NOT_FOUND`. + # + # While the operation is pending: + # + # * The database's + # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling} + # field is set to true. + # * Cancelling the operation is best-effort. If the cancellation succeeds, + # the operation metadata's + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata#cancel_time cancel_time} + # is set, the updates are reverted, and the operation terminates with a + # `CANCELLED` status. + # * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error + # until the pending operation is done (returns successfully or with + # error). + # * Reading the database via the API continues to give the pre-request + # values. + # + # Upon completion of the returned operation: + # + # * The new values are in effect and readable via the API. + # * The database's + # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling} + # field becomes false. + # + # The returned {::Google::Longrunning::Operation long-running operation} will + # have a name of the format + # `projects//instances//databases//operations/` + # and can be used to track the database modification. The + # {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata UpdateDatabaseMetadata}. + # The {::Google::Longrunning::Operation#response response} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful. + # + # @overload update_database(request, options = nil) + # Pass arguments to `update_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_database(database: nil, update_mask: nil) + # Pass arguments to `update_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::Google::Cloud::Spanner::Admin::Database::V1::Database, ::Hash] + # Required. The database to update. + # The `name` field of the database is of the form + # `projects//instances//databases/`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. Currently, only + # `enable_drop_protection` field can be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new + # + # # Call the update_database method. + # result = client.update_database request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest + + # Converts hash and nil to an 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_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.update_database request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 schema of a Cloud Spanner database by + # creating/altering/dropping tables, columns, indexes, etc. The returned + # {::Google::Longrunning::Operation long-running operation} will have a name of + # the format `/operations/` and can be used to + # track execution of the schema change(s). The + # {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlMetadata UpdateDatabaseDdlMetadata}. + # The operation has no response. + # + # @overload update_database_ddl(request, options = nil) + # Pass arguments to `update_database_ddl` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_database_ddl(database: nil, statements: nil, operation_id: nil, proto_descriptors: nil, throughput_mode: nil) + # Pass arguments to `update_database_ddl` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database to update. + # @param statements [::Array<::String>] + # Required. DDL statements to be applied to the database. + # @param operation_id [::String] + # If empty, the new update request is assigned an + # automatically-generated operation ID. Otherwise, `operation_id` + # is used to construct the name of the resulting + # {::Google::Longrunning::Operation Operation}. + # + # Specifying an explicit operation ID simplifies determining + # whether the statements were executed in the event that the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client#update_database_ddl UpdateDatabaseDdl} + # call is replayed, or the return value is otherwise lost: the + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database} + # and `operation_id` fields can be combined to form the + # {::Google::Longrunning::Operation#name name} of the resulting + # {::Google::Longrunning::Operation longrunning.Operation}: + # `/operations/`. + # + # `operation_id` should be unique within the database, and must be + # a valid identifier: `[a-z][a-z0-9_]*`. Note that + # automatically-generated operation IDs always begin with an + # underscore. If the named operation already exists, + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client#update_database_ddl UpdateDatabaseDdl} + # returns `ALREADY_EXISTS`. + # @param proto_descriptors [::String] + # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. + # Contains a protobuf-serialized + # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + # To generate it, [install](https://grpc.io/docs/protoc-installation/) and + # run `protoc` with --include_imports and --descriptor_set_out. For example, + # to generate for moon/shot/app.proto, run + # ``` + # $protoc --proto_path=/app_path --proto_path=/lib_path \ + # --include_imports \ + # --descriptor_set_out=descriptors.data \ + # moon/shot/app.proto + # ``` + # For more details, see protobuffer [self + # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + # @param throughput_mode [::Boolean] + # Optional. This field is exposed to be used by the Spanner Migration Tool. + # For more details, see + # [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new + # + # # Call the update_database_ddl method. + # result = client.update_database_ddl request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_database_ddl request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest + + # Converts hash and nil to an 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_database_ddl.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_database_ddl.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_database_ddl.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.update_database_ddl request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Drops (aka deletes) a Cloud Spanner database. + # Completed backups for the database will be retained according to their + # `expire_time`. + # Note: Cloud Spanner might continue to accept requests for a few seconds + # after the database has been deleted. + # + # @overload drop_database(request, options = nil) + # Pass arguments to `drop_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload drop_database(database: nil) + # Pass arguments to `drop_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database to be dropped. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new + # + # # Call the drop_database method. + # result = client.drop_database request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def drop_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.drop_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.drop_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.drop_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.drop_database request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the schema of a Cloud Spanner database as a list of formatted + # DDL statements. This method does not show pending schema updates, those may + # be queried using the Operations API. + # + # @overload get_database_ddl(request, options = nil) + # Pass arguments to `get_database_ddl` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_database_ddl(database: nil) + # Pass arguments to `get_database_ddl` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database whose schema we wish to get. + # Values are of the form + # `projects//instances//databases/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new + # + # # Call the get_database_ddl method. + # result = client.get_database_ddl request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse. + # p result + # + def get_database_ddl request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_database_ddl.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_database_ddl.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_database_ddl.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.get_database_ddl request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on a database or backup resource. + # Replaces any existing policy. + # + # Authorization requires `spanner.databases.setIamPolicy` + # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + # For backups, authorization requires `spanner.backups.setIamPolicy` + # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a database or backup resource. + # Returns an empty policy if a database or backup exists but does not have a + # policy set. + # + # Authorization requires `spanner.databases.getIamPolicy` permission on + # [resource][google.iam.v1.GetIamPolicyRequest.resource]. + # For backups, authorization requires `spanner.backups.getIamPolicy` + # permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that the caller has on the specified database or backup + # resource. + # + # Attempting this RPC on a non-existent Cloud Spanner database will + # result in a NOT_FOUND error if the user has + # `spanner.databases.list` permission on the containing Cloud + # Spanner instance. Otherwise returns an empty set of permissions. + # Calling this method on a backup that does not exist will + # result in a NOT_FOUND error if the user has + # `spanner.backups.list` permission on the containing instance. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts creating a new Cloud Spanner Backup. + # The returned backup {::Google::Longrunning::Operation long-running operation} + # will have a name of the format + # `projects//instances//backups//operations/` + # and can be used to track creation of the backup. The + # {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. + # The {::Google::Longrunning::Operation#response response} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. + # Cancelling the returned operation will stop the creation and delete the + # backup. There can be only one pending backup creation per database. Backup + # creation of different databases can run concurrently. + # + # @overload create_backup(request, options = nil) + # Pass arguments to `create_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_backup(parent: nil, backup_id: nil, backup: nil, encryption_config: nil) + # Pass arguments to `create_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 parent [::String] + # Required. The name of the instance in which the backup will be + # created. This must be the same instance that contains the database the + # backup will be created from. The backup will be stored in the + # location(s) specified in the instance configuration of this + # instance. Values are of the form + # `projects//instances/`. + # @param backup_id [::String] + # Required. The id of the backup to be created. The `backup_id` appended to + # `parent` forms the full backup name of the form + # `projects//instances//backups/`. + # @param backup [::Google::Cloud::Spanner::Admin::Database::V1::Backup, ::Hash] + # Required. The backup to create. + # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig, ::Hash] + # Optional. The encryption configuration used to encrypt the backup. If this + # field is not specified, the backup will use the same encryption + # configuration as the database by default, namely + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} + # = `USE_DATABASE_ENCRYPTION`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new + # + # # Call the create_backup method. + # result = client.create_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 create_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest + + # Converts hash and nil to an 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_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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.create_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 + + ## + # Starts copying a Cloud Spanner Backup. + # The returned backup {::Google::Longrunning::Operation long-running operation} + # will have a name of the format + # `projects//instances//backups//operations/` + # and can be used to track copying of the backup. The operation is associated + # with the destination backup. + # The {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. + # The {::Google::Longrunning::Operation#response response} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. + # Cancelling the returned operation will stop the copying and delete the + # destination backup. Concurrent CopyBackup requests can run on the same + # source backup. + # + # @overload copy_backup(request, options = nil) + # Pass arguments to `copy_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload copy_backup(parent: nil, backup_id: nil, source_backup: nil, expire_time: nil, encryption_config: nil) + # Pass arguments to `copy_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 parent [::String] + # Required. The name of the destination instance that will contain the backup + # copy. Values are of the form: `projects//instances/`. + # @param backup_id [::String] + # Required. The id of the backup copy. + # The `backup_id` appended to `parent` forms the full backup_uri of the form + # `projects//instances//backups/`. + # @param source_backup [::String] + # Required. The source backup to be copied. + # The source backup needs to be in READY state for it to be copied. + # Once CopyBackup is in progress, the source backup cannot be deleted or + # cleaned up on expiration until CopyBackup is finished. + # Values are of the form: + # `projects//instances//backups/`. + # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The expiration time of the backup in microsecond granularity. + # The expiration time must be at least 6 hours and at most 366 days + # from the `create_time` of the source backup. Once the `expire_time` has + # passed, the backup is eligible to be automatically deleted by Cloud Spanner + # to free the resources used by the backup. + # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig, ::Hash] + # Optional. The encryption configuration used to encrypt the backup. If this + # field is not specified, the backup will use the same encryption + # configuration as the source backup by default, namely + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} + # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new + # + # # Call the copy_backup method. + # result = client.copy_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 copy_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.copy_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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.copy_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.copy_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.copy_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 + + ## + # Gets metadata on a pending or completed + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::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. Name of the backup. + # Values are of the form + # `projects//instances//backups/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @database_admin_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 + + ## + # Updates a pending or completed + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. + # + # @overload update_backup(request, options = nil) + # Pass arguments to `update_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_backup(backup: nil, update_mask: nil) + # Pass arguments to `update_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 backup [::Google::Cloud::Spanner::Admin::Database::V1::Backup, ::Hash] + # Required. The backup to update. `backup.name`, and the fields to be updated + # as specified by `update_mask` are required. Other fields are ignored. + # Update is only supported for the following fields: + # * `backup.expire_time`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields (e.g. `expire_time`) in the + # Backup resource should be updated. This mask is relative to the Backup + # resource, not to the request message. The field mask must always be + # specified; this prevents any future fields from being erased accidentally + # by clients that do not know about them. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new + # + # # Call the update_backup method. + # result = client.update_backup request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. + # p result + # + def update_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest + + # Converts hash and nil to an 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_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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.update_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 pending or completed + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::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) + # 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. Name of the backup to delete. + # Values are of the form + # `projects//instances//backups/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @database_admin_stub.delete_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 + + ## + # Lists completed and pending backups. + # Backups returned are ordered by `create_time` in descending order, + # starting from the most recent `create_time`. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::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, filter: 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 instance to list backups from. Values are of the + # form `projects//instances/`. + # @param filter [::String] + # An expression that filters the list of returned backups. + # + # A filter expression consists of a field name, a comparison operator, and a + # value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup} are eligible for + # filtering: + # + # * `name` + # * `database` + # * `state` + # * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + # * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + # * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + # * `size_bytes` + # * `backup_schedules` + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic, but + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `name:Howl` - The backup's name contains the string "howl". + # * `database:prod` + # - The database's name contains the string "prod". + # * `state:CREATING` - The backup is pending creation. + # * `state:READY` - The backup is fully created and ready for use. + # * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + # - The backup name contains the string "howl" and `create_time` + # of the backup is before 2018-03-28T14:50:00Z. + # * `expire_time < \"2018-03-28T14:50:00Z\"` + # - The backup `expire_time` is before 2018-03-28T14:50:00Z. + # * `size_bytes > 10000000000` - The backup's size is greater than 10GB + # * `backup_schedules:daily` + # - The backup is created from a schedule with "daily" in its name. + # @param page_size [::Integer] + # Number of backups to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse ListBackupsResponse} + # to the same `parent` and with the same `filter`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @database_admin_stub.list_backups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @database_admin_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 + + ## + # Create a new database by restoring from a completed backup. The new + # database must be in the same project and in an instance with the same + # instance configuration as the instance containing + # the backup. The returned database [long-running + # operation][google.longrunning.Operation] has a name of the format + # `projects//instances//databases//operations/`, + # and can be used to track the progress of the operation, and to cancel it. + # The {::Google::Longrunning::Operation#metadata metadata} field type is + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. + # The {::Google::Longrunning::Operation#response response} type + # is {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if + # successful. Cancelling the returned operation will stop the restore and + # delete the database. + # There can be only one database being restored into an instance at a time. + # Once the restore operation completes, a new restore operation can be + # initiated, without waiting for the optimize operation associated with the + # first restore to complete. + # + # @overload restore_database(request, options = nil) + # Pass arguments to `restore_database` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload restore_database(parent: nil, database_id: nil, backup: nil, encryption_config: nil) + # Pass arguments to `restore_database` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance in which to create the + # restored database. This instance must be in the same project and + # have the same instance configuration as the instance containing + # the source backup. Values are of the form + # `projects//instances/`. + # @param database_id [::String] + # Required. The id of the database to create and restore to. This + # database must not already exist. The `database_id` appended to + # `parent` forms the full database name of the form + # `projects//instances//databases/`. + # @param backup [::String] + # Name of the backup from which to restore. Values are of the form + # `projects//instances//backups/`. + # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig, ::Hash] + # Optional. An encryption configuration describing the encryption type and + # key resources in Cloud KMS used to encrypt/decrypt the database to restore + # to. If this field is not specified, the restored database will use the same + # encryption configuration as the backup by default, namely + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} + # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new + # + # # Call the restore_database method. + # result = client.restore_database request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def restore_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.restore_database.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.restore_database.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_database.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.restore_database request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 database {::Google::Longrunning::Operation longrunning-operations}. + # A database operation has a name of the form + # `projects//instances//databases//operations/`. + # The long-running operation + # {::Google::Longrunning::Operation#metadata metadata} field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. + # + # @overload list_database_operations(request, options = nil) + # Pass arguments to `list_database_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_database_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_database_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance of the database operations. + # Values are of the form `projects//instances/`. + # @param filter [::String] + # An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the {::Google::Longrunning::Operation Operation} + # are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} + # is + # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ + # `(metadata.source_type:BACKUP) AND` \ + # `(metadata.backup_info.backup:backup_howl) AND` \ + # `(metadata.name:restored_howl) AND` \ + # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. + # * The database is restored from a backup. + # * The backup name contains "backup_howl". + # * The restored database's name contains "restored_howl". + # * The operation started before 2018-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse ListDatabaseOperationsResponse} + # to the same `parent` and with the same `filter`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new + # + # # Call the list_database_operations method. + # result = client.list_database_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_database_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_database_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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_database_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_database_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.list_database_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_database_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 + + ## + # Lists the backup {::Google::Longrunning::Operation long-running operations} in + # the given instance. A backup operation has a name of the form + # `projects//instances//backups//operations/`. + # The long-running operation + # {::Google::Longrunning::Operation#metadata metadata} field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.progress.start_time` in descending order starting + # from the most recently started operation. + # + # @overload list_backup_operations(request, options = nil) + # Pass arguments to `list_backup_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance of the backup operations. Values are of + # the form `projects//instances/`. + # @param filter [::String] + # An expression that filters the list of returned backup operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the {::Google::Longrunning::Operation operation} + # are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} + # is + # `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic, but + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + # `metadata.database:prod` - Returns operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. + # * The source database name of backup contains the string "prod". + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + # `(metadata.name:howl) AND` \ + # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Returns operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. + # * The backup name contains the string "howl". + # * The operation started before 2018-03-28T14:50:00Z. + # * The operation resulted in an error. + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ + # `(metadata.source_backup:test) AND` \ + # `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ + # `(error:*)` - Returns operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. + # * The source backup name contains the string "test". + # * The operation started before 2022-01-18T14:50:00Z. + # * The operation resulted in an error. + # * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + # `(metadata.database:test_db)) OR` \ + # `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) + # AND` \ + # `(metadata.source_backup:test_bkp)) AND` \ + # `(error:*)` - Returns operations where: + # * The operation's metadata matches either of criteria: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} + # AND the source database name of the backup contains the string + # "test_db" + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata} + # AND the source backup name contains the string "test_bkp" + # * The operation resulted in an error. + # @param page_size [::Integer] + # Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse ListBackupOperationsResponse} + # to the same `parent` and with the same `filter`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new + # + # # Call the list_backup_operations method. + # result = client.list_backup_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_backup_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest + + # Converts hash and nil to an options 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_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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.list_backup_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_backup_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 + + ## + # Lists Cloud Spanner database roles. + # + # @overload list_database_roles(request, options = nil) + # Pass arguments to `list_database_roles` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_database_roles(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_database_roles` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The database whose roles should be listed. + # Values are of the form + # `projects//instances//databases/`. + # @param page_size [::Integer] + # Number of database roles to be returned in the response. If 0 or less, + # defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse ListDatabaseRolesResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new + # + # # Call the list_database_roles method. + # result = client.list_database_roles request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole. + # p item + # end + # + def list_database_roles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_database_roles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_database_roles.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_database_roles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.list_database_roles request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_database_roles, "database_roles", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds split points to specified tables, indexes of a database. + # + # @overload add_split_points(request, options = nil) + # Pass arguments to `add_split_points` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_split_points(database: nil, split_points: nil, initiator: nil) + # Pass arguments to `add_split_points` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database on whose tables/indexes split points are to be + # added. Values are of the form + # `projects//instances//databases/`. + # @param split_points [::Array<::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints, ::Hash>] + # Required. The split points to add. + # @param initiator [::String] + # Optional. A user-supplied tag associated with the split points. + # For example, "intital_data_load", "special_event_1". + # Defaults to "CloudAddSplitPointsAPI" if not specified. + # The length of the tag must not exceed 50 characters,else will be trimmed. + # Only valid UTF8 characters are allowed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new + # + # # Call the add_split_points method. + # result = client.add_split_points request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse. + # p result + # + def add_split_points request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_split_points.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_split_points.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_split_points.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.add_split_points request, 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 backup schedule. + # + # @overload create_backup_schedule(request, options = nil) + # Pass arguments to `create_backup_schedule` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_backup_schedule(parent: nil, backup_schedule_id: nil, backup_schedule: nil) + # Pass arguments to `create_backup_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 database that this backup schedule applies to. + # @param backup_schedule_id [::String] + # Required. The Id to use for the backup schedule. The `backup_schedule_id` + # appended to `parent` forms the full backup schedule name of the form + # `projects//instances//databases//backupSchedules/`. + # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash] + # Required. The backup schedule to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new + # + # # Call the create_backup_schedule method. + # result = client.create_backup_schedule request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + # p result + # + def create_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest + + # Converts hash and nil to an 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_backup_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.create_backup_schedule request, 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 backup schedule for the input schedule name. + # + # @overload get_backup_schedule(request, options = nil) + # Pass arguments to `get_backup_schedule` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_schedule(name: nil) + # Pass arguments to `get_backup_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 schedule to retrieve. + # Values are of the form + # `projects//instances//databases//backupSchedules/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new + # + # # Call the get_backup_schedule method. + # result = client.get_backup_schedule request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + # p result + # + def get_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest + + # Converts hash and nil to an options 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_schedule.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.get_backup_schedule request, 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 backup schedule. + # + # @overload update_backup_schedule(request, options = nil) + # Pass arguments to `update_backup_schedule` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_backup_schedule(backup_schedule: nil, update_mask: nil) + # Pass arguments to `update_backup_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash] + # Required. The backup schedule to update. `backup_schedule.name`, and the + # fields to be updated as specified by `update_mask` are required. Other + # fields are ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in the BackupSchedule resource + # should be updated. This mask is relative to the BackupSchedule resource, + # not to the request message. The field mask must always be + # specified; this prevents any future fields from being erased + # accidentally. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new + # + # # Call the update_backup_schedule method. + # result = client.update_backup_schedule request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + # p result + # + def update_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest + + # Converts hash and nil to an 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_backup_schedule.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_backup_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.update_backup_schedule request, 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 backup schedule. + # + # @overload delete_backup_schedule(request, options = nil) + # Pass arguments to `delete_backup_schedule` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_schedule(name: nil) + # Pass arguments to `delete_backup_schedule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 schedule to delete. + # Values are of the form + # `projects//instances//databases//backupSchedules/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new + # + # # Call the delete_backup_schedule method. + # result = client.delete_backup_schedule request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_backup_schedule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest + + # Converts hash and nil to an options 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_schedule.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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_schedule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup_schedule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.delete_backup_schedule request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the backup schedules for the database. + # + # @overload list_backup_schedules(request, options = nil) + # Pass arguments to `list_backup_schedules` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_schedules(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_schedules` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Database is the parent resource whose backup schedules should be + # listed. Values are of the form + # projects//instances//databases/ + # @param page_size [::Integer] + # Optional. Number of backup schedules to be returned in the response. If 0 + # or less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # Optional. If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse ListBackupSchedulesResponse} + # to the same `parent`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/database/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.new + # + # # Call the list_backup_schedules method. + # result = client.list_backup_schedules request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + # p item + # end + # + def list_backup_schedules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest + + # Converts hash and nil to an options 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_schedules.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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_schedules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_schedules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @database_admin_stub.list_backup_schedules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_backup_schedules, "backup_schedules", request, result, 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 DatabaseAdmin REST API. + # + # This class represents the configuration for DatabaseAdmin REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_databases to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_databases.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_databases.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DatabaseAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_databases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_databases + ## + # RPC-specific configuration for `create_database` + # @return [::Gapic::Config::Method] + # + attr_reader :create_database + ## + # RPC-specific configuration for `get_database` + # @return [::Gapic::Config::Method] + # + attr_reader :get_database + ## + # RPC-specific configuration for `update_database` + # @return [::Gapic::Config::Method] + # + attr_reader :update_database + ## + # RPC-specific configuration for `update_database_ddl` + # @return [::Gapic::Config::Method] + # + attr_reader :update_database_ddl + ## + # RPC-specific configuration for `drop_database` + # @return [::Gapic::Config::Method] + # + attr_reader :drop_database + ## + # RPC-specific configuration for `get_database_ddl` + # @return [::Gapic::Config::Method] + # + attr_reader :get_database_ddl + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `create_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup + ## + # RPC-specific configuration for `copy_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :copy_backup + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `update_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `restore_database` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_database + ## + # RPC-specific configuration for `list_database_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_database_operations + ## + # RPC-specific configuration for `list_backup_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_operations + ## + # RPC-specific configuration for `list_database_roles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_database_roles + ## + # RPC-specific configuration for `add_split_points` + # @return [::Gapic::Config::Method] + # + attr_reader :add_split_points + ## + # RPC-specific configuration for `create_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_backup_schedule + ## + # RPC-specific configuration for `get_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_schedule + ## + # RPC-specific configuration for `update_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_backup_schedule + ## + # RPC-specific configuration for `delete_backup_schedule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup_schedule + ## + # RPC-specific configuration for `list_backup_schedules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_schedules + + # @private + def initialize parent_rpcs = nil + list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases + @list_databases = ::Gapic::Config::Method.new list_databases_config + create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database + @create_database = ::Gapic::Config::Method.new create_database_config + get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database + @get_database = ::Gapic::Config::Method.new get_database_config + update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database + @update_database = ::Gapic::Config::Method.new update_database_config + update_database_ddl_config = parent_rpcs.update_database_ddl if parent_rpcs.respond_to? :update_database_ddl + @update_database_ddl = ::Gapic::Config::Method.new update_database_ddl_config + drop_database_config = parent_rpcs.drop_database if parent_rpcs.respond_to? :drop_database + @drop_database = ::Gapic::Config::Method.new drop_database_config + get_database_ddl_config = parent_rpcs.get_database_ddl if parent_rpcs.respond_to? :get_database_ddl + @get_database_ddl = ::Gapic::Config::Method.new get_database_ddl_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup + @create_backup = ::Gapic::Config::Method.new create_backup_config + copy_backup_config = parent_rpcs.copy_backup if parent_rpcs.respond_to? :copy_backup + @copy_backup = ::Gapic::Config::Method.new copy_backup_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup + @update_backup = ::Gapic::Config::Method.new update_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 + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database + @restore_database = ::Gapic::Config::Method.new restore_database_config + list_database_operations_config = parent_rpcs.list_database_operations if parent_rpcs.respond_to? :list_database_operations + @list_database_operations = ::Gapic::Config::Method.new list_database_operations_config + list_backup_operations_config = parent_rpcs.list_backup_operations if parent_rpcs.respond_to? :list_backup_operations + @list_backup_operations = ::Gapic::Config::Method.new list_backup_operations_config + list_database_roles_config = parent_rpcs.list_database_roles if parent_rpcs.respond_to? :list_database_roles + @list_database_roles = ::Gapic::Config::Method.new list_database_roles_config + add_split_points_config = parent_rpcs.add_split_points if parent_rpcs.respond_to? :add_split_points + @add_split_points = ::Gapic::Config::Method.new add_split_points_config + create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule + @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config + get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule + @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config + update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule + @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config + delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule + @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config + list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules + @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/operations.rb new file mode 100644 index 000000000000..6b9abe99cdd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/operations.rb @@ -0,0 +1,1012 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 Spanner + module Admin + module Database + module V1 + module DatabaseAdmin + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the DatabaseAdmin 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 DatabaseAdmin 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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Database::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/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/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/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/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb new file mode 100644 index 000000000000..1322d594b811 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb @@ -0,0 +1,1740 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/spanner/admin/database/v1/spanner_database_admin_pb" + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + module DatabaseAdmin + module Rest + ## + # REST service stub for the DatabaseAdmin 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_databases REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse] + # A result object deserialized from the server's reply + def list_databases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_databases_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_databases", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.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_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_database_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_database", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Database] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database] + # A result object deserialized from the server's reply + def get_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_database_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_database", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::Database.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_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_database_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_database", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_database_ddl REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_database_ddl request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_database_ddl_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_database_ddl", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the drop_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def drop_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_drop_database_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "drop_database", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_database_ddl REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] + # A result object deserialized from the server's reply + def get_database_ddl request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_database_ddl_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_database_ddl", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_backup REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_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: "create_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 copy_backup REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def copy_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_copy_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: "copy_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 get_backup REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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 update_backup REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # A result object deserialized from the server's reply + def update_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_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: "update_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # 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::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::ListBackupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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 restore_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def restore_database request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_database_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "restore_database", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_database_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse] + # A result object deserialized from the server's reply + def list_database_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_database_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_database_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.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_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse] + # A result object deserialized from the server's reply + def list_backup_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_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_backup_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.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_database_roles REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse] + # A result object deserialized from the server's reply + def list_database_roles request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_database_roles_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_database_roles", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_split_points REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] + # A result object deserialized from the server's reply + def add_split_points request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_split_points_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_split_points", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse.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_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # A result object deserialized from the server's reply + def create_backup_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_backup_schedule_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_backup_schedule", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.decode_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_schedule REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # A result object deserialized from the server's reply + def get_backup_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_schedule_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |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_schedule", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.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_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # A result object deserialized from the server's reply + def update_backup_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_backup_schedule_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_backup_schedule", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.decode_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_schedule REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_backup_schedule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_schedule_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |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_schedule", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backup_schedules REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse] + # A result object deserialized from the server's reply + def list_backup_schedules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_schedules_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |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_schedules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse.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_databases REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_databases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/databases", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest] + # 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_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/databases", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest] + # 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_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{database.name}", + body: "database", + matches: [ + ["database.name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_database_ddl REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest] + # 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_database_ddl_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{database}/ddl", + body: "*", + matches: [ + ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the drop_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_drop_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{database}", + matches: [ + ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_database_ddl REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_database_ddl_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{database}/ddl", + matches: [ + ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/databaseRoles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_backup REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest] + # 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_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/backups", + body: "backup", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the copy_backup REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_copy_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/backups:copy", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_backup REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest] + # 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_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{backup.name}", + body: "backup", + matches: [ + ["backup.name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_database REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_restore_database_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/databases:restore", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_database_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_database_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/databaseOperations", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest] + # A 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_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/backupOperations", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_database_roles REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_database_roles_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/databaseRoles", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_split_points REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_split_points_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{database}:addSplitPoints", + body: "*", + matches: [ + ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest] + # 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_backup_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/backupSchedules", + body: "backup_schedule", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest] + # A 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_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest] + # 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_backup_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{backup_schedule.name}", + body: "backup_schedule", + matches: [ + ["backup_schedule.name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup_schedule REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest] + # A 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_schedule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_schedules REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest] + # A 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_schedules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/backupSchedules", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/rest.rb new file mode 100644 index 000000000000..d33ad82d059e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/rest.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/spanner/admin/database/v1/database_admin/rest" +require "google/cloud/spanner/admin/database/v1/version" + +module Google + module Cloud + module Spanner + module Admin + module Database + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/spanner/admin/database/v1/rest" + # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new + # + module V1 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/version.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/version.rb new file mode 100644 index 000000000000..112d0b089460 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/version.rb @@ -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! + + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + VERSION = "0.0.1" + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_pb.rb new file mode 100644 index 000000000000..6435707649ba --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/admin/database/v1/backup.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/spanner/admin/database/v1/common_pb' + + +descriptor_data = "\n-google/spanner/admin/database/v1/backup.proto\x12 google.spanner.admin.database.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a-google/spanner/admin/database/v1/common.proto\"\xed\t\n\x06\x42\x61\x63kup\x12\x36\n\x08\x64\x61tabase\x18\x02 \x01(\tB$\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x30\n\x0cversion_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12 \n\x13\x66reeable_size_bytes\x18\x0f \x01(\x03\x42\x03\xe0\x41\x03\x12!\n\x14\x65xclusive_size_bytes\x18\x10 \x01(\x03\x42\x03\xe0\x41\x03\x12\x42\n\x05state\x18\x06 \x01(\x0e\x32..google.spanner.admin.database.v1.Backup.StateB\x03\xe0\x41\x03\x12\x46\n\x15referencing_databases\x18\x07 \x03(\tB\'\xe0\x41\x03\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12N\n\x0f\x65ncryption_info\x18\x08 \x01(\x0b\x32\x30.google.spanner.admin.database.v1.EncryptionInfoB\x03\xe0\x41\x03\x12U\n\x16\x65ncryption_information\x18\r \x03(\x0b\x32\x30.google.spanner.admin.database.v1.EncryptionInfoB\x03\xe0\x41\x03\x12P\n\x10\x64\x61tabase_dialect\x18\n \x01(\x0e\x32\x31.google.spanner.admin.database.v1.DatabaseDialectB\x03\xe0\x41\x03\x12\x42\n\x13referencing_backups\x18\x0b \x03(\tB%\xe0\x41\x03\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x38\n\x0fmax_expire_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x10\x62\x61\x63kup_schedules\x18\x0e \x03(\tB-\xe0\x41\x03\xfa\x41\'\n%spanner.googleapis.com/BackupSchedule\x12(\n\x1bincremental_backup_chain_id\x18\x11 \x01(\tB\x03\xe0\x41\x03\x12<\n\x13oldest_version_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12[\n\x13instance_partitions\x18\x13 \x03(\x0b\x32\x39.google.spanner.admin.database.v1.BackupInstancePartitionB\x03\xe0\x41\x03\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02:\\\xea\x41Y\n\x1dspanner.googleapis.com/Backup\x12\x38projects/{project}/instances/{instance}/backups/{backup}\"\x85\x02\n\x13\x43reateBackupRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x16\n\tbackup_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x62\x61\x63kup\x18\x03 \x01(\x0b\x32(.google.spanner.admin.database.v1.BackupB\x03\xe0\x41\x02\x12^\n\x11\x65ncryption_config\x18\x04 \x01(\x0b\x32>.google.spanner.admin.database.v1.CreateBackupEncryptionConfigB\x03\xe0\x41\x01\"\xf8\x01\n\x14\x43reateBackupMetadata\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x36\n\x08\x64\x61tabase\x18\x02 \x01(\tB$\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x45\n\x08progress\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.database.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb6\x02\n\x11\x43opyBackupRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x16\n\tbackup_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\rsource_backup\x18\x03 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x34\n\x0b\x65xpire_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\\\n\x11\x65ncryption_config\x18\x05 \x01(\x0b\x32<.google.spanner.admin.database.v1.CopyBackupEncryptionConfigB\x03\xe0\x41\x01\"\xf9\x01\n\x12\x43opyBackupMetadata\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x39\n\rsource_backup\x18\x02 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x45\n\x08progress\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.database.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8a\x01\n\x13UpdateBackupRequest\x12=\n\x06\x62\x61\x63kup\x18\x01 \x01(\x0b\x32(.google.spanner.admin.database.v1.BackupB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"G\n\x10GetBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\"J\n\x13\x44\x65leteBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\"\x84\x01\n\x12ListBackupsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"i\n\x13ListBackupsResponse\x12\x39\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32(.google.spanner.admin.database.v1.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8d\x01\n\x1bListBackupOperationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"j\n\x1cListBackupOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe2\x01\n\nBackupInfo\x12\x32\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x30\n\x0cversion_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12=\n\x0fsource_database\x18\x03 \x01(\tB$\xfa\x41!\n\x1fspanner.googleapis.com/Database\"\x9f\x03\n\x1c\x43reateBackupEncryptionConfig\x12k\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32M.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionTypeB\x03\xe0\x41\x02\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12@\n\rkms_key_names\x18\x03 \x03(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x8e\x01\n\x0e\x45ncryptionType\x12\x1f\n\x1b\x45NCRYPTION_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17USE_DATABASE_ENCRYPTION\x10\x01\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x02\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x03\"\xab\x03\n\x1a\x43opyBackupEncryptionConfig\x12i\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32K.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionTypeB\x03\xe0\x41\x02\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12@\n\rkms_key_names\x18\x03 \x03(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x9e\x01\n\x0e\x45ncryptionType\x12\x1f\n\x1b\x45NCRYPTION_TYPE_UNSPECIFIED\x10\x00\x12+\n\'USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION\x10\x01\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x02\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x03\"\x10\n\x0e\x46ullBackupSpec\"\x17\n\x15IncrementalBackupSpec\"d\n\x17\x42\x61\x63kupInstancePartition\x12I\n\x12instance_partition\x18\x01 \x01(\tB-\xfa\x41*\n(spanner.googleapis.com/InstancePartitionB\xfd\x01\n$com.google.spanner.admin.database.v1B\x0b\x42\x61\x63kupProtoP\x01ZFcloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb\xaa\x02&Google.Cloud.Spanner.Admin.Database.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Database\\V1\xea\x02+Google::Cloud::Spanner::Admin::Database::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Backup").msgclass + Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Backup.State").enummodule + CreateBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupRequest").msgclass + CreateBackupMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupMetadata").msgclass + CopyBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupRequest").msgclass + CopyBackupMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupMetadata").msgclass + UpdateBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateBackupRequest").msgclass + GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetBackupRequest").msgclass + DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DeleteBackupRequest").msgclass + ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupsRequest").msgclass + ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupsResponse").msgclass + ListBackupOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsRequest").msgclass + ListBackupOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsResponse").msgclass + BackupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupInfo").msgclass + CreateBackupEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig").msgclass + CreateBackupEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType").enummodule + CopyBackupEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupEncryptionConfig").msgclass + CopyBackupEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType").enummodule + FullBackupSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.FullBackupSpec").msgclass + IncrementalBackupSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.IncrementalBackupSpec").msgclass + BackupInstancePartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupInstancePartition").msgclass + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb new file mode 100644 index 000000000000..1a24f3b3670a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/admin/database/v1/backup_schedule.proto + +require 'google/protobuf' + +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' +require 'google/spanner/admin/database/v1/backup_pb' + + +descriptor_data = "\n6google/spanner/admin/database/v1/backup_schedule.proto\x12 google.spanner.admin.database.v1\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\x1a-google/spanner/admin/database/v1/backup.proto\"i\n\x12\x42\x61\x63kupScheduleSpec\x12\x42\n\tcron_spec\x18\x01 \x01(\x0b\x32-.google.spanner.admin.database.v1.CrontabSpecH\x00\x42\x0f\n\rschedule_spec\"\xa4\x05\n\x0e\x42\x61\x63kupSchedule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12G\n\x04spec\x18\x06 \x01(\x0b\x32\x34.google.spanner.admin.database.v1.BackupScheduleSpecB\x03\xe0\x41\x01\x12:\n\x12retention_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12^\n\x11\x65ncryption_config\x18\x04 \x01(\x0b\x32>.google.spanner.admin.database.v1.CreateBackupEncryptionConfigB\x03\xe0\x41\x01\x12L\n\x10\x66ull_backup_spec\x18\x07 \x01(\x0b\x32\x30.google.spanner.admin.database.v1.FullBackupSpecH\x00\x12Z\n\x17incremental_backup_spec\x18\x08 \x01(\x0b\x32\x37.google.spanner.admin.database.v1.IncrementalBackupSpecH\x00\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xa5\x01\xea\x41\xa1\x01\n%spanner.googleapis.com/BackupSchedule\x12Wprojects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}*\x0f\x62\x61\x63kupSchedules2\x0e\x62\x61\x63kupScheduleB\x12\n\x10\x62\x61\x63kup_type_spec\"q\n\x0b\x43rontabSpec\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\ttime_zone\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x37\n\x0f\x63reation_window\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\"\xc7\x01\n\x1b\x43reateBackupScheduleRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x1f\n\x12\x62\x61\x63kup_schedule_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0f\x62\x61\x63kup_schedule\x18\x03 \x01(\x0b\x32\x30.google.spanner.admin.database.v1.BackupScheduleB\x03\xe0\x41\x02\"W\n\x18GetBackupScheduleRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/BackupSchedule\"Z\n\x1b\x44\x65leteBackupScheduleRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/BackupSchedule\"\x86\x01\n\x1aListBackupSchedulesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x82\x01\n\x1bListBackupSchedulesResponse\x12J\n\x10\x62\x61\x63kup_schedules\x18\x01 \x03(\x0b\x32\x30.google.spanner.admin.database.v1.BackupSchedule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa3\x01\n\x1bUpdateBackupScheduleRequest\x12N\n\x0f\x62\x61\x63kup_schedule\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.database.v1.BackupScheduleB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x42\x85\x02\n$com.google.spanner.admin.database.v1B\x13\x42\x61\x63kupScheduleProtoP\x01ZFcloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb\xaa\x02&Google.Cloud.Spanner.Admin.Database.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Database\\V1\xea\x02+Google::Cloud::Spanner::Admin::Database::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + BackupScheduleSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupScheduleSpec").msgclass + BackupSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupSchedule").msgclass + CrontabSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CrontabSpec").msgclass + CreateBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupScheduleRequest").msgclass + GetBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetBackupScheduleRequest").msgclass + DeleteBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DeleteBackupScheduleRequest").msgclass + ListBackupSchedulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupSchedulesRequest").msgclass + ListBackupSchedulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupSchedulesResponse").msgclass + UpdateBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateBackupScheduleRequest").msgclass + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/common_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/common_pb.rb new file mode 100644 index 000000000000..407157236bdf --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/common_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/admin/database/v1/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n-google/spanner/admin/database/v1/common.proto\x12 google.spanner.admin.database.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x8b\x01\n\x11OperationProgress\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x01\n\x10\x45ncryptionConfig\x12<\n\x0ckms_key_name\x18\x02 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12=\n\rkms_key_names\x18\x03 \x03(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\xc2\x02\n\x0e\x45ncryptionInfo\x12S\n\x0f\x65ncryption_type\x18\x03 \x01(\x0e\x32\x35.google.spanner.admin.database.v1.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12\x32\n\x11\x65ncryption_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12I\n\x0fkms_key_version\x18\x02 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\\\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*\\\n\x0f\x44\x61tabaseDialect\x12 \n\x1c\x44\x41TABASE_DIALECT_UNSPECIFIED\x10\x00\x12\x17\n\x13GOOGLE_STANDARD_SQL\x10\x01\x12\x0e\n\nPOSTGRESQL\x10\x02\x42\xa2\x04\n$com.google.spanner.admin.database.v1B\x0b\x43ommonProtoP\x01ZFcloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb\xaa\x02&Google.Cloud.Spanner.Admin.Database.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Database\\V1\xea\x02+Google::Cloud::Spanner::Admin::Database::V1\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + OperationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OperationProgress").msgclass + EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionConfig").msgclass + EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo").msgclass + EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo.Type").enummodule + DatabaseDialect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DatabaseDialect").enummodule + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb new file mode 100644 index 000000000000..5cccf7377b63 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/admin/database/v1/spanner_database_admin.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/spanner/admin/database/v1/backup_pb' +require 'google/spanner/admin/database/v1/backup_schedule_pb' +require 'google/spanner/admin/database/v1/common_pb' + + +descriptor_data = "\n=google/spanner/admin/database/v1/spanner_database_admin.proto\x12 google.spanner.admin.database.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a-google/spanner/admin/database/v1/backup.proto\x1a\x36google/spanner/admin/database/v1/backup_schedule.proto\x1a-google/spanner/admin/database/v1/common.proto\"\xab\x01\n\x0bRestoreInfo\x12H\n\x0bsource_type\x18\x01 \x01(\x0e\x32\x33.google.spanner.admin.database.v1.RestoreSourceType\x12\x43\n\x0b\x62\x61\x63kup_info\x18\x02 \x01(\x0b\x32,.google.spanner.admin.database.v1.BackupInfoH\x00\x42\r\n\x0bsource_info\"\xca\x06\n\x08\x44\x61tabase\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x05state\x18\x02 \x01(\x0e\x32\x30.google.spanner.admin.database.v1.Database.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12H\n\x0crestore_info\x18\x04 \x01(\x0b\x32-.google.spanner.admin.database.v1.RestoreInfoB\x03\xe0\x41\x03\x12R\n\x11\x65ncryption_config\x18\x05 \x01(\x0b\x32\x32.google.spanner.admin.database.v1.EncryptionConfigB\x03\xe0\x41\x03\x12N\n\x0f\x65ncryption_info\x18\x08 \x03(\x0b\x32\x30.google.spanner.admin.database.v1.EncryptionInfoB\x03\xe0\x41\x03\x12%\n\x18version_retention_period\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12>\n\x15\x65\x61rliest_version_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x64\x65\x66\x61ult_leader\x18\t \x01(\tB\x03\xe0\x41\x03\x12P\n\x10\x64\x61tabase_dialect\x18\n \x01(\x0e\x32\x31.google.spanner.admin.database.v1.DatabaseDialectB\x03\xe0\x41\x03\x12\x1e\n\x16\x65nable_drop_protection\x18\x0b \x01(\x08\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\"M\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x14\n\x10READY_OPTIMIZING\x10\x03:b\xea\x41_\n\x1fspanner.googleapis.com/Database\x12\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/instances/*}/databases\x12\xa4\x02\n\x0e\x43reateDatabase\x12\x37.google.spanner.admin.database.v1.CreateDatabaseRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41\x64\n)google.spanner.admin.database.v1.Database\x12\x37google.spanner.admin.database.v1.CreateDatabaseMetadata\xda\x41\x17parent,create_statement\x82\xd3\xe4\x93\x02\x32\"-/v1/{parent=projects/*/instances/*}/databases:\x01*\x12\xad\x01\n\x0bGetDatabase\x12\x34.google.spanner.admin.database.v1.GetDatabaseRequest\x1a*.google.spanner.admin.database.v1.Database\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/instances/*/databases/*}\x12\xef\x01\n\x0eUpdateDatabase\x12\x37.google.spanner.admin.database.v1.UpdateDatabaseRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41\"\n\x08\x44\x61tabase\x12\x16UpdateDatabaseMetadata\xda\x41\x14\x64\x61tabase,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{database.name=projects/*/instances/*/databases/*}:\x08\x64\x61tabase\x12\x9d\x02\n\x11UpdateDatabaseDdl\x12:.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest\x1a\x1d.google.longrunning.Operation\"\xac\x01\xca\x41S\n\x15google.protobuf.Empty\x12:google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata\xda\x41\x13\x64\x61tabase,statements\x82\xd3\xe4\x93\x02:25/v1/{database=projects/*/instances/*/databases/*}/ddl:\x01*\x12\xa3\x01\n\x0c\x44ropDatabase\x12\x35.google.spanner.admin.database.v1.DropDatabaseRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02\x33*1/v1/{database=projects/*/instances/*/databases/*}\x12\xcd\x01\n\x0eGetDatabaseDdl\x12\x37.google.spanner.admin.database.v1.GetDatabaseDdlRequest\x1a\x38.google.spanner.admin.database.v1.GetDatabaseDdlResponse\"H\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{database=projects/*/instances/*/databases/*}/ddl\x12\xc2\x02\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xf6\x01\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\xdd\x01\">/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy:\x01*ZA\"/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy:\x01*ZA\".google.spanner.admin.database.v1.ListBackupOperationsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/instances/*}/backupOperations\x12\xdc\x01\n\x11ListDatabaseRoles\x12:.google.spanner.admin.database.v1.ListDatabaseRolesRequest\x1a;.google.spanner.admin.database.v1.ListDatabaseRolesResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles\x12\xe8\x01\n\x0e\x41\x64\x64SplitPoints\x12\x37.google.spanner.admin.database.v1.AddSplitPointsRequest\x1a\x38.google.spanner.admin.database.v1.AddSplitPointsResponse\"c\xda\x41\x15\x64\x61tabase,split_points\x82\xd3\xe4\x93\x02\x45\"@/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints:\x01*\x12\x8e\x02\n\x14\x43reateBackupSchedule\x12=.google.spanner.admin.database.v1.CreateBackupScheduleRequest\x1a\x30.google.spanner.admin.database.v1.BackupSchedule\"\x84\x01\xda\x41)parent,backup_schedule,backup_schedule_id\x82\xd3\xe4\x93\x02R\"?/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules:\x0f\x62\x61\x63kup_schedule\x12\xd1\x01\n\x11GetBackupSchedule\x12:.google.spanner.admin.database.v1.GetBackupScheduleRequest\x1a\x30.google.spanner.admin.database.v1.BackupSchedule\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}\x12\x90\x02\n\x14UpdateBackupSchedule\x12=.google.spanner.admin.database.v1.UpdateBackupScheduleRequest\x1a\x30.google.spanner.admin.database.v1.BackupSchedule\"\x86\x01\xda\x41\x1b\x62\x61\x63kup_schedule,update_mask\x82\xd3\xe4\x93\x02\x62\x32O/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}:\x0f\x62\x61\x63kup_schedule\x12\xbd\x01\n\x14\x44\x65leteBackupSchedule\x12=.google.spanner.admin.database.v1.DeleteBackupScheduleRequest\x1a\x16.google.protobuf.Empty\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41*?/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}\x12\xe4\x01\n\x13ListBackupSchedules\x12<.google.spanner.admin.database.v1.ListBackupSchedulesRequest\x1a=.google.spanner.admin.database.v1.ListBackupSchedulesResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules\x12\xc7\x01\n\x1cInternalUpdateGraphOperation\x12\x45.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest\x1a\x46.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse\"\x18\xda\x41\x15\x64\x61tabase,operation_id\x1ax\xca\x41\x16spanner.googleapis.com\xd2\x41\\https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.adminB\xd6\x03\n$com.google.spanner.admin.database.v1B\x19SpannerDatabaseAdminProtoP\x01ZFcloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb\xaa\x02&Google.Cloud.Spanner.Admin.Database.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Database\\V1\xea\x02+Google::Cloud::Spanner::Admin::Database::V1\xea\x41J\n\x1fspanner.googleapis.com/Instance\x12\'projects/{project}/instances/{instance}\xea\x41{\n(spanner.googleapis.com/InstancePartition\x12Oprojects/{project}/instances/{instance}/instancePartitions/{instance_partition}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + RestoreInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreInfo").msgclass + Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Database").msgclass + Database::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Database.State").enummodule + ListDatabasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabasesRequest").msgclass + ListDatabasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabasesResponse").msgclass + CreateDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateDatabaseRequest").msgclass + CreateDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateDatabaseMetadata").msgclass + GetDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseRequest").msgclass + UpdateDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseRequest").msgclass + UpdateDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseMetadata").msgclass + UpdateDatabaseDdlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseDdlRequest").msgclass + DdlStatementActionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DdlStatementActionInfo").msgclass + UpdateDatabaseDdlMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata").msgclass + DropDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DropDatabaseRequest").msgclass + GetDatabaseDdlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseDdlRequest").msgclass + GetDatabaseDdlResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseDdlResponse").msgclass + ListDatabaseOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsRequest").msgclass + ListDatabaseOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsResponse").msgclass + RestoreDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseRequest").msgclass + RestoreDatabaseEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig").msgclass + RestoreDatabaseEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType").enummodule + RestoreDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseMetadata").msgclass + OptimizeRestoredDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata").msgclass + DatabaseRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DatabaseRole").msgclass + ListDatabaseRolesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseRolesRequest").msgclass + ListDatabaseRolesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseRolesResponse").msgclass + AddSplitPointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.AddSplitPointsRequest").msgclass + AddSplitPointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.AddSplitPointsResponse").msgclass + SplitPoints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.SplitPoints").msgclass + SplitPoints::Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.SplitPoints.Key").msgclass + InternalUpdateGraphOperationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest").msgclass + InternalUpdateGraphOperationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse").msgclass + RestoreSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreSourceType").enummodule + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb new file mode 100644 index 000000000000..84dcc83177fd --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb @@ -0,0 +1,245 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/spanner/admin/database/v1/spanner_database_admin.proto for package 'Google.Cloud.Spanner.Admin.Database.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/spanner/admin/database/v1/spanner_database_admin_pb' + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + module DatabaseAdmin + # Cloud Spanner Database Admin API + # + # The Cloud Spanner Database Admin API can be used to: + # * create, drop, and list databases + # * update the schema of pre-existing databases + # * create, delete, copy and list backups for a database + # * restore a database from an existing backup + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.spanner.admin.database.v1.DatabaseAdmin' + + # Lists Cloud Spanner databases. + rpc :ListDatabases, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse + # Creates a new Cloud Spanner database and starts to prepare it for serving. + # The returned [long-running operation][google.longrunning.Operation] will + # have a name of the format `/operations/` and + # can be used to track preparation of the database. The + # [metadata][google.longrunning.Operation.metadata] field type is + # [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. + # The [response][google.longrunning.Operation.response] field type is + # [Database][google.spanner.admin.database.v1.Database], if successful. + rpc :CreateDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, ::Google::Longrunning::Operation + # Gets the state of a Cloud Spanner database. + rpc :GetDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Database + # Updates a Cloud Spanner database. The returned + # [long-running operation][google.longrunning.Operation] can be used to track + # the progress of updating the database. If the named database does not + # exist, returns `NOT_FOUND`. + # + # While the operation is pending: + # + # * The database's + # [reconciling][google.spanner.admin.database.v1.Database.reconciling] + # field is set to true. + # * Cancelling the operation is best-effort. If the cancellation succeeds, + # the operation metadata's + # [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] + # is set, the updates are reverted, and the operation terminates with a + # `CANCELLED` status. + # * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error + # until the pending operation is done (returns successfully or with + # error). + # * Reading the database via the API continues to give the pre-request + # values. + # + # Upon completion of the returned operation: + # + # * The new values are in effect and readable via the API. + # * The database's + # [reconciling][google.spanner.admin.database.v1.Database.reconciling] + # field becomes false. + # + # The returned [long-running operation][google.longrunning.Operation] will + # have a name of the format + # `projects//instances//databases//operations/` + # and can be used to track the database modification. The + # [metadata][google.longrunning.Operation.metadata] field type is + # [UpdateDatabaseMetadata][google.spanner.admin.database.v1.UpdateDatabaseMetadata]. + # The [response][google.longrunning.Operation.response] field type is + # [Database][google.spanner.admin.database.v1.Database], if successful. + rpc :UpdateDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, ::Google::Longrunning::Operation + # Updates the schema of a Cloud Spanner database by + # creating/altering/dropping tables, columns, indexes, etc. The returned + # [long-running operation][google.longrunning.Operation] will have a name of + # the format `/operations/` and can be used to + # track execution of the schema change(s). The + # [metadata][google.longrunning.Operation.metadata] field type is + # [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. + # The operation has no response. + rpc :UpdateDatabaseDdl, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, ::Google::Longrunning::Operation + # Drops (aka deletes) a Cloud Spanner database. + # Completed backups for the database will be retained according to their + # `expire_time`. + # Note: Cloud Spanner might continue to accept requests for a few seconds + # after the database has been deleted. + rpc :DropDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, ::Google::Protobuf::Empty + # Returns the schema of a Cloud Spanner database as a list of formatted + # DDL statements. This method does not show pending schema updates, those may + # be queried using the [Operations][google.longrunning.Operations] API. + rpc :GetDatabaseDdl, ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse + # Sets the access control policy on a database or backup resource. + # Replaces any existing policy. + # + # Authorization requires `spanner.databases.setIamPolicy` + # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + # For backups, authorization requires `spanner.backups.setIamPolicy` + # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets the access control policy for a database or backup resource. + # Returns an empty policy if a database or backup exists but does not have a + # policy set. + # + # Authorization requires `spanner.databases.getIamPolicy` permission on + # [resource][google.iam.v1.GetIamPolicyRequest.resource]. + # For backups, authorization requires `spanner.backups.getIamPolicy` + # permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that the caller has on the specified database or backup + # resource. + # + # Attempting this RPC on a non-existent Cloud Spanner database will + # result in a NOT_FOUND error if the user has + # `spanner.databases.list` permission on the containing Cloud + # Spanner instance. Otherwise returns an empty set of permissions. + # Calling this method on a backup that does not exist will + # result in a NOT_FOUND error if the user has + # `spanner.backups.list` permission on the containing instance. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Starts creating a new Cloud Spanner Backup. + # The returned backup [long-running operation][google.longrunning.Operation] + # will have a name of the format + # `projects//instances//backups//operations/` + # and can be used to track creation of the backup. The + # [metadata][google.longrunning.Operation.metadata] field type is + # [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + # The [response][google.longrunning.Operation.response] field type is + # [Backup][google.spanner.admin.database.v1.Backup], if successful. + # Cancelling the returned operation will stop the creation and delete the + # backup. There can be only one pending backup creation per database. Backup + # creation of different databases can run concurrently. + rpc :CreateBackup, ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, ::Google::Longrunning::Operation + # Starts copying a Cloud Spanner Backup. + # The returned backup [long-running operation][google.longrunning.Operation] + # will have a name of the format + # `projects//instances//backups//operations/` + # and can be used to track copying of the backup. The operation is associated + # with the destination backup. + # The [metadata][google.longrunning.Operation.metadata] field type is + # [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + # The [response][google.longrunning.Operation.response] field type is + # [Backup][google.spanner.admin.database.v1.Backup], if successful. + # Cancelling the returned operation will stop the copying and delete the + # destination backup. Concurrent CopyBackup requests can run on the same + # source backup. + rpc :CopyBackup, ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, ::Google::Longrunning::Operation + # Gets metadata on a pending or completed + # [Backup][google.spanner.admin.database.v1.Backup]. + rpc :GetBackup, ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Backup + # Updates a pending or completed + # [Backup][google.spanner.admin.database.v1.Backup]. + rpc :UpdateBackup, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Backup + # Deletes a pending or completed + # [Backup][google.spanner.admin.database.v1.Backup]. + rpc :DeleteBackup, ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest, ::Google::Protobuf::Empty + # Lists completed and pending backups. + # Backups returned are ordered by `create_time` in descending order, + # starting from the most recent `create_time`. + rpc :ListBackups, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse + # Create a new database by restoring from a completed backup. The new + # database must be in the same project and in an instance with the same + # instance configuration as the instance containing + # the backup. The returned database [long-running + # operation][google.longrunning.Operation] has a name of the format + # `projects//instances//databases//operations/`, + # and can be used to track the progress of the operation, and to cancel it. + # The [metadata][google.longrunning.Operation.metadata] field type is + # [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + # The [response][google.longrunning.Operation.response] type + # is [Database][google.spanner.admin.database.v1.Database], if + # successful. Cancelling the returned operation will stop the restore and + # delete the database. + # There can be only one database being restored into an instance at a time. + # Once the restore operation completes, a new restore operation can be + # initiated, without waiting for the optimize operation associated with the + # first restore to complete. + rpc :RestoreDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, ::Google::Longrunning::Operation + # Lists database [longrunning-operations][google.longrunning.Operation]. + # A database operation has a name of the form + # `projects//instances//databases//operations/`. + # The long-running operation + # [metadata][google.longrunning.Operation.metadata] field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. + rpc :ListDatabaseOperations, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse + # Lists the backup [long-running operations][google.longrunning.Operation] in + # the given instance. A backup operation has a name of the form + # `projects//instances//backups//operations/`. + # The long-running operation + # [metadata][google.longrunning.Operation.metadata] field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.progress.start_time` in descending order starting + # from the most recently started operation. + rpc :ListBackupOperations, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse + # Lists Cloud Spanner database roles. + rpc :ListDatabaseRoles, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse + # Adds split points to specified tables, indexes of a database. + rpc :AddSplitPoints, ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse + # Creates a new backup schedule. + rpc :CreateBackupSchedule, ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule + # Gets backup schedule for the input schedule name. + rpc :GetBackupSchedule, ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule + # Updates a backup schedule. + rpc :UpdateBackupSchedule, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule + # Deletes a backup schedule. + rpc :DeleteBackupSchedule, ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, ::Google::Protobuf::Empty + # Lists all the backup schedules for the database. + rpc :ListBackupSchedules, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse + # This is an internal API called by Spanner Graph jobs. You should never need + # to call this API directly. + rpc :InternalUpdateGraphOperation, ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest, ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/README.md new file mode 100644 index 000000000000..c27a38fa2526 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Spanner Database Admin 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-spanner-admin-database-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup.rb new file mode 100644 index 000000000000..e94d6cbaa8e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup.rb @@ -0,0 +1,730 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + # A backup of a Cloud Spanner database. + # @!attribute [rw] database + # @return [::String] + # Required for the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} + # operation. Name of the database from which this backup was created. This + # needs to be in the same instance as the backup. Values are of the form + # `projects//instances//databases/`. + # @!attribute [rw] version_time + # @return [::Google::Protobuf::Timestamp] + # The backup will contain an externally consistent copy of the database at + # the timestamp specified by `version_time`. If `version_time` is not + # specified, the system will set `version_time` to the `create_time` of the + # backup. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Required for the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} + # operation. The expiration time of the backup, with microseconds + # granularity that must be at least 6 hours and at most 366 days + # from the time the CreateBackup request is processed. Once the `expire_time` + # has passed, the backup is eligible to be automatically deleted by Cloud + # Spanner to free the resources used by the backup. + # @!attribute [rw] name + # @return [::String] + # Output only for the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} + # operation. Required for the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup UpdateBackup} + # operation. + # + # A globally unique identifier for the backup which cannot be + # changed. Values are of the form + # `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` + # The final segment of the name must be between 2 and 60 characters + # in length. + # + # The backup is stored in the location(s) specified in the instance + # configuration of the instance containing the backup, identified + # by the prefix of the backup name of the form + # `projects//instances/`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} + # request is received. If the request does not specify `version_time`, the + # `version_time` of the backup will be equivalent to the `create_time`. + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. Size of the backup in bytes. + # @!attribute [r] freeable_size_bytes + # @return [::Integer] + # Output only. The number of bytes that will be freed by deleting this + # backup. This value will be zero if, for example, this backup is part of an + # incremental backup chain and younger backups in the chain require that we + # keep its data. For backups not in an incremental backup chain, this is + # always the size of the backup. This value may change if backups on the same + # chain get created, deleted or expired. + # @!attribute [r] exclusive_size_bytes + # @return [::Integer] + # Output only. For a backup in an incremental backup chain, this is the + # storage space needed to keep the data that has changed since the previous + # backup. For all other backups, this is always the size of the backup. This + # value may change if backups on the same chain get deleted or expired. + # + # This field can be used to calculate the total storage space used by a set + # of backups. For example, the total space used by all backups of a database + # can be computed by summing up this field. + # @!attribute [r] state + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup::State] + # Output only. The current state of the backup. + # @!attribute [r] referencing_databases + # @return [::Array<::String>] + # Output only. The names of the restored databases that reference the backup. + # The database names are of + # the form `projects//instances//databases/`. + # Referencing databases may exist in different instances. The existence of + # any referencing database prevents the backup from being deleted. When a + # restored database from the backup enters the `READY` state, the reference + # to the backup is removed. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo] + # Output only. The encryption information for the backup. + # @!attribute [r] encryption_information + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo>] + # Output only. The encryption information for the backup, whether it is + # protected by one or more KMS keys. The information includes all Cloud + # KMS key versions used to encrypt the backup. The `encryption_status' field + # inside of each `EncryptionInfo` is not populated. At least one of the key + # versions must be available for the backup to be restored. If a key version + # is revoked in the middle of a restore, the restore behavior is undefined. + # @!attribute [r] database_dialect + # @return [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] + # Output only. The database dialect information for the backup. + # @!attribute [r] referencing_backups + # @return [::Array<::String>] + # Output only. The names of the destination backups being created by copying + # this source backup. The backup names are of the form + # `projects//instances//backups/`. + # Referencing backups may exist in different instances. The existence of + # any referencing backup prevents the backup from being deleted. When the + # copy operation is done (either successfully completed or cancelled or the + # destination backup is deleted), the reference to the backup is removed. + # @!attribute [r] max_expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The max allowed expiration time of the backup, with + # microseconds granularity. A backup's expiration time can be configured in + # multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or + # copying an existing backup, the expiration time specified must be + # less than `Backup.max_expire_time`. + # @!attribute [r] backup_schedules + # @return [::Array<::String>] + # Output only. List of backup schedule URIs that are associated with + # creating this backup. This is only applicable for scheduled backups, and + # is empty for on-demand backups. + # + # To optimize for storage, whenever possible, multiple schedules are + # collapsed together to create one backup. In such cases, this field captures + # the list of all backup schedule URIs that are associated with creating + # this backup. If collapsing is not done, then this field captures the + # single backup schedule URI associated with creating this backup. + # @!attribute [r] incremental_backup_chain_id + # @return [::String] + # Output only. Populated only for backups in an incremental backup chain. + # Backups share the same chain id if and only if they belong to the same + # incremental backup chain. Use this field to determine which backups are + # part of the same incremental backup chain. The ordering of backups in the + # chain can be determined by ordering the backup `version_time`. + # @!attribute [r] oldest_version_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Data deleted at a time older than this is guaranteed not to be + # retained in order to support this backup. For a backup in an incremental + # backup chain, this is the version time of the oldest backup that exists or + # ever existed in the chain. For all other backups, this is the version time + # of the backup. This field can be used to understand what data is being + # retained by the backup system. + # @!attribute [r] instance_partitions + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::BackupInstancePartition>] + # Output only. The instance partition(s) storing the backup. + # + # This is the same as the list of the instance partition(s) that the database + # had footprint in at the backup's `version_time`. + class Backup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the current state of the backup. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The pending backup is still being created. Operations on the + # backup may fail with `FAILED_PRECONDITION` in this state. + CREATING = 1 + + # The backup is complete and ready for use. + READY = 2 + end + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the instance in which the backup will be + # created. This must be the same instance that contains the database the + # backup will be created from. The backup will be stored in the + # location(s) specified in the instance configuration of this + # instance. Values are of the form + # `projects//instances/`. + # @!attribute [rw] backup_id + # @return [::String] + # Required. The id of the backup to be created. The `backup_id` appended to + # `parent` forms the full backup name of the form + # `projects//instances//backups/`. + # @!attribute [rw] backup + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # Required. The backup to create. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig] + # Optional. The encryption configuration used to encrypt the backup. If this + # field is not specified, the backup will use the same encryption + # configuration as the database by default, namely + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} + # = `USE_DATABASE_ENCRYPTION`. + class CreateBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup}. + # @!attribute [rw] name + # @return [::String] + # The name of the backup being created. + # @!attribute [rw] database + # @return [::String] + # The name of the database the backup is created from. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} + # operation. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which cancellation of this operation was received. + # Operations.CancelOperation + # starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not guaranteed. + # 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`. + class CreateBackupMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the destination instance that will contain the backup + # copy. Values are of the form: `projects//instances/`. + # @!attribute [rw] backup_id + # @return [::String] + # Required. The id of the backup copy. + # The `backup_id` appended to `parent` forms the full backup_uri of the form + # `projects//instances//backups/`. + # @!attribute [rw] source_backup + # @return [::String] + # Required. The source backup to be copied. + # The source backup needs to be in READY state for it to be copied. + # Once CopyBackup is in progress, the source backup cannot be deleted or + # cleaned up on expiration until CopyBackup is finished. + # Values are of the form: + # `projects//instances//backups/`. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Required. The expiration time of the backup in microsecond granularity. + # The expiration time must be at least 6 hours and at most 366 days + # from the `create_time` of the source backup. Once the `expire_time` has + # passed, the backup is eligible to be automatically deleted by Cloud Spanner + # to free the resources used by the backup. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig] + # Optional. The encryption configuration used to encrypt the backup. If this + # field is not specified, the backup will use the same encryption + # configuration as the source backup by default, namely + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} + # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + class CopyBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup}. + # @!attribute [rw] name + # @return [::String] + # The name of the backup being created through the copy operation. + # Values are of the form + # `projects//instances//backups/`. + # @!attribute [rw] source_backup + # @return [::String] + # The name of the source backup that is being copied. + # Values are of the form + # `projects//instances//backups/`. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup} + # operation. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which cancellation of CopyBackup operation was received. + # Operations.CancelOperation + # starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not guaranteed. + # 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`. + class CopyBackupMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup UpdateBackup}. + # @!attribute [rw] backup + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] + # Required. The backup to update. `backup.name`, and the fields to be updated + # as specified by `update_mask` are required. Other fields are ignored. + # Update is only supported for the following fields: + # * `backup.expire_time`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A mask specifying which fields (e.g. `expire_time`) in the + # Backup resource should be updated. This mask is relative to the Backup + # resource, not to the request message. The field mask must always be + # specified; this prevents any future fields from being erased accidentally + # by clients that do not know about them. + class UpdateBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup GetBackup}. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the backup. + # Values are of the form + # `projects//instances//backups/`. + class GetBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup DeleteBackup}. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the backup to delete. + # Values are of the form + # `projects//instances//backups/`. + class DeleteBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups ListBackups}. + # @!attribute [rw] parent + # @return [::String] + # Required. The instance to list backups from. Values are of the + # form `projects//instances/`. + # @!attribute [rw] filter + # @return [::String] + # An expression that filters the list of returned backups. + # + # A filter expression consists of a field name, a comparison operator, and a + # value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the + # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup} are eligible for + # filtering: + # + # * `name` + # * `database` + # * `state` + # * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + # * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + # * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + # * `size_bytes` + # * `backup_schedules` + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic, but + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `name:Howl` - The backup's name contains the string "howl". + # * `database:prod` + # - The database's name contains the string "prod". + # * `state:CREATING` - The backup is pending creation. + # * `state:READY` - The backup is fully created and ready for use. + # * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + # - The backup name contains the string "howl" and `create_time` + # of the backup is before 2018-03-28T14:50:00Z. + # * `expire_time < \"2018-03-28T14:50:00Z\"` + # - The backup `expire_time` is before 2018-03-28T14:50:00Z. + # * `size_bytes > 10000000000` - The backup's size is greater than 10GB + # * `backup_schedules:daily` + # - The backup is created from a schedule with "daily" in its name. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of backups to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse ListBackupsResponse} + # to the same `parent` and with the same `filter`. + class ListBackupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups ListBackups}. + # @!attribute [rw] backups + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] + # The list of matching backups. Backups returned are ordered by `create_time` + # in descending order, starting from the most recent `create_time`. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups ListBackups} + # call to fetch more of the matching backups. + class ListBackupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations ListBackupOperations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The instance of the backup operations. Values are of + # the form `projects//instances/`. + # @!attribute [rw] filter + # @return [::String] + # An expression that filters the list of returned backup operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the {::Google::Longrunning::Operation operation} + # are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} + # is + # `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic, but + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + # `metadata.database:prod` - Returns operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. + # * The source database name of backup contains the string "prod". + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + # `(metadata.name:howl) AND` \ + # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Returns operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. + # * The backup name contains the string "howl". + # * The operation started before 2018-03-28T14:50:00Z. + # * The operation resulted in an error. + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ + # `(metadata.source_backup:test) AND` \ + # `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ + # `(error:*)` - Returns operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. + # * The source backup name contains the string "test". + # * The operation started before 2022-01-18T14:50:00Z. + # * The operation resulted in an error. + # * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ + # `(metadata.database:test_db)) OR` \ + # `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) + # AND` \ + # `(metadata.source_backup:test_bkp)) AND` \ + # `(error:*)` - Returns operations where: + # * The operation's metadata matches either of criteria: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} + # AND the source database name of the backup contains the string + # "test_db" + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata} + # AND the source backup name contains the string "test_bkp" + # * The operation resulted in an error. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse ListBackupOperationsResponse} + # to the same `parent` and with the same `filter`. + class ListBackupOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations ListBackupOperations}. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # The list of matching backup [long-running + # operations][google.longrunning.Operation]. Each operation's name will be + # prefixed by the backup's name. The operation's + # {::Google::Longrunning::Operation#metadata metadata} field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that are pending or have completed/failed/canceled within the + # last 7 days. Operations returned are ordered by + # `operation.metadata.value.progress.start_time` in descending order starting + # from the most recently started operation. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations ListBackupOperations} + # call to fetch more of the matching metadata. + class ListBackupOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about a backup. + # @!attribute [rw] backup + # @return [::String] + # Name of the backup. + # @!attribute [rw] version_time + # @return [::Google::Protobuf::Timestamp] + # The backup contains an externally consistent copy of `source_database` at + # the timestamp specified by `version_time`. If the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} + # request did not specify `version_time`, the `version_time` of the backup is + # equivalent to the `create_time`. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} + # request was received. + # @!attribute [rw] source_database + # @return [::String] + # Name of the database the backup was created from. + class BackupInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Encryption configuration for the backup to create. + # @!attribute [rw] encryption_type + # @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig::EncryptionType] + # Required. The encryption type of the backup. + # @!attribute [rw] kms_key_name + # @return [::String] + # Optional. The Cloud KMS key that will be used to protect the backup. + # This field should be set only when + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} + # is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + # `projects//locations//keyRings//cryptoKeys/`. + # @!attribute [rw] kms_key_names + # @return [::Array<::String>] + # Optional. Specifies the KMS configuration for the one or more keys used to + # protect the backup. Values are of the form + # `projects//locations//keyRings//cryptoKeys/`. + # + # The keys referenced by kms_key_names must fully cover all + # regions of the backup's instance configuration. Some examples: + # * For single region instance configs, specify a single regional + # location KMS key. + # * For multi-regional instance configs of type GOOGLE_MANAGED, + # either specify a multi-regional location KMS key or multiple regional + # location KMS keys that cover all regions in the instance config. + # * For an instance config of type USER_MANAGED, please specify only + # regional location KMS keys to cover each region in the instance config. + # Multi-regional location KMS keys are not supported for USER_MANAGED + # instance configs. + class CreateBackupEncryptionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Encryption types for the backup. + module EncryptionType + # Unspecified. Do not use. + ENCRYPTION_TYPE_UNSPECIFIED = 0 + + # Use the same encryption configuration as the database. This is the + # default option when + # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig encryption_config} + # is empty. For example, if the database is using + # `Customer_Managed_Encryption`, the backup will be using the same Cloud + # KMS key as the database. + USE_DATABASE_ENCRYPTION = 1 + + # Use Google default encryption. + GOOGLE_DEFAULT_ENCRYPTION = 2 + + # Use customer managed encryption. If specified, `kms_key_name` + # must contain a valid Cloud KMS key. + CUSTOMER_MANAGED_ENCRYPTION = 3 + end + end + + # Encryption configuration for the copied backup. + # @!attribute [rw] encryption_type + # @return [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig::EncryptionType] + # Required. The encryption type of the backup. + # @!attribute [rw] kms_key_name + # @return [::String] + # Optional. The Cloud KMS key that will be used to protect the backup. + # This field should be set only when + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} + # is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + # `projects//locations//keyRings//cryptoKeys/`. + # @!attribute [rw] kms_key_names + # @return [::Array<::String>] + # Optional. Specifies the KMS configuration for the one or more keys used to + # protect the backup. Values are of the form + # `projects//locations//keyRings//cryptoKeys/`. + # Kms keys specified can be in any order. + # + # The keys referenced by kms_key_names must fully cover all + # regions of the backup's instance configuration. Some examples: + # * For single region instance configs, specify a single regional + # location KMS key. + # * For multi-regional instance configs of type GOOGLE_MANAGED, + # either specify a multi-regional location KMS key or multiple regional + # location KMS keys that cover all regions in the instance config. + # * For an instance config of type USER_MANAGED, please specify only + # regional location KMS keys to cover each region in the instance config. + # Multi-regional location KMS keys are not supported for USER_MANAGED + # instance configs. + class CopyBackupEncryptionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Encryption types for the backup. + module EncryptionType + # Unspecified. Do not use. + ENCRYPTION_TYPE_UNSPECIFIED = 0 + + # This is the default option for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup} + # when + # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig encryption_config} + # is not specified. For example, if the source backup is using + # `Customer_Managed_Encryption`, the backup will be using the same Cloud + # KMS key as the source backup. + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1 + + # Use Google default encryption. + GOOGLE_DEFAULT_ENCRYPTION = 2 + + # Use customer managed encryption. If specified, either `kms_key_name` or + # `kms_key_names` must contain valid Cloud KMS key(s). + CUSTOMER_MANAGED_ENCRYPTION = 3 + end + end + + # The specification for full backups. + # A full backup stores the entire contents of the database at a given + # version time. + class FullBackupSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The specification for incremental backup chains. + # An incremental backup stores the delta of changes between a previous + # backup and the database contents at a given version time. An + # incremental backup chain consists of a full backup and zero or more + # successive incremental backups. The first backup created for an + # incremental backup chain is always a full backup. + class IncrementalBackupSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Instance partition information for the backup. + # @!attribute [rw] instance_partition + # @return [::String] + # A unique identifier for the instance partition. Values are of the form + # `projects//instances//instancePartitions/` + class BackupInstancePartition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb new file mode 100644 index 000000000000..99370211c6c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb @@ -0,0 +1,220 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + # Defines specifications of the backup schedule. + # @!attribute [rw] cron_spec + # @return [::Google::Cloud::Spanner::Admin::Database::V1::CrontabSpec] + # Cron style schedule specification. + class BackupScheduleSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BackupSchedule expresses the automated backup creation specification for a + # Spanner database. + # Next ID: 10 + # @!attribute [rw] name + # @return [::String] + # Identifier. Output only for the + # [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation. + # Required for the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule UpdateBackupSchedule} + # operation. A globally unique identifier for the backup schedule which + # cannot be changed. Values are of the form + # `projects//instances//databases//backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]` + # The final segment of the name must be between 2 and 60 characters in + # length. + # @!attribute [rw] spec + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupScheduleSpec] + # Optional. The schedule specification based on which the backup creations + # are triggered. + # @!attribute [rw] retention_duration + # @return [::Google::Protobuf::Duration] + # Optional. The retention duration of a backup that must be at least 6 hours + # and at most 366 days. The backup is eligible to be automatically deleted + # once the retention period has elapsed. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig] + # Optional. The encryption configuration that will be used to encrypt the + # backup. If this field is not specified, the backup will use the same + # encryption configuration as the database. + # @!attribute [rw] full_backup_spec + # @return [::Google::Cloud::Spanner::Admin::Database::V1::FullBackupSpec] + # The schedule creates only full backups. + # + # Note: The following fields are mutually exclusive: `full_backup_spec`, `incremental_backup_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] incremental_backup_spec + # @return [::Google::Cloud::Spanner::Admin::Database::V1::IncrementalBackupSpec] + # The schedule creates incremental backup chains. + # + # Note: The following fields are mutually exclusive: `incremental_backup_spec`, `full_backup_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp at which the schedule was last updated. + # If the schedule has never been updated, this field contains the timestamp + # when the schedule was first created. + class BackupSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CrontabSpec can be used to specify the version time and frequency at + # which the backup should be created. + # @!attribute [rw] text + # @return [::String] + # Required. Textual representation of the crontab. User can customize the + # backup frequency and the backup version time using the cron + # expression. The version time must be in UTC timezone. + # + # The backup will contain an externally consistent copy of the + # database at the version time. Allowed frequencies are 12 hour, 1 day, + # 1 week and 1 month. Examples of valid cron specifications: + # * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC. + # * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC. + # * `0 2 * * * ` : once a day at 2 past midnight in UTC. + # * `0 2 * * 0 ` : once a week every Sunday at 2 past midnight in UTC. + # * `0 2 8 * * ` : once a month on 8th day at 2 past midnight in UTC. + # @!attribute [r] time_zone + # @return [::String] + # Output only. The time zone of the times in `CrontabSpec.text`. Currently + # only UTC is supported. + # @!attribute [r] creation_window + # @return [::Google::Protobuf::Duration] + # Output only. Schedule backups will contain an externally consistent copy + # of the database at the version time specified in + # `schedule_spec.cron_spec`. However, Spanner may not initiate the creation + # of the scheduled backups at that version time. Spanner will initiate + # the creation of scheduled backups within the time window bounded by the + # version_time specified in `schedule_spec.cron_spec` and version_time + + # `creation_window`. + class CrontabSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup_schedule CreateBackupSchedule}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the database that this backup schedule applies to. + # @!attribute [rw] backup_schedule_id + # @return [::String] + # Required. The Id to use for the backup schedule. The `backup_schedule_id` + # appended to `parent` forms the full backup schedule name of the form + # `projects//instances//databases//backupSchedules/`. + # @!attribute [rw] backup_schedule + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # Required. The backup schedule to create. + class CreateBackupScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup_schedule GetBackupSchedule}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the schedule to retrieve. + # Values are of the form + # `projects//instances//databases//backupSchedules/`. + class GetBackupScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup_schedule DeleteBackupSchedule}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the schedule to delete. + # Values are of the form + # `projects//instances//databases//backupSchedules/`. + class DeleteBackupScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules ListBackupSchedules}. + # @!attribute [rw] parent + # @return [::String] + # Required. Database is the parent resource whose backup schedules should be + # listed. Values are of the form + # projects//instances//databases/ + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Number of backup schedules to be returned in the response. If 0 + # or less, defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse ListBackupSchedulesResponse} + # to the same `parent`. + class ListBackupSchedulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules ListBackupSchedules}. + # @!attribute [rw] backup_schedules + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] + # The list of backup schedules for a database. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules ListBackupSchedules} + # call to fetch more of the schedules. + class ListBackupSchedulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule UpdateBackupScheduleRequest}. + # @!attribute [rw] backup_schedule + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] + # Required. The backup schedule to update. `backup_schedule.name`, and the + # fields to be updated as specified by `update_mask` are required. Other + # fields are ignored. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A mask specifying which fields in the BackupSchedule resource + # should be updated. This mask is relative to the BackupSchedule resource, + # not to the request message. The field mask must always be + # specified; this prevents any future fields from being erased + # accidentally. + class UpdateBackupScheduleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/common.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/common.rb new file mode 100644 index 000000000000..7deaa30f1933 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/common.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + # Encapsulates progress related information for a Cloud Spanner long + # running operation. + # @!attribute [rw] progress_percent + # @return [::Integer] + # Percent completion of the operation. + # Values are between 0 and 100 inclusive. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Time the request was received. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # If set, the time at which this operation failed or was completed + # successfully. + class OperationProgress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Encryption configuration for a Cloud Spanner database. + # @!attribute [rw] kms_key_name + # @return [::String] + # The Cloud KMS key to be used for encrypting and decrypting + # the database. Values are of the form + # `projects//locations//keyRings//cryptoKeys/`. + # @!attribute [rw] kms_key_names + # @return [::Array<::String>] + # Specifies the KMS configuration for the one or more keys used to encrypt + # the database. Values are of the form + # `projects//locations//keyRings//cryptoKeys/`. + # + # The keys referenced by kms_key_names must fully cover all + # regions of the database instance configuration. Some examples: + # * For single region database instance configs, specify a single regional + # location KMS key. + # * For multi-regional database instance configs of type GOOGLE_MANAGED, + # either specify a multi-regional location KMS key or multiple regional + # location KMS keys that cover all regions in the instance config. + # * For a database instance config of type USER_MANAGED, please specify only + # regional location KMS keys to cover each region in the instance config. + # Multi-regional location KMS keys are not supported for USER_MANAGED + # instance configs. + class EncryptionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Encryption information for a Cloud Spanner database or backup. + # @!attribute [r] encryption_type + # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo::Type] + # Output only. The type of encryption. + # @!attribute [r] encryption_status + # @return [::Google::Rpc::Status] + # Output only. If present, the status of a recent encrypt/decrypt call on + # underlying data for this database or backup. Regardless of status, data is + # always encrypted at rest. + # @!attribute [r] kms_key_version + # @return [::String] + # Output only. A Cloud KMS key version that is being used to protect the + # database or backup. + class EncryptionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible encryption types. + module Type + # Encryption type was not specified, though data at rest remains encrypted. + TYPE_UNSPECIFIED = 0 + + # The data is encrypted at rest with a key that is + # fully managed by Google. No key version or status 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. The active version of the key. `kms_key_version` + # will be populated, and `encryption_status` may be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2 + end + end + + # Indicates the dialect type of a database. + module DatabaseDialect + # Default value. This value will create a database with the + # GOOGLE_STANDARD_SQL dialect. + DATABASE_DIALECT_UNSPECIFIED = 0 + + # GoogleSQL supported SQL. + GOOGLE_STANDARD_SQL = 1 + + # PostgreSQL supported SQL. + POSTGRESQL = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb new file mode 100644 index 000000000000..4c996f50b61f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb @@ -0,0 +1,834 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module Admin + module Database + module V1 + # Information about the database restore. + # @!attribute [rw] source_type + # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreSourceType] + # The type of the restore source. + # @!attribute [rw] backup_info + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupInfo] + # Information about the backup used to restore the database. The backup + # may no longer exist. + class RestoreInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Cloud Spanner database. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the database. Values are of the form + # `projects//instances//databases/`, + # where `` is as specified in the `CREATE DATABASE` + # statement. This name can be passed to other API methods to + # identify the database. + # @!attribute [r] state + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database::State] + # Output only. The current database state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. If exists, the time at which the database creation started. + # @!attribute [r] restore_info + # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreInfo] + # Output only. Applicable only for restored databases. Contains information + # about the restore source. + # @!attribute [r] encryption_config + # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig] + # Output only. For databases that are using customer managed encryption, this + # field contains the encryption configuration for the database. + # For databases that are using Google default or other types of encryption, + # this field is empty. + # @!attribute [r] encryption_info + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo>] + # Output only. For databases that are using customer managed encryption, this + # field contains the encryption information for the database, such as + # all Cloud KMS key versions that are in use. The `encryption_status' field + # inside of each `EncryptionInfo` is not populated. + # + # For databases that are using Google default or other types of encryption, + # this field is empty. + # + # This field is propagated lazily from the backend. There might be a delay + # from when a key version is being used and when it appears in this field. + # @!attribute [r] version_retention_period + # @return [::String] + # Output only. The period in which Cloud Spanner retains all versions of data + # for the database. This is the same as the value of version_retention_period + # database option set using + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}. + # Defaults to 1 hour, if not set. + # @!attribute [r] earliest_version_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Earliest timestamp at which older versions of the data can be + # read. This value is continuously updated by Cloud Spanner and becomes stale + # the moment it is queried. If you are using this value to recover data, make + # sure to account for the time from the moment when the value is queried to + # the moment when you initiate the recovery. + # @!attribute [r] default_leader + # @return [::String] + # Output only. The read-write region which contains the database's leader + # replicas. + # + # This is the same as the value of default_leader + # database option set using DatabaseAdmin.CreateDatabase or + # DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty. + # @!attribute [r] database_dialect + # @return [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] + # Output only. The dialect of the Cloud Spanner Database. + # @!attribute [rw] enable_drop_protection + # @return [::Boolean] + # Whether drop protection is enabled for this database. Defaults to false, + # if not set. For more details, please see how to [prevent accidental + # database + # deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. If true, the database is being updated. If false, there are no + # ongoing update operations for the database. + class Database + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the current state of the database. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The database is still being created. Operations on the database may fail + # with `FAILED_PRECONDITION` in this state. + CREATING = 1 + + # The database is fully created and ready for use. + READY = 2 + + # The database is fully created and ready for use, but is still + # being optimized for performance and cannot handle full load. + # + # In this state, the database still references the backup + # it was restore from, preventing the backup + # from being deleted. When optimizations are complete, the full performance + # of the database will be restored, and the database will transition to + # `READY` state. + READY_OPTIMIZING = 3 + end + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases}. + # @!attribute [rw] parent + # @return [::String] + # Required. The instance whose databases should be listed. + # Values are of the form `projects//instances/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of databases to be returned in the response. If 0 or less, + # defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}. + class ListDatabasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases}. + # @!attribute [rw] databases + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::Database>] + # Databases that matched the request. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases} + # call to fetch more of the matching databases. + class ListDatabasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database CreateDatabase}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the instance that will serve the new database. + # Values are of the form `projects//instances/`. + # @!attribute [rw] create_statement + # @return [::String] + # Required. A `CREATE DATABASE` statement, which specifies the ID of the + # new database. The database ID must conform to the regular expression + # `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. + # If the database ID is a reserved word or if it contains a hyphen, the + # database ID must be enclosed in backticks (`` ` ``). + # @!attribute [rw] extra_statements + # @return [::Array<::String>] + # Optional. A list of DDL statements to run inside the newly created + # database. Statements can create tables, indexes, etc. These + # statements execute atomically with the creation of the database: + # if there is an error in any statement, the database is not created. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig] + # Optional. The encryption configuration for the database. If this field is + # not specified, Cloud Spanner will encrypt/decrypt all data at rest using + # Google default encryption. + # @!attribute [rw] database_dialect + # @return [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] + # Optional. The dialect of the Cloud Spanner Database. + # @!attribute [rw] proto_descriptors + # @return [::String] + # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in + # 'extra_statements' above. + # Contains a protobuf-serialized + # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + # To generate it, [install](https://grpc.io/docs/protoc-installation/) and + # run `protoc` with --include_imports and --descriptor_set_out. For example, + # to generate for moon/shot/app.proto, run + # ``` + # $protoc --proto_path=/app_path --proto_path=/lib_path \ + # --include_imports \ + # --descriptor_set_out=descriptors.data \ + # moon/shot/app.proto + # ``` + # For more details, see protobuffer [self + # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + class CreateDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database CreateDatabase}. + # @!attribute [rw] database + # @return [::String] + # The database being created. + class CreateDatabaseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database GetDatabase}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested database. Values are of the form + # `projects//instances//databases/`. + class GetDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database UpdateDatabase}. + # @!attribute [rw] database + # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database] + # Required. The database to update. + # The `name` field of the database is of the form + # `projects//instances//databases/`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields to update. Currently, only + # `enable_drop_protection` field can be updated. + class UpdateDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database UpdateDatabase}. + # @!attribute [rw] request + # @return [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest] + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database UpdateDatabase}. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database UpdateDatabase} + # operation. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. If set, this operation is + # in the process of undoing itself (which is best-effort). + class UpdateDatabaseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enqueues the given DDL statements to be applied, in order but not + # necessarily all at once, to the database schema at some point (or + # points) in the future. The server checks that the statements + # are executable (syntactically valid, name tables that exist, etc.) + # before enqueueing them, but they may still fail upon + # later execution (e.g., if a statement from another batch of + # statements is applied first and it conflicts in some way, or if + # there is some data-related problem like a `NULL` value in a column to + # which `NOT NULL` would be added). If a statement fails, all + # subsequent statements in the batch are automatically cancelled. + # + # Each batch of statements is assigned a name which can be used with + # the Operations API to monitor + # progress. See the + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#operation_id operation_id} + # field for more details. + # @!attribute [rw] database + # @return [::String] + # Required. The database to update. + # @!attribute [rw] statements + # @return [::Array<::String>] + # Required. DDL statements to be applied to the database. + # @!attribute [rw] operation_id + # @return [::String] + # If empty, the new update request is assigned an + # automatically-generated operation ID. Otherwise, `operation_id` + # is used to construct the name of the resulting + # {::Google::Longrunning::Operation Operation}. + # + # Specifying an explicit operation ID simplifies determining + # whether the statements were executed in the event that the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} + # call is replayed, or the return value is otherwise lost: the + # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database} + # and `operation_id` fields can be combined to form the + # {::Google::Longrunning::Operation#name name} of the resulting + # {::Google::Longrunning::Operation longrunning.Operation}: + # `/operations/`. + # + # `operation_id` should be unique within the database, and must be + # a valid identifier: `[a-z][a-z0-9_]*`. Note that + # automatically-generated operation IDs always begin with an + # underscore. If the named operation already exists, + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} + # returns `ALREADY_EXISTS`. + # @!attribute [rw] proto_descriptors + # @return [::String] + # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. + # Contains a protobuf-serialized + # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + # To generate it, [install](https://grpc.io/docs/protoc-installation/) and + # run `protoc` with --include_imports and --descriptor_set_out. For example, + # to generate for moon/shot/app.proto, run + # ``` + # $protoc --proto_path=/app_path --proto_path=/lib_path \ + # --include_imports \ + # --descriptor_set_out=descriptors.data \ + # moon/shot/app.proto + # ``` + # For more details, see protobuffer [self + # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + # @!attribute [rw] throughput_mode + # @return [::Boolean] + # Optional. This field is exposed to be used by the Spanner Migration Tool. + # For more details, see + # [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). + class UpdateDatabaseDdlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Action information extracted from a DDL statement. This proto is used to + # display the brief info of the DDL statement for the operation + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}. + # @!attribute [rw] action + # @return [::String] + # The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc. + # This field is a non-empty string. + # @!attribute [rw] entity_type + # @return [::String] + # The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc. + # This field can be empty string for some DDL statement, + # e.g. for statement "ANALYZE", `entity_type` = "". + # @!attribute [rw] entity_names + # @return [::Array<::String>] + # The entity name(s) being operated on the DDL statement. + # E.g. + # 1. For statement "CREATE TABLE t1(...)", `entity_names` = ["t1"]. + # 2. For statement "GRANT ROLE r1, r2 ...", `entity_names` = ["r1", "r2"]. + # 3. For statement "ANALYZE", `entity_names` = []. + class DdlStatementActionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}. + # @!attribute [rw] database + # @return [::String] + # The database being modified. + # @!attribute [rw] statements + # @return [::Array<::String>] + # For an update this list contains all the statements. For an + # individual statement, this list contains only that statement. + # @!attribute [rw] commit_timestamps + # @return [::Array<::Google::Protobuf::Timestamp>] + # Reports the commit timestamps of all statements that have + # succeeded so far, where `commit_timestamps[i]` is the commit + # timestamp for the statement `statements[i]`. + # @!attribute [r] throttled + # @return [::Boolean] + # Output only. When true, indicates that the operation is throttled e.g. + # due to resource constraints. When resources become available the operation + # will resume and this field will be false again. + # @!attribute [rw] progress + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress>] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} + # operations. All DDL statements will have continuously updating progress, + # and `progress[i]` is the operation progress for `statements[i]`. Also, + # `progress[i]` will have start time and end time populated with commit + # timestamp of operation, as well as a progress of 100% once the operation + # has completed. + # @!attribute [rw] actions + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::DdlStatementActionInfo>] + # The brief action info for the DDL statements. + # `actions[i]` is the brief info for `statements[i]`. + class UpdateDatabaseDdlMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database DropDatabase}. + # @!attribute [rw] database + # @return [::String] + # Required. The database to be dropped. + class DropDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl GetDatabaseDdl}. + # @!attribute [rw] database + # @return [::String] + # Required. The database whose schema we wish to get. + # Values are of the form + # `projects//instances//databases/` + class GetDatabaseDdlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl GetDatabaseDdl}. + # @!attribute [rw] statements + # @return [::Array<::String>] + # A list of formatted DDL statements defining the schema of the database + # specified in the request. + # @!attribute [rw] proto_descriptors + # @return [::String] + # Proto descriptors stored in the database. + # Contains a protobuf-serialized + # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). + # For more details, see protobuffer [self + # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). + class GetDatabaseDdlResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations ListDatabaseOperations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The instance of the database operations. + # Values are of the form `projects//instances/`. + # @!attribute [rw] filter + # @return [::String] + # An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the {::Google::Longrunning::Operation Operation} + # are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} + # is + # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ + # `(metadata.source_type:BACKUP) AND` \ + # `(metadata.backup_info.backup:backup_howl) AND` \ + # `(metadata.name:restored_howl) AND` \ + # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. + # * The database is restored from a backup. + # * The backup name contains "backup_howl". + # * The restored database's name contains "restored_howl". + # * The operation started before 2018-03-28T14:50:00Z. + # * The operation resulted in an error. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse ListDatabaseOperationsResponse} + # to the same `parent` and with the same `filter`. + class ListDatabaseOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations ListDatabaseOperations}. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # The list of matching database [long-running + # operations][google.longrunning.Operation]. Each operation's name will be + # prefixed by the database's name. The operation's + # {::Google::Longrunning::Operation#metadata metadata} field type + # `metadata.type_url` describes the type of the metadata. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations ListDatabaseOperations} + # call to fetch more of the matching metadata. + class ListDatabaseOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database RestoreDatabase}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the instance in which to create the + # restored database. This instance must be in the same project and + # have the same instance configuration as the instance containing + # the source backup. Values are of the form + # `projects//instances/`. + # @!attribute [rw] database_id + # @return [::String] + # Required. The id of the database to create and restore to. This + # database must not already exist. The `database_id` appended to + # `parent` forms the full database name of the form + # `projects//instances//databases/`. + # @!attribute [rw] backup + # @return [::String] + # Name of the backup from which to restore. Values are of the form + # `projects//instances//backups/`. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig] + # Optional. An encryption configuration describing the encryption type and + # key resources in Cloud KMS used to encrypt/decrypt the database to restore + # to. If this field is not specified, the restored database will use the same + # encryption configuration as the backup by default, namely + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} + # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. + class RestoreDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Encryption configuration for the restored database. + # @!attribute [rw] encryption_type + # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig::EncryptionType] + # Required. The encryption type of the restored database. + # @!attribute [rw] kms_key_name + # @return [::String] + # Optional. The Cloud KMS key that will be used to encrypt/decrypt the + # restored database. This field should be set only when + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} + # is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form + # `projects//locations//keyRings//cryptoKeys/`. + # @!attribute [rw] kms_key_names + # @return [::Array<::String>] + # Optional. Specifies the KMS configuration for the one or more keys used to + # encrypt the database. Values are of the form + # `projects//locations//keyRings//cryptoKeys/`. + # + # The keys referenced by kms_key_names must fully cover all + # regions of the database instance configuration. Some examples: + # * For single region database instance configs, specify a single regional + # location KMS key. + # * For multi-regional database instance configs of type GOOGLE_MANAGED, + # either specify a multi-regional location KMS key or multiple regional + # location KMS keys that cover all regions in the instance config. + # * For a database instance config of type USER_MANAGED, please specify only + # regional location KMS keys to cover each region in the instance config. + # Multi-regional location KMS keys are not supported for USER_MANAGED + # instance configs. + class RestoreDatabaseEncryptionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Encryption types for the database to be restored. + module EncryptionType + # Unspecified. Do not use. + ENCRYPTION_TYPE_UNSPECIFIED = 0 + + # This is the default option when + # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig encryption_config} + # is not specified. + USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1 + + # Use Google default encryption. + GOOGLE_DEFAULT_ENCRYPTION = 2 + + # Use customer managed encryption. If specified, `kms_key_name` must + # must contain a valid Cloud KMS key. + CUSTOMER_MANAGED_ENCRYPTION = 3 + end + end + + # Metadata type for the long-running operation returned by + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database RestoreDatabase}. + # @!attribute [rw] name + # @return [::String] + # Name of the database being created and restored to. + # @!attribute [rw] source_type + # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreSourceType] + # The type of the restore source. + # @!attribute [rw] backup_info + # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupInfo] + # Information about the backup used to restore the database. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database RestoreDatabase} + # operation. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which cancellation of this operation was received. + # Operations.CancelOperation + # starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not guaranteed. + # 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`. + # @!attribute [rw] optimize_database_operation_name + # @return [::String] + # If exists, the name of the long-running operation that will be used to + # track the post-restore optimization process to optimize the performance of + # the restored database, and remove the dependency on the restore source. + # The name is of the form + # `projects//instances//databases//operations/` + # where the is the name of database being created and restored to. + # The metadata type of the long-running operation is + # {::Google::Cloud::Spanner::Admin::Database::V1::OptimizeRestoredDatabaseMetadata OptimizeRestoredDatabaseMetadata}. + # This long-running operation will be automatically created by the system + # after the RestoreDatabase long-running operation completes successfully. + # This operation will not be created if the restore was not successful. + class RestoreDatabaseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the long-running operation used to track the progress + # of optimizations performed on a newly restored database. This long-running + # operation is automatically created by the system after the successful + # completion of a database restore, and cannot be cancelled. + # @!attribute [rw] name + # @return [::String] + # Name of the restored database being optimized. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] + # The progress of the post-restore optimizations. + class OptimizeRestoredDatabaseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Cloud Spanner database role. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the database role. Values are of the form + # `projects//instances//databases//databaseRoles/` + # where `` is as specified in the `CREATE ROLE` DDL statement. + class DatabaseRole + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles ListDatabaseRoles}. + # @!attribute [rw] parent + # @return [::String] + # Required. The database whose roles should be listed. + # Values are of the form + # `projects//instances//databases/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of database roles to be returned in the response. If 0 or less, + # defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse ListDatabaseRolesResponse}. + class ListDatabaseRolesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles ListDatabaseRoles}. + # @!attribute [rw] database_roles + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] + # Database roles that matched the request. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles ListDatabaseRoles} + # call to fetch more of the matching roles. + class ListDatabaseRolesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points AddSplitPoints}. + # @!attribute [rw] database + # @return [::String] + # Required. The database on whose tables/indexes split points are to be + # added. Values are of the form + # `projects//instances//databases/`. + # @!attribute [rw] split_points + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints>] + # Required. The split points to add. + # @!attribute [rw] initiator + # @return [::String] + # Optional. A user-supplied tag associated with the split points. + # For example, "intital_data_load", "special_event_1". + # Defaults to "CloudAddSplitPointsAPI" if not specified. + # The length of the tag must not exceed 50 characters,else will be trimmed. + # Only valid UTF8 characters are allowed. + class AddSplitPointsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points AddSplitPoints}. + class AddSplitPointsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The split points of a table/index. + # @!attribute [rw] table + # @return [::String] + # The table to split. + # @!attribute [rw] index + # @return [::String] + # The index to split. + # If specified, the `table` field must refer to the index's base table. + # @!attribute [rw] keys + # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints::Key>] + # Required. The list of split keys, i.e., the split boundaries. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The expiration timestamp of the split points. + # A timestamp in the past means immediate expiration. + # The maximum value can be 30 days in the future. + # Defaults to 10 days in the future if not specified. + class SplitPoints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A split key. + # @!attribute [rw] key_parts + # @return [::Google::Protobuf::ListValue] + # Required. The column values making up the split key. + class Key + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Internal request proto, do not use directly. + # @!attribute [rw] database + # @return [::String] + # Internal field, do not use directly. + # @!attribute [rw] operation_id + # @return [::String] + # Internal field, do not use directly. + # @!attribute [rw] vm_identity_token + # @return [::String] + # Internal field, do not use directly. + # @!attribute [rw] progress + # @return [::Float] + # Internal field, do not use directly. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Internal field, do not use directly. + class InternalUpdateGraphOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Internal response proto, do not use directly. + class InternalUpdateGraphOperationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicates the type of the restore source. + module RestoreSourceType + # No restore associated. + TYPE_UNSPECIFIED = 0 + + # A backup was used as the source of the restore. + BACKUP = 1 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/Gemfile new file mode 100644 index 000000000000..9f880b7cd501 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1", path: "../" +else + gem "google-cloud-spanner-admin-database-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-spanner-admin-database-v1/snippets/database_admin/add_split_points.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/add_split_points.rb new file mode 100644 index 000000000000..b40f9ed68996 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/add_split_points.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the add_split_points call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points. +# +def add_split_points + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new + + # Call the add_split_points method. + result = client.add_split_points request + + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb new file mode 100644 index 000000000000..4f5d4e196698 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_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 spanner_v1_generated_DatabaseAdmin_CopyBackup_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the copy_backup call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup. +# +def copy_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new + + # Call the copy_backup method. + result = client.copy_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 spanner_v1_generated_DatabaseAdmin_CopyBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb new file mode 100644 index 000000000000..7bdb66daafbb --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_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 spanner_v1_generated_DatabaseAdmin_CreateBackup_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the create_backup call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup. +# +def create_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new + + # Call the create_backup method. + result = client.create_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 spanner_v1_generated_DatabaseAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup_schedule.rb new file mode 100644 index 000000000000..0e52ad4acecc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup_schedule.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_CreateBackupSchedule_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the create_backup_schedule call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup_schedule. +# +def create_backup_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new + + # Call the create_backup_schedule method. + result = client.create_backup_schedule request + + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_CreateBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb new file mode 100644 index 000000000000..7071ecb8f557 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_CreateDatabase_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the create_database call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database. +# +def create_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new + + # Call the create_database method. + result = client.create_database request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_DatabaseAdmin_CreateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb new file mode 100644 index 000000000000..4193a0014644 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_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 spanner_v1_generated_DatabaseAdmin_DeleteBackup_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the delete_backup call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup. +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new + + # Call the delete_backup method. + result = client.delete_backup request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup_schedule.rb new file mode 100644 index 000000000000..60427f4241f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup_schedule.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_DeleteBackupSchedule_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the delete_backup_schedule call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup_schedule. +# +def delete_backup_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new + + # Call the delete_backup_schedule method. + result = client.delete_backup_schedule request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_DeleteBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb new file mode 100644 index 000000000000..7d960d68517c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_DropDatabase_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the drop_database call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database. +# +def drop_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new + + # Call the drop_database method. + result = client.drop_database request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_DropDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb new file mode 100644 index 000000000000..45401693ebdb --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/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 spanner_v1_generated_DatabaseAdmin_GetBackup_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the get_backup call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup. +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest.new + + # Call the get_backup method. + result = client.get_backup request + + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup_schedule.rb new file mode 100644 index 000000000000..29edea9a86fa --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup_schedule.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_GetBackupSchedule_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the get_backup_schedule call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup_schedule. +# +def get_backup_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new + + # Call the get_backup_schedule method. + result = client.get_backup_schedule request + + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_GetBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb new file mode 100644 index 000000000000..cee9d27e148b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_GetDatabase_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the get_database call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database. +# +def get_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new + + # Call the get_database method. + result = client.get_database request + + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Database. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_GetDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb new file mode 100644 index 000000000000..0bcdf7f40932 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the get_database_ddl call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl. +# +def get_database_ddl + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new + + # Call the get_database_ddl method. + result = client.get_database_ddl request + + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb new file mode 100644 index 000000000000..ec196400f896 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_GetIamPolicy_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the get_iam_policy call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/internal_update_graph_operation.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/internal_update_graph_operation.rb new file mode 100644 index 000000000000..d28d071db2e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/internal_update_graph_operation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_InternalUpdateGraphOperation_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the internal_update_graph_operation call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#internal_update_graph_operation. +# +def internal_update_graph_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest.new + + # Call the internal_update_graph_operation method. + result = client.internal_update_graph_operation request + + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_InternalUpdateGraphOperation_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb new file mode 100644 index 000000000000..aa01ffea3aca --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_ListBackupOperations_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the list_backup_operations call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations. +# +def list_backup_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new + + # Call the list_backup_operations method. + result = client.list_backup_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 +end +# [END spanner_v1_generated_DatabaseAdmin_ListBackupOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_schedules.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_schedules.rb new file mode 100644 index 000000000000..bbb680f5318f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_schedules.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 spanner_v1_generated_DatabaseAdmin_ListBackupSchedules_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the list_backup_schedules call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules. +# +def list_backup_schedules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.new + + # Call the list_backup_schedules method. + result = client.list_backup_schedules request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + p item + end +end +# [END spanner_v1_generated_DatabaseAdmin_ListBackupSchedules_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb new file mode 100644 index 000000000000..db27cb097f7c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/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 spanner_v1_generated_DatabaseAdmin_ListBackups_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the list_backups call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups. +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::Backup. + p item + end +end +# [END spanner_v1_generated_DatabaseAdmin_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb new file mode 100644 index 000000000000..2bc09405f027 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the list_database_operations call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations. +# +def list_database_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new + + # Call the list_database_operations method. + result = client.list_database_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 +end +# [END spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb new file mode 100644 index 000000000000..0c3f79067aae --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.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 spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the list_database_roles call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles. +# +def list_database_roles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new + + # Call the list_database_roles method. + result = client.list_database_roles request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole. + p item + end +end +# [END spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb new file mode 100644 index 000000000000..6fc0fc085df9 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.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 spanner_v1_generated_DatabaseAdmin_ListDatabases_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the list_databases call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases. +# +def list_databases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new + + # Call the list_databases method. + result = client.list_databases request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Database. + p item + end +end +# [END spanner_v1_generated_DatabaseAdmin_ListDatabases_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb new file mode 100644 index 000000000000..29fba6511896 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_RestoreDatabase_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the restore_database call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database. +# +def restore_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new + + # Call the restore_database method. + result = client.restore_database request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_DatabaseAdmin_RestoreDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb new file mode 100644 index 000000000000..c009dea6b085 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_SetIamPolicy_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the set_iam_policy call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb new file mode 100644 index 000000000000..0758fe97ccf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_TestIamPermissions_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the test_iam_permissions call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb new file mode 100644 index 000000000000..0d378479ff72 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_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 spanner_v1_generated_DatabaseAdmin_UpdateBackup_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the update_backup call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup. +# +def update_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new + + # Call the update_backup method. + result = client.update_backup request + + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup_schedule.rb new file mode 100644 index 000000000000..25c121a40b2e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup_schedule.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_UpdateBackupSchedule_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the update_backup_schedule call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule. +# +def update_backup_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new + + # Call the update_backup_schedule method. + result = client.update_backup_schedule request + + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. + p result +end +# [END spanner_v1_generated_DatabaseAdmin_UpdateBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database.rb new file mode 100644 index 000000000000..7e8b003939c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_UpdateDatabase_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the update_database call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database. +# +def update_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new + + # Call the update_database method. + result = client.update_database request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_DatabaseAdmin_UpdateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb new file mode 100644 index 000000000000..16bc289eab58 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_sync] +require "google/cloud/spanner/admin/database/v1" + +## +# Snippet for the update_database_ddl call in the DatabaseAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl. +# +def update_database_ddl + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new + + # Call the update_database_ddl method. + result = client.update_database_ddl request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json new file mode 100644 index 000000000000..804d69497d76 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json @@ -0,0 +1,1095 @@ +{ + "client_library": { + "name": "google-cloud-spanner-admin-database-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.spanner.admin.database.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_ListDatabases_sync", + "title": "Snippet for the list_databases call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases.", + "file": "database_admin/list_databases.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_databases", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "ListDatabases", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_CreateDatabase_sync", + "title": "Snippet for the create_database call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database.", + "file": "database_admin/create_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_database", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "CreateDatabase", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_GetDatabase_sync", + "title": "Snippet for the get_database call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database.", + "file": "database_admin/get_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_database", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::Database", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "GetDatabase", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_UpdateDatabase_sync", + "title": "Snippet for the update_database call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database.", + "file": "database_admin/update_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_database", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "UpdateDatabase", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_sync", + "title": "Snippet for the update_database_ddl call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl.", + "file": "database_admin/update_database_ddl.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_database_ddl", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "UpdateDatabaseDdl", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_DropDatabase_sync", + "title": "Snippet for the drop_database call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database.", + "file": "database_admin/drop_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "drop_database", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "DropDatabase", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_sync", + "title": "Snippet for the get_database_ddl call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl.", + "file": "database_admin/get_database_ddl.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_database_ddl", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "GetDatabaseDdl", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#set_iam_policy.", + "file": "database_admin/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicy", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_iam_policy.", + "file": "database_admin/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicy", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#test_iam_permissions.", + "file": "database_admin/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissions", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_CreateBackup_sync", + "title": "Snippet for the create_backup call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup.", + "file": "database_admin/create_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_backup", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "CreateBackup", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_CopyBackup_sync", + "title": "Snippet for the copy_backup call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup.", + "file": "database_admin/copy_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "copy_backup", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "CopyBackup", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_GetBackup_sync", + "title": "Snippet for the get_backup call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup.", + "file": "database_admin/get_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::Backup", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "GetBackup", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetBackup", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_UpdateBackup_sync", + "title": "Snippet for the update_backup call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup.", + "file": "database_admin/update_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_backup", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::Backup", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "UpdateBackup", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_DeleteBackup_sync", + "title": "Snippet for the delete_backup call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup.", + "file": "database_admin/delete_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "DeleteBackup", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_ListBackups_sync", + "title": "Snippet for the list_backups call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups.", + "file": "database_admin/list_backups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backups", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "ListBackups", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListBackups", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_RestoreDatabase_sync", + "title": "Snippet for the restore_database call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database.", + "file": "database_admin/restore_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_database", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "RestoreDatabase", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_sync", + "title": "Snippet for the list_database_operations call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations.", + "file": "database_admin/list_database_operations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_database_operations", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "ListDatabaseOperations", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_ListBackupOperations_sync", + "title": "Snippet for the list_backup_operations call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations.", + "file": "database_admin/list_backup_operations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_operations", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "ListBackupOperations", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_sync", + "title": "Snippet for the list_database_roles call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles.", + "file": "database_admin/list_database_roles.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_database_roles", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "ListDatabaseRoles", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync", + "title": "Snippet for the add_split_points call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points.", + "file": "database_admin/add_split_points.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_split_points", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "AddSplitPoints", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_CreateBackupSchedule_sync", + "title": "Snippet for the create_backup_schedule call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup_schedule.", + "file": "database_admin/create_backup_schedule.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_backup_schedule", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup_schedule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "CreateBackupSchedule", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_GetBackupSchedule_sync", + "title": "Snippet for the get_backup_schedule call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup_schedule.", + "file": "database_admin/get_backup_schedule.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_schedule", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup_schedule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "GetBackupSchedule", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_UpdateBackupSchedule_sync", + "title": "Snippet for the update_backup_schedule call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule.", + "file": "database_admin/update_backup_schedule.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_backup_schedule", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "UpdateBackupSchedule", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_DeleteBackupSchedule_sync", + "title": "Snippet for the delete_backup_schedule call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup_schedule.", + "file": "database_admin/delete_backup_schedule.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup_schedule", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup_schedule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "DeleteBackupSchedule", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_ListBackupSchedules_sync", + "title": "Snippet for the list_backup_schedules call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules.", + "file": "database_admin/list_backup_schedules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_schedules", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "ListBackupSchedules", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_DatabaseAdmin_InternalUpdateGraphOperation_sync", + "title": "Snippet for the internal_update_graph_operation call in the DatabaseAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#internal_update_graph_operation.", + "file": "database_admin/internal_update_graph_operation.rb", + "language": "RUBY", + "client_method": { + "short_name": "internal_update_graph_operation", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#internal_update_graph_operation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse", + "client": { + "short_name": "DatabaseAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" + }, + "method": { + "short_name": "InternalUpdateGraphOperation", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperation", + "service": { + "short_name": "DatabaseAdmin", + "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" + } + } + }, + "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-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb new file mode 100644 index 000000000000..835166633ef1 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_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/spanner/admin/database/v1/spanner_database_admin_pb" +require "google/spanner/admin/database/v1/spanner_database_admin_services_pb" +require "google/cloud/spanner/admin/database/v1/database_admin" + +class ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb new file mode 100644 index 000000000000..5c96b14460f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_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 "gapic/grpc/service_stub" + +require "google/cloud/spanner/admin/database/v1/database_admin" + +class ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", instance: "value1", backup: "value2" + assert_equal "projects/value0/instances/value1/backups/value2", path + end + end + + def test_backup_schedule_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_schedule_path project: "value0", instance: "value1", database: "value2", schedule: "value3" + assert_equal "projects/value0/instances/value1/databases/value2/backupSchedules/value3", 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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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_database_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.database_path project: "value0", instance: "value1", database: "value2" + assert_equal "projects/value0/instances/value1/databases/value2", path + end + end + + def test_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", instance: "value1" + assert_equal "projects/value0/instances/value1", path + end + end + + def test_instance_partition_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_partition_path project: "value0", instance: "value1", instance_partition: "value2" + assert_equal "projects/value0/instances/value1/instancePartitions/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb new file mode 100644 index 000000000000..6e5024ac4a63 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb @@ -0,0 +1,1548 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/spanner/admin/database/v1/spanner_database_admin_pb" +require "google/cloud/spanner/admin/database/v1/database_admin/rest" + + +class ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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_databases + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.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_databases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_databases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_databases_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_databases({ 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_databases 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_databases ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.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_databases({ 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_databases(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.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_databases_client_stub.call_count + end + end + end + + def test_create_database + # Create test objects. + 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" + create_statement = "hello world" + extra_statements = ["hello world"] + encryption_config = {} + database_dialect = :DATABASE_DIALECT_UNSPECIFIED + proto_descriptors = "hello world" + + create_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_create_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_database({ parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_database parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_database ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new(parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_database({ parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_database(::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new(parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_database_client_stub.call_count + end + end + end + + def test_get_database + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::Database.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_database({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_database name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_database ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_database({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_database(::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_database_client_stub.call_count + end + end + end + + def test_update_database + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + database = {} + update_mask = {} + + update_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_update_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_database({ database: database, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_database database: database, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_database ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_database({ database: database, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_database(::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_database_client_stub.call_count + end + end + end + + def test_update_database_ddl + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + database = "hello world" + statements = ["hello world"] + operation_id = "hello world" + proto_descriptors = "hello world" + throughput_mode = true + + update_database_ddl_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_update_database_ddl_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_database_ddl_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_database_ddl({ database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_database_ddl database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_database_ddl ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new(database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_database_ddl({ database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_database_ddl(::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new(database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_database_ddl_client_stub.call_count + end + end + end + + def test_drop_database + # 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. + database = "hello world" + + drop_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_drop_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, drop_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.drop_database({ database: database }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.drop_database database: database do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.drop_database ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new(database: database) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.drop_database({ database: database }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.drop_database(::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new(database: database), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, drop_database_client_stub.call_count + end + end + end + + def test_get_database_ddl + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + database = "hello world" + + get_database_ddl_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_database_ddl_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_database_ddl_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_database_ddl({ database: database }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_database_ddl database: database do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_database_ddl ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new(database: database) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_database_ddl({ database: database }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_database_ddl(::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new(database: database), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_database_ddl_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_create_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. + parent = "hello world" + backup_id = "hello world" + backup = {} + encryption_config = {} + + create_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_create_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_backup_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_backup parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_backup ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_backup(::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_backup_client_stub.call_count + end + end + end + + def test_copy_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. + parent = "hello world" + backup_id = "hello world" + source_backup = "hello world" + expire_time = {} + encryption_config = {} + + copy_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_copy_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, copy_backup_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.copy_backup({ parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.copy_backup parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.copy_backup ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new(parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.copy_backup({ parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.copy_backup(::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new(parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, copy_backup_client_stub.call_count + end + end + end + + def test_get_backup + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::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::Spanner::Admin::Database::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_update_backup + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::Backup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + backup = {} + update_mask = {} + + update_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_update_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_backup_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_backup({ backup: backup, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_backup backup: backup, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_backup ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new(backup: backup, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_backup({ backup: backup, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_backup(::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new(backup: backup, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_backup_client_stub.call_count + end + end + end + + def test_delete_backup + # 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_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_backup({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_backup name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_backup({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new(name: name), 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_list_backups + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + 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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backups({ parent: parent, 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.list_backups parent: parent, 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.list_backups ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new(parent: parent, 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.list_backups({ parent: parent, 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.list_backups(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new(parent: parent, 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, list_backups_client_stub.call_count + end + end + end + + def test_restore_database + # Create test objects. + 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" + database_id = "hello world" + backup = "hello world" + encryption_config = {} + + restore_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_restore_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restore_database({ parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restore_database parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restore_database ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restore_database({ parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restore_database(::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_database_client_stub.call_count + end + end + end + + def test_list_database_operations + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_database_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_database_operations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_database_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_database_operations({ parent: parent, 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.list_database_operations parent: parent, 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.list_database_operations ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new(parent: parent, 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.list_database_operations({ parent: parent, 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.list_database_operations(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new(parent: parent, 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, list_database_operations_client_stub.call_count + end + end + end + + def test_list_backup_operations + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_backup_operations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backup_operations({ parent: parent, 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.list_backup_operations parent: parent, 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.list_backup_operations ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new(parent: parent, 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.list_backup_operations({ parent: parent, 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.list_backup_operations(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new(parent: parent, 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, list_backup_operations_client_stub.call_count + end + end + end + + def test_list_database_roles + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse.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_database_roles_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_database_roles_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_database_roles_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_database_roles({ 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_database_roles 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_database_roles ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.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_database_roles({ 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_database_roles(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.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_database_roles_client_stub.call_count + end + end + end + + def test_add_split_points + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + database = "hello world" + split_points = [{}] + initiator = "hello world" + + add_split_points_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_add_split_points_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_split_points_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_split_points({ database: database, split_points: split_points, initiator: initiator }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_split_points database: database, split_points: split_points, initiator: initiator do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_split_points ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new(database: database, split_points: split_points, initiator: initiator) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_split_points({ database: database, split_points: split_points, initiator: initiator }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_split_points(::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new(database: database, split_points: split_points, initiator: initiator), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_split_points_client_stub.call_count + end + end + end + + def test_create_backup_schedule + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + backup_schedule_id = "hello world" + backup_schedule = {} + + create_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_create_backup_schedule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_backup_schedule({ parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_backup_schedule parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_backup_schedule({ parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_backup_schedule_client_stub.call_count + end + end + end + + def test_get_backup_schedule + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_backup_schedule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_backup_schedule({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_backup_schedule name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_backup_schedule({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_schedule_client_stub.call_count + end + end + end + + def test_update_backup_schedule + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + backup_schedule = {} + update_mask = {} + + update_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_update_backup_schedule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_backup_schedule backup_schedule: backup_schedule, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_backup_schedule_client_stub.call_count + end + end + end + + def test_delete_backup_schedule + # 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_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_delete_backup_schedule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_backup_schedule({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_backup_schedule name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_backup_schedule({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_schedule_client_stub.call_count + end + end + end + + def test_list_backup_schedules + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse.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_schedules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_backup_schedules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_schedules_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backup_schedules({ 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_schedules 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_schedules ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.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_schedules({ 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_schedules(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.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_schedules_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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb new file mode 100644 index 000000000000..6e2f29620c73 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb @@ -0,0 +1,1843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/spanner/admin/database/v1/spanner_database_admin_pb" +require "google/cloud/spanner/admin/database/v1/database_admin" + +class ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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_databases + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_databases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_databases, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, 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_databases_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_databases({ parent: parent, page_size: page_size, page_token: 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_databases parent: parent, page_size: page_size, page_token: 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_databases ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.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_databases({ parent: parent, page_size: page_size, page_token: page_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_databases(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.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_databases_client_stub.call_rpc_count + end + end + + def test_create_database + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + create_statement = "hello world" + extra_statements = ["hello world"] + encryption_config = {} + database_dialect = :DATABASE_DIALECT_UNSPECIFIED + proto_descriptors = "hello world" + + create_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_database, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["create_statement"] + assert_equal ["hello world"], request["extra_statements"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig), request["encryption_config"] + assert_equal :DATABASE_DIALECT_UNSPECIFIED, request["database_dialect"] + assert_equal "hello world", request["proto_descriptors"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_database({ parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors }) do |response, 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_database parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors do |response, 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_database ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new(parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors) do |response, operation| + assert_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_database({ parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors }, grpc_options) do |response, operation| + assert_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_database(::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new(parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors), grpc_options) do |response, operation| + assert_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_database_client_stub.call_rpc_count + end + end + + def test_get_database + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::Database.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_database, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_database({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_database name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_database ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_database({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_database(::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_database_client_stub.call_rpc_count + end + end + + def test_update_database + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = {} + update_mask = {} + + update_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_database, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::Database), request["database"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_database({ database: database, 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_database database: database, 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_database ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new(database: database, 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_database({ database: database, 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_database(::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new(database: database, 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_database_client_stub.call_rpc_count + end + end + + def test_update_database_ddl + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + statements = ["hello world"] + operation_id = "hello world" + proto_descriptors = "hello world" + throughput_mode = true + + update_database_ddl_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_database_ddl, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, request + assert_equal "hello world", request["database"] + assert_equal ["hello world"], request["statements"] + assert_equal "hello world", request["operation_id"] + assert_equal "hello world", request["proto_descriptors"] + assert_equal true, request["throughput_mode"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_database_ddl_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_database_ddl({ database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_database_ddl database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_database_ddl ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new(database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_database_ddl({ database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_database_ddl(::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new(database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_database_ddl_client_stub.call_rpc_count + end + end + + def test_drop_database + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + + drop_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :drop_database, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, request + assert_equal "hello world", request["database"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, drop_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.drop_database({ database: database }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.drop_database database: database do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.drop_database ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new(database: database) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.drop_database({ database: database }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.drop_database(::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new(database: database), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, drop_database_client_stub.call_rpc_count + end + end + + def test_get_database_ddl + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + + get_database_ddl_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_database_ddl, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, request + assert_equal "hello world", request["database"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_database_ddl_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_database_ddl({ database: database }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_database_ddl database: database do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_database_ddl ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new(database: database) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_database_ddl({ database: database }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_database_ddl(::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new(database: database), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_database_ddl_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_create_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. + parent = "hello world" + backup_id = "hello world" + backup = {} + encryption_config = {} + + create_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_backup, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["backup_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::Backup), request["backup"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig), request["encryption_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_backup_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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.create_backup parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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.create_backup ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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.create_backup({ parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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.create_backup(::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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, create_backup_client_stub.call_rpc_count + end + end + + def test_copy_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. + parent = "hello world" + backup_id = "hello world" + source_backup = "hello world" + expire_time = {} + encryption_config = {} + + copy_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :copy_backup, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["backup_id"] + assert_equal "hello world", request["source_backup"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["expire_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig), request["encryption_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, copy_backup_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.copy_backup({ parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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.copy_backup parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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.copy_backup ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new(parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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.copy_backup({ parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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.copy_backup(::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new(parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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, copy_backup_client_stub.call_rpc_count + end + end + + def test_get_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::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::Spanner::Admin::Database::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_update_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::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. + backup = {} + update_mask = {} + + update_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_backup, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::Backup), request["backup"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_backup_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_backup({ backup: backup, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_backup backup: backup, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_backup ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new(backup: backup, 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_backup({ backup: backup, 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_backup(::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new(backup: backup, 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_backup_client_stub.call_rpc_count + end + end + + def test_delete_backup + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_backup({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_backup name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_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.delete_backup(::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new(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_backup_client_stub.call_rpc_count + end + end + + def test_list_backups + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::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" + filter = "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::Spanner::Admin::Database::V1::ListBackupsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backups({ parent: parent, 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.list_backups parent: parent, 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.list_backups ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new(parent: parent, 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.list_backups({ parent: parent, 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.list_backups(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new(parent: parent, 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, list_backups_client_stub.call_rpc_count + end + end + + def test_restore_database + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + database_id = "hello world" + backup = "hello world" + encryption_config = {} + + restore_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_database, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["database_id"] + assert_equal "hello world", request["backup"] + assert_equal :backup, request.source + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig), request["encryption_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_database_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restore_database({ parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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.restore_database parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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.restore_database ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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.restore_database({ parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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.restore_database(::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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, restore_database_client_stub.call_rpc_count + end + end + + def test_list_database_operations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_database_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_database_operations, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_database_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_database_operations({ parent: parent, 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.list_database_operations parent: parent, 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.list_database_operations ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new(parent: parent, 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.list_database_operations({ parent: parent, 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.list_database_operations(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new(parent: parent, 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, list_database_operations_client_stub.call_rpc_count + end + end + + def test_list_backup_operations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_operations, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backup_operations({ parent: parent, 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.list_backup_operations parent: parent, 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.list_backup_operations ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new(parent: parent, 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.list_backup_operations({ parent: parent, 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.list_backup_operations(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new(parent: parent, 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, list_backup_operations_client_stub.call_rpc_count + end + end + + def test_list_database_roles + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_database_roles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_database_roles, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, 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_database_roles_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_database_roles({ parent: parent, page_size: page_size, page_token: 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_database_roles parent: parent, page_size: page_size, page_token: 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_database_roles ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.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_database_roles({ parent: parent, page_size: page_size, page_token: page_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_database_roles(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.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_database_roles_client_stub.call_rpc_count + end + end + + def test_add_split_points + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + split_points = [{}] + initiator = "hello world" + + add_split_points_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_split_points, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest, request + assert_equal "hello world", request["database"] + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints, request["split_points"].first + assert_equal "hello world", request["initiator"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_split_points_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_split_points({ database: database, split_points: split_points, initiator: initiator }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_split_points database: database, split_points: split_points, initiator: initiator do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_split_points ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new(database: database, split_points: split_points, initiator: initiator) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_split_points({ database: database, split_points: split_points, initiator: initiator }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_split_points(::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new(database: database, split_points: split_points, initiator: initiator), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_split_points_client_stub.call_rpc_count + end + end + + def test_create_backup_schedule + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + backup_schedule_id = "hello world" + backup_schedule = {} + + create_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_backup_schedule, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["backup_schedule_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule), request["backup_schedule"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_backup_schedule({ parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_backup_schedule parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_backup_schedule({ parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_backup_schedule_client_stub.call_rpc_count + end + end + + def test_get_backup_schedule + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = 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_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_schedule, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup_schedule({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup_schedule name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.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_schedule({ name: 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_schedule(::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new(name: 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_schedule_client_stub.call_rpc_count + end + end + + def test_update_backup_schedule + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + backup_schedule = {} + update_mask = {} + + update_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_backup_schedule, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule), request["backup_schedule"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_backup_schedule backup_schedule: backup_schedule, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, 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_backup_schedule({ backup_schedule: backup_schedule, 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_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, 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_backup_schedule_client_stub.call_rpc_count + end + end + + def test_delete_backup_schedule + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup_schedule, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_schedule_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_backup_schedule({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_backup_schedule name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_backup_schedule({ 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_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new(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_backup_schedule_client_stub.call_rpc_count + end + end + + def test_list_backup_schedules + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_schedules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_schedules, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, 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_schedules_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backup_schedules({ parent: parent, page_size: page_size, page_token: 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_schedules parent: parent, page_size: page_size, page_token: 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_schedules ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.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_schedules({ parent: parent, page_size: page_size, page_token: page_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_schedules(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.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_schedules_client_stub.call_rpc_count + end + end + + def test_internal_update_graph_operation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + operation_id = "hello world" + vm_identity_token = "hello world" + progress = 3.5 + status = {} + + internal_update_graph_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :internal_update_graph_operation, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest, request + assert_equal "hello world", request["database"] + assert_equal "hello world", request["operation_id"] + assert_equal "hello world", request["vm_identity_token"] + assert_equal 3.5, request["progress"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Rpc::Status), request["status"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, internal_update_graph_operation_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.internal_update_graph_operation({ database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.internal_update_graph_operation database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.internal_update_graph_operation ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest.new(database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.internal_update_graph_operation({ database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.internal_update_graph_operation(::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest.new(database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, internal_update_graph_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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json new file mode 100644 index 000000000000..f5020bbedc04 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "spanner.googleapis.com", + "api_shortname": "spanner", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-instance-v1/latest", + "distribution_name": "google-cloud-spanner-admin-instance-v1", + "is_cloud": true, + "language": "ruby", + "name": "spanner", + "name_pretty": "Cloud Spanner Instance Admin V1 API", + "product_documentation": "https://cloud.google.com/spanner", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-admin-instance-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SPANNER", + "ruby-cloud-product-url": "https://cloud.google.com/spanner", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml new file mode 100644 index 000000000000..d1a683d9ac76 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts new file mode 100644 index 000000000000..5a169a006a69 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Spanner Instance Admin 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-spanner-admin-instance-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..cfb0ca7fb54f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-spanner-admin-instance-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-spanner-admin-instance-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/spanner/admin/instance/v1" + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/spanner/admin/instance/v1" + +::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-spanner-admin-instance-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/spanner/admin/instance/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-spanner-admin-instance-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/README.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md new file mode 100644 index 000000000000..b579b9d0f741 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Spanner Instance Admin V1 API + +Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. + + +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 Spanner Instance Admin V1 API. Most users should consider using +the main client gem, +[google-cloud-spanner](https://rubygems.org/gems/google-cloud-spanner). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-spanner-admin-instance-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/spanner.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/spanner/admin/instance/v1" + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +request = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new # (request fields as keyword arguments...) +response = client.list_instance_configs request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-instance-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/spanner) +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/spanner/admin/instance/v1" +require "logger" + +client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-spanner`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-spanner-admin-instance-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-spanner`. +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-spanner-admin-instance-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-spanner-admin-instance-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile new file mode 100644 index 000000000000..ec4f0e71b11c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SPANNER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SPANNER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SPANNER_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 SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SPANNER_PROJECT"] = project + ENV["SPANNER_TEST_PROJECT"] = project + ENV["SPANNER_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-spanner-admin-instance-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-spanner-admin-instance-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-spanner-admin-instance-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-spanner-admin-instance-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-spanner-admin-instance-v1" + header "google-cloud-spanner-admin-instance-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-spanner-admin-instance-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-spanner-admin-instance-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-spanner-admin-instance-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-spanner-admin-instance-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-spanner-admin-instance-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json new file mode 100644 index 000000000000..2e44d0f21e72 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json @@ -0,0 +1,123 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.spanner.admin.instance.v1", + "libraryPackage": "::Google::Cloud::Spanner::Admin::Instance::V1", + "services": { + "InstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client", + "rpcs": { + "ListInstanceConfigs": { + "methods": [ + "list_instance_configs" + ] + }, + "GetInstanceConfig": { + "methods": [ + "get_instance_config" + ] + }, + "CreateInstanceConfig": { + "methods": [ + "create_instance_config" + ] + }, + "UpdateInstanceConfig": { + "methods": [ + "update_instance_config" + ] + }, + "DeleteInstanceConfig": { + "methods": [ + "delete_instance_config" + ] + }, + "ListInstanceConfigOperations": { + "methods": [ + "list_instance_config_operations" + ] + }, + "ListInstances": { + "methods": [ + "list_instances" + ] + }, + "ListInstancePartitions": { + "methods": [ + "list_instance_partitions" + ] + }, + "GetInstance": { + "methods": [ + "get_instance" + ] + }, + "CreateInstance": { + "methods": [ + "create_instance" + ] + }, + "UpdateInstance": { + "methods": [ + "update_instance" + ] + }, + "DeleteInstance": { + "methods": [ + "delete_instance" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "GetInstancePartition": { + "methods": [ + "get_instance_partition" + ] + }, + "CreateInstancePartition": { + "methods": [ + "create_instance_partition" + ] + }, + "DeleteInstancePartition": { + "methods": [ + "delete_instance_partition" + ] + }, + "UpdateInstancePartition": { + "methods": [ + "update_instance_partition" + ] + }, + "ListInstancePartitionOperations": { + "methods": [ + "list_instance_partition_operations" + ] + }, + "MoveInstance": { + "methods": [ + "move_instance" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec new file mode 100644 index 000000000000..fdf1af7548a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/spanner/admin/instance/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-spanner-admin-instance-v1" + gem.version = Google::Cloud::Spanner::Admin::Instance::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-admin-instance-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details." + gem.summary = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb new file mode 100644 index 000000000000..31e76b3589b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-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/spanner/admin/instance/v1" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb new file mode 100644 index 000000000000..36a77f21a4d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.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 "google/cloud/spanner/admin/instance/v1/instance_admin" +require "google/cloud/spanner/admin/instance/v1/version" + +module Google + module Cloud + module Spanner + module Admin + module Instance + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/spanner/admin/instance/v1" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/spanner/admin/instance/v1" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + module V1 + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/spanner/admin/instance/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb new file mode 100644 index 000000000000..80c300501ca9 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.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! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/spanner/admin/instance/v1/version" + +require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" +require "google/cloud/spanner/admin/instance/v1/instance_admin/paths" +require "google/cloud/spanner/admin/instance/v1/instance_admin/operations" +require "google/cloud/spanner/admin/instance/v1/instance_admin/client" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + ## + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/spanner/admin/instance/v1/instance_admin" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + module InstanceAdmin + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "instance_admin", "helpers.rb" +require "google/cloud/spanner/admin/instance/v1/instance_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb new file mode 100644 index 000000000000..abf931465381 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb @@ -0,0 +1,3140 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/spanner/admin/instance/v1/spanner_instance_admin_pb" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + ## + # Client for the InstanceAdmin service. + # + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :instance_admin_stub + + ## + # Configure the InstanceAdmin Client class. + # + # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all InstanceAdmin clients + # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Spanner", "Admin", "Instance", "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_instance_configs.timeout = 3600.0 + default_config.rpcs.list_instance_configs.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_instance_config.timeout = 3600.0 + default_config.rpcs.get_instance_config.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_instances.timeout = 3600.0 + default_config.rpcs.list_instances.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_instance.timeout = 3600.0 + default_config.rpcs.get_instance.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_instance.timeout = 3600.0 + + default_config.rpcs.update_instance.timeout = 3600.0 + + default_config.rpcs.delete_instance.timeout = 3600.0 + default_config.rpcs.delete_instance.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.set_iam_policy.timeout = 30.0 + + default_config.rpcs.get_iam_policy.timeout = 30.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.test_iam_permissions.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the InstanceAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @instance_admin_stub.universe_domain + end + + ## + # Create a new InstanceAdmin client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the InstanceAdmin 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/spanner/admin/instance/v1/spanner_instance_admin_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 + + @instance_admin_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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 + ) + + @instance_admin_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::Spanner::Admin::Instance::V1::InstanceAdmin::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @instance_admin_stub.logger + end + + # Service calls + + ## + # Lists the supported instance configurations for a given project. + # + # Returns both Google-managed configurations and user-managed + # configurations. + # + # @overload list_instance_configs(request, options = nil) + # Pass arguments to `list_instance_configs` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_instance_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instance_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project for which a list of supported instance + # configurations is requested. Values are of the form + # `projects/`. + # @param page_size [::Integer] + # Number of instance configurations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new + # + # # Call the list_instance_configs method. + # result = client.list_instance_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + # p item + # end + # + def list_instance_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_instance_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_instance_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instance_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instance_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a particular instance configuration. + # + # @overload get_instance_config(request, options = nil) + # Pass arguments to `get_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_instance_config(name: nil) + # Pass arguments to `get_instance_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the requested instance configuration. Values are of + # the form `projects//instanceConfigs/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new + # + # # Call the get_instance_config method. + # result = client.get_instance_config request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + # p result + # + def get_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_instance_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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_instance_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :get_instance_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an instance configuration and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance configuration. The instance configuration name is assigned by the + # caller. If the named instance configuration already exists, + # `CreateInstanceConfig` returns `ALREADY_EXISTS`. + # + # Immediately after the request returns: + # + # * The instance configuration is readable via the API, with all requested + # attributes. The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field is set to true. Its state is `CREATING`. + # + # While the operation is pending: + # + # * Cancelling the operation renders the instance configuration immediately + # unreadable via the API. + # * Except for deleting the creating resource, all other attempts to modify + # the instance configuration are rejected. + # + # Upon completion of the returned operation: + # + # * Instances can be created using the instance configuration. + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field becomes false. Its state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # creation of the instance configuration. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if + # successful. + # + # Authorization requires `spanner.instanceConfigs.create` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest#parent parent}. + # + # @overload create_instance_config(request, options = nil) + # Pass arguments to `create_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil) + # Pass arguments to `create_instance_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project in which to create the instance + # configuration. Values are of the form `projects/`. + # @param instance_config_id [::String] + # Required. The ID of the instance configuration to create. Valid identifiers + # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. The `custom-` prefix is required to avoid name + # conflicts with Google-managed configurations. + # @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] + # Required. The `InstanceConfig` proto of the configuration to create. + # `instance_config.name` must be + # `/instanceConfigs/`. + # `instance_config.base_config` must be a Google-managed configuration name, + # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new + # + # # Call the create_instance_config method. + # result = client.create_instance_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_instance_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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_instance_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :create_instance_config, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 an instance configuration. The returned + # long-running operation can be used to track + # the progress of updating the instance. If the named instance configuration + # does not exist, returns `NOT_FOUND`. + # + # Only user-managed configurations can be updated. + # + # Immediately after the request returns: + # + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field is set to true. + # + # While the operation is pending: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}. + # The operation is guaranteed to succeed at undoing all changes, after + # which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance configuration are rejected. + # * Reading the instance configuration via the API continues to give the + # pre-request values. + # + # Upon completion of the returned operation: + # + # * Creating instances using the instance configuration uses the new + # values. + # * The new values of the instance configuration are readable via the API. + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field becomes false. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # the instance configuration modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if + # successful. + # + # Authorization requires `spanner.instanceConfigs.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. + # + # @overload update_instance_config(request, options = nil) + # Pass arguments to `update_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_instance_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 instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] + # Required. The user instance configuration to update, which must always + # include the instance configuration name. Otherwise, only fields mentioned + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} + # need be included. To prevent conflicts of concurrent updates, + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can + # be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be + # updated. The field mask must always be specified; this prevents any future + # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} + # from being erased accidentally by clients that do not know about them. Only + # display_name and labels can be updated. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new + # + # # Call the update_instance_config method. + # result = client.update_instance_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_instance_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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.instance_config&.name + header_params["instance_config.name"] = request.instance_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_instance_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :update_instance_config, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 the instance configuration. Deletion is only allowed when no + # instances are using the configuration. If any instances are using + # the configuration, returns `FAILED_PRECONDITION`. + # + # Only user-managed configurations can be deleted. + # + # Authorization requires `spanner.instanceConfigs.delete` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. + # + # @overload delete_instance_config(request, options = nil) + # Pass arguments to `delete_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_instance_config(name: nil, etag: nil, validate_only: nil) + # Pass arguments to `delete_instance_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the instance configuration to be deleted. + # Values are of the form + # `projects//instanceConfigs/` + # @param etag [::String] + # Used for optimistic concurrency control as a way to help prevent + # simultaneous deletes of an instance configuration from overwriting each + # other. If not empty, the API + # only deletes the instance configuration when the etag provided matches the + # current status of the requested instance configuration. Otherwise, deletes + # the instance configuration without checking the current status of the + # requested instance configuration. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new + # + # # Call the delete_instance_config method. + # result = client.delete_instance_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_instance_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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_instance_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :delete_instance_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the user-managed instance configuration long-running + # operations in the given project. An instance + # configuration operation has a name of the form + # `projects//instanceConfigs//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting + # from the most recently started operation. + # + # @overload list_instance_config_operations(request, options = nil) + # Pass arguments to `list_instance_config_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instance_config_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project of the instance configuration operations. + # Values are of the form `projects/`. + # @param filter [::String] + # An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + # AND` \ + # `(metadata.instance_config.name:custom-config) AND` \ + # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # * The instance configuration name contains "custom-config". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} + # to the same `parent` and with the same `filter`. + # + # @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/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new + # + # # Call the list_instance_config_operations method. + # result = client.list_instance_config_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_instance_config_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_instance_config_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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_instance_config_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instance_config_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instance_config_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_config_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 + + ## + # Lists all instances in the given project. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, instance_deadline: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project for which a list of instances is + # requested. Values are of the form `projects/`. + # @param page_size [::Integer] + # Number of instances to be returned in the response. If 0 or less, defaults + # to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # @param filter [::String] + # An expression for filtering the results of the request. Filter rules are + # case insensitive. The fields eligible for filtering are: + # + # * `name` + # * `display_name` + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `name:*` --> The instance has a name. + # * `name:Howl` --> The instance's name contains the string "howl". + # * `name:HOWL` --> Equivalent to above. + # * `NAME:howl` --> Equivalent to above. + # * `labels.env:*` --> The instance has the label "env". + # * `labels.env:dev` --> The instance has the label "env" and the value of + # the label contains the string "dev". + # * `name:howl labels.env:dev` --> The instance's name contains "howl" and + # it has the label "env" with its value + # containing "dev". + # @param instance_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Deadline used while retrieving metadata for instances. + # Instances whose metadata cannot be retrieved within this deadline will be + # added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_instances.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instances, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instances, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all instance partitions for the given instance. + # + # @overload list_instance_partitions(request, options = nil) + # Pass arguments to `list_instance_partitions` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_instance_partitions(parent: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) + # Pass arguments to `list_instance_partitions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance whose instance partitions should be listed. Values + # are of the form `projects//instances/`. Use `{instance} + # = '-'` to list instance partitions for all Instances in a project, e.g., + # `projects/myproject/instances/-`. + # @param page_size [::Integer] + # Number of instance partitions to be returned in the response. If 0 or less, + # defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Deadline used while retrieving metadata for instance partitions. + # Instance partitions whose metadata cannot be retrieved within this deadline + # will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new + # + # # Call the list_instance_partitions method. + # result = client.list_instance_partitions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. + # p item + # end + # + def list_instance_partitions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_instance_partitions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_instance_partitions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instance_partitions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instance_partitions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, request, response, 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 information about a particular instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_instance(name: nil, field_mask: nil) + # Pass arguments to `get_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the requested instance. Values are of the form + # `projects//instances/`. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # If field_mask is present, specifies the subset of + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be + # returned. If absent, all + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :get_instance, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an instance and begins preparing it to begin serving. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance. The instance name is assigned by the caller. If the + # named instance already exists, `CreateInstance` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance is readable via the API, with all requested attributes + # but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance immediately unreadable + # via the API. + # * The instance can be deleted. + # * All other attempts to modify the instance are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can be created in the instance. + # * The instance's allocated resource levels are readable via the API. + # * The instance's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track creation of the instance. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata CreateInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_instance(parent: nil, instance_id: nil, instance: nil) + # Pass arguments to `create_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project in which to create the instance. Values + # are of the form `projects/`. + # @param instance_id [::String] + # Required. The ID of the instance to create. Valid identifiers are of the + # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in + # length. + # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] + # Required. The instance to create. The name may be omitted, but if + # specified must be `/instances/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :create_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an instance, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance. If the named instance does not + # exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance's allocation + # has been requested, billing is based on the newly-requested level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time}, + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance are rejected. + # * Reading the instance via the API continues to give the pre-request + # resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance's + # tables. + # * The instance's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track the instance modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata UpdateInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. + # + # Authorization requires `spanner.instances.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance#name name}. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_instance(instance: nil, field_mask: nil) + # Pass arguments to `update_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] + # Required. The instance to update, which must always include the instance + # name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} + # need be included. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. + # The field mask must always be specified; this prevents any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased + # accidentally by clients that do not know about them. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.instance&.name + header_params["instance.name"] = request.instance.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :update_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an instance. + # + # Immediately upon completion of the request: + # + # * Billing ceases for all of the instance's reserved resources. + # + # Soon afterward: + # + # * The instance and *all of its databases* immediately and + # irrevocably disappear from the API. All data in the databases + # is permanently deleted. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_instance(name: nil) + # Pass arguments to `delete_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the instance to be deleted. Values are of the form + # `projects//instances/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :delete_instance, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on an instance resource. Replaces any + # existing policy. + # + # Authorization requires `spanner.instances.setIamPolicy` on + # [resource][google.iam.v1.SetIamPolicyRequest.resource]. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for an instance resource. Returns an empty + # policy if an instance exists but does not have a policy set. + # + # Authorization requires `spanner.instances.getIamPolicy` on + # [resource][google.iam.v1.GetIamPolicyRequest.resource]. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that the caller has on the specified instance resource. + # + # Attempting this RPC on a non-existent Cloud Spanner instance resource will + # result in a NOT_FOUND error if the user has `spanner.instances.list` + # permission on the containing Google Cloud Project. Otherwise returns an + # empty set of permissions. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a particular instance partition. + # + # @overload get_instance_partition(request, options = nil) + # Pass arguments to `get_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_instance_partition(name: nil) + # Pass arguments to `get_instance_partition` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance partition. Values are of + # the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new + # + # # Call the get_instance_partition method. + # result = client.get_instance_partition request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. + # p result + # + def get_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_instance_partition.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :get_instance_partition, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an instance partition and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new instance partition. + # The instance partition name is assigned by the caller. If the named + # instance partition already exists, `CreateInstancePartition` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance partition is readable via the API, with all requested + # attributes but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance partition immediately + # unreadable via the API. + # * The instance partition can be deleted. + # * All other attempts to modify the instance partition are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can start using this instance partition. + # * The instance partition's allocated resource levels are readable via the + # API. + # * The instance partition's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track creation of the instance partition. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if + # successful. + # + # @overload create_instance_partition(request, options = nil) + # Pass arguments to `create_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_instance_partition(parent: nil, instance_partition_id: nil, instance_partition: nil) + # Pass arguments to `create_instance_partition` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance in which to create the instance + # partition. Values are of the form + # `projects//instances/`. + # @param instance_partition_id [::String] + # Required. The ID of the instance partition to create. Valid identifiers are + # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. + # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] + # Required. The instance partition to create. The instance_partition.name may + # be omitted, but if specified must be + # `/instancePartitions/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new + # + # # Call the create_instance_partition method. + # result = client.create_instance_partition request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_instance_partition.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :create_instance_partition, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing instance partition. Requires that the + # instance partition is not used by any database or backup and is not the + # default instance partition of an instance. + # + # Authorization requires `spanner.instancePartitions.delete` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. + # + # @overload delete_instance_partition(request, options = nil) + # Pass arguments to `delete_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_instance_partition(name: nil, etag: nil) + # Pass arguments to `delete_instance_partition` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance partition to be deleted. + # Values are of the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + # @param etag [::String] + # Optional. If not empty, the API only deletes the instance partition when + # the etag provided matches the current status of the requested instance + # partition. Otherwise, deletes the instance partition without checking the + # current status of the requested instance partition. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new + # + # # Call the delete_instance_partition method. + # result = client.delete_instance_partition request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_instance_partition.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :delete_instance_partition, request, 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 instance partition, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance partition. If the named instance + # partition does not exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance partition's + # allocation has been requested, billing is based on the newly-requested + # level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata#cancel_time cancel_time}, + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance partition are rejected. + # * Reading the instance partition via the API continues to give the + # pre-request resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance + # partition's tables. + # * The instance partition's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track the instance partition modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata UpdateInstancePartitionMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if + # successful. + # + # Authorization requires `spanner.instancePartitions.update` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. + # + # @overload update_instance_partition(request, options = nil) + # Pass arguments to `update_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_instance_partition(instance_partition: nil, field_mask: nil) + # Pass arguments to `update_instance_partition` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] + # Required. The instance partition to update, which must always include the + # instance partition name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} + # need be included. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # should be updated. The field mask must always be specified; this prevents + # any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # from being erased accidentally by clients that do not know about them. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new + # + # # Call the update_instance_partition method. + # result = client.update_instance_partition request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.instance_partition&.name + header_params["instance_partition.name"] = request.instance_partition.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_instance_partition.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :update_instance_partition, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 instance partition long-running operations in the given instance. + # An instance partition operation has a name of the form + # `projects//instances//instancePartitions//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting from the + # most recently started operation. + # + # Authorization requires `spanner.instancePartitionOperations.list` + # permission on the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#parent parent}. + # + # @overload list_instance_partition_operations(request, options = nil) + # Pass arguments to `list_instance_partition_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_instance_partition_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) + # Pass arguments to `list_instance_partition_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent instance of the instance partition operations. + # Values are of the form `projects//instances/`. + # @param filter [::String] + # Optional. An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + # AND` \ + # `(metadata.instance_partition.name:custom-instance-partition) AND` \ + # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # * The instance partition name contains "custom-instance-partition". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Optional. Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # Optional. If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} + # to the same `parent` and with the same `filter`. + # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Deadline used while retrieving metadata for instance partition + # operations. Instance partitions whose operation metadata cannot be + # retrieved within this deadline will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. + # + # @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/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new + # + # # Call the list_instance_partition_operations method. + # result = client.list_instance_partition_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_instance_partition_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_instance_partition_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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_instance_partition_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instance_partition_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :list_instance_partition_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_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 + + ## + # Moves an instance to the target instance configuration. You can use the + # returned long-running operation to track + # the progress of moving the instance. + # + # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of + # the following criteria: + # + # * Is undergoing a move to a different instance configuration + # * Has backups + # * Has an ongoing update + # * Contains any CMEK-enabled databases + # * Is a free trial instance + # + # While the operation is pending: + # + # * All other attempts to modify the instance, including changes to its + # compute capacity, are rejected. + # * The following database and backup admin operations are rejected: + # + # * `DatabaseAdmin.CreateDatabase` + # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is + # specified in the request.) + # * `DatabaseAdmin.RestoreDatabase` + # * `DatabaseAdmin.CreateBackup` + # * `DatabaseAdmin.CopyBackup` + # + # * Both the source and target instance configurations are subject to + # hourly compute and storage charges. + # * The instance might experience higher read-write latencies and a higher + # transaction abort rate. However, moving an instance doesn't cause any + # downtime. + # + # The returned long-running operation has + # a name of the format + # `/operations/` and can be used to track + # the move instance operation. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata MoveInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, + # if successful. + # Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata#cancel_time cancel_time}. + # Cancellation is not immediate because it involves moving any data + # previously moved to the target instance configuration back to the original + # instance configuration. You can use this operation to track the progress of + # the cancellation. Upon successful completion of the cancellation, the + # operation terminates with `CANCELLED` status. + # + # If not cancelled, upon completion of the returned operation: + # + # * The instance successfully moves to the target instance + # configuration. + # * You are billed for compute and storage in target instance + # configuration. + # + # Authorization requires the `spanner.instances.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance instance}. + # + # For more details, see + # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). + # + # @overload move_instance(request, options = nil) + # Pass arguments to `move_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload move_instance(name: nil, target_config: nil) + # Pass arguments to `move_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The instance to move. + # Values are of the form `projects//instances/`. + # @param target_config [::String] + # Required. The target instance configuration where to move the instance. + # Values are of the form `projects//instanceConfigs/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new + # + # # Call the move_instance method. + # result = client.move_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def move_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.move_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.move_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.move_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.call_rpc :move_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the InstanceAdmin API. + # + # This class represents the configuration for InstanceAdmin, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_instance_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instance_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instance_configs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the InstanceAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_instance_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_configs + ## + # RPC-specific configuration for `get_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_config + ## + # RPC-specific configuration for `create_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance_config + ## + # RPC-specific configuration for `update_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance_config + ## + # RPC-specific configuration for `delete_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance_config + ## + # RPC-specific configuration for `list_instance_config_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_config_operations + ## + # RPC-specific configuration for `list_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `list_instance_partitions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_partitions + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `update_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `get_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_partition + ## + # RPC-specific configuration for `create_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance_partition + ## + # RPC-specific configuration for `delete_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance_partition + ## + # RPC-specific configuration for `update_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance_partition + ## + # RPC-specific configuration for `list_instance_partition_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_partition_operations + ## + # RPC-specific configuration for `move_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :move_instance + + # @private + def initialize parent_rpcs = nil + list_instance_configs_config = parent_rpcs.list_instance_configs if parent_rpcs.respond_to? :list_instance_configs + @list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config + get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config + @get_instance_config = ::Gapic::Config::Method.new get_instance_config_config + create_instance_config_config = parent_rpcs.create_instance_config if parent_rpcs.respond_to? :create_instance_config + @create_instance_config = ::Gapic::Config::Method.new create_instance_config_config + update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config + @update_instance_config = ::Gapic::Config::Method.new update_instance_config_config + delete_instance_config_config = parent_rpcs.delete_instance_config if parent_rpcs.respond_to? :delete_instance_config + @delete_instance_config = ::Gapic::Config::Method.new delete_instance_config_config + list_instance_config_operations_config = parent_rpcs.list_instance_config_operations if parent_rpcs.respond_to? :list_instance_config_operations + @list_instance_config_operations = ::Gapic::Config::Method.new list_instance_config_operations_config + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + list_instance_partitions_config = parent_rpcs.list_instance_partitions if parent_rpcs.respond_to? :list_instance_partitions + @list_instance_partitions = ::Gapic::Config::Method.new list_instance_partitions_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance + @update_instance = ::Gapic::Config::Method.new update_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + get_instance_partition_config = parent_rpcs.get_instance_partition if parent_rpcs.respond_to? :get_instance_partition + @get_instance_partition = ::Gapic::Config::Method.new get_instance_partition_config + create_instance_partition_config = parent_rpcs.create_instance_partition if parent_rpcs.respond_to? :create_instance_partition + @create_instance_partition = ::Gapic::Config::Method.new create_instance_partition_config + delete_instance_partition_config = parent_rpcs.delete_instance_partition if parent_rpcs.respond_to? :delete_instance_partition + @delete_instance_partition = ::Gapic::Config::Method.new delete_instance_partition_config + update_instance_partition_config = parent_rpcs.update_instance_partition if parent_rpcs.respond_to? :update_instance_partition + @update_instance_partition = ::Gapic::Config::Method.new update_instance_partition_config + list_instance_partition_operations_config = parent_rpcs.list_instance_partition_operations if parent_rpcs.respond_to? :list_instance_partition_operations + @list_instance_partition_operations = ::Gapic::Config::Method.new list_instance_partition_operations_config + move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance + @move_instance = ::Gapic::Config::Method.new move_instance_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-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb new file mode 100644 index 000000000000..f1cfbb949203 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.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 "googleauth" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + # Credentials for the InstanceAdmin API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.admin" + ] + self.env_vars = [ + "SPANNER_CREDENTIALS", + "SPANNER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPANNER_CREDENTIALS_JSON", + "SPANNER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb new file mode 100644 index 000000000000..1c2e3065f0d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb @@ -0,0 +1,845 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the InstanceAdmin 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 InstanceAdmin 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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Spanner::Admin::Instance::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::Spanner::Admin::Instance::V1::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 = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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 +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb new file mode 100644 index 000000000000..58eb65bcfcfe --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + # Path helper methods for the InstanceAdmin API. + module Paths + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}` + # + # @param project [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/instances/#{instance}" + end + + ## + # Create a fully-qualified InstanceConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instanceConfigs/{instance_config}` + # + # @param project [String] + # @param instance_config [String] + # + # @return [::String] + def instance_config_path project:, instance_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/instanceConfigs/#{instance_config}" + end + + ## + # Create a fully-qualified InstancePartition resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + # + # @param project [String] + # @param instance [String] + # @param instance_partition [String] + # + # @return [::String] + def instance_partition_path project:, instance:, instance_partition: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/instancePartitions/#{instance_partition}" + 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 + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb new file mode 100644 index 000000000000..17c9131daf5d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.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" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/spanner/admin/instance/v1/version" + +require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" +require "google/cloud/spanner/admin/instance/v1/instance_admin/paths" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/client" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + ## + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + module InstanceAdmin + # Client for the REST transport + module Rest + end + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb new file mode 100644 index 000000000000..660ec9bb8d2c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb @@ -0,0 +1,2948 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/spanner/admin/instance/v1/spanner_instance_admin_pb" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + module Rest + ## + # REST client for the InstanceAdmin service. + # + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :instance_admin_stub + + ## + # Configure the InstanceAdmin Client class. + # + # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all InstanceAdmin clients + # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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", "Spanner", "Admin", "Instance", "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_instance_configs.timeout = 3600.0 + default_config.rpcs.list_instance_configs.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_instance_config.timeout = 3600.0 + default_config.rpcs.get_instance_config.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_instances.timeout = 3600.0 + default_config.rpcs.list_instances.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_instance.timeout = 3600.0 + default_config.rpcs.get_instance.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_instance.timeout = 3600.0 + + default_config.rpcs.update_instance.timeout = 3600.0 + + default_config.rpcs.delete_instance.timeout = 3600.0 + default_config.rpcs.delete_instance.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.set_iam_policy.timeout = 30.0 + + default_config.rpcs.get_iam_policy.timeout = 30.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.test_iam_permissions.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the InstanceAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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 + @instance_admin_stub.universe_domain + end + + ## + # Create a new InstanceAdmin REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the InstanceAdmin 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::Spanner::Admin::Instance::V1::InstanceAdmin::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 + + @instance_admin_stub = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @instance_admin_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @instance_admin_stub.logger + end + + # Service calls + + ## + # Lists the supported instance configurations for a given project. + # + # Returns both Google-managed configurations and user-managed + # configurations. + # + # @overload list_instance_configs(request, options = nil) + # Pass arguments to `list_instance_configs` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_instance_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instance_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project for which a list of supported instance + # configurations is requested. Values are of the form + # `projects/`. + # @param page_size [::Integer] + # Number of instance configurations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new + # + # # Call the list_instance_configs method. + # result = client.list_instance_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + # p item + # end + # + def list_instance_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_instance_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instance_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instance_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instance_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, "instance_configs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a particular instance configuration. + # + # @overload get_instance_config(request, options = nil) + # Pass arguments to `get_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_instance_config(name: nil) + # Pass arguments to `get_instance_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the requested instance configuration. Values are of + # the form `projects//instanceConfigs/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new + # + # # Call the get_instance_config method. + # result = client.get_instance_config request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + # p result + # + def get_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_instance_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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_instance_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.get_instance_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an instance configuration and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance configuration. The instance configuration name is assigned by the + # caller. If the named instance configuration already exists, + # `CreateInstanceConfig` returns `ALREADY_EXISTS`. + # + # Immediately after the request returns: + # + # * The instance configuration is readable via the API, with all requested + # attributes. The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field is set to true. Its state is `CREATING`. + # + # While the operation is pending: + # + # * Cancelling the operation renders the instance configuration immediately + # unreadable via the API. + # * Except for deleting the creating resource, all other attempts to modify + # the instance configuration are rejected. + # + # Upon completion of the returned operation: + # + # * Instances can be created using the instance configuration. + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field becomes false. Its state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # creation of the instance configuration. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if + # successful. + # + # Authorization requires `spanner.instanceConfigs.create` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest#parent parent}. + # + # @overload create_instance_config(request, options = nil) + # Pass arguments to `create_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil) + # Pass arguments to `create_instance_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project in which to create the instance + # configuration. Values are of the form `projects/`. + # @param instance_config_id [::String] + # Required. The ID of the instance configuration to create. Valid identifiers + # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. The `custom-` prefix is required to avoid name + # conflicts with Google-managed configurations. + # @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] + # Required. The `InstanceConfig` proto of the configuration to create. + # `instance_config.name` must be + # `/instanceConfigs/`. + # `instance_config.base_config` must be a Google-managed configuration name, + # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new + # + # # Call the create_instance_config method. + # result = client.create_instance_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_instance_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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_instance_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.create_instance_config request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an instance configuration. The returned + # long-running operation can be used to track + # the progress of updating the instance. If the named instance configuration + # does not exist, returns `NOT_FOUND`. + # + # Only user-managed configurations can be updated. + # + # Immediately after the request returns: + # + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field is set to true. + # + # While the operation is pending: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}. + # The operation is guaranteed to succeed at undoing all changes, after + # which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance configuration are rejected. + # * Reading the instance configuration via the API continues to give the + # pre-request values. + # + # Upon completion of the returned operation: + # + # * Creating instances using the instance configuration uses the new + # values. + # * The new values of the instance configuration are readable via the API. + # * The instance configuration's + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} + # field becomes false. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # the instance configuration modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if + # successful. + # + # Authorization requires `spanner.instanceConfigs.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. + # + # @overload update_instance_config(request, options = nil) + # Pass arguments to `update_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_instance_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 instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] + # Required. The user instance configuration to update, which must always + # include the instance configuration name. Otherwise, only fields mentioned + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} + # need be included. To prevent conflicts of concurrent updates, + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can + # be used. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be + # updated. The field mask must always be specified; this prevents any future + # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} + # from being erased accidentally by clients that do not know about them. Only + # display_name and labels can be updated. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new + # + # # Call the update_instance_config method. + # result = client.update_instance_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_instance_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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_instance_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.update_instance_config request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 the instance configuration. Deletion is only allowed when no + # instances are using the configuration. If any instances are using + # the configuration, returns `FAILED_PRECONDITION`. + # + # Only user-managed configurations can be deleted. + # + # Authorization requires `spanner.instanceConfigs.delete` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. + # + # @overload delete_instance_config(request, options = nil) + # Pass arguments to `delete_instance_config` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_instance_config(name: nil, etag: nil, validate_only: nil) + # Pass arguments to `delete_instance_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the instance configuration to be deleted. + # Values are of the form + # `projects//instanceConfigs/` + # @param etag [::String] + # Used for optimistic concurrency control as a way to help prevent + # simultaneous deletes of an instance configuration from overwriting each + # other. If not empty, the API + # only deletes the instance configuration when the etag provided matches the + # current status of the requested instance configuration. Otherwise, deletes + # the instance configuration without checking the current status of the + # requested instance configuration. + # @param validate_only [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new + # + # # Call the delete_instance_config method. + # result = client.delete_instance_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_instance_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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_instance_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_instance_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.delete_instance_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the user-managed instance configuration long-running + # operations in the given project. An instance + # configuration operation has a name of the form + # `projects//instanceConfigs//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting + # from the most recently started operation. + # + # @overload list_instance_config_operations(request, options = nil) + # Pass arguments to `list_instance_config_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_instance_config_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project of the instance configuration operations. + # Values are of the form `projects/`. + # @param filter [::String] + # An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + # AND` \ + # `(metadata.instance_config.name:custom-config) AND` \ + # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # * The instance configuration name contains "custom-config". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} + # to the same `parent` and with the same `filter`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new + # + # # Call the list_instance_config_operations method. + # result = client.list_instance_config_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_instance_config_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_instance_config_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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instance_config_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instance_config_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instance_config_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_config_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 + + ## + # Lists all instances in the given project. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, instance_deadline: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project for which a list of instances is + # requested. Values are of the form `projects/`. + # @param page_size [::Integer] + # Number of instances to be returned in the response. If 0 or less, defaults + # to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # @param filter [::String] + # An expression for filtering the results of the request. Filter rules are + # case insensitive. The fields eligible for filtering are: + # + # * `name` + # * `display_name` + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `name:*` --> The instance has a name. + # * `name:Howl` --> The instance's name contains the string "howl". + # * `name:HOWL` --> Equivalent to above. + # * `NAME:howl` --> Equivalent to above. + # * `labels.env:*` --> The instance has the label "env". + # * `labels.env:dev` --> The instance has the label "env" and the value of + # the label contains the string "dev". + # * `name:howl labels.env:dev` --> The instance's name contains "howl" and + # it has the label "env" with its value + # containing "dev". + # @param instance_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Deadline used while retrieving metadata for instances. + # Instances whose metadata cannot be retrieved within this deadline will be + # added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_instances.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instances request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instances, "instances", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all instance partitions for the given instance. + # + # @overload list_instance_partitions(request, options = nil) + # Pass arguments to `list_instance_partitions` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_instance_partitions(parent: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) + # Pass arguments to `list_instance_partitions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The instance whose instance partitions should be listed. Values + # are of the form `projects//instances/`. Use `{instance} + # = '-'` to list instance partitions for all Instances in a project, e.g., + # `projects/myproject/instances/-`. + # @param page_size [::Integer] + # Number of instance partitions to be returned in the response. If 0 or less, + # defaults to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Deadline used while retrieving metadata for instance partitions. + # Instance partitions whose metadata cannot be retrieved within this deadline + # will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new + # + # # Call the list_instance_partitions method. + # result = client.list_instance_partitions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. + # p item + # end + # + def list_instance_partitions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_instance_partitions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instance_partitions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instance_partitions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instance_partitions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, "instance_partitions", request, result, 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 information about a particular instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_instance(name: nil, field_mask: nil) + # Pass arguments to `get_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the requested instance. Values are of the form + # `projects//instances/`. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # If field_mask is present, specifies the subset of + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be + # returned. If absent, all + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.get_instance request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an instance and begins preparing it to begin serving. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance. The instance name is assigned by the caller. If the + # named instance already exists, `CreateInstance` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance is readable via the API, with all requested attributes + # but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance immediately unreadable + # via the API. + # * The instance can be deleted. + # * All other attempts to modify the instance are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can be created in the instance. + # * The instance's allocated resource levels are readable via the API. + # * The instance's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track creation of the instance. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata CreateInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_instance(parent: nil, instance_id: nil, instance: nil) + # Pass arguments to `create_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project in which to create the instance. Values + # are of the form `projects/`. + # @param instance_id [::String] + # Required. The ID of the instance to create. Valid identifiers are of the + # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in + # length. + # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] + # Required. The instance to create. The name may be omitted, but if + # specified must be `/instances/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.create_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an instance, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance. If the named instance does not + # exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance's allocation + # has been requested, billing is based on the newly-requested level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time}, + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance are rejected. + # * Reading the instance via the API continues to give the pre-request + # resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance's + # tables. + # * The instance's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track the instance modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata UpdateInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. + # + # Authorization requires `spanner.instances.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance#name name}. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_instance(instance: nil, field_mask: nil) + # Pass arguments to `update_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] + # Required. The instance to update, which must always include the instance + # name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} + # need be included. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. + # The field mask must always be specified; this prevents any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased + # accidentally by clients that do not know about them. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.update_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an instance. + # + # Immediately upon completion of the request: + # + # * Billing ceases for all of the instance's reserved resources. + # + # Soon afterward: + # + # * The instance and *all of its databases* immediately and + # irrevocably disappear from the API. All data in the databases + # is permanently deleted. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_instance(name: nil) + # Pass arguments to `delete_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the instance to be deleted. Values are of the form + # `projects//instances/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.delete_instance request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on an instance resource. Replaces any + # existing policy. + # + # Authorization requires `spanner.instances.setIamPolicy` on + # [resource][google.iam.v1.SetIamPolicyRequest.resource]. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for an instance resource. Returns an empty + # policy if an instance exists but does not have a policy set. + # + # Authorization requires `spanner.instances.getIamPolicy` on + # [resource][google.iam.v1.GetIamPolicyRequest.resource]. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that the caller has on the specified instance resource. + # + # Attempting this RPC on a non-existent Cloud Spanner instance resource will + # result in a NOT_FOUND error if the user has `spanner.instances.list` + # permission on the containing Google Cloud Project. Otherwise returns an + # empty set of permissions. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a particular instance partition. + # + # @overload get_instance_partition(request, options = nil) + # Pass arguments to `get_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_instance_partition(name: nil) + # Pass arguments to `get_instance_partition` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance partition. Values are of + # the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new + # + # # Call the get_instance_partition method. + # result = client.get_instance_partition request + # + # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. + # p result + # + def get_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_instance_partition.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.get_instance_partition request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an instance partition and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new instance partition. + # The instance partition name is assigned by the caller. If the named + # instance partition already exists, `CreateInstancePartition` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance partition is readable via the API, with all requested + # attributes but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance partition immediately + # unreadable via the API. + # * The instance partition can be deleted. + # * All other attempts to modify the instance partition are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can start using this instance partition. + # * The instance partition's allocated resource levels are readable via the + # API. + # * The instance partition's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track creation of the instance partition. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if + # successful. + # + # @overload create_instance_partition(request, options = nil) + # Pass arguments to `create_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_instance_partition(parent: nil, instance_partition_id: nil, instance_partition: nil) + # Pass arguments to `create_instance_partition` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance in which to create the instance + # partition. Values are of the form + # `projects//instances/`. + # @param instance_partition_id [::String] + # Required. The ID of the instance partition to create. Valid identifiers are + # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. + # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] + # Required. The instance partition to create. The instance_partition.name may + # be omitted, but if specified must be + # `/instancePartitions/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new + # + # # Call the create_instance_partition method. + # result = client.create_instance_partition request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_instance_partition.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.create_instance_partition request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing instance partition. Requires that the + # instance partition is not used by any database or backup and is not the + # default instance partition of an instance. + # + # Authorization requires `spanner.instancePartitions.delete` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. + # + # @overload delete_instance_partition(request, options = nil) + # Pass arguments to `delete_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_instance_partition(name: nil, etag: nil) + # Pass arguments to `delete_instance_partition` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 instance partition to be deleted. + # Values are of the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + # @param etag [::String] + # Optional. If not empty, the API only deletes the instance partition when + # the etag provided matches the current status of the requested instance + # partition. Otherwise, deletes the instance partition without checking the + # current status of the requested instance partition. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new + # + # # Call the delete_instance_partition method. + # result = client.delete_instance_partition request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_instance_partition.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.delete_instance_partition request, 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 instance partition, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance partition. If the named instance + # partition does not exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance partition's + # allocation has been requested, billing is based on the newly-requested + # level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata#cancel_time cancel_time}, + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance partition are rejected. + # * Reading the instance partition via the API continues to give the + # pre-request resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance + # partition's tables. + # * The instance partition's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track the instance partition modification. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata UpdateInstancePartitionMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if + # successful. + # + # Authorization requires `spanner.instancePartitions.update` permission on + # the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. + # + # @overload update_instance_partition(request, options = nil) + # Pass arguments to `update_instance_partition` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_instance_partition(instance_partition: nil, field_mask: nil) + # Pass arguments to `update_instance_partition` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] + # Required. The instance partition to update, which must always include the + # instance partition name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} + # need be included. + # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # should be updated. The field mask must always be specified; this prevents + # any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # from being erased accidentally by clients that do not know about them. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new + # + # # Call the update_instance_partition method. + # result = client.update_instance_partition request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance_partition request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_instance_partition.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_instance_partition.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_instance_partition.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.update_instance_partition request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 instance partition long-running operations in the given instance. + # An instance partition operation has a name of the form + # `projects//instances//instancePartitions//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting from the + # most recently started operation. + # + # Authorization requires `spanner.instancePartitionOperations.list` + # permission on the resource + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#parent parent}. + # + # @overload list_instance_partition_operations(request, options = nil) + # Pass arguments to `list_instance_partition_operations` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_instance_partition_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) + # Pass arguments to `list_instance_partition_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent instance of the instance partition operations. + # Values are of the form `projects//instances/`. + # @param filter [::String] + # Optional. An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + # AND` \ + # `(metadata.instance_partition.name:custom-instance-partition) AND` \ + # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # * The instance partition name contains "custom-instance-partition". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @param page_size [::Integer] + # Optional. Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @param page_token [::String] + # Optional. If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} + # to the same `parent` and with the same `filter`. + # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Deadline used while retrieving metadata for instance partition + # operations. Instance partitions whose operation metadata cannot be + # retrieved within this deadline will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new + # + # # Call the list_instance_partition_operations method. + # result = client.list_instance_partition_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_instance_partition_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_instance_partition_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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_instance_partition_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instance_partition_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.list_instance_partition_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_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 + + ## + # Moves an instance to the target instance configuration. You can use the + # returned long-running operation to track + # the progress of moving the instance. + # + # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of + # the following criteria: + # + # * Is undergoing a move to a different instance configuration + # * Has backups + # * Has an ongoing update + # * Contains any CMEK-enabled databases + # * Is a free trial instance + # + # While the operation is pending: + # + # * All other attempts to modify the instance, including changes to its + # compute capacity, are rejected. + # * The following database and backup admin operations are rejected: + # + # * `DatabaseAdmin.CreateDatabase` + # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is + # specified in the request.) + # * `DatabaseAdmin.RestoreDatabase` + # * `DatabaseAdmin.CreateBackup` + # * `DatabaseAdmin.CopyBackup` + # + # * Both the source and target instance configurations are subject to + # hourly compute and storage charges. + # * The instance might experience higher read-write latencies and a higher + # transaction abort rate. However, moving an instance doesn't cause any + # downtime. + # + # The returned long-running operation has + # a name of the format + # `/operations/` and can be used to track + # the move instance operation. The + # metadata field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata MoveInstanceMetadata}. + # The response field type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, + # if successful. + # Cancelling the operation sets its metadata's + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata#cancel_time cancel_time}. + # Cancellation is not immediate because it involves moving any data + # previously moved to the target instance configuration back to the original + # instance configuration. You can use this operation to track the progress of + # the cancellation. Upon successful completion of the cancellation, the + # operation terminates with `CANCELLED` status. + # + # If not cancelled, upon completion of the returned operation: + # + # * The instance successfully moves to the target instance + # configuration. + # * You are billed for compute and storage in target instance + # configuration. + # + # Authorization requires the `spanner.instances.update` permission on + # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance instance}. + # + # For more details, see + # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). + # + # @overload move_instance(request, options = nil) + # Pass arguments to `move_instance` via a request object, either of type + # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload move_instance(name: nil, target_config: nil) + # Pass arguments to `move_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The instance to move. + # Values are of the form `projects//instances/`. + # @param target_config [::String] + # Required. The target instance configuration where to move the instance. + # Values are of the form `projects//instanceConfigs/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/spanner/admin/instance/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new + # + # # Call the move_instance method. + # result = client.move_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def move_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.move_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.move_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.move_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @instance_admin_stub.move_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the InstanceAdmin REST API. + # + # This class represents the configuration for InstanceAdmin REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_instance_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instance_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instance_configs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the InstanceAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_instance_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_configs + ## + # RPC-specific configuration for `get_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_config + ## + # RPC-specific configuration for `create_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance_config + ## + # RPC-specific configuration for `update_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance_config + ## + # RPC-specific configuration for `delete_instance_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance_config + ## + # RPC-specific configuration for `list_instance_config_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_config_operations + ## + # RPC-specific configuration for `list_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `list_instance_partitions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_partitions + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `update_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `get_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance_partition + ## + # RPC-specific configuration for `create_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance_partition + ## + # RPC-specific configuration for `delete_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance_partition + ## + # RPC-specific configuration for `update_instance_partition` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance_partition + ## + # RPC-specific configuration for `list_instance_partition_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instance_partition_operations + ## + # RPC-specific configuration for `move_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :move_instance + + # @private + def initialize parent_rpcs = nil + list_instance_configs_config = parent_rpcs.list_instance_configs if parent_rpcs.respond_to? :list_instance_configs + @list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config + get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config + @get_instance_config = ::Gapic::Config::Method.new get_instance_config_config + create_instance_config_config = parent_rpcs.create_instance_config if parent_rpcs.respond_to? :create_instance_config + @create_instance_config = ::Gapic::Config::Method.new create_instance_config_config + update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config + @update_instance_config = ::Gapic::Config::Method.new update_instance_config_config + delete_instance_config_config = parent_rpcs.delete_instance_config if parent_rpcs.respond_to? :delete_instance_config + @delete_instance_config = ::Gapic::Config::Method.new delete_instance_config_config + list_instance_config_operations_config = parent_rpcs.list_instance_config_operations if parent_rpcs.respond_to? :list_instance_config_operations + @list_instance_config_operations = ::Gapic::Config::Method.new list_instance_config_operations_config + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + list_instance_partitions_config = parent_rpcs.list_instance_partitions if parent_rpcs.respond_to? :list_instance_partitions + @list_instance_partitions = ::Gapic::Config::Method.new list_instance_partitions_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance + @update_instance = ::Gapic::Config::Method.new update_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + get_instance_partition_config = parent_rpcs.get_instance_partition if parent_rpcs.respond_to? :get_instance_partition + @get_instance_partition = ::Gapic::Config::Method.new get_instance_partition_config + create_instance_partition_config = parent_rpcs.create_instance_partition if parent_rpcs.respond_to? :create_instance_partition + @create_instance_partition = ::Gapic::Config::Method.new create_instance_partition_config + delete_instance_partition_config = parent_rpcs.delete_instance_partition if parent_rpcs.respond_to? :delete_instance_partition + @delete_instance_partition = ::Gapic::Config::Method.new delete_instance_partition_config + update_instance_partition_config = parent_rpcs.update_instance_partition if parent_rpcs.respond_to? :update_instance_partition + @update_instance_partition = ::Gapic::Config::Method.new update_instance_partition_config + list_instance_partition_operations_config = parent_rpcs.list_instance_partition_operations if parent_rpcs.respond_to? :list_instance_partition_operations + @list_instance_partition_operations = ::Gapic::Config::Method.new list_instance_partition_operations_config + move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance + @move_instance = ::Gapic::Config::Method.new move_instance_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb new file mode 100644 index 000000000000..ca2f206d9d5f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb @@ -0,0 +1,1068 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the InstanceAdmin 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 InstanceAdmin 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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Instance::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/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/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/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/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb new file mode 100644 index 000000000000..7f927a943f3e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb @@ -0,0 +1,1376 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/spanner/admin/instance/v1/spanner_instance_admin_pb" + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + module Rest + ## + # REST service stub for the InstanceAdmin 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_instance_configs REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse] + # A result object deserialized from the server's reply + def list_instance_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_configs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_instance_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # A result object deserialized from the server's reply + def get_instance_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_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_instance_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_instance_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_instance_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_instance_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_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_instance_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_instance_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_instance_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_instance_config_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse] + # A result object deserialized from the server's reply + def list_instance_config_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_config_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_instance_config_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.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_instances REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse] + # A result object deserialized from the server's reply + def list_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_instances", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_instance_partitions REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse] + # A result object deserialized from the server's reply + def list_instance_partitions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_partitions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_instance_partitions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # A result object deserialized from the server's reply + def get_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::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 set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # A result object deserialized from the server's reply + def get_instance_partition request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_partition_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_instance_partition", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_instance_partition request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_partition_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_instance_partition", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_instance_partition request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_partition_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_instance_partition", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_instance_partition request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_partition_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_instance_partition", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_instance_partition_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse] + # A result object deserialized from the server's reply + def list_instance_partition_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_partition_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_instance_partition_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the move_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def move_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_move_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "move_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instance_configs REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instance_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instanceConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_instance_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_instance_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/instanceConfigs", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_instance_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{instance_config.name}", + body: "*", + matches: [ + ["instance_config.name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance_config REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_instance_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instance_config_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instance_config_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instanceConfigOperations", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instances REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instances", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instance_partitions REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instance_partitions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instancePartitions", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/instances", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{instance.name}", + body: "*", + matches: [ + ["instance.name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_instance_partition_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_instance_partition_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/instancePartitions", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_instance_partition_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance_partition REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_instance_partition_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{instance_partition.name}", + body: "*", + matches: [ + ["instance_partition.name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instance_partition_operations REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instance_partition_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instancePartitionOperations", + matches: [ + ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the move_instance REST call + # + # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_move_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:move", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb new file mode 100644 index 000000000000..bc6ad4b7dcf4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" +require "google/cloud/spanner/admin/instance/v1/version" + +module Google + module Cloud + module Spanner + module Admin + module Instance + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/spanner/admin/instance/v1/rest" + # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new + # + module V1 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb new file mode 100644 index 000000000000..a9cfa90b04fb --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb @@ -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! + + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + VERSION = "0.0.1" + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb new file mode 100644 index 000000000000..f6f080766f8d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/admin/instance/v1/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/spanner/admin/instance/v1/common.proto\x12 google.spanner.admin.instance.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8b\x01\n\x11OperationProgress\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\")\n\x10ReplicaSelection\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x02*w\n\x11\x46ulfillmentPeriod\x12\"\n\x1e\x46ULFILLMENT_PERIOD_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x46ULFILLMENT_PERIOD_NORMAL\x10\x01\x12\x1f\n\x1b\x46ULFILLMENT_PERIOD_EXTENDED\x10\x02\x42\xfd\x01\n$com.google.spanner.admin.instance.v1B\x0b\x43ommonProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + OperationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.OperationProgress").msgclass + ReplicaSelection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaSelection").msgclass + FulfillmentPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FulfillmentPeriod").enummodule + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb new file mode 100644 index 000000000000..49f467979b51 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/admin/instance/v1/spanner_instance_admin.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/spanner/admin/instance/v1/common_pb' + + +descriptor_data = "\n=google/spanner/admin/instance/v1/spanner_instance_admin.proto\x12 google.spanner.admin.instance.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a-google/spanner/admin/instance/v1/common.proto\"\xda\x01\n\x0bReplicaInfo\x12\x10\n\x08location\x18\x01 \x01(\t\x12G\n\x04type\x18\x02 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType\x12\x1f\n\x17\x64\x65\x66\x61ult_leader_location\x18\x03 \x01(\x08\"O\n\x0bReplicaType\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x12\x0b\n\x07WITNESS\x10\x03\"\xc0\n\n\x0eInstanceConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12O\n\x0b\x63onfig_type\x18\x05 \x01(\x0e\x32\x35.google.spanner.admin.instance.v1.InstanceConfig.TypeB\x03\xe0\x41\x03\x12?\n\x08replicas\x18\x03 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfo\x12M\n\x11optional_replicas\x18\x06 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfoB\x03\xe0\x41\x03\x12?\n\x0b\x62\x61se_config\x18\x07 \x01(\tB*\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12L\n\x06labels\x18\x08 \x03(\x0b\x32<.google.spanner.admin.instance.v1.InstanceConfig.LabelsEntry\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x12\x16\n\x0eleader_options\x18\x04 \x03(\t\x12\x18\n\x0breconciling\x18\n \x01(\x08\x42\x03\xe0\x41\x03\x12J\n\x05state\x18\x0b \x01(\x0e\x32\x36.google.spanner.admin.instance.v1.InstanceConfig.StateB\x03\xe0\x41\x03\x12r\n\x1a\x66ree_instance_availability\x18\x0c \x01(\x0e\x32I.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailabilityB\x03\xe0\x41\x03\x12U\n\x0bquorum_type\x18\x12 \x01(\x0e\x32;.google.spanner.admin.instance.v1.InstanceConfig.QuorumTypeB\x03\xe0\x41\x03\x12.\n!storage_limit_per_processing_unit\x18\x13 \x01(\x03\x42\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\"B\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eGOOGLE_MANAGED\x10\x01\x12\x10\n\x0cUSER_MANAGED\x10\x02\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"\x88\x01\n\x18\x46reeInstanceAvailability\x12*\n&FREE_INSTANCE_AVAILABILITY_UNSPECIFIED\x10\x00\x12\r\n\tAVAILABLE\x10\x01\x12\x0f\n\x0bUNSUPPORTED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x12\n\x0eQUOTA_EXCEEDED\x10\x04\"X\n\nQuorumType\x12\x1b\n\x17QUORUM_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06REGION\x10\x01\x12\x0f\n\x0b\x44UAL_REGION\x10\x02\x12\x10\n\x0cMULTI_REGION\x10\x03:\x81\x01\xea\x41~\n%spanner.googleapis.com/InstanceConfig\x12\x34projects/{project}/instanceConfigs/{instance_config}*\x0finstanceConfigs2\x0einstanceConfig\"\xb2\x01\n\x16ReplicaComputeCapacity\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x02 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x03 \x01(\x05H\x00\x42\x12\n\x10\x63ompute_capacity\"\x84\n\n\x11\x41utoscalingConfig\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x02\x12h\n\x13\x61utoscaling_targets\x18\x02 \x01(\x0b\x32\x46.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargetsB\x03\xe0\x41\x02\x12|\n\x1e\x61symmetric_autoscaling_options\x18\x03 \x03(\x0b\x32O.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOptionB\x03\xe0\x41\x01\x1a\x97\x01\n\x11\x41utoscalingLimits\x12\x13\n\tmin_nodes\x18\x01 \x01(\x05H\x00\x12\x1e\n\x14min_processing_units\x18\x02 \x01(\x05H\x00\x12\x13\n\tmax_nodes\x18\x03 \x01(\x05H\x01\x12\x1e\n\x14max_processing_units\x18\x04 \x01(\x05H\x01\x42\x0b\n\tmin_limitB\x0b\n\tmax_limit\x1a\x9e\x01\n\x12\x41utoscalingTargets\x12\x32\n%high_priority_cpu_utilization_percent\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12*\n\x1dtotal_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12(\n\x1bstorage_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1a\xe3\x04\n\x1b\x41symmetricAutoscalingOption\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x82\x01\n\toverrides\x18\x02 \x01(\x0b\x32j.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverridesB\x03\xe0\x41\x01\x1a\xea\x02\n\x1a\x41utoscalingConfigOverrides\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x01\x12\x45\n8autoscaling_target_high_priority_cpu_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12=\n0autoscaling_target_total_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x32\n%disable_high_priority_cpu_autoscaling\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12*\n\x1d\x64isable_total_cpu_autoscaling\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xaa\x0b\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nnode_count\x18\x05 \x01(\x05\x12\x18\n\x10processing_units\x18\t \x01(\x05\x12_\n\x18replica_compute_capacity\x18\x13 \x03(\x0b\x32\x38.google.spanner.admin.instance.v1.ReplicaComputeCapacityB\x03\xe0\x41\x03\x12T\n\x12\x61utoscaling_config\x18\x11 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x44\n\x05state\x18\x06 \x01(\x0e\x32\x30.google.spanner.admin.instance.v1.Instance.StateB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x07 \x03(\x0b\x32\x36.google.spanner.admin.instance.v1.Instance.LabelsEntry\x12N\n\rinstance_type\x18\n \x01(\x0e\x32\x37.google.spanner.admin.instance.v1.Instance.InstanceType\x12\x15\n\rendpoint_uris\x18\x08 \x03(\t\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x16\x66ree_instance_metadata\x18\r \x01(\x0b\x32\x36.google.spanner.admin.instance.v1.FreeInstanceMetadata\x12H\n\x07\x65\x64ition\x18\x14 \x01(\x0e\x32\x32.google.spanner.admin.instance.v1.Instance.EditionB\x03\xe0\x41\x01\x12o\n\x1c\x64\x65\x66\x61ult_backup_schedule_type\x18\x17 \x01(\x0e\x32\x44.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleTypeB\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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"Q\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bPROVISIONED\x10\x01\x12\x11\n\rFREE_INSTANCE\x10\x02\"U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03\"b\n\x19\x44\x65\x66\x61ultBackupScheduleType\x12,\n(DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\r\n\tAUTOMATIC\x10\x02:b\xea\x41_\n\x1fspanner.googleapis.com/Instance\x12\'projects/{project}/instances/{instance}*\tinstances2\x08instance\"\x88\x01\n\x1aListInstanceConfigsRequest\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\"\x82\x01\n\x1bListInstanceConfigsResponse\x12J\n\x10instance_configs\x18\x01 \x03(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x18GetInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\xea\x01\n\x1b\x43reateInstanceConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x1f\n\x12instance_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0finstance_config\x18\x03 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xba\x01\n\x1bUpdateInstanceConfigRequest\x12N\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\x7f\n\x1b\x44\x65leteInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xa1\x01\n#ListInstanceConfigOperationsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"r\n$ListInstanceConfigOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x12GetInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb9\x01\n\x15\x43reateInstanceRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x08instance\x18\x03 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\"\xc9\x01\n\x14ListInstancesRequest\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\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x35\n\x11instance_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x84\x01\n\x15ListInstancesResponse\x12=\n\tinstances\x18\x01 \x03(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x8f\x01\n\x15UpdateInstanceRequest\x12\x41\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x15\x44\x65leteInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\"\xbf\x02\n\x16\x43reateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xbf\x02\n\x16UpdateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xce\x02\n\x14\x46reeInstanceMetadata\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0cupgrade_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12^\n\x0f\x65xpire_behavior\x18\x03 \x01(\x0e\x32\x45.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior\"i\n\x0e\x45xpireBehavior\x12\x1f\n\x1b\x45XPIRE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x17\n\x13\x46REE_TO_PROVISIONED\x10\x01\x12\x1d\n\x19REMOVE_AFTER_GRACE_PERIOD\x10\x02\"\xe1\x01\n\x1c\x43reateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe1\x01\n\x1cUpdateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x06\n\x11InstancePartition\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x05 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x06 \x01(\x05H\x00\x12T\n\x12\x61utoscaling_config\x18\r \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12M\n\x05state\x18\x07 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.InstancePartition.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15referencing_databases\x18\n \x03(\tB\x03\xe0\x41\x03\x12\"\n\x13referencing_backups\x18\x0b \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0c \x01(\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02:\xa6\x01\xea\x41\xa2\x01\n(spanner.googleapis.com/InstancePartition\x12Oprojects/{project}/instances/{instance}/instancePartitions/{instance_partition}*\x12instancePartitions2\x11instancePartitionB\x12\n\x10\x63ompute_capacity\"\x81\x02\n\x1f\x43reateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd3\x01\n\x1e\x43reateInstancePartitionRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\"\n\x15instance_partition_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x12instance_partition\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\"n\n\x1e\x44\x65leteInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\"]\n\x1bGetInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\"\xab\x01\n\x1eUpdateInstancePartitionRequest\x12T\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x81\x02\n\x1fUpdateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc5\x01\n\x1dListInstancePartitionsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x44\n\x1binstance_partition_deadline\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xa0\x01\n\x1eListInstancePartitionsResponse\x12P\n\x13instance_partitions\x18\x01 \x03(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xed\x01\n&ListInstancePartitionOperationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\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\x12\x44\n\x1binstance_partition_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x9e\x01\n\'ListInstancePartitionOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\'\n\x1funreachable_instance_partitions\x18\x03 \x03(\t\"\x92\x01\n\x13MoveInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x44\n\rtarget_config\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\x16\n\x14MoveInstanceResponse\"\xa5\x01\n\x14MoveInstanceMetadata\x12\x15\n\rtarget_config\x18\x01 \x01(\t\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xda\'\n\rInstanceAdmin\x12\xcc\x01\n\x13ListInstanceConfigs\x12<.google.spanner.admin.instance.v1.ListInstanceConfigsRequest\x1a=.google.spanner.admin.instance.v1.ListInstanceConfigsResponse\"8\xda\x41\x06parent\x82\xd3\xe4\x93\x02)\x12\'/v1/{parent=projects/*}/instanceConfigs\x12\xb9\x01\n\x11GetInstanceConfig\x12:.google.spanner.admin.instance.v1.GetInstanceConfigRequest\x1a\x30.google.spanner.admin.instance.v1.InstanceConfig\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)\x12\'/v1/{name=projects/*/instanceConfigs/*}\x12\xc8\x02\n\x14\x43reateInstanceConfig\x12=.google.spanner.admin.instance.v1.CreateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd1\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.CreateInstanceConfigMetadata\xda\x41)parent,instance_config,instance_config_id\x82\xd3\xe4\x93\x02,\"\'/v1/{parent=projects/*}/instanceConfigs:\x01*\x12\xca\x02\n\x14UpdateInstanceConfig\x12=.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata\xda\x41\x1binstance_config,update_mask\x82\xd3\xe4\x93\x02<27/v1/{instance_config.name=projects/*/instanceConfigs/*}:\x01*\x12\xa5\x01\n\x14\x44\x65leteInstanceConfig\x12=.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest\x1a\x16.google.protobuf.Empty\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)*\'/v1/{name=projects/*/instanceConfigs/*}\x12\xf0\x01\n\x1cListInstanceConfigOperations\x12\x45.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest\x1a\x46.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*}/instanceConfigOperations\x12\xb4\x01\n\rListInstances\x12\x36.google.spanner.admin.instance.v1.ListInstancesRequest\x1a\x37.google.spanner.admin.instance.v1.ListInstancesResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=projects/*}/instances\x12\xe4\x01\n\x16ListInstancePartitions\x12?.google.spanner.admin.instance.v1.ListInstancePartitionsRequest\x1a@.google.spanner.admin.instance.v1.ListInstancePartitionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/instances/*}/instancePartitions\x12\xa1\x01\n\x0bGetInstance\x12\x34.google.spanner.admin.instance.v1.GetInstanceRequest\x1a*.google.spanner.admin.instance.v1.Instance\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=projects/*/instances/*}\x12\x9c\x02\n\x0e\x43reateInstance\x12\x37.google.spanner.admin.instance.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb1\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.CreateInstanceMetadata\xda\x41\x1bparent,instance_id,instance\x82\xd3\xe4\x93\x02&\"!/v1/{parent=projects/*}/instances:\x01*\x12\x9d\x02\n\x0eUpdateInstance\x12\x37.google.spanner.admin.instance.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.UpdateInstanceMetadata\xda\x41\x13instance,field_mask\x82\xd3\xe4\x93\x02/2*/v1/{instance.name=projects/*/instances/*}:\x01*\x12\x93\x01\n\x0e\x44\x65leteInstance\x12\x37.google.spanner.admin.instance.v1.DeleteInstanceRequest\x1a\x16.google.protobuf.Empty\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v1/{name=projects/*/instances/*}\x12\x9a\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"O\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:setIamPolicy:\x01*\x12\x93\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"H\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:getIamPolicy:\x01*\x12\xc5\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"Z\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02=\"8/v1/{resource=projects/*/instances/*}:testIamPermissions:\x01*\x12\xd1\x01\n\x14GetInstancePartition\x12=.google.spanner.admin.instance.v1.GetInstancePartitionRequest\x1a\x33.google.spanner.admin.instance.v1.InstancePartition\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xe9\x02\n\x17\x43reateInstancePartition\x12@.google.spanner.admin.instance.v1.CreateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xec\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.CreateInstancePartitionMetadata\xda\x41/parent,instance_partition,instance_partition_id\x82\xd3\xe4\x93\x02;\"6/v1/{parent=projects/*/instances/*}/instancePartitions:\x01*\x12\xba\x01\n\x17\x44\x65leteInstancePartition\x12@.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xea\x02\n\x17UpdateInstancePartition\x12@.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xed\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata\xda\x41\x1dinstance_partition,field_mask\x82\xd3\xe4\x93\x02N2I/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}:\x01*\x12\x88\x02\n\x1fListInstancePartitionOperations\x12H.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest\x1aI.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/instances/*}/instancePartitionOperations\x12\x89\x02\n\x0cMoveInstance\x12\x35.google.spanner.admin.instance.v1.MoveInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa2\x01\xca\x41n\n5google.spanner.admin.instance.v1.MoveInstanceResponse\x12\x35google.spanner.admin.instance.v1.MoveInstanceMetadata\x82\xd3\xe4\x93\x02+\"&/v1/{name=projects/*/instances/*}:move:\x01*\x1ax\xca\x41\x16spanner.googleapis.com\xd2\x41\\https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.adminB\x8b\x02\n$com.google.spanner.admin.instance.v1B\x19SpannerInstanceAdminProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + ReplicaInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo").msgclass + ReplicaInfo::ReplicaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType").enummodule + InstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig").msgclass + InstanceConfig::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.Type").enummodule + InstanceConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.State").enummodule + InstanceConfig::FreeInstanceAvailability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability").enummodule + InstanceConfig::QuorumType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.QuorumType").enummodule + ReplicaComputeCapacity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaComputeCapacity").msgclass + AutoscalingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig").msgclass + AutoscalingConfig::AutoscalingLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits").msgclass + AutoscalingConfig::AutoscalingTargets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets").msgclass + AutoscalingConfig::AsymmetricAutoscalingOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption").msgclass + AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides").msgclass + Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance").msgclass + Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.State").enummodule + Instance::InstanceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.InstanceType").enummodule + Instance::Edition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.Edition").enummodule + Instance::DefaultBackupScheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType").enummodule + ListInstanceConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsRequest").msgclass + ListInstanceConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsResponse").msgclass + GetInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceConfigRequest").msgclass + CreateInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceConfigRequest").msgclass + UpdateInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceConfigRequest").msgclass + DeleteInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstanceConfigRequest").msgclass + ListInstanceConfigOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest").msgclass + ListInstanceConfigOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse").msgclass + GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceRequest").msgclass + CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceRequest").msgclass + ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesRequest").msgclass + ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesResponse").msgclass + UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceRequest").msgclass + DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstanceRequest").msgclass + CreateInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceMetadata").msgclass + UpdateInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceMetadata").msgclass + FreeInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FreeInstanceMetadata").msgclass + FreeInstanceMetadata::ExpireBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior").enummodule + CreateInstanceConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceConfigMetadata").msgclass + UpdateInstanceConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata").msgclass + InstancePartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstancePartition").msgclass + InstancePartition::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstancePartition.State").enummodule + CreateInstancePartitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstancePartitionMetadata").msgclass + CreateInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstancePartitionRequest").msgclass + DeleteInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstancePartitionRequest").msgclass + GetInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstancePartitionRequest").msgclass + UpdateInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstancePartitionRequest").msgclass + UpdateInstancePartitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata").msgclass + ListInstancePartitionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionsRequest").msgclass + ListInstancePartitionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionsResponse").msgclass + ListInstancePartitionOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest").msgclass + ListInstancePartitionOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse").msgclass + MoveInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceRequest").msgclass + MoveInstanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceResponse").msgclass + MoveInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceMetadata").msgclass + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb new file mode 100644 index 000000000000..d5b8848f47b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb @@ -0,0 +1,463 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/spanner/admin/instance/v1/spanner_instance_admin.proto for package 'Google.Cloud.Spanner.Admin.Instance.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/spanner/admin/instance/v1/spanner_instance_admin_pb' + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + module InstanceAdmin + # Cloud Spanner Instance Admin API + # + # The Cloud Spanner Instance Admin API can be used to create, delete, + # modify and list instances. Instances are dedicated Cloud Spanner serving + # and storage resources to be used by Cloud Spanner databases. + # + # Each instance has a "configuration", which dictates where the + # serving resources for the Cloud Spanner instance are located (e.g., + # US-central, Europe). Configurations are created by Google based on + # resource availability. + # + # Cloud Spanner billing is based on the instances that exist and their + # sizes. After an instance exists, there are no additional + # per-database or per-operation charges for use of the instance + # (though there may be additional network bandwidth charges). + # Instances offer isolation: problems with databases in one instance + # will not affect other instances. However, within an instance + # databases can affect each other. For example, if one database in an + # instance receives a lot of requests and consumes most of the + # instance resources, fewer resources are available for other + # databases in that instance, and their performance may suffer. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.spanner.admin.instance.v1.InstanceAdmin' + + # Lists the supported instance configurations for a given project. + # + # Returns both Google-managed configurations and user-managed + # configurations. + rpc :ListInstanceConfigs, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse + # Gets information about a particular instance configuration. + rpc :GetInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig + # Creates an instance configuration and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance configuration. The instance configuration name is assigned by the + # caller. If the named instance configuration already exists, + # `CreateInstanceConfig` returns `ALREADY_EXISTS`. + # + # Immediately after the request returns: + # + # * The instance configuration is readable via the API, with all requested + # attributes. The instance configuration's + # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + # field is set to true. Its state is `CREATING`. + # + # While the operation is pending: + # + # * Cancelling the operation renders the instance configuration immediately + # unreadable via the API. + # * Except for deleting the creating resource, all other attempts to modify + # the instance configuration are rejected. + # + # Upon completion of the returned operation: + # + # * Instances can be created using the instance configuration. + # * The instance configuration's + # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + # field becomes false. Its state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # creation of the instance configuration. The + # metadata field type is + # [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. + # The response field type is + # [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if + # successful. + # + # Authorization requires `spanner.instanceConfigs.create` permission on + # the resource + # [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. + rpc :CreateInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::Google::Longrunning::Operation + # Updates an instance configuration. The returned + # long-running operation can be used to track + # the progress of updating the instance. If the named instance configuration + # does not exist, returns `NOT_FOUND`. + # + # Only user-managed configurations can be updated. + # + # Immediately after the request returns: + # + # * The instance configuration's + # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + # field is set to true. + # + # While the operation is pending: + # + # * Cancelling the operation sets its metadata's + # [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. + # The operation is guaranteed to succeed at undoing all changes, after + # which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance configuration are rejected. + # * Reading the instance configuration via the API continues to give the + # pre-request values. + # + # Upon completion of the returned operation: + # + # * Creating instances using the instance configuration uses the new + # values. + # * The new values of the instance configuration are readable via the API. + # * The instance configuration's + # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + # field becomes false. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to track + # the instance configuration modification. The + # metadata field type is + # [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. + # The response field type is + # [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if + # successful. + # + # Authorization requires `spanner.instanceConfigs.update` permission on + # the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. + rpc :UpdateInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::Google::Longrunning::Operation + # Deletes the instance configuration. Deletion is only allowed when no + # instances are using the configuration. If any instances are using + # the configuration, returns `FAILED_PRECONDITION`. + # + # Only user-managed configurations can be deleted. + # + # Authorization requires `spanner.instanceConfigs.delete` permission on + # the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. + rpc :DeleteInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::Google::Protobuf::Empty + # Lists the user-managed instance configuration long-running + # operations in the given project. An instance + # configuration operation has a name of the form + # `projects//instanceConfigs//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting + # from the most recently started operation. + rpc :ListInstanceConfigOperations, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse + # Lists all instances in the given project. + rpc :ListInstances, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse + # Lists all instance partitions for the given instance. + rpc :ListInstancePartitions, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse + # Gets information about a particular instance. + rpc :GetInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::Instance + # Creates an instance and begins preparing it to begin serving. The + # returned long-running operation + # can be used to track the progress of preparing the new + # instance. The instance name is assigned by the caller. If the + # named instance already exists, `CreateInstance` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance is readable via the API, with all requested attributes + # but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance immediately unreadable + # via the API. + # * The instance can be deleted. + # * All other attempts to modify the instance are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can be created in the instance. + # * The instance's allocated resource levels are readable via the API. + # * The instance's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track creation of the instance. The + # metadata field type is + # [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. + # The response field type is + # [Instance][google.spanner.admin.instance.v1.Instance], if successful. + rpc :CreateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::Google::Longrunning::Operation + # Updates an instance, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance. If the named instance does not + # exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance's allocation + # has been requested, billing is based on the newly-requested level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance are rejected. + # * Reading the instance via the API continues to give the pre-request + # resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance's + # tables. + # * The instance's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format `/operations/` and + # can be used to track the instance modification. The + # metadata field type is + # [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. + # The response field type is + # [Instance][google.spanner.admin.instance.v1.Instance], if successful. + # + # Authorization requires `spanner.instances.update` permission on + # the resource [name][google.spanner.admin.instance.v1.Instance.name]. + rpc :UpdateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::Google::Longrunning::Operation + # Deletes an instance. + # + # Immediately upon completion of the request: + # + # * Billing ceases for all of the instance's reserved resources. + # + # Soon afterward: + # + # * The instance and *all of its databases* immediately and + # irrevocably disappear from the API. All data in the databases + # is permanently deleted. + rpc :DeleteInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::Google::Protobuf::Empty + # Sets the access control policy on an instance resource. Replaces any + # existing policy. + # + # Authorization requires `spanner.instances.setIamPolicy` on + # [resource][google.iam.v1.SetIamPolicyRequest.resource]. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets the access control policy for an instance resource. Returns an empty + # policy if an instance exists but does not have a policy set. + # + # Authorization requires `spanner.instances.getIamPolicy` on + # [resource][google.iam.v1.GetIamPolicyRequest.resource]. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that the caller has on the specified instance resource. + # + # Attempting this RPC on a non-existent Cloud Spanner instance resource will + # result in a NOT_FOUND error if the user has `spanner.instances.list` + # permission on the containing Google Cloud Project. Otherwise returns an + # empty set of permissions. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Gets information about a particular instance partition. + rpc :GetInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition + # Creates an instance partition and begins preparing it to be used. The + # returned long-running operation + # can be used to track the progress of preparing the new instance partition. + # The instance partition name is assigned by the caller. If the named + # instance partition already exists, `CreateInstancePartition` returns + # `ALREADY_EXISTS`. + # + # Immediately upon completion of this request: + # + # * The instance partition is readable via the API, with all requested + # attributes but no allocated resources. Its state is `CREATING`. + # + # Until completion of the returned operation: + # + # * Cancelling the operation renders the instance partition immediately + # unreadable via the API. + # * The instance partition can be deleted. + # * All other attempts to modify the instance partition are rejected. + # + # Upon completion of the returned operation: + # + # * Billing for all successfully-allocated resources begins (some types + # may have lower than the requested levels). + # * Databases can start using this instance partition. + # * The instance partition's allocated resource levels are readable via the + # API. + # * The instance partition's state becomes `READY`. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track creation of the instance partition. The + # metadata field type is + # [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. + # The response field type is + # [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if + # successful. + rpc :CreateInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::Google::Longrunning::Operation + # Deletes an existing instance partition. Requires that the + # instance partition is not used by any database or backup and is not the + # default instance partition of an instance. + # + # Authorization requires `spanner.instancePartitions.delete` permission on + # the resource + # [name][google.spanner.admin.instance.v1.InstancePartition.name]. + rpc :DeleteInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::Google::Protobuf::Empty + # Updates an instance partition, and begins allocating or releasing resources + # as requested. The returned long-running operation can be used to track the + # progress of updating the instance partition. If the named instance + # partition does not exist, returns `NOT_FOUND`. + # + # Immediately upon completion of this request: + # + # * For resource types for which a decrease in the instance partition's + # allocation has been requested, billing is based on the newly-requested + # level. + # + # Until completion of the returned operation: + # + # * Cancelling the operation sets its metadata's + # [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], + # and begins restoring resources to their pre-request values. The + # operation is guaranteed to succeed at undoing all resource changes, + # after which point it terminates with a `CANCELLED` status. + # * All other attempts to modify the instance partition are rejected. + # * Reading the instance partition via the API continues to give the + # pre-request resource levels. + # + # Upon completion of the returned operation: + # + # * Billing begins for all successfully-allocated resources (some types + # may have lower than the requested levels). + # * All newly-reserved resources are available for serving the instance + # partition's tables. + # * The instance partition's new resource levels are readable via the API. + # + # The returned long-running operation will + # have a name of the format + # `/operations/` and can be used to + # track the instance partition modification. The + # metadata field type is + # [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. + # The response field type is + # [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if + # successful. + # + # Authorization requires `spanner.instancePartitions.update` permission on + # the resource + # [name][google.spanner.admin.instance.v1.InstancePartition.name]. + rpc :UpdateInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::Google::Longrunning::Operation + # Lists instance partition long-running operations in the given instance. + # An instance partition operation has a name of the form + # `projects//instances//instancePartitions//operations/`. + # The long-running operation + # metadata field type + # `metadata.type_url` describes the type of the metadata. Operations returned + # include those that have completed/failed/canceled within the last 7 days, + # and pending operations. Operations returned are ordered by + # `operation.metadata.value.start_time` in descending order starting from the + # most recently started operation. + # + # Authorization requires `spanner.instancePartitionOperations.list` + # permission on the resource + # [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. + rpc :ListInstancePartitionOperations, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse + # Moves an instance to the target instance configuration. You can use the + # returned long-running operation to track + # the progress of moving the instance. + # + # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of + # the following criteria: + # + # * Is undergoing a move to a different instance configuration + # * Has backups + # * Has an ongoing update + # * Contains any CMEK-enabled databases + # * Is a free trial instance + # + # While the operation is pending: + # + # * All other attempts to modify the instance, including changes to its + # compute capacity, are rejected. + # * The following database and backup admin operations are rejected: + # + # * `DatabaseAdmin.CreateDatabase` + # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is + # specified in the request.) + # * `DatabaseAdmin.RestoreDatabase` + # * `DatabaseAdmin.CreateBackup` + # * `DatabaseAdmin.CopyBackup` + # + # * Both the source and target instance configurations are subject to + # hourly compute and storage charges. + # * The instance might experience higher read-write latencies and a higher + # transaction abort rate. However, moving an instance doesn't cause any + # downtime. + # + # The returned long-running operation has + # a name of the format + # `/operations/` and can be used to track + # the move instance operation. The + # metadata field type is + # [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. + # The response field type is + # [Instance][google.spanner.admin.instance.v1.Instance], + # if successful. + # Cancelling the operation sets its metadata's + # [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. + # Cancellation is not immediate because it involves moving any data + # previously moved to the target instance configuration back to the original + # instance configuration. You can use this operation to track the progress of + # the cancellation. Upon successful completion of the cancellation, the + # operation terminates with `CANCELLED` status. + # + # If not cancelled, upon completion of the returned operation: + # + # * The instance successfully moves to the target instance + # configuration. + # * You are billed for compute and storage in target instance + # configuration. + # + # Authorization requires the `spanner.instances.update` permission on + # the resource [instance][google.spanner.admin.instance.v1.Instance]. + # + # For more details, see + # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). + rpc :MoveInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md new file mode 100644 index 000000000000..ff5b3befac4d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Spanner Instance Admin 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-spanner-admin-instance-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb new file mode 100644 index 000000000000..12175e5866ba --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + # Encapsulates progress related information for a Cloud Spanner long + # running instance operations. + # @!attribute [rw] progress_percent + # @return [::Integer] + # Percent completion of the operation. + # Values are between 0 and 100 inclusive. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Time the request was received. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # If set, the time at which this operation failed or was completed + # successfully. + class OperationProgress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ReplicaSelection identifies replicas with common properties. + # @!attribute [rw] location + # @return [::String] + # Required. Name of the location of the replicas (e.g., "us-central1"). + class ReplicaSelection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicates the expected fulfillment period of an operation. + module FulfillmentPeriod + # Not specified. + FULFILLMENT_PERIOD_UNSPECIFIED = 0 + + # Normal fulfillment period. The operation is expected to complete within + # minutes. + FULFILLMENT_PERIOD_NORMAL = 1 + + # Extended fulfillment period. It can take up to an hour for the operation + # to complete. + FULFILLMENT_PERIOD_EXTENDED = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb new file mode 100644 index 000000000000..d59b84381c11 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb @@ -0,0 +1,1561 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module Admin + module Instance + module V1 + # @!attribute [rw] location + # @return [::String] + # The location of the serving resources, e.g., "us-central1". + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo::ReplicaType] + # The type of replica. + # @!attribute [rw] default_leader_location + # @return [::Boolean] + # If true, this location is designated as the default leader location where + # leader replicas are placed. See the [region types + # documentation](https://cloud.google.com/spanner/docs/instances#region_types) + # for more details. + class ReplicaInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the type of replica. See the [replica types + # documentation](https://cloud.google.com/spanner/docs/replication#replica_types) + # for more details. + module ReplicaType + # Not specified. + TYPE_UNSPECIFIED = 0 + + # Read-write replicas support both reads and writes. These replicas: + # + # * Maintain a full copy of your data. + # * Serve reads. + # * Can vote whether to commit a write. + # * Participate in leadership election. + # * Are eligible to become a leader. + READ_WRITE = 1 + + # Read-only replicas only support reads (not writes). Read-only replicas: + # + # * Maintain a full copy of your data. + # * Serve reads. + # * Do not participate in voting to commit writes. + # * Are not eligible to become a leader. + READ_ONLY = 2 + + # Witness replicas don't support reads but do participate in voting to + # commit writes. Witness replicas: + # + # * Do not maintain a full copy of data. + # * Do not serve reads. + # * Vote whether to commit writes. + # * Participate in leader election but are not eligible to become leader. + WITNESS = 3 + end + end + + # A possible configuration for a Cloud Spanner instance. Configurations + # define the geographic placement of nodes and their replication. + # @!attribute [rw] name + # @return [::String] + # A unique identifier for the instance configuration. Values + # are of the form + # `projects//instanceConfigs/[a-z][-a-z0-9]*`. + # + # User instance configuration must start with `custom-`. + # @!attribute [rw] display_name + # @return [::String] + # The name of this instance configuration as it appears in UIs. + # @!attribute [r] config_type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::Type] + # Output only. Whether this instance configuration is a Google-managed or + # user-managed configuration. + # @!attribute [rw] replicas + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo>] + # The geographic placement of nodes in this instance configuration and their + # replication properties. + # + # To create user-managed configurations, input + # `replicas` must include all replicas in `replicas` of the `base_config` + # and include one or more replicas in the `optional_replicas` of the + # `base_config`. + # @!attribute [r] optional_replicas + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo>] + # Output only. The available optional replicas to choose from for + # user-managed configurations. Populated for Google-managed configurations. + # @!attribute [rw] base_config + # @return [::String] + # Base configuration name, e.g. projects//instanceConfigs/nam3, + # based on which this configuration is created. Only set for user-managed + # configurations. `base_config` must refer to a configuration of type + # `GOOGLE_MANAGED` in the same project as this configuration. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Cloud Labels are a flexible and lightweight mechanism for organizing cloud + # resources into groups that reflect a customer's organizational needs and + # deployment strategies. Cloud Labels can be used to filter collections of + # resources. They can be used to control how resource metrics are aggregated. + # And they can be used as arguments to policy management rules (e.g. route, + # firewall, load balancing, etc.). + # + # * Label keys must be between 1 and 63 characters long and must conform to + # the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + # * Label values must be between 0 and 63 characters long and must conform + # to the regular expression `[a-z0-9_-]{0,63}`. + # * No more than 64 labels can be associated with a given resource. + # + # See https://goo.gl/xmQnxf for more information on and examples of labels. + # + # If you plan to use labels in your own code, please note that additional + # characters may be allowed in the future. Therefore, you are advised to use + # an internal label representation, such as JSON, which doesn't rely upon + # specific characters being disallowed. For example, representing labels + # as the string: name + "_" + value would prove problematic if we were to + # allow "_" in a future release. + # @!attribute [rw] etag + # @return [::String] + # etag is used for optimistic concurrency control as a way + # to help prevent simultaneous updates of a instance configuration from + # overwriting each other. It is strongly suggested that systems make use of + # the etag in the read-modify-write cycle to perform instance configuration + # updates in order to avoid race conditions: An etag is returned in the + # response which contains instance configurations, and systems are expected + # to put that etag in the request to update instance configuration to ensure + # that their change is applied to the same version of the instance + # configuration. If no etag is provided in the call to update the instance + # configuration, then the existing instance configuration is overwritten + # blindly. + # @!attribute [rw] leader_options + # @return [::Array<::String>] + # Allowed values of the "default_leader" schema option for databases in + # instances that use this instance configuration. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. If true, the instance configuration is being created or + # updated. If false, there are no ongoing operations for the instance + # configuration. + # @!attribute [r] state + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::State] + # Output only. The current instance configuration state. Applicable only for + # `USER_MANAGED` configurations. + # @!attribute [r] free_instance_availability + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::FreeInstanceAvailability] + # Output only. Describes whether free instances are available to be created + # in this instance configuration. + # @!attribute [r] quorum_type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::QuorumType] + # Output only. The `QuorumType` of the instance configuration. + # @!attribute [r] storage_limit_per_processing_unit + # @return [::Integer] + # Output only. The storage limit in bytes per processing unit. + class InstanceConfig + 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 + + # The type of this configuration. + module Type + # Unspecified. + TYPE_UNSPECIFIED = 0 + + # Google-managed configuration. + GOOGLE_MANAGED = 1 + + # User-managed configuration. + USER_MANAGED = 2 + end + + # Indicates the current state of the instance configuration. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The instance configuration is still being created. + CREATING = 1 + + # The instance configuration is fully created and ready to be used to + # create instances. + READY = 2 + end + + # Describes the availability for free instances to be created in an instance + # configuration. + module FreeInstanceAvailability + # Not specified. + FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0 + + # Indicates that free instances are available to be created in this + # instance configuration. + AVAILABLE = 1 + + # Indicates that free instances are not supported in this instance + # configuration. + UNSUPPORTED = 2 + + # Indicates that free instances are currently not available to be created + # in this instance configuration. + DISABLED = 3 + + # Indicates that additional free instances cannot be created in this + # instance configuration because the project has reached its limit of free + # instances. + QUOTA_EXCEEDED = 4 + end + + # Indicates the quorum type of this instance configuration. + module QuorumType + # Quorum type not specified. + QUORUM_TYPE_UNSPECIFIED = 0 + + # An instance configuration tagged with `REGION` quorum type forms a write + # quorum in a single region. + REGION = 1 + + # An instance configuration tagged with the `DUAL_REGION` quorum type forms + # a write quorum with exactly two read-write regions in a multi-region + # configuration. + # + # This instance configuration requires failover in the event of + # regional failures. + DUAL_REGION = 2 + + # An instance configuration tagged with the `MULTI_REGION` quorum type + # forms a write quorum from replicas that are spread across more than one + # region in a multi-region configuration. + MULTI_REGION = 3 + end + end + + # ReplicaComputeCapacity describes the amount of server resources that are + # allocated to each replica identified by the replica selection. + # @!attribute [rw] replica_selection + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaSelection] + # Required. Identifies replicas by specified properties. + # All replicas in the selection have the same amount of compute capacity. + # @!attribute [rw] node_count + # @return [::Integer] + # The number of nodes allocated to each replica. + # + # This may be zero in API responses for instances that are not yet in + # state `READY`. + # + # Note: The following fields are mutually exclusive: `node_count`, `processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] processing_units + # @return [::Integer] + # The number of processing units allocated to each replica. + # + # This may be zero in API responses for instances that are not yet in + # state `READY`. + # + # Note: The following fields are mutually exclusive: `processing_units`, `node_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReplicaComputeCapacity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Autoscaling configuration for an instance. + # @!attribute [rw] autoscaling_limits + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingLimits] + # Required. Autoscaling limits for an instance. + # @!attribute [rw] autoscaling_targets + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets] + # Required. The autoscaling targets for an instance. + # @!attribute [rw] asymmetric_autoscaling_options + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption>] + # Optional. Optional asymmetric autoscaling options. + # Replicas matching the replica selection criteria will be autoscaled + # independently from other replicas. The autoscaler will scale the replicas + # based on the utilization of replicas identified by the replica selection. + # Replica selections should not overlap with each other. + # + # Other replicas (those do not match any replica selection) will be + # autoscaled together and will have the same compute capacity allocated to + # them. + class AutoscalingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The autoscaling limits for the instance. Users can define the minimum and + # maximum compute capacity allocated to the instance, and the autoscaler will + # only scale within that range. Users can either use nodes or processing + # units to specify the limits, but should use the same unit to set both the + # min_limit and max_limit. + # @!attribute [rw] min_nodes + # @return [::Integer] + # Minimum number of nodes allocated to the instance. If set, this number + # should be greater than or equal to 1. + # + # Note: The following fields are mutually exclusive: `min_nodes`, `min_processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] min_processing_units + # @return [::Integer] + # Minimum number of processing units allocated to the instance. If set, + # this number should be multiples of 1000. + # + # Note: The following fields are mutually exclusive: `min_processing_units`, `min_nodes`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] max_nodes + # @return [::Integer] + # Maximum number of nodes allocated to the instance. If set, this number + # should be greater than or equal to min_nodes. + # + # Note: The following fields are mutually exclusive: `max_nodes`, `max_processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] max_processing_units + # @return [::Integer] + # Maximum number of processing units allocated to the instance. If set, + # this number should be multiples of 1000 and be greater than or equal to + # min_processing_units. + # + # Note: The following fields are mutually exclusive: `max_processing_units`, `max_nodes`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AutoscalingLimits + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The autoscaling targets for an instance. + # @!attribute [rw] high_priority_cpu_utilization_percent + # @return [::Integer] + # Optional. The target high priority cpu utilization percentage that the + # autoscaler should be trying to achieve for the instance. This number is + # on a scale from 0 (no utilization) to 100 (full utilization). The valid + # range is [10, 90] inclusive. If not specified or set to 0, the autoscaler + # skips scaling based on high priority CPU utilization. + # @!attribute [rw] total_cpu_utilization_percent + # @return [::Integer] + # Optional. The target total CPU utilization percentage that the autoscaler + # should be trying to achieve for the instance. This number is on a scale + # from 0 (no utilization) to 100 (full utilization). The valid range is + # [10, 90] inclusive. If not specified or set to 0, the autoscaler skips + # scaling based on total CPU utilization. If both + # `high_priority_cpu_utilization_percent` and + # `total_cpu_utilization_percent` are specified, the autoscaler provisions + # the larger of the two required compute capacities to satisfy both + # targets. + # @!attribute [rw] storage_utilization_percent + # @return [::Integer] + # Required. The target storage utilization percentage that the autoscaler + # should be trying to achieve for the instance. This number is on a scale + # from 0 (no utilization) to 100 (full utilization). The valid range is + # [10, 99] inclusive. + class AutoscalingTargets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AsymmetricAutoscalingOption specifies the scaling of replicas identified by + # the given selection. + # @!attribute [rw] replica_selection + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaSelection] + # Required. Selects the replicas to which this AsymmetricAutoscalingOption + # applies. Only read-only replicas are supported. + # @!attribute [rw] overrides + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides] + # Optional. Overrides applied to the top-level autoscaling configuration + # for the selected replicas. + class AsymmetricAutoscalingOption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Overrides the top-level autoscaling configuration for the replicas + # identified by `replica_selection`. All fields in this message are + # optional. Any unspecified fields will use the corresponding values from + # the top-level autoscaling configuration. + # @!attribute [rw] autoscaling_limits + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingLimits] + # Optional. If specified, overrides the min/max limit in the top-level + # autoscaling configuration for the selected replicas. + # @!attribute [rw] autoscaling_target_high_priority_cpu_utilization_percent + # @return [::Integer] + # Optional. If specified, overrides the autoscaling target + # high_priority_cpu_utilization_percent in the top-level autoscaling + # configuration for the selected replicas. + # @!attribute [rw] autoscaling_target_total_cpu_utilization_percent + # @return [::Integer] + # Optional. If specified, overrides the + # autoscaling target `total_cpu_utilization_percent` + # in the top-level autoscaling configuration for the selected replicas. + # @!attribute [rw] disable_high_priority_cpu_autoscaling + # @return [::Boolean] + # Optional. If true, disables high priority CPU autoscaling for the + # selected replicas and ignores + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} + # in the top-level autoscaling configuration. + # + # When setting this field to true, setting + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} + # field to a non-zero value for the same replica is not supported. + # + # If false, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} + # field in the replica will be used if set to a non-zero value. + # Otherwise, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} + # field in the top-level autoscaling configuration will be used. + # + # Setting both + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} + # and + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} + # to true for the same replica is not supported. + # @!attribute [rw] disable_total_cpu_autoscaling + # @return [::Boolean] + # Optional. If true, disables total CPU autoscaling for the selected + # replicas and ignores + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} + # in the top-level autoscaling configuration. + # + # When setting this field to true, setting + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} + # field to a non-zero value for the same replica is not supported. + # + # If false, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} + # field in the replica will be used if set to a non-zero value. + # Otherwise, the + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} + # field in the top-level autoscaling configuration will be used. + # + # Setting both + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} + # and + # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} + # to true for the same replica is not supported. + class AutoscalingConfigOverrides + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # An isolated set of Cloud Spanner resources on which databases can be hosted. + # @!attribute [rw] name + # @return [::String] + # Required. A unique identifier for the instance, which cannot be changed + # after the instance is created. Values are of the form + # `projects//instances/[a-z][-a-z0-9]*[a-z0-9]`. The final + # segment of the name must be between 2 and 64 characters in length. + # @!attribute [rw] config + # @return [::String] + # Required. The name of the instance's configuration. Values are of the form + # `projects//instanceConfigs/`. See + # also {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} and + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. + # @!attribute [rw] display_name + # @return [::String] + # Required. The descriptive name for this instance as it appears in UIs. + # Must be unique per project and between 4 and 30 characters in length. + # @!attribute [rw] node_count + # @return [::Integer] + # The number of nodes allocated to this instance. At most, one of either + # `node_count` or `processing_units` should be present in the message. + # + # Users can set the `node_count` field to specify the target number of nodes + # allocated to the instance. + # + # If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` + # field and reflects the current number of nodes allocated to the instance. + # + # This might be zero in API responses for instances that are not yet in the + # `READY` state. + # + # + # For more information, see + # [Compute capacity, nodes, and processing + # units](https://cloud.google.com/spanner/docs/compute-capacity). + # @!attribute [rw] processing_units + # @return [::Integer] + # The number of processing units allocated to this instance. At most, one of + # either `processing_units` or `node_count` should be present in the message. + # + # Users can set the `processing_units` field to specify the target number of + # processing units allocated to the instance. + # + # If autoscaling is enabled, `processing_units` is treated as an + # `OUTPUT_ONLY` field and reflects the current number of processing units + # allocated to the instance. + # + # This might be zero in API responses for instances that are not yet in the + # `READY` state. + # + # + # For more information, see + # [Compute capacity, nodes and processing + # units](https://cloud.google.com/spanner/docs/compute-capacity). + # @!attribute [r] replica_compute_capacity + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaComputeCapacity>] + # Output only. Lists the compute capacity per ReplicaSelection. A replica + # selection identifies a set of replicas with common properties. Replicas + # identified by a ReplicaSelection are scaled with the same compute capacity. + # @!attribute [rw] autoscaling_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig] + # Optional. The autoscaling configuration. Autoscaling is enabled if this + # field is set. When autoscaling is enabled, node_count and processing_units + # are treated as OUTPUT_ONLY fields and reflect the current compute capacity + # allocated to the instance. + # @!attribute [r] state + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::State] + # Output only. The current instance state. For + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}, + # the state must be either omitted or set to `CREATING`. For + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}, + # the state must be either omitted or set to `READY`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Cloud Labels are a flexible and lightweight mechanism for organizing cloud + # resources into groups that reflect a customer's organizational needs and + # deployment strategies. Cloud Labels can be used to filter collections of + # resources. They can be used to control how resource metrics are aggregated. + # And they can be used as arguments to policy management rules (e.g. route, + # firewall, load balancing, etc.). + # + # * Label keys must be between 1 and 63 characters long and must conform to + # the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + # * Label values must be between 0 and 63 characters long and must conform + # to the regular expression `[a-z0-9_-]{0,63}`. + # * No more than 64 labels can be associated with a given resource. + # + # See https://goo.gl/xmQnxf for more information on and examples of labels. + # + # If you plan to use labels in your own code, please note that additional + # characters may be allowed in the future. And so you are advised to use an + # internal label representation, such as JSON, which doesn't rely upon + # specific characters being disallowed. For example, representing labels + # as the string: name + "_" + value would prove problematic if we were to + # allow "_" in a future release. + # @!attribute [rw] instance_type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::InstanceType] + # The `InstanceType` of the current instance. + # @!attribute [rw] endpoint_uris + # @return [::Array<::String>] + # Deprecated. This field is not populated. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the instance was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the instance was most recently updated. + # @!attribute [rw] free_instance_metadata + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FreeInstanceMetadata] + # Free instance metadata. Only populated for free instances. + # @!attribute [rw] edition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::Edition] + # Optional. The `Edition` of the current instance. + # @!attribute [rw] default_backup_schedule_type + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::DefaultBackupScheduleType] + # Optional. Controls the default backup schedule behavior for new databases + # within the instance. By default, a backup schedule is created automatically + # when a new database is created in a new instance. + # + # Note that the `AUTOMATIC` value isn't permitted for free instances, + # as backups and backup schedules aren't supported for free instances. + # + # In the `GetInstance` or `ListInstances` response, if the value of + # `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't + # create a default backup schedule for new databases in the instance. + class Instance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicates the current state of the instance. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The instance is still being created. Resources may not be + # available yet, and operations such as database creation may not + # work. + CREATING = 1 + + # The instance is fully created and ready to do work such as + # creating databases. + READY = 2 + end + + # The type of this instance. The type can be used to distinguish product + # variants, that can affect aspects like: usage restrictions, quotas and + # billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED + # instances. + module InstanceType + # Not specified. + INSTANCE_TYPE_UNSPECIFIED = 0 + + # Provisioned instances have dedicated resources, standard usage limits and + # support. + PROVISIONED = 1 + + # Free instances provide no guarantee for dedicated resources, + # [node_count, processing_units] should be 0. They come + # with stricter usage limits and limited support. + FREE_INSTANCE = 2 + end + + # The edition selected for this instance. Different editions provide + # different capabilities at different price points. + module Edition + # Edition not specified. + EDITION_UNSPECIFIED = 0 + + # Standard edition. + STANDARD = 1 + + # Enterprise edition. + ENTERPRISE = 2 + + # Enterprise Plus edition. + ENTERPRISE_PLUS = 3 + end + + # Indicates the + # [default backup + # schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules) + # behavior for new databases within the instance. + module DefaultBackupScheduleType + # Not specified. + DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0 + + # A default backup schedule isn't created automatically when a new database + # is created in the instance. + NONE = 1 + + # A default backup schedule is created automatically when a new database + # is created in the instance. The default backup schedule creates a full + # backup every 24 hours. These full backups are retained for 7 days. + # You can edit or delete the default backup schedule once it's created. + AUTOMATIC = 2 + end + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project for which a list of supported instance + # configurations is requested. Values are of the form + # `projects/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of instance configurations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. + class ListInstanceConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. + # @!attribute [rw] instance_configs + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] + # The list of requested instance configurations. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs} + # call to fetch more of the matching instance configurations. + class ListInstanceConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config GetInstanceConfigRequest}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested instance configuration. Values are of + # the form `projects//instanceConfigs/`. + class GetInstanceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which to create the instance + # configuration. Values are of the form `projects/`. + # @!attribute [rw] instance_config_id + # @return [::String] + # Required. The ID of the instance configuration to create. Valid identifiers + # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. The `custom-` prefix is required to avoid name + # conflicts with Google-managed configurations. + # @!attribute [rw] instance_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # Required. The `InstanceConfig` proto of the configuration to create. + # `instance_config.name` must be + # `/instanceConfigs/`. + # `instance_config.base_config` must be a Google-managed configuration name, + # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. + # @!attribute [rw] validate_only + # @return [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + class CreateInstanceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig}. + # @!attribute [rw] instance_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # Required. The user instance configuration to update, which must always + # include the instance configuration name. Otherwise, only fields mentioned + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} + # need be included. To prevent conflicts of concurrent updates, + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can + # be used. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be + # updated. The field mask must always be specified; this prevents any future + # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} + # from being erased accidentally by clients that do not know about them. Only + # display_name and labels can be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + class UpdateInstanceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config DeleteInstanceConfig}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the instance configuration to be deleted. + # Values are of the form + # `projects//instanceConfigs/` + # @!attribute [rw] etag + # @return [::String] + # Used for optimistic concurrency control as a way to help prevent + # simultaneous deletes of an instance configuration from overwriting each + # other. If not empty, the API + # only deletes the instance configuration when the etag provided matches the + # current status of the requested instance configuration. Otherwise, deletes + # the instance configuration without checking the current status of the + # requested instance configuration. + # @!attribute [rw] validate_only + # @return [::Boolean] + # An option to validate, but not actually execute, a request, + # and provide the same response. + class DeleteInstanceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project of the instance configuration operations. + # Values are of the form `projects/`. + # @!attribute [rw] filter + # @return [::String] + # An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) + # AND` \ + # `(metadata.instance_config.name:custom-config) AND` \ + # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. + # * The instance configuration name contains "custom-config". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} + # to the same `parent` and with the same `filter`. + class ListInstanceConfigOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations}. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # The list of matching instance configuration long-running operations. Each + # operation's name will be + # prefixed by the name of the instance configuration. The operation's + # metadata field type + # `metadata.type_url` describes the type of the metadata. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations} + # call to fetch more of the matching metadata. + class ListInstanceConfigOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance GetInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested instance. Values are of the form + # `projects//instances/`. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # If field_mask is present, specifies the subset of + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be + # returned. If absent, all + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. + class GetInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which to create the instance. Values + # are of the form `projects/`. + # @!attribute [rw] instance_id + # @return [::String] + # Required. The ID of the instance to create. Valid identifiers are of the + # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in + # length. + # @!attribute [rw] instance + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # Required. The instance to create. The name may be omitted, but if + # specified must be `/instances/`. + class CreateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project for which a list of instances is + # requested. Values are of the form `projects/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of instances to be returned in the response. If 0 or less, defaults + # to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + # @!attribute [rw] filter + # @return [::String] + # An expression for filtering the results of the request. Filter rules are + # case insensitive. The fields eligible for filtering are: + # + # * `name` + # * `display_name` + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `name:*` --> The instance has a name. + # * `name:Howl` --> The instance's name contains the string "howl". + # * `name:HOWL` --> Equivalent to above. + # * `NAME:howl` --> Equivalent to above. + # * `labels.env:*` --> The instance has the label "env". + # * `labels.env:dev` --> The instance has the label "env" and the value of + # the label contains the string "dev". + # * `name:howl labels.env:dev` --> The instance's name contains "howl" and + # it has the label "env" with its value + # containing "dev". + # @!attribute [rw] instance_deadline + # @return [::Google::Protobuf::Timestamp] + # Deadline used while retrieving metadata for instances. + # Instances whose metadata cannot be retrieved within this deadline will be + # added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. + class ListInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances}. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] + # The list of requested instances. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances} + # call to fetch more of the matching instances. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # The list of unreachable instances. + # It includes the names of instances whose metadata could not be retrieved + # within + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest#instance_deadline instance_deadline}. + class ListInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}. + # @!attribute [rw] instance + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # Required. The instance to update, which must always include the instance + # name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} + # need be included. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. + # The field mask must always be specified; this prevents any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased + # accidentally by clients that do not know about them. + class UpdateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance DeleteInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the instance to be deleted. Values are of the form + # `projects//instances/` + class DeleteInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}. + # @!attribute [rw] instance + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # The instance being created. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance} + # request was received. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. If set, this operation is + # in the process of undoing itself (which is guaranteed to succeed) and + # cannot be cancelled again. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation failed or was completed successfully. + # @!attribute [rw] expected_fulfillment_period + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FulfillmentPeriod] + # The expected fulfillment period of this create operation. + class CreateInstanceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}. + # @!attribute [rw] instance + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] + # The desired end state of the update. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance} + # request was received. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. If set, this operation is + # in the process of undoing itself (which is guaranteed to succeed) and + # cannot be cancelled again. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation failed or was completed successfully. + # @!attribute [rw] expected_fulfillment_period + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FulfillmentPeriod] + # The expected fulfillment period of this update operation. + class UpdateInstanceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Free instance specific metadata that is kept even after an instance has been + # upgraded for tracking purposes. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp after which the instance will either be upgraded or + # scheduled for deletion after a grace period. ExpireBehavior is used to + # choose between upgrading or scheduling the free instance for deletion. This + # timestamp is set during the creation of a free instance. + # @!attribute [r] upgrade_time + # @return [::Google::Protobuf::Timestamp] + # Output only. If present, the timestamp at which the free instance was + # upgraded to a provisioned instance. + # @!attribute [rw] expire_behavior + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FreeInstanceMetadata::ExpireBehavior] + # Specifies the expiration behavior of a free instance. The default of + # ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during + # or after creation, and before expiration. + class FreeInstanceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Allows users to change behavior when a free instance expires. + module ExpireBehavior + # Not specified. + EXPIRE_BEHAVIOR_UNSPECIFIED = 0 + + # When the free instance expires, upgrade the instance to a provisioned + # instance. + FREE_TO_PROVISIONED = 1 + + # When the free instance expires, disable the instance, and delete it + # after the grace period passes if it has not been upgraded. + REMOVE_AFTER_GRACE_PERIOD = 2 + end + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig}. + # @!attribute [rw] instance_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # The target instance configuration end state. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig} + # operation. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. + class CreateInstanceConfigMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig}. + # @!attribute [rw] instance_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] + # The desired instance configuration after updating. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig} + # operation. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. + class UpdateInstanceConfigMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An isolated set of Cloud Spanner resources that databases can define + # placements on. + # @!attribute [rw] name + # @return [::String] + # Required. A unique identifier for the instance partition. Values are of the + # form + # `projects//instances//instancePartitions/[a-z][-a-z0-9]*[a-z0-9]`. + # The final segment of the name must be between 2 and 64 characters in + # length. An instance partition's name cannot be changed after the instance + # partition is created. + # @!attribute [rw] config + # @return [::String] + # Required. The name of the instance partition's configuration. Values are of + # the form `projects//instanceConfigs/`. See also + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} and + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. + # @!attribute [rw] display_name + # @return [::String] + # Required. The descriptive name for this instance partition as it appears in + # UIs. Must be unique per project and between 4 and 30 characters in length. + # @!attribute [rw] node_count + # @return [::Integer] + # The number of nodes allocated to this instance partition. + # + # Users can set the `node_count` field to specify the target number of + # nodes allocated to the instance partition. + # + # This may be zero in API responses for instance partitions that are not + # yet in state `READY`. + # + # Note: The following fields are mutually exclusive: `node_count`, `processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] processing_units + # @return [::Integer] + # The number of processing units allocated to this instance partition. + # + # Users can set the `processing_units` field to specify the target number + # of processing units allocated to the instance partition. + # + # This might be zero in API responses for instance partitions that are not + # yet in the `READY` state. + # + # Note: The following fields are mutually exclusive: `processing_units`, `node_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] autoscaling_config + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig] + # Optional. The autoscaling configuration. Autoscaling is enabled if this + # field is set. When autoscaling is enabled, fields in compute_capacity are + # treated as OUTPUT_ONLY fields and reflect the current compute capacity + # allocated to the instance partition. + # @!attribute [r] state + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition::State] + # Output only. The current instance partition state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the instance partition was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the instance partition was most recently + # updated. + # @!attribute [r] referencing_databases + # @return [::Array<::String>] + # Output only. The names of the databases that reference this + # instance partition. Referencing databases should share the parent instance. + # The existence of any referencing database prevents the instance partition + # from being deleted. + # @!attribute [r] referencing_backups + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # Output only. Deprecated: This field is not populated. + # Output only. The names of the backups that reference this instance + # partition. Referencing backups should share the parent instance. The + # existence of any referencing backup prevents the instance partition from + # being deleted. + # @!attribute [rw] etag + # @return [::String] + # Used for optimistic concurrency control as a way + # to help prevent simultaneous updates of a instance partition from + # overwriting each other. It is strongly suggested that systems make use of + # the etag in the read-modify-write cycle to perform instance partition + # updates in order to avoid race conditions: An etag is returned in the + # response which contains instance partitions, and systems are expected to + # put that etag in the request to update instance partitions to ensure that + # their change will be applied to the same version of the instance partition. + # If no etag is provided in the call to update instance partition, then the + # existing instance partition is overwritten blindly. + class InstancePartition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the current state of the instance partition. + module State + # Not specified. + STATE_UNSPECIFIED = 0 + + # The instance partition is still being created. Resources may not be + # available yet, and operations such as creating placements using this + # instance partition may not work. + CREATING = 1 + + # The instance partition is fully created and ready to do work such as + # creating placements and using in databases. + READY = 2 + end + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition}. + # @!attribute [rw] instance_partition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # The instance partition being created. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition} + # request was received. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. If set, this operation is + # in the process of undoing itself (which is guaranteed to succeed) and + # cannot be cancelled again. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation failed or was completed successfully. + class CreateInstancePartitionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the instance in which to create the instance + # partition. Values are of the form + # `projects//instances/`. + # @!attribute [rw] instance_partition_id + # @return [::String] + # Required. The ID of the instance partition to create. Valid identifiers are + # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 + # characters in length. + # @!attribute [rw] instance_partition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # Required. The instance partition to create. The instance_partition.name may + # be omitted, but if specified must be + # `/instancePartitions/`. + class CreateInstancePartitionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition DeleteInstancePartition}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the instance partition to be deleted. + # Values are of the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` + # @!attribute [rw] etag + # @return [::String] + # Optional. If not empty, the API only deletes the instance partition when + # the etag provided matches the current status of the requested instance + # partition. Otherwise, deletes the instance partition without checking the + # current status of the requested instance partition. + class DeleteInstancePartitionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition GetInstancePartition}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested instance partition. Values are of + # the form + # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. + class GetInstancePartitionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition}. + # @!attribute [rw] instance_partition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # Required. The instance partition to update, which must always include the + # instance partition name. Otherwise, only fields mentioned in + # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} + # need be included. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Required. A mask specifying which fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # should be updated. The field mask must always be specified; this prevents + # any future fields in + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} + # from being erased accidentally by clients that do not know about them. + class UpdateInstancePartitionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition}. + # @!attribute [rw] instance_partition + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] + # The desired end state of the update. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition} + # request was received. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. If set, this operation is + # in the process of undoing itself (which is guaranteed to succeed) and + # cannot be cancelled again. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation failed or was completed successfully. + class UpdateInstancePartitionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The instance whose instance partitions should be listed. Values + # are of the form `projects//instances/`. Use `{instance} + # = '-'` to list instance partitions for all Instances in a project, e.g., + # `projects/myproject/instances/-`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of instance partitions to be returned in the response. If 0 or less, + # defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + # @!attribute [rw] instance_partition_deadline + # @return [::Google::Protobuf::Timestamp] + # Optional. Deadline used while retrieving metadata for instance partitions. + # Instance partitions whose metadata cannot be retrieved within this deadline + # will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. + class ListInstancePartitionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions}. + # @!attribute [rw] instance_partitions + # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] + # The list of requested instancePartitions. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions} + # call to fetch more of the matching instance partitions. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # The list of unreachable instances or instance partitions. + # It includes the names of instances or instance partitions whose metadata + # could not be retrieved within + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest#instance_partition_deadline instance_partition_deadline}. + class ListInstancePartitionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent instance of the instance partition operations. + # Values are of the form `projects//instances/`. + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression that filters the list of returned operations. + # + # A filter expression consists of a field name, a + # comparison operator, and a value for filtering. + # The value must be a string, a number, or a boolean. The comparison operator + # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + # Colon `:` is the contains operator. Filter rules are not case sensitive. + # + # The following fields in the Operation are eligible for filtering: + # + # * `name` - The name of the long-running operation + # * `done` - False if the operation is in progress, else true. + # * `metadata.@type` - the type of metadata. For example, the type string + # for + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} + # is + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. + # * `metadata.` - any field in metadata.value. + # `metadata.@type` must be specified first, if filtering on metadata + # fields. + # * `error` - Error associated with the long-running operation. + # * `response.@type` - the type of response. + # * `response.` - any field in response.value. + # + # You can combine multiple expressions by enclosing each expression in + # parentheses. By default, expressions are combined with AND logic. However, + # you can specify AND, OR, and NOT logic explicitly. + # + # Here are a few examples: + # + # * `done:true` - The operation is complete. + # * `(metadata.@type=` \ + # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) + # AND` \ + # `(metadata.instance_partition.name:custom-instance-partition) AND` \ + # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ + # `(error:*)` - Return operations where: + # * The operation's metadata type is + # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. + # * The instance partition name contains "custom-instance-partition". + # * The operation started before 2021-03-28T14:50:00Z. + # * The operation resulted in an error. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Number of operations to be returned in the response. If 0 or + # less, defaults to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} + # to the same `parent` and with the same `filter`. + # @!attribute [rw] instance_partition_deadline + # @return [::Google::Protobuf::Timestamp] + # Optional. Deadline used while retrieving metadata for instance partition + # operations. Instance partitions whose operation metadata cannot be + # retrieved within this deadline will be added to + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} + # in + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. + class ListInstancePartitionOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations}. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # The list of matching instance partition long-running operations. Each + # operation's name will be + # prefixed by the instance partition's name. The operation's + # metadata field type + # `metadata.type_url` describes the type of the metadata. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations} + # call to fetch more of the matching metadata. + # @!attribute [rw] unreachable_instance_partitions + # @return [::Array<::String>] + # The list of unreachable instance partitions. + # It includes the names of instance partitions whose operation metadata could + # not be retrieved within + # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#instance_partition_deadline instance_partition_deadline}. + class ListInstancePartitionOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. + # @!attribute [rw] name + # @return [::String] + # Required. The instance to move. + # Values are of the form `projects//instances/`. + # @!attribute [rw] target_config + # @return [::String] + # Required. The target instance configuration where to move the instance. + # Values are of the form `projects//instanceConfigs/`. + class MoveInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. + class MoveInstanceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata type for the operation returned by + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. + # @!attribute [rw] target_config + # @return [::String] + # The target instance configuration where to move the instance. + # Values are of the form `projects//instanceConfigs/`. + # @!attribute [rw] progress + # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] + # The progress of the + # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance} + # operation. + # {::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress#progress_percent progress_percent} + # is reset when cancellation is requested. + # @!attribute [rw] cancel_time + # @return [::Google::Protobuf::Timestamp] + # The time at which this operation was cancelled. + class MoveInstanceMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile new file mode 100644 index 000000000000..948960481f0c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1", path: "../" +else + gem "google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb new file mode 100644 index 000000000000..2348ff40f605 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_CreateInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the create_instance call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance. +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new + + # Call the create_instance method. + result = client.create_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb new file mode 100644 index 000000000000..c3a27669fdae --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the create_instance_config call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config. +# +def create_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new + + # Call the create_instance_config method. + result = client.create_instance_config request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb new file mode 100644 index 000000000000..d21b55b5b196 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the create_instance_partition call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition. +# +def create_instance_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new + + # Call the create_instance_partition method. + result = client.create_instance_partition request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb new file mode 100644 index 000000000000..69724c0b1606 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_DeleteInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the delete_instance call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance. +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new + + # Call the delete_instance method. + result = client.delete_instance request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_InstanceAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb new file mode 100644 index 000000000000..4a1f618dbf0e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_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 spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the delete_instance_config call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config. +# +def delete_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new + + # Call the delete_instance_config method. + result = client.delete_instance_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb new file mode 100644 index 000000000000..e0a538237a72 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the delete_instance_partition call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition. +# +def delete_instance_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new + + # Call the delete_instance_partition method. + result = client.delete_instance_partition request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb new file mode 100644 index 000000000000..87a8c0c3714a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the get_iam_policy call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb new file mode 100644 index 000000000000..a1cca2d1c9dc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_GetInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the get_instance call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance. +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new + + # Call the get_instance method. + result = client.get_instance request + + # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. + p result +end +# [END spanner_v1_generated_InstanceAdmin_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb new file mode 100644 index 000000000000..ba21ffeef8ab --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_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 spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the get_instance_config call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config. +# +def get_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new + + # Call the get_instance_config method. + result = client.get_instance_config request + + # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + p result +end +# [END spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb new file mode 100644 index 000000000000..9654b300ce3f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the get_instance_partition call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition. +# +def get_instance_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new + + # Call the get_instance_partition method. + result = client.get_instance_partition request + + # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. + p result +end +# [END spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb new file mode 100644 index 000000000000..a43ab8906614 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instance_config_operations call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations. +# +def list_instance_config_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new + + # Call the list_instance_config_operations method. + result = client.list_instance_config_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 +end +# [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb new file mode 100644 index 000000000000..ebe64e95ead6 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instance_configs call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs. +# +def list_instance_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new + + # Call the list_instance_configs method. + result = client.list_instance_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + p item + end +end +# [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb new file mode 100644 index 000000000000..a30b5cab92b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instance_partition_operations call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations. +# +def list_instance_partition_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new + + # Call the list_instance_partition_operations method. + result = client.list_instance_partition_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 +end +# [END spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb new file mode 100644 index 000000000000..7a571906f7d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.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 spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instance_partitions call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions. +# +def list_instance_partitions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new + + # Call the list_instance_partitions method. + result = client.list_instance_partitions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. + p item + end +end +# [END spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb new file mode 100644 index 000000000000..07eef9c99042 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_ListInstances_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the list_instances call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances. +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new + + # Call the list_instances method. + result = client.list_instances request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::Instance. + p item + end +end +# [END spanner_v1_generated_InstanceAdmin_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb new file mode 100644 index 000000000000..d1260ae8c95f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_MoveInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the move_instance call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance. +# +def move_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new + + # Call the move_instance method. + result = client.move_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_MoveInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb new file mode 100644 index 000000000000..bf36a3b73464 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the set_iam_policy call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb new file mode 100644 index 000000000000..4f9cc75a5905 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the test_iam_permissions call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb new file mode 100644 index 000000000000..16786ba2e441 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_UpdateInstance_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the update_instance call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance. +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new + + # Call the update_instance method. + result = client.update_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb new file mode 100644 index 000000000000..4dcaf1b12731 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the update_instance_config call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config. +# +def update_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new + + # Call the update_instance_config method. + result = client.update_instance_config request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb new file mode 100644 index 000000000000..38c1442fe587 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync] +require "google/cloud/spanner/admin/instance/v1" + +## +# Snippet for the update_instance_partition call in the InstanceAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition. +# +def update_instance_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new + + # Call the update_instance_partition method. + result = client.update_instance_partition request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json new file mode 100644 index 000000000000..d91b8bef1312 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json @@ -0,0 +1,855 @@ +{ + "client_library": { + "name": "google-cloud-spanner-admin-instance-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.spanner.admin.instance.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync", + "title": "Snippet for the list_instance_configs call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs.", + "file": "instance_admin/list_instance_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instance_configs", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstanceConfigs", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync", + "title": "Snippet for the get_instance_config call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config.", + "file": "instance_admin/get_instance_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance_config", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "GetInstanceConfig", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync", + "title": "Snippet for the create_instance_config call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config.", + "file": "instance_admin/create_instance_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance_config", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "CreateInstanceConfig", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync", + "title": "Snippet for the update_instance_config call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config.", + "file": "instance_admin/update_instance_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_instance_config", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "UpdateInstanceConfig", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync", + "title": "Snippet for the delete_instance_config call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config.", + "file": "instance_admin/delete_instance_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance_config", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "DeleteInstanceConfig", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync", + "title": "Snippet for the list_instance_config_operations call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations.", + "file": "instance_admin/list_instance_config_operations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instance_config_operations", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstanceConfigOperations", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstances_sync", + "title": "Snippet for the list_instances call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances.", + "file": "instance_admin/list_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instances", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstances", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstances", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync", + "title": "Snippet for the list_instance_partitions call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions.", + "file": "instance_admin/list_instance_partitions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instance_partitions", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstancePartitions", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstance_sync", + "title": "Snippet for the get_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance.", + "file": "instance_admin/get_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::Instance", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "GetInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstance_sync", + "title": "Snippet for the create_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance.", + "file": "instance_admin/create_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "CreateInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstance_sync", + "title": "Snippet for the update_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance.", + "file": "instance_admin/update_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "UpdateInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstance_sync", + "title": "Snippet for the delete_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance.", + "file": "instance_admin/delete_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "DeleteInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy.", + "file": "instance_admin/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicy", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy.", + "file": "instance_admin/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicy", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions.", + "file": "instance_admin/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissions", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync", + "title": "Snippet for the get_instance_partition call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition.", + "file": "instance_admin/get_instance_partition.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance_partition", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "GetInstancePartition", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartition", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync", + "title": "Snippet for the create_instance_partition call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition.", + "file": "instance_admin/create_instance_partition.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance_partition", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "CreateInstancePartition", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync", + "title": "Snippet for the delete_instance_partition call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition.", + "file": "instance_admin/delete_instance_partition.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance_partition", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "DeleteInstancePartition", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartition", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync", + "title": "Snippet for the update_instance_partition call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition.", + "file": "instance_admin/update_instance_partition.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_instance_partition", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "UpdateInstancePartition", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync", + "title": "Snippet for the list_instance_partition_operations call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations.", + "file": "instance_admin/list_instance_partition_operations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instance_partition_operations", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "ListInstancePartitionOperations", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_InstanceAdmin_MoveInstance_sync", + "title": "Snippet for the move_instance call in the InstanceAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance.", + "file": "instance_admin/move_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "move_instance", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "InstanceAdmin::Client", + "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" + }, + "method": { + "short_name": "MoveInstance", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance", + "service": { + "short_name": "InstanceAdmin", + "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" + } + } + }, + "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-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb new file mode 100644 index 000000000000..14acadf19511 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_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/spanner/admin/instance/v1/spanner_instance_admin_pb" +require "google/spanner/admin/instance/v1/spanner_instance_admin_services_pb" +require "google/cloud/spanner/admin/instance/v1/instance_admin" + +class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb new file mode 100644 index 000000000000..25bc1dce8a0a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/spanner/admin/instance/v1/instance_admin" + +class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", instance: "value1" + assert_equal "projects/value0/instances/value1", path + end + end + + def test_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_config_path project: "value0", instance_config: "value1" + assert_equal "projects/value0/instanceConfigs/value1", path + end + end + + def test_instance_partition_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_partition_path project: "value0", instance: "value1", instance_partition: "value2" + assert_equal "projects/value0/instances/value1/instancePartitions/value2", 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::Spanner::Admin::Instance::V1::InstanceAdmin::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-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb new file mode 100644 index 000000000000..a4f875fb92b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb @@ -0,0 +1,1269 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/spanner/admin/instance/v1/spanner_instance_admin_pb" +require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" + + +class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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_instance_configs + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.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_instance_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instance_configs_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instance_configs parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instance_configs ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.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_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instance_configs(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.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_instance_configs_client_stub.call_count + end + end + end + + def test_get_instance_config + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_config_client_stub.call_count + end + end + end + + def test_create_instance_config + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_config_id = "hello world" + instance_config = {} + validate_only = true + + create_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance_config parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_instance_config_client_stub.call_count + end + end + end + + def test_update_instance_config + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + instance_config = {} + update_mask = {} + validate_only = true + + update_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_instance_config({ instance_config: instance_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_instance_config instance_config: instance_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_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_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_instance_config({ instance_config: instance_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_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_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_instance_config_client_stub.call_count + end + end + end + + def test_delete_instance_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + + delete_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance_config name: name, etag: etag, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_instance_config_client_stub.call_count + end + end + end + + def test_list_instance_config_operations + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_instance_config_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_config_operations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instance_config_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instance_config_operations({ parent: parent, 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.list_instance_config_operations parent: parent, 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.list_instance_config_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, 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.list_instance_config_operations({ parent: parent, 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.list_instance_config_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, 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, list_instance_config_operations_client_stub.call_count + end + end + end + + def test_list_instances + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + instance_deadline = {} + + list_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instances ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instances(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instances_client_stub.call_count + end + end + end + + def test_list_instance_partitions + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.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" + instance_partition_deadline = {} + + list_instance_partitions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_partitions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instance_partitions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instance_partitions parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instance_partitions ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instance_partitions(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instance_partitions_client_stub.call_count + end + end + end + + def test_get_instance + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + field_mask = {} + + get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance({ name: name, field_mask: field_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance name: name, field_mask: field_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance({ name: name, field_mask: field_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_count + end + end + end + + def test_create_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_id = "hello world" + instance = {} + + create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_instance(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_instance_client_stub.call_count + end + end + end + + def test_update_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + instance = {} + field_mask = {} + + update_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_instance({ instance: instance, field_mask: field_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_instance instance: instance, field_mask: field_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_instance ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_instance({ instance: instance, field_mask: field_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_instance(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_instance_client_stub.call_count + end + end + end + + def test_delete_instance + # 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_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_instance({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_instance(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_instance_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_get_instance_partition + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_partition_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance_partition({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance_partition name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance_partition({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_partition_client_stub.call_count + end + end + end + + def test_create_instance_partition + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_partition_id = "hello world" + instance_partition = {} + + create_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_partition_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance_partition parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_instance_partition_client_stub.call_count + end + end + end + + def test_delete_instance_partition + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_partition_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance_partition({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance_partition name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_instance_partition({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_instance_partition_client_stub.call_count + end + end + end + + def test_update_instance_partition + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + instance_partition = {} + field_mask = {} + + update_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_partition_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_instance_partition instance_partition: instance_partition, field_mask: field_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_instance_partition_client_stub.call_count + end + end + end + + def test_list_instance_partition_operations + # Create test objects. + client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + instance_partition_deadline = {} + + list_instance_partition_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_partition_operations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instance_partition_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instance_partition_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instance_partition_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instance_partition_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instance_partition_operations_client_stub.call_count + end + end + end + + def test_move_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + target_config = "hello world" + + move_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_move_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, move_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.move_instance({ name: name, target_config: target_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.move_instance name: name, target_config: target_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.move_instance ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.move_instance({ name: name, target_config: target_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.move_instance(::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, move_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb new file mode 100644 index 000000000000..a00bf9333f7b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_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/spanner/admin/instance/v1/spanner_instance_admin_pb" +require "google/cloud/spanner/admin/instance/v1/instance_admin" + +class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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_instance_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_instance_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instance_configs, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, 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_instance_configs_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_instance_configs parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_instance_configs ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.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_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_instance_configs(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.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_instance_configs_client_stub.call_rpc_count + end + end + + def test_get_instance_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance_config, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance_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_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_instance_config_client_stub.call_rpc_count + end + end + + def test_create_instance_config + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_config_id = "hello world" + instance_config = {} + validate_only = true + + create_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance_config, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_config_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig), request["instance_config"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_instance_config parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_instance_config_client_stub.call_rpc_count + end + end + + def test_update_instance_config + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + instance_config = {} + update_mask = {} + validate_only = true + + update_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance_config, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig), request["instance_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_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_instance_config instance_config: instance_config, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_instance_config_client_stub.call_rpc_count + end + end + + def test_delete_instance_config + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + + delete_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance_config, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_config_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_instance_config name: name, etag: etag, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_instance_config_client_stub.call_rpc_count + end + end + + def test_list_instance_config_operations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_instance_config_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instance_config_operations, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instance_config_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instance_config_operations({ parent: parent, 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.list_instance_config_operations parent: parent, 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.list_instance_config_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, 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.list_instance_config_operations({ parent: parent, 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.list_instance_config_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, 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, list_instance_config_operations_client_stub.call_rpc_count + end + end + + def test_list_instances + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + instance_deadline = {} + + list_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instances, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_deadline"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_instances ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_instances(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_instances_client_stub.call_rpc_count + end + end + + def test_list_instance_partitions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + instance_partition_deadline = {} + + list_instance_partitions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instance_partitions, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_partition_deadline"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instance_partitions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_instance_partitions parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_instance_partitions ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_instance_partitions(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_instance_partitions_client_stub.call_rpc_count + end + end + + def test_get_instance + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + field_mask = {} + + get_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance({ name: name, field_mask: field_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance name: name, field_mask: field_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance({ name: name, field_mask: field_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_rpc_count + end + end + + def test_create_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_id = "hello world" + instance = {} + + create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::Instance), request["instance"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_instance ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_instance(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_instance_client_stub.call_rpc_count + end + end + + def test_update_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + instance = {} + field_mask = {} + + update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::Instance), request["instance"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance({ instance: instance, field_mask: field_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_instance instance: instance, field_mask: field_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_instance ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_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_instance({ instance: instance, field_mask: field_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_instance(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_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_instance_client_stub.call_rpc_count + end + end + + def test_delete_instance + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_instance name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_instance({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_instance(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(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_instance_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_get_instance_partition + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance_partition, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance_partition({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance_partition name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance_partition({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_instance_partition_client_stub.call_rpc_count + end + end + + def test_create_instance_partition + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_partition_id = "hello world" + instance_partition = {} + + create_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance_partition, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_partition_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition), request["instance_partition"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_instance_partition parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_instance_partition_client_stub.call_rpc_count + end + end + + def test_delete_instance_partition + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance_partition, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance_partition({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_instance_partition name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_instance_partition({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_instance_partition_client_stub.call_rpc_count + end + end + + def test_update_instance_partition + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + instance_partition = {} + field_mask = {} + + update_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance_partition, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition), request["instance_partition"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_instance_partition_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_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_instance_partition instance_partition: instance_partition, field_mask: field_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_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_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_instance_partition({ instance_partition: instance_partition, field_mask: field_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_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_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_instance_partition_client_stub.call_rpc_count + end + end + + def test_list_instance_partition_operations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + instance_partition_deadline = {} + + list_instance_partition_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instance_partition_operations, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_partition_deadline"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instance_partition_operations_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_instance_partition_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_instance_partition_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_instance_partition_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_instance_partition_operations_client_stub.call_rpc_count + end + end + + def test_move_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + target_config = "hello world" + + move_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :move_instance, name + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["target_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, move_instance_client_stub do + # Create client + client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.move_instance({ name: name, target_config: target_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.move_instance name: name, target_config: target_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.move_instance ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_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.move_instance({ name: name, target_config: target_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.move_instance(::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_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, move_instance_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-spanner-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json new file mode 100644 index 000000000000..97ae30d48f35 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "spanner.googleapis.com", + "api_shortname": "spanner", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest", + "distribution_name": "google-cloud-spanner-v1", + "is_cloud": true, + "language": "ruby", + "name": "spanner", + "name_pretty": "Cloud Spanner V1 API", + "product_documentation": "https://cloud.google.com/spanner", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SPANNER", + "ruby-cloud-product-url": "https://cloud.google.com/spanner", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml new file mode 100644 index 000000000000..c29064123444 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-spanner-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-spanner-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-v1/.yardopts new file mode 100644 index 000000000000..62c084b2c082 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Spanner 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-spanner-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..a4d7b47836ad --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-spanner-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-spanner-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/spanner/v1" + +client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/spanner/v1" + +::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Spanner::V1::Spanner::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-spanner-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/spanner/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Spanner::V1::Spanner::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-spanner-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-spanner-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/README.md b/owl-bot-staging/google-cloud-spanner-v1/README.md new file mode 100644 index 000000000000..1ff29659d58a --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Spanner V1 API + +Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. + + +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 Spanner V1 API. Most users should consider using +the main client gem, +[google-cloud-spanner](https://rubygems.org/gems/google-cloud-spanner). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-spanner-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/spanner.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/spanner/v1" + +client = ::Google::Cloud::Spanner::V1::Spanner::Client.new +request = ::Google::Cloud::Spanner::V1::CreateSessionRequest.new # (request fields as keyword arguments...) +response = client.create_session request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/spanner) +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/spanner/v1" +require "logger" + +client = ::Google::Cloud::Spanner::V1::Spanner::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-spanner`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-spanner-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-spanner`. +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-spanner-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-spanner-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-v1/Rakefile new file mode 100644 index 000000000000..b18de45c0a03 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SPANNER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SPANNER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SPANNER_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 SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/spanner/v1/spanner/credentials" + ::Google::Cloud::Spanner::V1::Spanner::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SPANNER_PROJECT"] = project + ENV["SPANNER_TEST_PROJECT"] = project + ENV["SPANNER_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-spanner-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-spanner-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-spanner-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-spanner-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-spanner-v1" + header "google-cloud-spanner-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-spanner-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-spanner-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-spanner-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-spanner-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-spanner-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json new file mode 100644 index 000000000000..5d46cd55f5fb --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.spanner.v1", + "libraryPackage": "::Google::Cloud::Spanner::V1", + "services": { + "Spanner": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Spanner::V1::Spanner::Client", + "rpcs": { + "CreateSession": { + "methods": [ + "create_session" + ] + }, + "BatchCreateSessions": { + "methods": [ + "batch_create_sessions" + ] + }, + "GetSession": { + "methods": [ + "get_session" + ] + }, + "ListSessions": { + "methods": [ + "list_sessions" + ] + }, + "DeleteSession": { + "methods": [ + "delete_session" + ] + }, + "ExecuteSql": { + "methods": [ + "execute_sql" + ] + }, + "ExecuteStreamingSql": { + "methods": [ + "execute_streaming_sql" + ] + }, + "ExecuteBatchDml": { + "methods": [ + "execute_batch_dml" + ] + }, + "Read": { + "methods": [ + "read" + ] + }, + "StreamingRead": { + "methods": [ + "streaming_read" + ] + }, + "BeginTransaction": { + "methods": [ + "begin_transaction" + ] + }, + "Commit": { + "methods": [ + "commit" + ] + }, + "Rollback": { + "methods": [ + "rollback" + ] + }, + "PartitionQuery": { + "methods": [ + "partition_query" + ] + }, + "PartitionRead": { + "methods": [ + "partition_read" + ] + }, + "BatchWrite": { + "methods": [ + "batch_write" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec b/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec new file mode 100644 index 000000000000..ccade5d97a84 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/spanner/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-spanner-v1" + gem.version = Google::Cloud::Spanner::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details." + gem.summary = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb new file mode 100644 index 000000000000..2f3a79fec01f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-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/spanner/v1" diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb new file mode 100644 index 000000000000..031d8a0b49f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/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/spanner/v1/spanner" +require "google/cloud/spanner/v1/version" + +module Google + module Cloud + module Spanner + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/spanner/v1" + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/spanner/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb new file mode 100644 index 000000000000..50df58fbcc65 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.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/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/spanner/v1/version" + +require "google/cloud/spanner/v1/spanner/credentials" +require "google/cloud/spanner/v1/spanner/paths" +require "google/cloud/spanner/v1/spanner/client" + +module Google + module Cloud + module Spanner + module V1 + ## + # Cloud Spanner API + # + # The Cloud Spanner API can be used to manage sessions and execute + # transactions on data stored in Cloud Spanner databases. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/spanner/v1/spanner" + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new + # + module Spanner + end + end + end + end +end + +helper_path = ::File.join __dir__, "spanner", "helpers.rb" +require "google/cloud/spanner/v1/spanner/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb new file mode 100644 index 000000000000..9ee4c79a9513 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb @@ -0,0 +1,2636 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/spanner/v1/spanner_pb" + +module Google + module Cloud + module Spanner + module V1 + module Spanner + ## + # Client for the Spanner service. + # + # Cloud Spanner API + # + # The Cloud Spanner API can be used to manage sessions and execute + # transactions on data stored in Cloud Spanner databases. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :spanner_stub + + ## + # Configure the Spanner Client class. + # + # See {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Spanner clients + # ::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Spanner", "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_session.timeout = 30.0 + default_config.rpcs.create_session.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.batch_create_sessions.timeout = 60.0 + default_config.rpcs.batch_create_sessions.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.get_session.timeout = 30.0 + default_config.rpcs.get_session.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.list_sessions.timeout = 3600.0 + default_config.rpcs.list_sessions.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.delete_session.timeout = 30.0 + default_config.rpcs.delete_session.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.execute_sql.timeout = 30.0 + default_config.rpcs.execute_sql.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.execute_streaming_sql.timeout = 3600.0 + + default_config.rpcs.execute_batch_dml.timeout = 30.0 + default_config.rpcs.execute_batch_dml.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.read.timeout = 30.0 + default_config.rpcs.read.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.streaming_read.timeout = 3600.0 + + default_config.rpcs.begin_transaction.timeout = 30.0 + default_config.rpcs.begin_transaction.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.commit.timeout = 3600.0 + default_config.rpcs.commit.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.rollback.timeout = 30.0 + default_config.rpcs.rollback.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.partition_query.timeout = 30.0 + default_config.rpcs.partition_query.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.partition_read.timeout = 30.0 + default_config.rpcs.partition_read.retry_policy = { + initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] + } + + default_config.rpcs.batch_write.timeout = 3600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Spanner Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @spanner_stub.universe_domain + end + + ## + # Create a new Spanner client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Spanner 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/spanner/v1/spanner_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 + + @spanner_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Spanner::V1::Spanner::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 + ) + + @spanner_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 + @spanner_stub.logger + end + + # Service calls + + ## + # Creates a new session. A session can be used to perform + # transactions that read and/or modify data in a Cloud Spanner database. + # Sessions are meant to be reused for many consecutive + # transactions. + # + # Sessions can only execute one transaction at a time. To execute + # multiple concurrent read-write/write-only transactions, create + # multiple sessions. Note that standalone reads and queries use a + # transaction internally, and count toward the one transaction + # limit. + # + # Active sessions use additional server resources, so it's a good idea to + # delete idle and unneeded sessions. + # Aside from explicit deletes, Cloud Spanner can delete sessions when no + # operations are sent for more than an hour. If a session is deleted, + # requests to it return `NOT_FOUND`. + # + # Idle sessions can be kept alive by sending a trivial SQL query + # periodically, for example, `"SELECT 1"`. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::Spanner::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::CreateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_session(database: nil, session: nil) + # Pass arguments to `create_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database in which the new session is created. + # @param session [::Google::Cloud::Spanner::V1::Session, ::Hash] + # Required. The session to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session request + # + # # The returned object is of type Google::Cloud::Spanner::V1::Session. + # p result + # + def create_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::CreateSessionRequest + + # Converts hash and nil to 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_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_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_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :create_session, request, 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 multiple new sessions. + # + # This API can be used to initialize a session cache on the clients. + # See https://goo.gl/TgSFN2 for best practices on session cache management. + # + # @overload batch_create_sessions(request, options = nil) + # Pass arguments to `batch_create_sessions` via a request object, either of type + # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_create_sessions(database: nil, session_template: nil, session_count: nil) + # Pass arguments to `batch_create_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database in which the new sessions are created. + # @param session_template [::Google::Cloud::Spanner::V1::Session, ::Hash] + # Parameters to apply to each created session. + # @param session_count [::Integer] + # Required. The number of sessions to be created in this batch call. At least + # one session is created. The API can return fewer than the requested number + # of sessions. If a specific number of sessions are desired, the client can + # make additional calls to `BatchCreateSessions` (adjusting + # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} + # as necessary). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new + # + # # Call the batch_create_sessions method. + # result = client.batch_create_sessions request + # + # # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. + # p result + # + def batch_create_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_create_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_create_sessions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :batch_create_sessions, request, 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 session. Returns `NOT_FOUND` if the session doesn't exist. + # This is mainly useful for determining whether a session is still + # alive. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::Spanner::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::GetSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_session(name: nil) + # Pass arguments to `get_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 session to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::Spanner::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::GetSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :get_session, request, 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 sessions in a given database. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ListSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_sessions(database: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database in which to list sessions. + # @param page_size [::Integer] + # Number of sessions to be returned in the response. If 0 or less, defaults + # to the server's maximum allowed page size. + # @param page_token [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::V1::ListSessionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::V1::ListSessionsResponse ListSessionsResponse}. + # @param filter [::String] + # An expression for filtering the results of the request. Filter rules are + # case insensitive. The fields eligible for filtering are: + # + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `labels.env:*` --> The session has the label "env". + # * `labels.env:dev` --> The session has the label "env" and the value of + # the label contains the string "dev". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::V1::Session>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::V1::Session>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Spanner::V1::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ListSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :list_sessions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @spanner_stub, :list_sessions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Ends a session, releasing server resources associated with it. This + # asynchronously triggers the cancellation of any operations that are running + # with this session. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::Spanner::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::DeleteSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_session(name: nil) + # Pass arguments to `delete_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 session to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::DeleteSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :delete_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Executes an SQL statement, returning all results in a single reply. This + # method can't be used to return a result set larger than 10 MiB; + # if the query yields more data than that, the query fails with + # a `FAILED_PRECONDITION` error. + # + # Operations inside read-write transactions might return `ABORTED`. If + # this occurs, the application should restart the transaction from + # the beginning. See {::Google::Cloud::Spanner::V1::Transaction Transaction} for more + # details. + # + # Larger result sets can be fetched in streaming fashion by calling + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql} + # instead. + # + # The query string can be SQL or [Graph Query Language + # (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + # + # @overload execute_sql(request, options = nil) + # Pass arguments to `execute_sql` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ExecuteSqlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload execute_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, last_statement: nil, routing_hint: nil) + # Pass arguments to `execute_sql` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the SQL query should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # The transaction to use. + # + # For queries, if none is provided, the default is a temporary read-only + # transaction with strong concurrency. + # + # Standard DML statements require a read-write transaction. To protect + # against replays, single-use transactions are not supported. The caller + # must either supply an existing transaction ID or begin a new transaction. + # + # Partitioned DML requires an existing Partitioned DML transaction ID. + # @param sql [::String] + # Required. The SQL string. + # @param params [::Google::Protobuf::Struct, ::Hash] + # Parameter names and values that bind to placeholders in the SQL string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names must conform + # to the naming requirements of identifiers as specified at + # https://cloud.google.com/spanner/docs/lexical#identifiers. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] + # It isn't always possible for Cloud Spanner to infer the right SQL type + # from a JSON value. For example, values of type `BYTES` and values + # of type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. + # + # In these cases, you can use `param_types` to specify the exact + # SQL type for some or all of the SQL statement parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @param resume_token [::String] + # If this request is resuming a previously interrupted SQL statement + # execution, `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new SQL statement execution to resume + # where the last one left off. The rest of the request parameters must + # exactly match the request that yielded this token. + # @param query_mode [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] + # Used to control the amount of debugging information returned in + # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is + # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only + # be set to + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. + # @param partition_token [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionQuery`. There must be an exact + # match for the values of fields common to this message and the + # `PartitionQueryRequest` message used to create this `partition_token`. + # @param seqno [::Integer] + # A per-transaction sequence number used to identify this request. This field + # makes each request idempotent such that if the request is received multiple + # times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction can be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # + # Required for DML statements. Ignored for queries. + # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash] + # Query optimizer configuration to use for the given query. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] + # Directed read options for this request. + # @param data_boost_enabled [::Boolean] + # If this is for a partitioned query and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @param last_statement [::Boolean] + # Optional. If set to `true`, this statement marks the end of the + # transaction. After this statement executes, you must commit or abort the + # transaction. Attempts to execute any other requests against this + # transaction (including reads and queries) are rejected. + # + # For DML statements, setting this option might cause some error reporting to + # be deferred until commit time (for example, validation of unique + # constraints). Given this, successful execution of a DML statement shouldn't + # be assumed until a subsequent `Commit` call completes successfully. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::ResultSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + # + # # Call the execute_sql method. + # result = client.execute_sql request + # + # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + # p result + # + def execute_sql request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.execute_sql.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.execute_sql.timeout, + metadata: metadata, + retry_policy: @config.rpcs.execute_sql.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :execute_sql, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Like {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, except returns the + # result set as a stream. Unlike + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, there is no limit on + # the size of the returned result set. However, no individual row in the + # result set can exceed 100 MiB, and no column value can exceed 10 MiB. + # + # The query string can be SQL or [Graph Query Language + # (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). + # + # @overload execute_streaming_sql(request, options = nil) + # Pass arguments to `execute_streaming_sql` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ExecuteSqlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload execute_streaming_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, last_statement: nil, routing_hint: nil) + # Pass arguments to `execute_streaming_sql` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the SQL query should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # The transaction to use. + # + # For queries, if none is provided, the default is a temporary read-only + # transaction with strong concurrency. + # + # Standard DML statements require a read-write transaction. To protect + # against replays, single-use transactions are not supported. The caller + # must either supply an existing transaction ID or begin a new transaction. + # + # Partitioned DML requires an existing Partitioned DML transaction ID. + # @param sql [::String] + # Required. The SQL string. + # @param params [::Google::Protobuf::Struct, ::Hash] + # Parameter names and values that bind to placeholders in the SQL string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names must conform + # to the naming requirements of identifiers as specified at + # https://cloud.google.com/spanner/docs/lexical#identifiers. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] + # It isn't always possible for Cloud Spanner to infer the right SQL type + # from a JSON value. For example, values of type `BYTES` and values + # of type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. + # + # In these cases, you can use `param_types` to specify the exact + # SQL type for some or all of the SQL statement parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @param resume_token [::String] + # If this request is resuming a previously interrupted SQL statement + # execution, `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new SQL statement execution to resume + # where the last one left off. The rest of the request parameters must + # exactly match the request that yielded this token. + # @param query_mode [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] + # Used to control the amount of debugging information returned in + # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is + # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only + # be set to + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. + # @param partition_token [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionQuery`. There must be an exact + # match for the values of fields common to this message and the + # `PartitionQueryRequest` message used to create this `partition_token`. + # @param seqno [::Integer] + # A per-transaction sequence number used to identify this request. This field + # makes each request idempotent such that if the request is received multiple + # times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction can be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # + # Required for DML statements. Ignored for queries. + # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash] + # Query optimizer configuration to use for the given query. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] + # Directed read options for this request. + # @param data_boost_enabled [::Boolean] + # If this is for a partitioned query and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @param last_statement [::Boolean] + # Optional. If set to `true`, this statement marks the end of the + # transaction. After this statement executes, you must commit or abort the + # transaction. Attempts to execute any other requests against this + # transaction (including reads and queries) are rejected. + # + # For DML statements, setting this option might cause some error reporting to + # be deferred until commit time (for example, validation of unique + # constraints). Given this, successful execution of a DML statement shouldn't + # be assumed until a subsequent `Commit` call completes successfully. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + # + # # Call the execute_streaming_sql method to start streaming. + # output = client.execute_streaming_sql request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Spanner::V1::PartialResultSet + # output.each do |current_response| + # p current_response + # end + # + def execute_streaming_sql request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.execute_streaming_sql.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.execute_streaming_sql.timeout, + metadata: metadata, + retry_policy: @config.rpcs.execute_streaming_sql.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :execute_streaming_sql, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Executes a batch of SQL DML statements. This method allows many statements + # to be run with lower latency than submitting them sequentially with + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. + # + # Statements are executed in sequential order. A request can succeed even if + # a statement fails. The + # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse#status ExecuteBatchDmlResponse.status} + # field in the response provides information about the statement that failed. + # Clients must inspect this field to determine whether an error occurred. + # + # Execution stops after the first failed statement; the remaining statements + # are not executed. + # + # @overload execute_batch_dml(request, options = nil) + # Pass arguments to `execute_batch_dml` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload execute_batch_dml(session: nil, transaction: nil, statements: nil, seqno: nil, request_options: nil, last_statements: nil) + # Pass arguments to `execute_batch_dml` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the DML statements should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # Required. The transaction to use. Must be a read-write transaction. + # + # To protect against replays, single-use transactions are not supported. The + # caller must either supply an existing transaction ID or begin a new + # transaction. + # @param statements [::Array<::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement, ::Hash>] + # Required. The list of statements to execute in this batch. Statements are + # executed serially, such that the effects of statement `i` are visible to + # statement `i+1`. Each statement must be a DML statement. Execution stops at + # the first failed statement; the remaining statements are not executed. + # + # Callers must provide at least one statement. + # @param seqno [::Integer] + # Required. A per-transaction sequence number used to identify this request. + # This field makes each request idempotent such that if the request is + # received multiple times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction might be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param last_statements [::Boolean] + # Optional. If set to `true`, this request marks the end of the transaction. + # After these statements execute, you must commit or abort the transaction. + # Attempts to execute any other requests against this transaction + # (including reads and queries) are rejected. + # + # Setting this option might cause some error reporting to be deferred until + # commit time (for example, validation of unique constraints). Given this, + # successful execution of statements shouldn't be assumed until a subsequent + # `Commit` call completes successfully. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new + # + # # Call the execute_batch_dml method. + # result = client.execute_batch_dml request + # + # # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. + # p result + # + def execute_batch_dml request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.execute_batch_dml.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.execute_batch_dml.timeout, + metadata: metadata, + retry_policy: @config.rpcs.execute_batch_dml.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :execute_batch_dml, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reads rows from the database using key lookups and scans, as a + # simple key/value style alternative to + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. This method can't be + # used to return a result set larger than 10 MiB; if the read matches more + # data than that, the read fails with a `FAILED_PRECONDITION` + # error. + # + # Reads inside read-write transactions might return `ABORTED`. If + # this occurs, the application should restart the transaction from + # the beginning. See {::Google::Cloud::Spanner::V1::Transaction Transaction} for more + # details. + # + # Larger result sets can be yielded in streaming fashion by calling + # {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead} instead. + # + # @overload read(request, options = nil) + # Pass arguments to `read` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ReadRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ReadRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, order_by: nil, lock_hint: nil, routing_hint: nil) + # Pass arguments to `read` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the read should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # The transaction to use. If none is provided, the default is a + # temporary read-only transaction with strong concurrency. + # @param table [::String] + # Required. The name of the table in the database to be read. + # @param index [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of + # the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. + # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further + # information. + # @param columns [::Array<::String>] + # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be + # returned for each row matching this request. + # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to + # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. + # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys + # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. + # + # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} + # field is empty, rows are yielded in table primary key order (if + # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order + # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the + # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field + # isn't empty, rows are yielded in an unspecified order. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @param limit [::Integer] + # If greater than zero, only the first `limit` rows are yielded. If `limit` + # is zero, the default is no limit. A limit can't be specified if + # `partition_token` is set. + # @param resume_token [::String] + # If this request is resuming a previously interrupted read, + # `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new read to resume where the last read + # left off. The rest of the request parameters must exactly match the request + # that yielded this token. + # @param partition_token [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionRead`. There must be an exact + # match for the values of fields common to this message and the + # PartitionReadRequest message used to create this partition_token. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] + # Directed read options for this request. + # @param data_boost_enabled [::Boolean] + # If this is for a partitioned read and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @param order_by [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] + # Optional. Order for the returned rows. + # + # By default, Spanner returns result rows in primary key order except for + # PartitionRead requests. For applications that don't require rows to be + # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + # resulting in lower latencies in certain cases (for example, bulk point + # lookups). + # @param lock_hint [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] + # Optional. Lock Hint for the request, it can only be used with read-write + # transactions. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::ResultSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ReadRequest.new + # + # # Call the read method. + # result = client.read request + # + # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + # p result + # + def read request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ReadRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.read.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.read.timeout, + metadata: metadata, + retry_policy: @config.rpcs.read.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :read, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Like {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, except returns the result set + # as a stream. Unlike {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, there is no + # limit on the size of the returned result set. However, no individual row in + # the result set can exceed 100 MiB, and no column value can exceed + # 10 MiB. + # + # @overload streaming_read(request, options = nil) + # Pass arguments to `streaming_read` via a request object, either of type + # {::Google::Cloud::Spanner::V1::ReadRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::ReadRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload streaming_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, order_by: nil, lock_hint: nil, routing_hint: nil) + # Pass arguments to `streaming_read` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the read should be performed. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # The transaction to use. If none is provided, the default is a + # temporary read-only transaction with strong concurrency. + # @param table [::String] + # Required. The name of the table in the database to be read. + # @param index [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of + # the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. + # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further + # information. + # @param columns [::Array<::String>] + # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be + # returned for each row matching this request. + # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to + # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. + # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys + # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. + # + # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} + # field is empty, rows are yielded in table primary key order (if + # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order + # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the + # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field + # isn't empty, rows are yielded in an unspecified order. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @param limit [::Integer] + # If greater than zero, only the first `limit` rows are yielded. If `limit` + # is zero, the default is no limit. A limit can't be specified if + # `partition_token` is set. + # @param resume_token [::String] + # If this request is resuming a previously interrupted read, + # `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new read to resume where the last read + # left off. The rest of the request parameters must exactly match the request + # that yielded this token. + # @param partition_token [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionRead`. There must be an exact + # match for the values of fields common to this message and the + # PartitionReadRequest message used to create this partition_token. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] + # Directed read options for this request. + # @param data_boost_enabled [::Boolean] + # If this is for a partitioned read and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @param order_by [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] + # Optional. Order for the returned rows. + # + # By default, Spanner returns result rows in primary key order except for + # PartitionRead requests. For applications that don't require rows to be + # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + # resulting in lower latencies in certain cases (for example, bulk point + # lookups). + # @param lock_hint [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] + # Optional. Lock Hint for the request, it can only be used with read-write + # transactions. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::ReadRequest.new + # + # # Call the streaming_read method to start streaming. + # output = client.streaming_read request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Spanner::V1::PartialResultSet + # output.each do |current_response| + # p current_response + # end + # + def streaming_read request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ReadRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.streaming_read.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.streaming_read.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_read.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :streaming_read, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins a new transaction. This step can often be skipped: + # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} can begin a new transaction as a + # side-effect. + # + # @overload begin_transaction(request, options = nil) + # Pass arguments to `begin_transaction` via a request object, either of type + # {::Google::Cloud::Spanner::V1::BeginTransactionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::BeginTransactionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload begin_transaction(session: nil, options: nil, request_options: nil, mutation_key: nil, routing_hint: nil) + # Pass arguments to `begin_transaction` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the transaction runs. + # @param options [::Google::Cloud::Spanner::V1::TransactionOptions, ::Hash] + # Required. Options for the new transaction. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # Priority is ignored for this request. Setting the priority in this + # `request_options` struct doesn't do anything. To set the priority for a + # transaction, set it on the reads and writes that are part of this + # transaction instead. + # @param mutation_key [::Google::Cloud::Spanner::V1::Mutation, ::Hash] + # Optional. Required for read-write transactions on a multiplexed session + # that commit mutations but don't perform any reads or queries. You must + # randomly select one of the mutations from the mutation set and send it as a + # part of this request. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::Transaction] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::Transaction] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new + # + # # Call the begin_transaction method. + # result = client.begin_transaction request + # + # # The returned object is of type Google::Cloud::Spanner::V1::Transaction. + # p result + # + def begin_transaction request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BeginTransactionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.begin_transaction.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout, + metadata: metadata, + retry_policy: @config.rpcs.begin_transaction.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :begin_transaction, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Commits a transaction. The request includes the mutations to be + # applied to rows in the database. + # + # `Commit` might return an `ABORTED` error. This can occur at any time; + # commonly, the cause is conflicts with concurrent + # transactions. However, it can also happen for a variety of other + # reasons. If `Commit` returns `ABORTED`, the caller should retry + # the transaction from the beginning, reusing the same session. + # + # On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, + # for example, if the client job experiences a 1+ hour networking failure. + # At that point, Cloud Spanner has lost track of the transaction outcome and + # we recommend that you perform another read from the database to see the + # state of things as they are now. + # + # @overload commit(request, options = nil) + # Pass arguments to `commit` via a request object, either of type + # {::Google::Cloud::Spanner::V1::CommitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::CommitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload commit(session: nil, transaction_id: nil, single_use_transaction: nil, mutations: nil, return_commit_stats: nil, max_commit_delay: nil, request_options: nil, precommit_token: nil, routing_hint: nil) + # Pass arguments to `commit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the transaction to be committed is running. + # @param transaction_id [::String] + # Commit a previously-started transaction. + # + # Note: The following parameters are mutually exclusive: `transaction_id`, `single_use_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param single_use_transaction [::Google::Cloud::Spanner::V1::TransactionOptions, ::Hash] + # Execute mutations in a temporary transaction. Note that unlike + # commit of a previously-started transaction, commit with a + # temporary transaction is non-idempotent. That is, if the + # `CommitRequest` is sent to Cloud Spanner more than once (for + # instance, due to retries in the application, or in the + # transport library), it's possible that the mutations are + # executed more than once. If this is undesirable, use + # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} instead. + # + # Note: The following parameters are mutually exclusive: `single_use_transaction`, `transaction_id`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param mutations [::Array<::Google::Cloud::Spanner::V1::Mutation, ::Hash>] + # The mutations to be executed when this transaction commits. All + # mutations are applied atomically, in the order they appear in + # this list. + # @param return_commit_stats [::Boolean] + # If `true`, then statistics related to the transaction is included in + # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. + # Default value is `false`. + # @param max_commit_delay [::Google::Protobuf::Duration, ::Hash] + # Optional. The amount of latency this request is configured to incur in + # order to improve throughput. If this field isn't set, Spanner assumes + # requests are relatively latency sensitive and automatically determines an + # appropriate delay time. You can specify a commit delay value between 0 and + # 500 ms. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param precommit_token [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken, ::Hash] + # Optional. If the read-write transaction was executed on a multiplexed + # session, then you must include the precommit token with the highest + # sequence number received in this transaction attempt. Failing to do so + # results in a `FailedPrecondition` error. + # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::CommitResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::CommitResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::CommitRequest.new + # + # # Call the commit method. + # result = client.commit request + # + # # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. + # p result + # + def commit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::CommitRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.commit.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.commit.timeout, + metadata: metadata, + retry_policy: @config.rpcs.commit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :commit, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rolls back a transaction, releasing any locks it holds. It's a good + # idea to call this for any transaction that includes one or more + # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} requests and ultimately + # decides not to commit. + # + # `Rollback` returns `OK` if it successfully aborts the transaction, the + # transaction was already aborted, or the transaction isn't + # found. `Rollback` never returns `ABORTED`. + # + # @overload rollback(request, options = nil) + # Pass arguments to `rollback` via a request object, either of type + # {::Google::Cloud::Spanner::V1::RollbackRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::RollbackRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload rollback(session: nil, transaction_id: nil) + # Pass arguments to `rollback` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the transaction to roll back is running. + # @param transaction_id [::String] + # Required. The transaction to roll back. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::RollbackRequest.new + # + # # Call the rollback method. + # result = client.rollback request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def rollback request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::RollbackRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.rollback.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rollback.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rollback.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :rollback, request, 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 set of partition tokens that can be used to execute a query + # operation in parallel. Each of the returned partition tokens can be used + # by {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql} to + # specify a subset of the query result to read. The same session and + # read-only transaction must be used by the `PartitionQueryRequest` used to + # create the partition tokens and the `ExecuteSqlRequests` that use the + # partition tokens. + # + # Partition tokens become invalid when the session used to create them + # is deleted, is idle for too long, begins a new transaction, or becomes too + # old. When any of these happen, it isn't possible to resume the query, and + # the whole operation must be restarted from the beginning. + # + # @overload partition_query(request, options = nil) + # Pass arguments to `partition_query` via a request object, either of type + # {::Google::Cloud::Spanner::V1::PartitionQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::PartitionQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload partition_query(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, partition_options: nil) + # Pass arguments to `partition_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session used to create the partitions. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # Read-only snapshot transactions are supported, read and write and + # single-use transactions are not. + # @param sql [::String] + # Required. The query request to generate partitions for. The request fails + # if the query isn't root partitionable. For a query to be root + # partitionable, it needs to satisfy a few conditions. For example, if the + # query execution plan contains a distributed union operator, then it must be + # the first operator in the plan. For more information about other + # conditions, see [Read data in + # parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). + # + # The query request must not contain DML commands, such as `INSERT`, + # `UPDATE`, or `DELETE`. Use + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql `ExecuteStreamingSql`} with + # a `PartitionedDml` transaction for large, partition-friendly DML + # operations. + # @param params [::Google::Protobuf::Struct, ::Hash] + # Optional. Parameter names and values that bind to placeholders in the SQL + # string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names can contain + # letters, numbers, and underscores. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] + # Optional. It isn't always possible for Cloud Spanner to infer the right SQL + # type from a JSON value. For example, values of type `BYTES` and values of + # type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. + # + # In these cases, `param_types` can be used to specify the exact + # SQL type for some or all of the SQL query parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @param partition_options [::Google::Cloud::Spanner::V1::PartitionOptions, ::Hash] + # Additional options that affect how many partitions are created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::PartitionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::PartitionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new + # + # # Call the partition_query method. + # result = client.partition_query request + # + # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + # p result + # + def partition_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::PartitionQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.partition_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.partition_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.partition_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :partition_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a set of partition tokens that can be used to execute a read + # operation in parallel. Each of the returned partition tokens can be used + # by {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead} to specify a + # subset of the read result to read. The same session and read-only + # transaction must be used by the `PartitionReadRequest` used to create the + # partition tokens and the `ReadRequests` that use the partition tokens. + # There are no ordering guarantees on rows returned among the returned + # partition tokens, or even within each individual `StreamingRead` call + # issued with a `partition_token`. + # + # Partition tokens become invalid when the session used to create them + # is deleted, is idle for too long, begins a new transaction, or becomes too + # old. When any of these happen, it isn't possible to resume the read, and + # the whole operation must be restarted from the beginning. + # + # @overload partition_read(request, options = nil) + # Pass arguments to `partition_read` via a request object, either of type + # {::Google::Cloud::Spanner::V1::PartitionReadRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::PartitionReadRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload partition_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, partition_options: nil) + # Pass arguments to `partition_read` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session used to create the partitions. + # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] + # Read only snapshot transactions are supported, read/write and single use + # transactions are not. + # @param table [::String] + # Required. The name of the table in the database to be read. + # @param index [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table}. This index is used + # instead of the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting + # result rows. See {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} + # for further information. + # @param columns [::Array<::String>] + # The columns of {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be + # returned for each row matching this request. + # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present. If + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} instead names + # index keys in {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index}. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @param partition_options [::Google::Cloud::Spanner::V1::PartitionOptions, ::Hash] + # Additional options that affect how many partitions are created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Spanner::V1::PartitionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Spanner::V1::PartitionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::PartitionReadRequest.new + # + # # Call the partition_read method. + # result = client.partition_read request + # + # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + # p result + # + def partition_read request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::PartitionReadRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.partition_read.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.partition_read.timeout, + metadata: metadata, + retry_policy: @config.rpcs.partition_read.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :partition_read, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Batches the supplied mutation groups in a collection of efficient + # transactions. All mutations in a group are committed atomically. However, + # mutations across groups can be committed non-atomically in an unspecified + # order and thus, they must be independent of each other. Partial failure is + # possible, that is, some groups might have been committed successfully, + # while some might have failed. The results of individual batches are + # streamed into the response as the batches are applied. + # + # `BatchWrite` requests are not replay protected, meaning that each mutation + # group can be applied more than once. Replays of non-idempotent mutations + # can have undesirable effects. For example, replays of an insert mutation + # can produce an already exists error or if you use generated or commit + # timestamp-based keys, it can result in additional rows being added to the + # mutation's table. We recommend structuring your mutation groups to be + # idempotent to avoid this issue. + # + # @overload batch_write(request, options = nil) + # Pass arguments to `batch_write` via a request object, either of type + # {::Google::Cloud::Spanner::V1::BatchWriteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Spanner::V1::BatchWriteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_write(session: nil, request_options: nil, mutation_groups: nil, exclude_txn_from_change_streams: nil) + # Pass arguments to `batch_write` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::String] + # Required. The session in which the batch request is to be run. + # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] + # Common options for this request. + # @param mutation_groups [::Array<::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup, ::Hash>] + # Required. The groups of mutations to be applied. + # @param exclude_txn_from_change_streams [::Boolean] + # Optional. If you don't set the `exclude_txn_from_change_streams` option or + # if it's set to `false`, then any change streams monitoring columns modified + # by transactions will capture the updates made within that transaction. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::BatchWriteResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Spanner::V1::BatchWriteResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/spanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Spanner::V1::Spanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Spanner::V1::BatchWriteRequest.new + # + # # Call the batch_write method to start streaming. + # output = client.batch_write request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Spanner::V1::BatchWriteResponse + # output.each do |current_response| + # p current_response + # end + # + def batch_write request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BatchWriteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_write.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Spanner::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_write.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_write.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @spanner_stub.call_rpc :batch_write, request, 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 Spanner API. + # + # This class represents the configuration for Spanner, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_session to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Spanner::V1::Spanner::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "spanner.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Spanner API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `batch_create_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_sessions + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + ## + # RPC-specific configuration for `execute_sql` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_sql + ## + # RPC-specific configuration for `execute_streaming_sql` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_streaming_sql + ## + # RPC-specific configuration for `execute_batch_dml` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_batch_dml + ## + # RPC-specific configuration for `read` + # @return [::Gapic::Config::Method] + # + attr_reader :read + ## + # RPC-specific configuration for `streaming_read` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_read + ## + # RPC-specific configuration for `begin_transaction` + # @return [::Gapic::Config::Method] + # + attr_reader :begin_transaction + ## + # RPC-specific configuration for `commit` + # @return [::Gapic::Config::Method] + # + attr_reader :commit + ## + # RPC-specific configuration for `rollback` + # @return [::Gapic::Config::Method] + # + attr_reader :rollback + ## + # RPC-specific configuration for `partition_query` + # @return [::Gapic::Config::Method] + # + attr_reader :partition_query + ## + # RPC-specific configuration for `partition_read` + # @return [::Gapic::Config::Method] + # + attr_reader :partition_read + ## + # RPC-specific configuration for `batch_write` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_write + + # @private + def initialize parent_rpcs = nil + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + batch_create_sessions_config = parent_rpcs.batch_create_sessions if parent_rpcs.respond_to? :batch_create_sessions + @batch_create_sessions = ::Gapic::Config::Method.new batch_create_sessions_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql + @execute_sql = ::Gapic::Config::Method.new execute_sql_config + execute_streaming_sql_config = parent_rpcs.execute_streaming_sql if parent_rpcs.respond_to? :execute_streaming_sql + @execute_streaming_sql = ::Gapic::Config::Method.new execute_streaming_sql_config + execute_batch_dml_config = parent_rpcs.execute_batch_dml if parent_rpcs.respond_to? :execute_batch_dml + @execute_batch_dml = ::Gapic::Config::Method.new execute_batch_dml_config + read_config = parent_rpcs.read if parent_rpcs.respond_to? :read + @read = ::Gapic::Config::Method.new read_config + streaming_read_config = parent_rpcs.streaming_read if parent_rpcs.respond_to? :streaming_read + @streaming_read = ::Gapic::Config::Method.new streaming_read_config + begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction + @begin_transaction = ::Gapic::Config::Method.new begin_transaction_config + commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit + @commit = ::Gapic::Config::Method.new commit_config + rollback_config = parent_rpcs.rollback if parent_rpcs.respond_to? :rollback + @rollback = ::Gapic::Config::Method.new rollback_config + partition_query_config = parent_rpcs.partition_query if parent_rpcs.respond_to? :partition_query + @partition_query = ::Gapic::Config::Method.new partition_query_config + partition_read_config = parent_rpcs.partition_read if parent_rpcs.respond_to? :partition_read + @partition_read = ::Gapic::Config::Method.new partition_read_config + batch_write_config = parent_rpcs.batch_write if parent_rpcs.respond_to? :batch_write + @batch_write = ::Gapic::Config::Method.new batch_write_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb new file mode 100644 index 000000000000..1970ece8b929 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Spanner + module V1 + module Spanner + # Credentials for the Spanner API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/spanner.data" + ] + self.env_vars = [ + "SPANNER_CREDENTIALS", + "SPANNER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPANNER_CREDENTIALS_JSON", + "SPANNER_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-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb new file mode 100644 index 000000000000..ef5cfd6c6bab --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/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 Spanner + module V1 + module Spanner + # Path helper methods for the Spanner API. + module Paths + ## + # Create a fully-qualified Database resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/databases/{database}` + # + # @param project [String] + # @param instance [String] + # @param database [String] + # + # @return [::String] + def database_path project:, instance:, database: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/databases/#{database}" + end + + ## + # Create a fully-qualified Session resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/instances/{instance}/databases/{database}/sessions/{session}` + # + # @param project [String] + # @param instance [String] + # @param database [String] + # @param session [String] + # + # @return [::String] + def session_path project:, instance:, database:, session: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" + + "projects/#{project}/instances/#{instance}/databases/#{database}/sessions/#{session}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb new file mode 100644 index 000000000000..d42f1a645d00 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/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 Spanner + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb new file mode 100644 index 000000000000..4d36ea2bd9bf --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/change_stream.proto + +require 'google/protobuf' + +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/spanner/v1/type_pb' + + +descriptor_data = "\n%google/spanner/v1/change_stream.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x96\x14\n\x12\x43hangeStreamRecord\x12T\n\x12\x64\x61ta_change_record\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.ChangeStreamRecord.DataChangeRecordH\x00\x12Q\n\x10heartbeat_record\x18\x02 \x01(\x0b\x32\x35.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordH\x00\x12\\\n\x16partition_start_record\x18\x03 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordH\x00\x12X\n\x14partition_end_record\x18\x04 \x01(\x0b\x32\x38.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordH\x00\x12\\\n\x16partition_event_record\x18\x05 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordH\x00\x1a\xd2\n\n\x10\x44\x61taChangeRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x1d\n\x15server_transaction_id\x18\x03 \x01(\t\x12\x32\n*is_last_record_in_transaction_in_partition\x18\x04 \x01(\x08\x12\r\n\x05table\x18\x05 \x01(\t\x12^\n\x0f\x63olumn_metadata\x18\x06 \x03(\x0b\x32\x45.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata\x12H\n\x04mods\x18\x07 \x03(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod\x12P\n\x08mod_type\x18\x08 \x01(\x0e\x32>.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType\x12\x63\n\x12value_capture_type\x18\t \x01(\x0e\x32G.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType\x12(\n number_of_records_in_transaction\x18\n \x01(\x05\x12+\n#number_of_partitions_in_transaction\x18\x0b \x01(\x05\x12\x17\n\x0ftransaction_tag\x18\x0c \x01(\t\x12\x1d\n\x15is_system_transaction\x18\r \x01(\x08\x1aw\n\x0e\x43olumnMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type\x12\x16\n\x0eis_primary_key\x18\x03 \x01(\x08\x12\x18\n\x10ordinal_position\x18\x04 \x01(\x03\x1aP\n\x08ModValue\x12\x1d\n\x15\x63olumn_metadata_index\x18\x01 \x01(\x05\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\xfe\x01\n\x03Mod\x12M\n\x04keys\x18\x01 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nold_values\x18\x02 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nnew_values\x18\x03 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\"G\n\x07ModType\x12\x18\n\x14MOD_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INSERT\x10\n\x12\n\n\x06UPDATE\x10\x14\x12\n\n\x06\x44\x45LETE\x10\x1e\"\x87\x01\n\x10ValueCaptureType\x12\"\n\x1eVALUE_CAPTURE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12OLD_AND_NEW_VALUES\x10\n\x12\x0e\n\nNEW_VALUES\x10\x14\x12\x0b\n\x07NEW_ROW\x10\x1e\x12\x1a\n\x16NEW_ROW_AND_OLD_VALUES\x10(\x1a@\n\x0fHeartbeatRecord\x12-\n\ttimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a~\n\x14PartitionStartRecord\x12\x33\n\x0fstart_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x18\n\x10partition_tokens\x18\x03 \x03(\t\x1ay\n\x12PartitionEndRecord\x12\x31\n\rend_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x1a\xa4\x03\n\x14PartitionEventRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x12^\n\x0emove_in_events\x18\x04 \x03(\x0b\x32\x46.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent\x12`\n\x0fmove_out_events\x18\x05 \x03(\x0b\x32G.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent\x1a-\n\x0bMoveInEvent\x12\x1e\n\x16source_partition_token\x18\x01 \x01(\t\x1a\x33\n\x0cMoveOutEvent\x12#\n\x1b\x64\x65stination_partition_token\x18\x01 \x01(\tB\x08\n\x06recordB\xb4\x01\n\x15\x63om.google.spanner.v1B\x11\x43hangeStreamProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module V1 + ChangeStreamRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord").msgclass + ChangeStreamRecord::DataChangeRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord").msgclass + ChangeStreamRecord::DataChangeRecord::ColumnMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata").msgclass + ChangeStreamRecord::DataChangeRecord::ModValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue").msgclass + ChangeStreamRecord::DataChangeRecord::Mod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod").msgclass + ChangeStreamRecord::DataChangeRecord::ModType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType").enummodule + ChangeStreamRecord::DataChangeRecord::ValueCaptureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType").enummodule + ChangeStreamRecord::HeartbeatRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.HeartbeatRecord").msgclass + ChangeStreamRecord::PartitionStartRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionStartRecord").msgclass + ChangeStreamRecord::PartitionEndRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEndRecord").msgclass + ChangeStreamRecord::PartitionEventRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord").msgclass + ChangeStreamRecord::PartitionEventRecord::MoveInEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent").msgclass + ChangeStreamRecord::PartitionEventRecord::MoveOutEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb new file mode 100644 index 000000000000..eac6aebcce64 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/commit_response.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' +require 'google/spanner/v1/location_pb' +require 'google/spanner/v1/transaction_pb' + + +descriptor_data = "\n\'google/spanner/v1/commit_response.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a google/spanner/v1/location.proto\x1a#google/spanner/v1/transaction.proto\"\x90\x03\n\x0e\x43ommitResponse\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x0c\x63ommit_stats\x18\x02 \x01(\x0b\x32-.google.spanner.v1.CommitResponse.CommitStats\x12N\n\x0fprecommit_token\x18\x04 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenH\x00\x12\x36\n\x12snapshot_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x39\n\x0c\x63\x61\x63he_update\x18\x06 \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\x1a%\n\x0b\x43ommitStats\x12\x16\n\x0emutation_count\x18\x01 \x01(\x03\x42\x19\n\x17MultiplexedSessionRetryB\xb6\x01\n\x15\x63om.google.spanner.v1B\x13\x43ommitResponseProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module V1 + CommitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse").msgclass + CommitResponse::CommitStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse.CommitStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb new file mode 100644 index 000000000000..8e8743e95c42 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/keys.proto + +require 'google/protobuf' + +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n\x1cgoogle/spanner/v1/keys.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\"\xf4\x01\n\x08KeyRange\x12\x32\n\x0cstart_closed\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x00\x12\x30\n\nstart_open\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x00\x12\x30\n\nend_closed\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x01\x12.\n\x08\x65nd_open\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x01\x42\x10\n\x0estart_key_typeB\x0e\n\x0c\x65nd_key_type\"l\n\x06KeySet\x12(\n\x04keys\x18\x01 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12+\n\x06ranges\x18\x02 \x03(\x0b\x32\x1b.google.spanner.v1.KeyRange\x12\x0b\n\x03\x61ll\x18\x03 \x01(\x08\x42\xac\x01\n\x15\x63om.google.spanner.v1B\tKeysProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module V1 + KeyRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRange").msgclass + KeySet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeySet").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb new file mode 100644 index 000000000000..911d7f698ff7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/location.proto + +require 'google/protobuf' + +require 'google/protobuf/struct_pb' +require 'google/spanner/v1/type_pb' + + +descriptor_data = "\n google/spanner/v1/location.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1cgoogle/spanner/v1/type.proto\"f\n\x05Range\x12\x11\n\tstart_key\x18\x01 \x01(\x0c\x12\x11\n\tlimit_key\x18\x02 \x01(\x0c\x12\x11\n\tgroup_uid\x18\x03 \x01(\x04\x12\x10\n\x08split_id\x18\x04 \x01(\x04\x12\x12\n\ngeneration\x18\x05 \x01(\x0c\"\xe6\x01\n\x06Tablet\x12\x12\n\ntablet_uid\x18\x01 \x01(\x04\x12\x16\n\x0eserver_address\x18\x02 \x01(\t\x12\x10\n\x08location\x18\x03 \x01(\t\x12,\n\x04role\x18\x04 \x01(\x0e\x32\x1e.google.spanner.v1.Tablet.Role\x12\x13\n\x0bincarnation\x18\x05 \x01(\x0c\x12\x10\n\x08\x64istance\x18\x06 \x01(\r\x12\x0c\n\x04skip\x18\x07 \x01(\x08\";\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\"p\n\x05Group\x12\x11\n\tgroup_uid\x18\x01 \x01(\x04\x12*\n\x07tablets\x18\x02 \x03(\x0b\x32\x19.google.spanner.v1.Tablet\x12\x14\n\x0cleader_index\x18\x03 \x01(\x05\x12\x12\n\ngeneration\x18\x04 \x01(\x0c\"\xd3\x04\n\tKeyRecipe\x12\x14\n\ntable_name\x18\x01 \x01(\tH\x00\x12\x14\n\nindex_name\x18\x02 \x01(\tH\x00\x12\x17\n\roperation_uid\x18\x03 \x01(\x04H\x00\x12/\n\x04part\x18\x04 \x03(\x0b\x32!.google.spanner.v1.KeyRecipe.Part\x1a\xc5\x03\n\x04Part\x12\x0b\n\x03tag\x18\x01 \x01(\r\x12\x36\n\x05order\x18\x02 \x01(\x0e\x32\'.google.spanner.v1.KeyRecipe.Part.Order\x12?\n\nnull_order\x18\x03 \x01(\x0e\x32+.google.spanner.v1.KeyRecipe.Part.NullOrder\x12%\n\x04type\x18\x04 \x01(\x0b\x32\x17.google.spanner.v1.Type\x12\x14\n\nidentifier\x18\x05 \x01(\tH\x00\x12\'\n\x05value\x18\x06 \x01(\x0b\x32\x16.google.protobuf.ValueH\x00\x12\x10\n\x06random\x18\x08 \x01(\x08H\x00\x12\x1a\n\x12struct_identifiers\x18\x07 \x03(\x05\"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"V\n\tNullOrder\x12\x1a\n\x16NULL_ORDER_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNULLS_FIRST\x10\x01\x12\x0e\n\nNULLS_LAST\x10\x02\x12\x0c\n\x08NOT_NULL\x10\x03\x42\x0c\n\nvalue_typeB\x08\n\x06target\"U\n\nRecipeList\x12\x19\n\x11schema_generation\x18\x01 \x01(\x0c\x12,\n\x06recipe\x18\x03 \x03(\x0b\x32\x1c.google.spanner.v1.KeyRecipe\"\xa8\x01\n\x0b\x43\x61\x63heUpdate\x12\x13\n\x0b\x64\x61tabase_id\x18\x01 \x01(\x04\x12\'\n\x05range\x18\x02 \x03(\x0b\x32\x18.google.spanner.v1.Range\x12\'\n\x05group\x18\x03 \x03(\x0b\x32\x18.google.spanner.v1.Group\x12\x32\n\x0bkey_recipes\x18\x05 \x01(\x0b\x32\x1d.google.spanner.v1.RecipeList\"\xca\x02\n\x0bRoutingHint\x12\x15\n\roperation_uid\x18\x01 \x01(\x04\x12\x13\n\x0b\x64\x61tabase_id\x18\x02 \x01(\x04\x12\x19\n\x11schema_generation\x18\x03 \x01(\x0c\x12\x0b\n\x03key\x18\x04 \x01(\x0c\x12\x11\n\tlimit_key\x18\x05 \x01(\x0c\x12\x11\n\tgroup_uid\x18\x06 \x01(\x04\x12\x10\n\x08split_id\x18\x07 \x01(\x04\x12\x12\n\ntablet_uid\x18\x08 \x01(\x04\x12H\n\x12skipped_tablet_uid\x18\t \x03(\x0b\x32,.google.spanner.v1.RoutingHint.SkippedTablet\x12\x17\n\x0f\x63lient_location\x18\n \x01(\t\x1a\x38\n\rSkippedTablet\x12\x12\n\ntablet_uid\x18\x01 \x01(\x04\x12\x13\n\x0bincarnation\x18\x02 \x01(\x0c\x42\xb0\x01\n\x15\x63om.google.spanner.v1B\rLocationProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module V1 + Range = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Range").msgclass + Tablet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Tablet").msgclass + Tablet::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Tablet.Role").enummodule + Group = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Group").msgclass + KeyRecipe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe").msgclass + KeyRecipe::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part").msgclass + KeyRecipe::Part::Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part.Order").enummodule + KeyRecipe::Part::NullOrder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part.NullOrder").enummodule + RecipeList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RecipeList").msgclass + CacheUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CacheUpdate").msgclass + RoutingHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RoutingHint").msgclass + RoutingHint::SkippedTablet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RoutingHint.SkippedTablet").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb new file mode 100644 index 000000000000..b84e466d4627 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/mutation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/spanner/v1/keys_pb' + + +descriptor_data = "\n google/spanner/v1/mutation.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/spanner/v1/keys.proto\"\xc0\x06\n\x08Mutation\x12\x33\n\x06insert\x18\x01 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x33\n\x06update\x18\x02 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12=\n\x10insert_or_update\x18\x03 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x34\n\x07replace\x18\x04 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x34\n\x06\x64\x65lete\x18\x05 \x01(\x0b\x32\".google.spanner.v1.Mutation.DeleteH\x00\x12\x30\n\x04send\x18\x06 \x01(\x0b\x32 .google.spanner.v1.Mutation.SendH\x00\x12.\n\x03\x61\x63k\x18\x07 \x01(\x0b\x32\x1f.google.spanner.v1.Mutation.AckH\x00\x1aX\n\x05Write\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07\x63olumns\x18\x02 \x03(\t\x12*\n\x06values\x18\x03 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x1aM\n\x06\x44\x65lete\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x02 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x1a\xa3\x01\n\x04Send\x12\x12\n\x05queue\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\x03key\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueB\x03\xe0\x41\x02\x12\x30\n\x0c\x64\x65liver_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x07payload\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\x61\n\x03\x41\x63k\x12\x12\n\x05queue\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\x03key\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueB\x03\xe0\x41\x02\x12\x18\n\x10ignore_not_found\x18\x03 \x01(\x08\x42\x0b\n\toperationB\xb0\x01\n\x15\x63om.google.spanner.v1B\rMutationProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module V1 + Mutation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation").msgclass + Mutation::Write = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Write").msgclass + Mutation::Delete = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Delete").msgclass + Mutation::Send = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Send").msgclass + Mutation::Ack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Ack").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb new file mode 100644 index 000000000000..143949a764c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/query_plan.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n\"google/spanner/v1/query_plan.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xf8\x04\n\x08PlanNode\x12\r\n\x05index\x18\x01 \x01(\x05\x12.\n\x04kind\x18\x02 \x01(\x0e\x32 .google.spanner.v1.PlanNode.Kind\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12:\n\x0b\x63hild_links\x18\x04 \x03(\x0b\x32%.google.spanner.v1.PlanNode.ChildLink\x12M\n\x14short_representation\x18\x05 \x01(\x0b\x32/.google.spanner.v1.PlanNode.ShortRepresentation\x12)\n\x08metadata\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x30\n\x0f\x65xecution_stats\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a@\n\tChildLink\x12\x13\n\x0b\x63hild_index\x18\x01 \x01(\x05\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x10\n\x08variable\x18\x03 \x01(\t\x1a\xb2\x01\n\x13ShortRepresentation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12S\n\nsubqueries\x18\x02 \x03(\x0b\x32?.google.spanner.v1.PlanNode.ShortRepresentation.SubqueriesEntry\x1a\x31\n\x0fSubqueriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"8\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x0e\n\nRELATIONAL\x10\x01\x12\n\n\x06SCALAR\x10\x02\"\xa4\x01\n\x12QueryAdvisorResult\x12L\n\x0cindex_advice\x18\x01 \x03(\x0b\x32\x31.google.spanner.v1.QueryAdvisorResult.IndexAdviceB\x03\xe0\x41\x01\x1a@\n\x0bIndexAdvice\x12\x10\n\x03\x64\x64l\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\x12improvement_factor\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\"~\n\tQueryPlan\x12/\n\nplan_nodes\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.PlanNode\x12@\n\x0cquery_advice\x18\x02 \x01(\x0b\x32%.google.spanner.v1.QueryAdvisorResultB\x03\xe0\x41\x01\x42\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eQueryPlanProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module V1 + PlanNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode").msgclass + PlanNode::ChildLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ChildLink").msgclass + PlanNode::ShortRepresentation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ShortRepresentation").msgclass + PlanNode::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.Kind").enummodule + QueryAdvisorResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryAdvisorResult").msgclass + QueryAdvisorResult::IndexAdvice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryAdvisorResult.IndexAdvice").msgclass + QueryPlan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryPlan").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb new file mode 100644 index 000000000000..687b6efa6936 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/result_set.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' +require 'google/spanner/v1/location_pb' +require 'google/spanner/v1/query_plan_pb' +require 'google/spanner/v1/transaction_pb' +require 'google/spanner/v1/type_pb' + + +descriptor_data = "\n\"google/spanner/v1/result_set.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a google/spanner/v1/location.proto\x1a\"google/spanner/v1/query_plan.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\xad\x02\n\tResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12(\n\x04rows\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12\x30\n\x05stats\x18\x03 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x05 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\x06 \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xf2\x02\n\x10PartialResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12&\n\x06values\x18\x02 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x15\n\rchunked_value\x18\x03 \x01(\x08\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12\x30\n\x05stats\x18\x05 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x08 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x11\n\x04last\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\n \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xb7\x01\n\x11ResultSetMetadata\x12/\n\x08row_type\x18\x01 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\x12<\n\x15undeclared_parameters\x18\x03 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\"\xb9\x01\n\x0eResultSetStats\x12\x30\n\nquery_plan\x18\x01 \x01(\x0b\x32\x1c.google.spanner.v1.QueryPlan\x12,\n\x0bquery_stats\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x19\n\x0frow_count_exact\x18\x03 \x01(\x03H\x00\x12\x1f\n\x15row_count_lower_bound\x18\x04 \x01(\x03H\x00\x42\x0b\n\trow_countB\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eResultSetProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module V1 + ResultSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSet").msgclass + PartialResultSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PartialResultSet").msgclass + ResultSetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetMetadata").msgclass + ResultSetStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb new file mode 100644 index 000000000000..22aa0b12b595 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/spanner/v1/spanner.proto + +require 'google/protobuf' + +require 'google/spanner/v1/commit_response_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/spanner/v1/keys_pb' +require 'google/spanner/v1/location_pb' +require 'google/spanner/v1/mutation_pb' +require 'google/spanner/v1/result_set_pb' +require 'google/spanner/v1/transaction_pb' +require 'google/spanner/v1/type_pb' + + +descriptor_data = "\n\x1fgoogle/spanner/v1/spanner.proto\x12\x11google.spanner.v1\x1a\'google/spanner/v1/commit_response.proto\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\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x1cgoogle/spanner/v1/keys.proto\x1a google/spanner/v1/location.proto\x1a google/spanner/v1/mutation.proto\x1a\"google/spanner/v1/result_set.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x83\x01\n\x14\x43reateSessionRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x30\n\x07session\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.SessionB\x03\xe0\x41\x02\"\xa9\x01\n\x1a\x42\x61tchCreateSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x34\n\x10session_template\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.Session\x12\x1a\n\rsession_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"J\n\x1b\x42\x61tchCreateSessionsResponse\x12+\n\x07session\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\"\xb8\x03\n\x07Session\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.google.spanner.v1.Session.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x19\x61pproximate_last_use_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x0c\x63reator_role\x18\x05 \x01(\t\x12\x18\n\x0bmultiplexed\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x88\x01\xea\x41\x84\x01\n\x1espanner.googleapis.com/Session\x12Oprojects/{project}/instances/{instance}/databases/{database}/sessions/{session}*\x08sessions2\x07session\"I\n\x11GetSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\x87\x01\n\x13ListSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\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\"]\n\x14ListSessionsResponse\x12,\n\x08sessions\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x14\x44\x65leteSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\xeb\x03\n\x0eRequestOptions\x12<\n\x08priority\x18\x01 \x01(\x0e\x32*.google.spanner.v1.RequestOptions.Priority\x12\x13\n\x0brequest_tag\x18\x02 \x01(\t\x12\x17\n\x0ftransaction_tag\x18\x03 \x01(\t\x12L\n\x0e\x63lient_context\x18\x04 \x01(\x0b\x32/.google.spanner.v1.RequestOptions.ClientContextB\x03\xe0\x41\x01\x1a\xbe\x01\n\rClientContext\x12_\n\x0esecure_context\x18\x01 \x03(\x0b\x32\x42.google.spanner.v1.RequestOptions.ClientContext.SecureContextEntryB\x03\xe0\x41\x01\x1aL\n\x12SecureContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"^\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x10\n\x0cPRIORITY_LOW\x10\x01\x12\x13\n\x0fPRIORITY_MEDIUM\x10\x02\x12\x11\n\rPRIORITY_HIGH\x10\x03\"\xea\x04\n\x13\x44irectedReadOptions\x12R\n\x10include_replicas\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.IncludeReplicasH\x00\x12R\n\x10\x65xclude_replicas\x18\x02 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.ExcludeReplicasH\x00\x1a\xad\x01\n\x10ReplicaSelection\x12\x10\n\x08location\x18\x01 \x01(\t\x12J\n\x04type\x18\x02 \x01(\x0e\x32<.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x1a\x86\x01\n\x0fIncludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelection\x12\x1e\n\x16\x61uto_failover_disabled\x18\x02 \x01(\x08\x1a\x66\n\x0f\x45xcludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelectionB\n\n\x08replicas\"\xc8\x07\n\x11\x45xecuteSqlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12I\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x34.google.spanner.v1.ExecuteSqlRequest.ParamTypesEntry\x12\x14\n\x0cresume_token\x18\x06 \x01(\x0c\x12\x42\n\nquery_mode\x18\x07 \x01(\x0e\x32..google.spanner.v1.ExecuteSqlRequest.QueryMode\x12\x17\n\x0fpartition_token\x18\x08 \x01(\x0c\x12\r\n\x05seqno\x18\t \x01(\x03\x12H\n\rquery_options\x18\n \x01(\x0b\x32\x31.google.spanner.v1.ExecuteSqlRequest.QueryOptions\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0f \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x10 \x01(\x08\x12\x1b\n\x0elast_statement\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\x1aO\n\x0cQueryOptions\x12\x19\n\x11optimizer_version\x18\x01 \x01(\t\x12$\n\x1coptimizer_statistics_package\x18\x02 \x01(\t\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"W\n\tQueryMode\x12\n\n\x06NORMAL\x10\x00\x12\x08\n\x04PLAN\x10\x01\x12\x0b\n\x07PROFILE\x10\x02\x12\x0e\n\nWITH_STATS\x10\x03\x12\x17\n\x13WITH_PLAN_AND_STATS\x10\x04\"\xbe\x04\n\x16\x45xecuteBatchDmlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12@\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelectorB\x03\xe0\x41\x02\x12L\n\nstatements\x18\x03 \x03(\x0b\x32\x33.google.spanner.v1.ExecuteBatchDmlRequest.StatementB\x03\xe0\x41\x02\x12\x12\n\x05seqno\x18\x04 \x01(\x03\x42\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x05 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x1c\n\x0flast_statements\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xec\x01\n\tStatement\x12\x10\n\x03sql\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12X\n\x0bparam_types\x18\x03 \x03(\x0b\x32\x43.google.spanner.v1.ExecuteBatchDmlRequest.Statement.ParamTypesEntry\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xc3\x01\n\x17\x45xecuteBatchDmlResponse\x12\x31\n\x0bresult_sets\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.ResultSet\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12Q\n\x0fprecommit_token\x18\x03 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\"H\n\x10PartitionOptions\x12\x1c\n\x14partition_size_bytes\x18\x01 \x01(\x03\x12\x16\n\x0emax_partitions\x18\x02 \x01(\x03\"\xad\x03\n\x15PartitionQueryRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12,\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12R\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x38.google.spanner.v1.PartitionQueryRequest.ParamTypesEntryB\x03\xe0\x41\x01\x12>\n\x11partition_options\x18\x06 \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xb1\x02\n\x14PartitionReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x0f\n\x07\x63olumns\x18\x05 \x03(\t\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12>\n\x11partition_options\x18\t \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\"$\n\tPartition\x12\x17\n\x0fpartition_token\x18\x01 \x01(\x0c\"z\n\x11PartitionResponse\x12\x30\n\npartitions\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.Partition\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\"\xb1\x06\n\x0bReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x14\n\x07\x63olumns\x18\x05 \x03(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x08 \x01(\x03\x12\x14\n\x0cresume_token\x18\t \x01(\x0c\x12\x17\n\x0fpartition_token\x18\n \x01(\x0c\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0e \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x0f \x01(\x08\x12=\n\x08order_by\x18\x10 \x01(\x0e\x32&.google.spanner.v1.ReadRequest.OrderByB\x03\xe0\x41\x01\x12?\n\tlock_hint\x18\x11 \x01(\x0e\x32\'.google.spanner.v1.ReadRequest.LockHintB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\"T\n\x07OrderBy\x12\x18\n\x14ORDER_BY_UNSPECIFIED\x10\x00\x12\x18\n\x14ORDER_BY_PRIMARY_KEY\x10\x01\x12\x15\n\x11ORDER_BY_NO_ORDER\x10\x02\"T\n\x08LockHint\x12\x19\n\x15LOCK_HINT_UNSPECIFIED\x10\x00\x12\x14\n\x10LOCK_HINT_SHARED\x10\x01\x12\x17\n\x13LOCK_HINT_EXCLUSIVE\x10\x02\"\xbe\x02\n\x17\x42\x65ginTransactionRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x07options\x18\x02 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsB\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x36\n\x0cmutation_key\x18\x04 \x01(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x05 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\"\x8b\x04\n\rCommitRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x18\n\x0etransaction_id\x18\x02 \x01(\x0cH\x00\x12G\n\x16single_use_transaction\x18\x03 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsH\x00\x12.\n\tmutations\x18\x04 \x03(\x0b\x32\x1b.google.spanner.v1.Mutation\x12\x1b\n\x13return_commit_stats\x18\x05 \x01(\x08\x12\x38\n\x10max_commit_delay\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12:\n\x0frequest_options\x18\x06 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12Q\n\x0fprecommit_token\x18\t \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\n \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\x42\r\n\x0btransaction\"g\n\x0fRollbackRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x1b\n\x0etransaction_id\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"\xce\x02\n\x11\x42\x61tchWriteRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12P\n\x0fmutation_groups\x18\x04 \x03(\x0b\x32\x32.google.spanner.v1.BatchWriteRequest.MutationGroupB\x03\xe0\x41\x02\x12,\n\x1f\x65xclude_txn_from_change_streams\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x44\n\rMutationGroup\x12\x33\n\tmutations\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x02\"\x7f\n\x12\x42\x61tchWriteResponse\x12\x0f\n\x07indexes\x18\x01 \x03(\x05\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x34\n\x10\x63ommit_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x8b\x18\n\x07Spanner\x12\xa6\x01\n\rCreateSession\x12\'.google.spanner.v1.CreateSessionRequest\x1a\x1a.google.spanner.v1.Session\"P\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02?\":/v1/{database=projects/*/instances/*/databases/*}/sessions:\x01*\x12\xe0\x01\n\x13\x42\x61tchCreateSessions\x12-.google.spanner.v1.BatchCreateSessionsRequest\x1a..google.spanner.v1.BatchCreateSessionsResponse\"j\xda\x41\x16\x64\x61tabase,session_count\x82\xd3\xe4\x93\x02K\"F/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate:\x01*\x12\x97\x01\n\nGetSession\x12$.google.spanner.v1.GetSessionRequest\x1a\x1a.google.spanner.v1.Session\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xae\x01\n\x0cListSessions\x12&.google.spanner.v1.ListSessionsRequest\x1a\'.google.spanner.v1.ListSessionsResponse\"M\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02<\x12:/v1/{database=projects/*/instances/*/databases/*}/sessions\x12\x99\x01\n\rDeleteSession\x12\'.google.spanner.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xa3\x01\n\nExecuteSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a\x1c.google.spanner.v1.ResultSet\"Q\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql:\x01*\x12\xbe\x01\n\x13\x45xecuteStreamingSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a#.google.spanner.v1.PartialResultSet\"Z\x82\xd3\xe4\x93\x02T\"O/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql:\x01*0\x01\x12\xc0\x01\n\x0f\x45xecuteBatchDml\x12).google.spanner.v1.ExecuteBatchDmlRequest\x1a*.google.spanner.v1.ExecuteBatchDmlResponse\"V\x82\xd3\xe4\x93\x02P\"K/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml:\x01*\x12\x91\x01\n\x04Read\x12\x1e.google.spanner.v1.ReadRequest\x1a\x1c.google.spanner.v1.ResultSet\"K\x82\xd3\xe4\x93\x02\x45\"@/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read:\x01*\x12\xac\x01\n\rStreamingRead\x12\x1e.google.spanner.v1.ReadRequest\x1a#.google.spanner.v1.PartialResultSet\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead:\x01*0\x01\x12\xc9\x01\n\x10\x42\x65ginTransaction\x12*.google.spanner.v1.BeginTransactionRequest\x1a\x1e.google.spanner.v1.Transaction\"i\xda\x41\x0fsession,options\x82\xd3\xe4\x93\x02Q\"L/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction:\x01*\x12\xeb\x01\n\x06\x43ommit\x12 .google.spanner.v1.CommitRequest\x1a!.google.spanner.v1.CommitResponse\"\x9b\x01\xda\x41 session,transaction_id,mutations\xda\x41(session,single_use_transaction,mutations\x82\xd3\xe4\x93\x02G\"B/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit:\x01*\x12\xb0\x01\n\x08Rollback\x12\".google.spanner.v1.RollbackRequest\x1a\x16.google.protobuf.Empty\"h\xda\x41\x16session,transaction_id\x82\xd3\xe4\x93\x02I\"D/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback:\x01*\x12\xb7\x01\n\x0ePartitionQuery\x12(.google.spanner.v1.PartitionQueryRequest\x1a$.google.spanner.v1.PartitionResponse\"U\x82\xd3\xe4\x93\x02O\"J/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery:\x01*\x12\xb4\x01\n\rPartitionRead\x12\'.google.spanner.v1.PartitionReadRequest\x1a$.google.spanner.v1.PartitionResponse\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead:\x01*\x12\xc8\x01\n\nBatchWrite\x12$.google.spanner.v1.BatchWriteRequest\x1a%.google.spanner.v1.BatchWriteResponse\"k\xda\x41\x17session,mutation_groups\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite:\x01*0\x01\x1aw\xca\x41\x16spanner.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.dataB\x91\x02\n\x15\x63om.google.spanner.v1B\x0cSpannerProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1\xea\x41_\n\x1fspanner.googleapis.com/Database\x12\n\x0ftype_annotation\x18\x04 \x01(\x0e\x32%.google.spanner.v1.TypeAnnotationCode\x12\x16\n\x0eproto_type_fqn\x18\x05 \x01(\t\"\x7f\n\nStructType\x12\x33\n\x06\x66ields\x18\x01 \x03(\x0b\x32#.google.spanner.v1.StructType.Field\x1a<\n\x05\x46ield\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type*\xdf\x01\n\x08TypeCode\x12\x19\n\x15TYPE_CODE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42OOL\x10\x01\x12\t\n\x05INT64\x10\x02\x12\x0b\n\x07\x46LOAT64\x10\x03\x12\x0b\n\x07\x46LOAT32\x10\x0f\x12\r\n\tTIMESTAMP\x10\x04\x12\x08\n\x04\x44\x41TE\x10\x05\x12\n\n\x06STRING\x10\x06\x12\t\n\x05\x42YTES\x10\x07\x12\t\n\x05\x41RRAY\x10\x08\x12\n\n\x06STRUCT\x10\t\x12\x0b\n\x07NUMERIC\x10\n\x12\x08\n\x04JSON\x10\x0b\x12\t\n\x05PROTO\x10\r\x12\x08\n\x04\x45NUM\x10\x0e\x12\x0c\n\x08INTERVAL\x10\x10\x12\x08\n\x04UUID\x10\x11*d\n\x12TypeAnnotationCode\x12$\n TYPE_ANNOTATION_CODE_UNSPECIFIED\x10\x00\x12\x0e\n\nPG_NUMERIC\x10\x02\x12\x0c\n\x08PG_JSONB\x10\x03\x12\n\n\x06PG_OID\x10\x04\x42\xac\x01\n\x15\x63om.google.spanner.v1B\tTypeProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Spanner + module V1 + Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Type").msgclass + StructType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType").msgclass + StructType::Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType.Field").msgclass + TypeCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeCode").enummodule + TypeAnnotationCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeAnnotationCode").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md new file mode 100644 index 000000000000..9e764966d911 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Spanner 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-spanner-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb new file mode 100644 index 000000000000..977e81d500bc --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb @@ -0,0 +1,488 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # Spanner Change Streams enable customers to capture and stream out changes to + # their Spanner databases in real-time. A change stream + # can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or + # partition_mode='MUTABLE_KEY_RANGE'. + # + # This message is only used in Change Streams created with the option + # partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special + # Table-Valued Function (TVF) along with each Change Streams. The function + # provides access to the change stream's records. The function is named + # READ_ (where is the + # name of the change stream), and it returns a table with only one column + # called ChangeRecord. + # @!attribute [rw] data_change_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord] + # Data change record describing a data change for a change stream + # partition. + # + # Note: The following fields are mutually exclusive: `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] heartbeat_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::HeartbeatRecord] + # Heartbeat record describing a heartbeat for a change stream partition. + # + # Note: The following fields are mutually exclusive: `heartbeat_record`, `data_change_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] partition_start_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionStartRecord] + # Partition start record describing a new change stream partition. + # + # Note: The following fields are mutually exclusive: `partition_start_record`, `data_change_record`, `heartbeat_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] partition_end_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord] + # Partition end record describing a terminated change stream partition. + # + # Note: The following fields are mutually exclusive: `partition_end_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] partition_event_record + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord] + # Partition event record describing key range changes for a change stream + # partition. + # + # Note: The following fields are mutually exclusive: `partition_event_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ChangeStreamRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A data change record contains a set of changes to a table with the same + # modification type (insert, update, or delete) committed at the same commit + # timestamp in one change stream partition for the same transaction. Multiple + # data change records can be returned for the same transaction across + # multiple change stream partitions. + # @!attribute [rw] commit_timestamp + # @return [::Google::Protobuf::Timestamp] + # Indicates the timestamp in which the change was committed. + # DataChangeRecord.commit_timestamps, + # PartitionStartRecord.start_timestamps, + # PartitionEventRecord.commit_timestamps, and + # PartitionEndRecord.end_timestamps can have the same value in the same + # partition. + # @!attribute [rw] record_sequence + # @return [::String] + # Record sequence numbers are unique and monotonically increasing (but not + # necessarily contiguous) for a specific timestamp across record + # types in the same partition. To guarantee ordered processing, the reader + # should process records (of potentially different types) in + # record_sequence order for a specific timestamp in the same partition. + # + # The record sequence number ordering across partitions is only meaningful + # in the context of a specific transaction. Record sequence numbers are + # unique across partitions for a specific transaction. Sort the + # DataChangeRecords for the same + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#server_transaction_id server_transaction_id} + # by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#record_sequence record_sequence} + # to reconstruct the ordering of the changes within the transaction. + # @!attribute [rw] server_transaction_id + # @return [::String] + # Provides a globally unique string that represents the transaction in + # which the change was committed. Multiple transactions can have the same + # commit timestamp, but each transaction has a unique + # server_transaction_id. + # @!attribute [rw] is_last_record_in_transaction_in_partition + # @return [::Boolean] + # Indicates whether this is the last record for a transaction in the + # current partition. Clients can use this field to determine when all + # records for a transaction in the current partition have been received. + # @!attribute [rw] table + # @return [::String] + # Name of the table affected by the change. + # @!attribute [rw] column_metadata + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ColumnMetadata>] + # Provides metadata describing the columns associated with the + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#mods mods} listed + # below. + # @!attribute [rw] mods + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod>] + # Describes the changes that were made. + # @!attribute [rw] mod_type + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType] + # Describes the type of change. + # @!attribute [rw] value_capture_type + # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType] + # Describes the value capture type that was specified in the change stream + # configuration when this change was captured. + # @!attribute [rw] number_of_records_in_transaction + # @return [::Integer] + # Indicates the number of data change records that are part of this + # transaction across all change stream partitions. This value can be used + # to assemble all the records associated with a particular transaction. + # @!attribute [rw] number_of_partitions_in_transaction + # @return [::Integer] + # Indicates the number of partitions that return data change records for + # this transaction. This value can be helpful in assembling all records + # associated with a particular transaction. + # @!attribute [rw] transaction_tag + # @return [::String] + # Indicates the transaction tag associated with this transaction. + # @!attribute [rw] is_system_transaction + # @return [::Boolean] + # Indicates whether the transaction is a system transaction. System + # transactions include those issued by time-to-live (TTL), column backfill, + # etc. + class DataChangeRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata for a column. + # @!attribute [rw] name + # @return [::String] + # Name of the column. + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::V1::Type] + # Type of the column. + # @!attribute [rw] is_primary_key + # @return [::Boolean] + # Indicates whether the column is a primary key column. + # @!attribute [rw] ordinal_position + # @return [::Integer] + # Ordinal position of the column based on the original table definition + # in the schema starting with a value of 1. + class ColumnMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Returns the value and associated metadata for a particular field of the + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod Mod}. + # @!attribute [rw] column_metadata_index + # @return [::Integer] + # Index within the repeated + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#column_metadata column_metadata} + # field, to obtain the column metadata for the column that was modified. + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + # The value of the column. + class ModValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A mod describes all data changes in a watched table row. + # @!attribute [rw] keys + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] + # Returns the value of the primary key of the modified row. + # @!attribute [rw] old_values + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] + # Returns the old values before the change for the modified columns. + # Always empty for + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::INSERT INSERT}, + # or if old values are not being captured specified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType value_capture_type}. + # @!attribute [rw] new_values + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] + # Returns the new values after the change for the modified columns. + # Always empty for + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::DELETE DELETE}. + class Mod + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Mod type describes the type of change Spanner applied to the data. For + # example, if the client submits an INSERT_OR_UPDATE request, Spanner will + # perform an insert if there is no existing row and return ModType INSERT. + # Alternatively, if there is an existing row, Spanner will perform an + # update and return ModType UPDATE. + module ModType + # Not specified. + MOD_TYPE_UNSPECIFIED = 0 + + # Indicates data was inserted. + INSERT = 10 + + # Indicates existing data was updated. + UPDATE = 20 + + # Indicates existing data was deleted. + DELETE = 30 + end + + # Value capture type describes which values are recorded in the data + # change record. + module ValueCaptureType + # Not specified. + VALUE_CAPTURE_TYPE_UNSPECIFIED = 0 + + # Records both old and new values of the modified watched columns. + OLD_AND_NEW_VALUES = 10 + + # Records only new values of the modified watched columns. + NEW_VALUES = 20 + + # Records new values of all watched columns, including modified and + # unmodified columns. + NEW_ROW = 30 + + # Records the new values of all watched columns, including modified and + # unmodified columns. Also records the old values of the modified + # columns. + NEW_ROW_AND_OLD_VALUES = 40 + end + end + + # A heartbeat record is returned as a progress indicator, when there are no + # data changes or any other partition record types in the change stream + # partition. + # @!attribute [rw] timestamp + # @return [::Google::Protobuf::Timestamp] + # Indicates the timestamp at which the query has returned all the records + # in the change stream partition with timestamp <= heartbeat timestamp. + # The heartbeat timestamp will not be the same as the timestamps of other + # record types in the same partition. + class HeartbeatRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A partition start record serves as a notification that the client should + # schedule the partitions to be queried. PartitionStartRecord returns + # information about one or more partitions. + # @!attribute [rw] start_timestamp + # @return [::Google::Protobuf::Timestamp] + # Start timestamp at which the partitions should be queried to return + # change stream records with timestamps >= start_timestamp. + # DataChangeRecord.commit_timestamps, + # PartitionStartRecord.start_timestamps, + # PartitionEventRecord.commit_timestamps, and + # PartitionEndRecord.end_timestamps can have the same value in the same + # partition. + # @!attribute [rw] record_sequence + # @return [::String] + # Record sequence numbers are unique and monotonically increasing (but not + # necessarily contiguous) for a specific timestamp across record + # types in the same partition. To guarantee ordered processing, the reader + # should process records (of potentially different types) in + # record_sequence order for a specific timestamp in the same partition. + # @!attribute [rw] partition_tokens + # @return [::Array<::String>] + # Unique partition identifiers to be used in queries. + class PartitionStartRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A partition end record serves as a notification that the client should stop + # reading the partition. No further records are expected to be retrieved on + # it. + # @!attribute [rw] end_timestamp + # @return [::Google::Protobuf::Timestamp] + # End timestamp at which the change stream partition is terminated. All + # changes generated by this partition will have timestamps <= + # end_timestamp. DataChangeRecord.commit_timestamps, + # PartitionStartRecord.start_timestamps, + # PartitionEventRecord.commit_timestamps, and + # PartitionEndRecord.end_timestamps can have the same value in the same + # partition. PartitionEndRecord is the last record returned for a + # partition. + # @!attribute [rw] record_sequence + # @return [::String] + # Record sequence numbers are unique and monotonically increasing (but not + # necessarily contiguous) for a specific timestamp across record + # types in the same partition. To guarantee ordered processing, the reader + # should process records (of potentially different types) in + # record_sequence order for a specific timestamp in the same partition. + # @!attribute [rw] partition_token + # @return [::String] + # Unique partition identifier describing the terminated change stream + # partition. + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord#partition_token partition_token} + # is equal to the partition token of the change stream partition currently + # queried to return this PartitionEndRecord. + class PartitionEndRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A partition event record describes key range changes for a change stream + # partition. The changes to a row defined by its primary key can be captured + # in one change stream partition for a specific time range, and then be + # captured in a different change stream partition for a different time range. + # This movement of key ranges across change stream partitions is a reflection + # of activities, such as Spanner's dynamic splitting and load balancing, etc. + # Processing this event is needed if users want to guarantee processing of + # the changes for any key in timestamp order. If time ordered processing of + # changes for a primary key is not needed, this event can be ignored. + # To guarantee time ordered processing for each primary key, if the event + # describes move-ins, the reader of this partition needs to wait until the + # readers of the source partitions have processed all records with timestamps + # <= this PartitionEventRecord.commit_timestamp, before advancing beyond this + # PartitionEventRecord. If the event describes move-outs, the reader can + # notify the readers of the destination partitions that they can continue + # processing. + # @!attribute [rw] commit_timestamp + # @return [::Google::Protobuf::Timestamp] + # Indicates the commit timestamp at which the key range change occurred. + # DataChangeRecord.commit_timestamps, + # PartitionStartRecord.start_timestamps, + # PartitionEventRecord.commit_timestamps, and + # PartitionEndRecord.end_timestamps can have the same value in the same + # partition. + # @!attribute [rw] record_sequence + # @return [::String] + # Record sequence numbers are unique and monotonically increasing (but not + # necessarily contiguous) for a specific timestamp across record + # types in the same partition. To guarantee ordered processing, the reader + # should process records (of potentially different types) in + # record_sequence order for a specific timestamp in the same partition. + # @!attribute [rw] partition_token + # @return [::String] + # Unique partition identifier describing the partition this event + # occurred on. + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} + # is equal to the partition token of the change stream partition currently + # queried to return this PartitionEventRecord. + # @!attribute [rw] move_in_events + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveInEvent>] + # Set when one or more key ranges are moved into the change stream + # partition identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. + # + # Example: Two key ranges are moved into partition (P1) from partition (P2) + # and partition (P3) in a single transaction at timestamp T. + # + # The PartitionEventRecord returned in P1 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P1" + # move_in_events { + # source_partition_token: "P2" + # } + # move_in_events { + # source_partition_token: "P3" + # } + # } + # + # The PartitionEventRecord returned in P2 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P2" + # move_out_events { + # destination_partition_token: "P1" + # } + # } + # + # The PartitionEventRecord returned in P3 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P3" + # move_out_events { + # destination_partition_token: "P1" + # } + # } + # @!attribute [rw] move_out_events + # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent>] + # Set when one or more key ranges are moved out of the change stream + # partition identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. + # + # Example: Two key ranges are moved out of partition (P1) to partition (P2) + # and partition (P3) in a single transaction at timestamp T. + # + # The PartitionEventRecord returned in P1 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P1" + # move_out_events { + # destination_partition_token: "P2" + # } + # move_out_events { + # destination_partition_token: "P3" + # } + # } + # + # The PartitionEventRecord returned in P2 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P2" + # move_in_events { + # source_partition_token: "P1" + # } + # } + # + # The PartitionEventRecord returned in P3 will reflect the move as: + # + # PartitionEventRecord { + # commit_timestamp: T + # partition_token: "P3" + # move_in_events { + # source_partition_token: "P1" + # } + # } + class PartitionEventRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes move-in of the key ranges into the change stream partition + # identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. + # + # To maintain processing the changes for a particular key in timestamp + # order, the query processing the change stream partition identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} + # should not advance beyond the partition event record commit timestamp + # until the queries processing the source change stream partitions have + # processed all change stream records with timestamps <= the partition + # event record commit timestamp. + # @!attribute [rw] source_partition_token + # @return [::String] + # An unique partition identifier describing the source change stream + # partition that recorded changes for the key range that is moving + # into this partition. + class MoveInEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes move-out of the key ranges out of the change stream partition + # identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. + # + # To maintain processing the changes for a particular key in timestamp + # order, the query processing the + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent MoveOutEvent} + # in the partition identified by + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} + # should inform the queries processing the destination partitions that + # they can unblock and proceed processing records past the + # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#commit_timestamp commit_timestamp}. + # @!attribute [rw] destination_partition_token + # @return [::String] + # An unique partition identifier describing the destination change + # stream partition that will record changes for the key range that is + # moving out of this partition. + class MoveOutEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb new file mode 100644 index 000000000000..85e535abbe41 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.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 Spanner + module V1 + # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}. + # @!attribute [rw] commit_timestamp + # @return [::Google::Protobuf::Timestamp] + # The Cloud Spanner timestamp at which the transaction committed. + # @!attribute [rw] commit_stats + # @return [::Google::Cloud::Spanner::V1::CommitResponse::CommitStats] + # The statistics about this `Commit`. Not returned by default. + # For more information, see + # {::Google::Cloud::Spanner::V1::CommitRequest#return_commit_stats CommitRequest.return_commit_stats}. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # If specified, transaction has not committed yet. + # You must retry the commit with the new precommit token. + # @!attribute [rw] snapshot_timestamp + # @return [::Google::Protobuf::Timestamp] + # If `TransactionOptions.isolation_level` is set to + # `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the + # timestamp at which all reads in the transaction ran. This timestamp is + # never returned. + # @!attribute [rw] cache_update + # @return [::Google::Cloud::Spanner::V1::CacheUpdate] + # Optional. A cache update expresses a set of changes the client should + # incorporate into its location cache. The client should discard the changes + # if they are older than the data it already has. This data can be obtained + # in response to requests that included a `RoutingHint` field, but may also + # be obtained by explicit location-fetching RPCs which may be added in the + # future. + class CommitResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Additional statistics about a commit. + # @!attribute [rw] mutation_count + # @return [::Integer] + # The total number of mutations for the transaction. Knowing the + # `mutation_count` value can help you maximize the number of mutations + # in a transaction and minimize the number of API round trips. You can + # also monitor this value to prevent transactions from exceeding the system + # [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data). + # If the number of mutations exceeds the limit, the server returns + # [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT). + class CommitStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb new file mode 100644 index 000000000000..5faebc2232ef --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb @@ -0,0 +1,170 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # KeyRange represents a range of rows in a table or index. + # + # A range has a start key and an end key. These keys can be open or + # closed, indicating if the range includes rows with that key. + # + # Keys are represented by lists, where the ith value in the list + # corresponds to the ith component of the table or index primary key. + # Individual values are encoded as described + # {::Google::Cloud::Spanner::V1::TypeCode here}. + # + # For example, consider the following table definition: + # + # CREATE TABLE UserEvents ( + # UserName STRING(MAX), + # EventDate STRING(10) + # ) PRIMARY KEY(UserName, EventDate); + # + # The following keys name rows in this table: + # + # ["Bob", "2014-09-23"] + # ["Alfred", "2015-06-12"] + # + # Since the `UserEvents` table's `PRIMARY KEY` clause names two + # columns, each `UserEvents` key has two elements; the first is the + # `UserName`, and the second is the `EventDate`. + # + # Key ranges with multiple components are interpreted + # lexicographically by component using the table or index key's declared + # sort order. For example, the following range returns all events for + # user `"Bob"` that occurred in the year 2015: + # + # "start_closed": ["Bob", "2015-01-01"] + # "end_closed": ["Bob", "2015-12-31"] + # + # Start and end keys can omit trailing key components. This affects the + # inclusion and exclusion of rows that exactly match the provided key + # components: if the key is closed, then rows that exactly match the + # provided components are included; if the key is open, then rows + # that exactly match are not included. + # + # For example, the following range includes all events for `"Bob"` that + # occurred during and after the year 2000: + # + # "start_closed": ["Bob", "2000-01-01"] + # "end_closed": ["Bob"] + # + # The next example retrieves all events for `"Bob"`: + # + # "start_closed": ["Bob"] + # "end_closed": ["Bob"] + # + # To retrieve events before the year 2000: + # + # "start_closed": ["Bob"] + # "end_open": ["Bob", "2000-01-01"] + # + # The following range includes all rows in the table: + # + # "start_closed": [] + # "end_closed": [] + # + # This range returns all users whose `UserName` begins with any + # character from A to C: + # + # "start_closed": ["A"] + # "end_open": ["D"] + # + # This range returns all users whose `UserName` begins with B: + # + # "start_closed": ["B"] + # "end_open": ["C"] + # + # Key ranges honor column sort order. For example, suppose a table is + # defined as follows: + # + # CREATE TABLE DescendingSortedTable { + # Key INT64, + # ... + # ) PRIMARY KEY(Key DESC); + # + # The following range retrieves all rows with key values between 1 + # and 100 inclusive: + # + # "start_closed": ["100"] + # "end_closed": ["1"] + # + # Note that 100 is passed as the start, and 1 is passed as the end, + # because `Key` is a descending column in the schema. + # @!attribute [rw] start_closed + # @return [::Google::Protobuf::ListValue] + # If the start is closed, then the range includes all rows whose + # first `len(start_closed)` key columns exactly match `start_closed`. + # + # Note: The following fields are mutually exclusive: `start_closed`, `start_open`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] start_open + # @return [::Google::Protobuf::ListValue] + # If the start is open, then the range excludes rows whose first + # `len(start_open)` key columns exactly match `start_open`. + # + # Note: The following fields are mutually exclusive: `start_open`, `start_closed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] end_closed + # @return [::Google::Protobuf::ListValue] + # If the end is closed, then the range includes all rows whose + # first `len(end_closed)` key columns exactly match `end_closed`. + # + # Note: The following fields are mutually exclusive: `end_closed`, `end_open`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] end_open + # @return [::Google::Protobuf::ListValue] + # If the end is open, then the range excludes rows whose first + # `len(end_open)` key columns exactly match `end_open`. + # + # Note: The following fields are mutually exclusive: `end_open`, `end_closed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class KeyRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All + # the keys are expected to be in the same table or index. The keys need + # not be sorted in any particular way. + # + # If the same key is specified multiple times in the set (for example + # if two ranges, two keys, or a key and a range overlap), Cloud Spanner + # behaves as if the key were only specified once. + # @!attribute [rw] keys + # @return [::Array<::Google::Protobuf::ListValue>] + # A list of specific keys. Entries in `keys` should have exactly as + # many elements as there are columns in the primary or index key + # with which this `KeySet` is used. Individual key values are + # encoded as described {::Google::Cloud::Spanner::V1::TypeCode here}. + # @!attribute [rw] ranges + # @return [::Array<::Google::Cloud::Spanner::V1::KeyRange>] + # A list of key ranges. See {::Google::Cloud::Spanner::V1::KeyRange KeyRange} for more + # information about key range specifications. + # @!attribute [rw] all + # @return [::Boolean] + # For convenience `all` can be set to `true` to indicate that this + # `KeySet` matches all keys in the table or index. Note that any keys + # specified in `keys` or `ranges` are only yielded once. + class KeySet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb new file mode 100644 index 000000000000..d79971bad844 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb @@ -0,0 +1,417 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # A `Range` represents a range of keys in a database. The keys themselves + # are encoded in "sortable string format", also known as ssformat. Consult + # Spanner's open source client libraries for details on the encoding. + # + # Each range represents a contiguous range of rows, possibly from multiple + # tables/indexes. Each range is associated with a single paxos group (known as + # a "group" throughout this API), a split (which names the exact range within + # the group), and a generation that can be used to determine whether a given + # `Range` represents a newer or older location for the key range. + # @!attribute [rw] start_key + # @return [::String] + # The start key of the range, inclusive. Encoded in "sortable string format" + # (ssformat). + # @!attribute [rw] limit_key + # @return [::String] + # The limit key of the range, exclusive. Encoded in "sortable string format" + # (ssformat). + # @!attribute [rw] group_uid + # @return [::Integer] + # The UID of the paxos group where this range is stored. UIDs are unique + # within the database. References `Group.group_uid`. + # @!attribute [rw] split_id + # @return [::Integer] + # A group can store multiple ranges of keys. Each key range is named by an + # ID (the split ID). Within a group, split IDs are unique. The `split_id` + # names the exact split in `group_uid` where this range is stored. + # @!attribute [rw] generation + # @return [::String] + # `generation` indicates the freshness of the range information contained + # in this proto. Generations can be compared lexicographically; if generation + # A is greater than generation B, then the `Range` corresponding to A is + # newer than the `Range` corresponding to B, and should be used + # preferentially. + class Range + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `Tablet` represents a single replica of a `Group`. A tablet is served by a + # single server at a time, and can move between servers due to server death or + # simply load balancing. + # @!attribute [rw] tablet_uid + # @return [::Integer] + # The UID of the tablet, unique within the database. Matches the + # `tablet_uids` and `leader_tablet_uid` fields in `Group`. + # @!attribute [rw] server_address + # @return [::String] + # The address of the server that is serving this tablet -- either an IP + # address or DNS hostname and a port number. + # @!attribute [rw] location + # @return [::String] + # Where this tablet is located. This is the name of a Google Cloud region, + # such as "us-central1". + # @!attribute [rw] role + # @return [::Google::Cloud::Spanner::V1::Tablet::Role] + # The role of the tablet. + # @!attribute [rw] incarnation + # @return [::String] + # `incarnation` indicates the freshness of the tablet information contained + # in this proto. Incarnations can be compared lexicographically; if + # incarnation A is greater than incarnation B, then the `Tablet` + # corresponding to A is newer than the `Tablet` corresponding to B, and + # should be used preferentially. + # @!attribute [rw] distance + # @return [::Integer] + # Distances help the client pick the closest tablet out of the list of + # tablets for a given request. Tablets with lower distances should generally + # be preferred. Tablets with the same distance are approximately equally + # close; the client can choose arbitrarily. + # + # Distances do not correspond precisely to expected latency, geographical + # distance, or anything else. Distances should be compared only between + # tablets of the same group; they are not meaningful between different + # groups. + # + # A value of zero indicates that the tablet may be in the same zone as + # the client, and have minimum network latency. A value less than or equal to + # five indicates that the tablet is thought to be in the same region as the + # client, and may have a few milliseconds of network latency. Values greater + # than five are most likely in a different region, with non-trivial network + # latency. + # + # Clients should use the following algorithm: + # * If the request is using a directed read, eliminate any tablets that + # do not match the directed read's target zone and/or replica type. + # * (Read-write transactions only) Choose leader tablet if it has an + # distance <=5. + # * Group and sort tablets by distance. Choose a random + # tablet with the lowest distance. If the request + # is not a directed read, only consider replicas with distances <=5. + # * Send the request to the fallback endpoint. + # + # The tablet picked by this algorithm may be skipped, either because it is + # marked as `skip` by the server or because the corresponding server is + # unreachable, flow controlled, etc. Skipped tablets should be added to the + # `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should + # then be re-run without including the skipped tablet(s) to pick the next + # best tablet. + # @!attribute [rw] skip + # @return [::Boolean] + # If true, the tablet should not be chosen by the client. Typically, this + # signals that the tablet is unhealthy in some way. Tablets with `skip` + # set to true should be reported back to the server in + # `RoutingHint.skipped_tablet_uid`; this cues the server to send updated + # information for this tablet should it become usable again. + class Tablet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the role of the tablet. + module Role + # Not specified. + ROLE_UNSPECIFIED = 0 + + # The tablet can perform reads and (if elected leader) writes. + READ_WRITE = 1 + + # The tablet can only perform reads. + READ_ONLY = 2 + end + end + + # A `Group` represents a paxos group in a database. A group is a set of + # tablets that are replicated across multiple servers. Groups may have a leader + # tablet. Groups store one (or sometimes more) ranges of keys. + # @!attribute [rw] group_uid + # @return [::Integer] + # The UID of the paxos group, unique within the database. Matches the + # `group_uid` field in `Range`. + # @!attribute [rw] tablets + # @return [::Array<::Google::Cloud::Spanner::V1::Tablet>] + # A list of tablets that are part of the group. Note that this list may not + # be exhaustive; it will only include tablets the server considers useful + # to the client. The returned list is ordered ascending by distance. + # + # Tablet UIDs reference `Tablet.tablet_uid`. + # @!attribute [rw] leader_index + # @return [::Integer] + # The last known leader tablet of the group as an index into `tablets`. May + # be negative if the group has no known leader. + # @!attribute [rw] generation + # @return [::String] + # `generation` indicates the freshness of the group information (including + # leader information) contained in this proto. Generations can be compared + # lexicographically; if generation A is greater than generation B, then the + # `Group` corresponding to A is newer than the `Group` corresponding to B, + # and should be used preferentially. + class Group + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `KeyRecipe` provides the metadata required to translate reads, mutations, + # and queries into a byte array in "sortable string format" (ssformat)that can + # be used with `Range`s to route requests. Note that the client *must* tolerate + # `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may + # change over time. Requests with invalid `KeyRecipe`s should be routed to a + # default server. + # @!attribute [rw] table_name + # @return [::String] + # A table name, matching the name from the database schema. + # + # Note: The following fields are mutually exclusive: `table_name`, `index_name`, `operation_uid`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] index_name + # @return [::String] + # An index name, matching the name from the database schema. + # + # Note: The following fields are mutually exclusive: `index_name`, `table_name`, `operation_uid`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] operation_uid + # @return [::Integer] + # The UID of a query, matching the UID from `RoutingHint`. + # + # Note: The following fields are mutually exclusive: `operation_uid`, `table_name`, `index_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] part + # @return [::Array<::Google::Cloud::Spanner::V1::KeyRecipe::Part>] + # Parts are in the order they should appear in the encoded key. + class KeyRecipe + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An ssformat key is composed of a sequence of tag numbers and key column + # values. `Part` represents a single tag or key column value. + # @!attribute [rw] tag + # @return [::Integer] + # If non-zero, `tag` is the only field present in this `Part`. The part + # is encoded by appending `tag` to the ssformat key. + # @!attribute [rw] order + # @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::Order] + # Whether the key column is sorted ascending or descending. Only present + # if `tag` is zero. + # @!attribute [rw] null_order + # @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::NullOrder] + # How NULLs are represented in the encoded key part. Only present if `tag` + # is zero. + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::V1::Type] + # The type of the key part. Only present if `tag` is zero. + # @!attribute [rw] identifier + # @return [::String] + # `identifier` is the name of the column or query parameter. + # + # Note: The following fields are mutually exclusive: `identifier`, `value`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + # The constant value of the key part. + # It is present when query uses a constant as a part of the key. + # + # Note: The following fields are mutually exclusive: `value`, `identifier`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] random + # @return [::Boolean] + # If true, the client is responsible to fill in the value randomly. + # It's relevant only for the INT64 type. + # + # Note: The following fields are mutually exclusive: `random`, `identifier`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_identifiers + # @return [::Array<::Integer>] + # It is a repeated field to support fetching key columns from nested + # structs, such as `STRUCT` query parameters. + class Part + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The remaining fields encode column values. + module Order + # Default value, equivalent to `ASCENDING`. + ORDER_UNSPECIFIED = 0 + + # The key is ascending - corresponds to `ASC` in the schema definition. + ASCENDING = 1 + + # The key is descending - corresponds to `DESC` in the schema definition. + DESCENDING = 2 + end + + # The null order of the key column. This dictates where NULL values sort + # in the sorted order. Note that columns which are `NOT NULL` can have a + # special encoding. + module NullOrder + # Default value. This value is unused. + NULL_ORDER_UNSPECIFIED = 0 + + # NULL values sort before any non-NULL values. + NULLS_FIRST = 1 + + # NULL values sort after any non-NULL values. + NULLS_LAST = 2 + + # The column does not support NULL values. + NOT_NULL = 3 + end + end + end + + # A `RecipeList` contains a list of `KeyRecipe`s, which share the same + # schema generation. + # @!attribute [rw] schema_generation + # @return [::String] + # The schema generation of the recipes. To be sent to the server in + # `RoutingHint.schema_generation` whenever one of the recipes is used. + # `schema_generation` values are comparable with each other; if generation A + # compares greater than generation B, then A is a more recent schema than B. + # Clients should in general aim to cache only the latest schema generation, + # and discard more stale recipes. + # @!attribute [rw] recipe + # @return [::Array<::Google::Cloud::Spanner::V1::KeyRecipe>] + # A list of recipes to be cached. + class RecipeList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `CacheUpdate` expresses a set of changes the client should incorporate into + # its location cache. These changes may or may not be newer than what the + # client has in its cache, and should be discarded if necessary. `CacheUpdate`s + # can be obtained in response to requests that included a `RoutingHint` + # field, but may also be obtained by explicit location-fetching RPCs which may + # be added in the future. + # @!attribute [rw] database_id + # @return [::Integer] + # An internal ID for the database. Database names can be reused if a database + # is deleted and re-created. Each time the database is re-created, it will + # get a new database ID, which will never be re-used for any other database. + # @!attribute [rw] range + # @return [::Array<::Google::Cloud::Spanner::V1::Range>] + # A list of ranges to be cached. + # @!attribute [rw] group + # @return [::Array<::Google::Cloud::Spanner::V1::Group>] + # A list of groups to be cached. + # @!attribute [rw] key_recipes + # @return [::Google::Cloud::Spanner::V1::RecipeList] + # A list of recipes to be cached. + class CacheUpdate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `RoutingHint` can be optionally added to location-aware Spanner + # requests. It gives the server hints that can be used to route the request to + # an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + # + # The presence of a valid `RoutingHint` tells the server that the client + # is location-aware. + # + # `RoutingHint` does not change the semantics of the request; it is + # purely a performance hint; the request will perform the same actions on the + # database's data as if `RoutingHint` were not present. However, if + # the `RoutingHint` is incomplete or incorrect, the response may include + # a `CacheUpdate` the client can use to correct its location cache. + # @!attribute [rw] operation_uid + # @return [::Integer] + # A session-scoped unique ID for the operation, computed client-side. + # Requests with the same `operation_uid` should have a shared 'shape', + # meaning that some fields are expected to be the same, such as the SQL + # query, the target table/columns (for reads) etc. Requests with the same + # `operation_uid` are meant to differ only in fields like keys/key + # ranges/query parameters, transaction IDs, etc. + # + # `operation_uid` must be non-zero for `RoutingHint` to be valid. + # @!attribute [rw] database_id + # @return [::Integer] + # The database ID of the database being accessed, see + # `CacheUpdate.database_id`. Should match the cache entries that were used + # to generate the rest of the fields in this `RoutingHint`. + # @!attribute [rw] schema_generation + # @return [::String] + # The schema generation of the recipe that was used to generate `key` and + # `limit_key`. See also `RecipeList.schema_generation`. + # @!attribute [rw] key + # @return [::String] + # The key / key range that this request accesses. For operations that + # access a single key, `key` should be set and `limit_key` should be empty. + # For operations that access a key range, `key` and `limit_key` should both + # be set, to the inclusive start and exclusive end of the range respectively. + # + # The keys are encoded in "sortable string format" (ssformat), using a + # `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more + # details. + # @!attribute [rw] limit_key + # @return [::String] + # If this request targets a key range, this is the exclusive end of the + # range. See `key` for more details. + # @!attribute [rw] group_uid + # @return [::Integer] + # The group UID of the group that the client believes serves the range + # defined by `key` and `limit_key`. See `Range.group_uid` for more details. + # @!attribute [rw] split_id + # @return [::Integer] + # The split ID of the split that the client believes contains the range + # defined by `key` and `limit_key`. See `Range.split_id` for more details. + # @!attribute [rw] tablet_uid + # @return [::Integer] + # The tablet UID of the tablet from group `group_uid` that the client + # believes is best to serve this request. See `Group.local_tablet_uids` and + # `Group.leader_tablet_uid`. + # @!attribute [rw] skipped_tablet_uid + # @return [::Array<::Google::Cloud::Spanner::V1::RoutingHint::SkippedTablet>] + # If the client had multiple options for tablet selection, and some of its + # first choices were unhealthy (e.g., the server is unreachable, or + # `Tablet.skip` is true), this field will contain the tablet UIDs of those + # tablets, with their incarnations. The server may include a `CacheUpdate` + # with new locations for those tablets. + # @!attribute [rw] client_location + # @return [::String] + # If present, the client's current location. This should be the name of a + # Google Cloud zone or region, such as "us-central1". + # + # If absent, the client's location will be assumed to be the same as the + # location of the server the client ends up connected to. + # + # Locations are primarily valuable for clients that connect from regions + # other than the ones that contain the Spanner database. + class RoutingHint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A tablet that was skipped by the client. See `Tablet.tablet_uid` and + # `Tablet.incarnation`. + # @!attribute [rw] tablet_uid + # @return [::Integer] + # The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`. + # @!attribute [rw] incarnation + # @return [::String] + # The incarnation of the tablet that was skipped. See `Tablet.incarnation`. + class SkippedTablet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb new file mode 100644 index 000000000000..5c0d3caa5bb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # A modification to one or more Cloud Spanner rows. Mutations can be + # applied to a Cloud Spanner database by sending them in a + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} call. + # @!attribute [rw] insert + # @return [::Google::Cloud::Spanner::V1::Mutation::Write] + # Insert new rows in a table. If any of the rows already exist, + # the write or transaction fails with error `ALREADY_EXISTS`. + # + # Note: The following fields are mutually exclusive: `insert`, `update`, `insert_or_update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update + # @return [::Google::Cloud::Spanner::V1::Mutation::Write] + # Update existing rows in a table. If any of the rows does not + # already exist, the transaction fails with error `NOT_FOUND`. + # + # Note: The following fields are mutually exclusive: `update`, `insert`, `insert_or_update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] insert_or_update + # @return [::Google::Cloud::Spanner::V1::Mutation::Write] + # Like {::Google::Cloud::Spanner::V1::Mutation#insert insert}, except that if the row + # already exists, then its column values are overwritten with the ones + # provided. Any column values not explicitly written are preserved. + # + # When using + # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, just as + # when using {::Google::Cloud::Spanner::V1::Mutation#insert insert}, all `NOT NULL` + # columns in the table must be given a value. This holds true even when the + # row already exists and will therefore actually be updated. + # + # Note: The following fields are mutually exclusive: `insert_or_update`, `insert`, `update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] replace + # @return [::Google::Cloud::Spanner::V1::Mutation::Write] + # Like {::Google::Cloud::Spanner::V1::Mutation#insert insert}, except that if the row + # already exists, it is deleted, and the column values provided are + # inserted instead. Unlike + # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, this + # means any values not explicitly written become `NULL`. + # + # In an interleaved table, if you create the child table with the + # `ON DELETE CASCADE` annotation, then replacing a parent row + # also deletes the child rows. Otherwise, you must delete the + # child rows before you replace the parent row. + # + # Note: The following fields are mutually exclusive: `replace`, `insert`, `update`, `insert_or_update`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete + # @return [::Google::Cloud::Spanner::V1::Mutation::Delete] + # Delete rows from a table. Succeeds whether or not the named + # rows were present. + # + # Note: The following fields are mutually exclusive: `delete`, `insert`, `update`, `insert_or_update`, `replace`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] send + # @return [::Google::Cloud::Spanner::V1::Mutation::Send] + # Send a message to a queue. + # + # Note: The following fields are mutually exclusive: `send`, `insert`, `update`, `insert_or_update`, `replace`, `delete`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ack + # @return [::Google::Cloud::Spanner::V1::Mutation::Ack] + # Ack a message from a queue. + # + # Note: The following fields are mutually exclusive: `ack`, `insert`, `update`, `insert_or_update`, `replace`, `delete`, `send`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Mutation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Arguments to {::Google::Cloud::Spanner::V1::Mutation#insert insert}, + # {::Google::Cloud::Spanner::V1::Mutation#update update}, + # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, and + # {::Google::Cloud::Spanner::V1::Mutation#replace replace} operations. + # @!attribute [rw] table + # @return [::String] + # Required. The table whose rows will be written. + # @!attribute [rw] columns + # @return [::Array<::String>] + # The names of the columns in + # {::Google::Cloud::Spanner::V1::Mutation::Write#table table} to be written. + # + # The list of columns must contain enough columns to allow + # Cloud Spanner to derive values for all primary key columns in the + # row(s) to be modified. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::ListValue>] + # The values to be written. `values` can contain more than one + # list of values. If it does, then multiple rows are written, one + # for each entry in `values`. Each list in `values` must have + # exactly as many entries as there are entries in + # {::Google::Cloud::Spanner::V1::Mutation::Write#columns columns} above. Sending + # multiple lists is equivalent to sending multiple `Mutation`s, each + # containing one `values` entry and repeating + # {::Google::Cloud::Spanner::V1::Mutation::Write#table table} and + # {::Google::Cloud::Spanner::V1::Mutation::Write#columns columns}. Individual values in + # each list are encoded as described {::Google::Cloud::Spanner::V1::TypeCode here}. + class Write + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Arguments to {::Google::Cloud::Spanner::V1::Mutation#delete delete} operations. + # @!attribute [rw] table + # @return [::String] + # Required. The table whose rows will be deleted. + # @!attribute [rw] key_set + # @return [::Google::Cloud::Spanner::V1::KeySet] + # Required. The primary keys of the rows within + # {::Google::Cloud::Spanner::V1::Mutation::Delete#table table} to delete. The primary + # keys must be specified in the order in which they appear in the `PRIMARY + # KEY()` clause of the table's equivalent DDL statement (the DDL statement + # used to create the table). Delete is idempotent. The transaction will + # succeed even if some or all rows do not exist. + class Delete + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Arguments to {::Google::Cloud::Spanner::V1::Mutation#send send} operations. + # @!attribute [rw] queue + # @return [::String] + # Required. The queue to which the message will be sent. + # @!attribute [rw] key + # @return [::Google::Protobuf::ListValue] + # Required. The primary key of the message to be sent. + # @!attribute [rw] deliver_time + # @return [::Google::Protobuf::Timestamp] + # The time at which Spanner will begin attempting to deliver the message. + # If `deliver_time` is not set, Spanner will deliver the message + # immediately. If `deliver_time` is in the past, Spanner will replace it + # with a value closer to the current time. + # @!attribute [rw] payload + # @return [::Google::Protobuf::Value] + # The payload of the message. + class Send + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Arguments to {::Google::Cloud::Spanner::V1::Mutation#ack ack} operations. + # @!attribute [rw] queue + # @return [::String] + # Required. The queue where the message to be acked is stored. + # @!attribute [rw] key + # @return [::Google::Protobuf::ListValue] + # Required. The primary key of the message to be acked. + # @!attribute [rw] ignore_not_found + # @return [::Boolean] + # By default, an attempt to ack a message that does not exist will fail + # with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack + # will succeed even if the message does not exist. This is useful for + # unconditionally acking a message, even if it is missing or has already + # been acked. + class Ack + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb new file mode 100644 index 000000000000..a213c6fbe1d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # Node information for nodes appearing in a + # {::Google::Cloud::Spanner::V1::QueryPlan#plan_nodes QueryPlan.plan_nodes}. + # @!attribute [rw] index + # @return [::Integer] + # The `PlanNode`'s index in [node + # list][google.spanner.v1.QueryPlan.plan_nodes]. + # @!attribute [rw] kind + # @return [::Google::Cloud::Spanner::V1::PlanNode::Kind] + # Used to determine the type of node. May be needed for visualizing + # different kinds of nodes differently. For example, If the node is a + # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} node, it will have a + # condensed representation which can be used to directly embed a description + # of the node in its parent. + # @!attribute [rw] display_name + # @return [::String] + # The display name for the node. + # @!attribute [rw] child_links + # @return [::Array<::Google::Cloud::Spanner::V1::PlanNode::ChildLink>] + # List of child node `index`es and their relationship to this parent. + # @!attribute [rw] short_representation + # @return [::Google::Cloud::Spanner::V1::PlanNode::ShortRepresentation] + # Condensed representation for + # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} nodes. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Attributes relevant to the node contained in a group of key-value pairs. + # For example, a Parameter Reference node could have the following + # information in its metadata: + # + # { + # "parameter_reference": "param1", + # "parameter_type": "array" + # } + # @!attribute [rw] execution_stats + # @return [::Google::Protobuf::Struct] + # The execution statistics associated with the node, contained in a group of + # key-value pairs. Only present if the plan was returned as a result of a + # profile query. For example, number of executions, number of rows/time per + # execution etc. + class PlanNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata associated with a parent-child relationship appearing in a + # {::Google::Cloud::Spanner::V1::PlanNode PlanNode}. + # @!attribute [rw] child_index + # @return [::Integer] + # The node to which the link points. + # @!attribute [rw] type + # @return [::String] + # The type of the link. For example, in Hash Joins this could be used to + # distinguish between the build child and the probe child, or in the case + # of the child being an output variable, to represent the tag associated + # with the output variable. + # @!attribute [rw] variable + # @return [::String] + # Only present if the child node is + # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} and corresponds to an + # output variable of the parent node. The field carries the name of the + # output variable. For example, a `TableScan` operator that reads rows from + # a table will have child links to the `SCALAR` nodes representing the + # output variables created for each column that is read by the operator. + # The corresponding `variable` fields will be set to the variable names + # assigned to the columns. + class ChildLink + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Condensed representation of a node and its subtree. Only present for + # `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode]. + # @!attribute [rw] description + # @return [::String] + # A string representation of the expression subtree rooted at this node. + # @!attribute [rw] subqueries + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # A mapping of (subquery variable name) -> (subquery node id) for cases + # where the `description` string of this node references a `SCALAR` + # subquery contained in the expression subtree rooted at this node. The + # referenced `SCALAR` subquery may not necessarily be a direct child of + # this node. + class ShortRepresentation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class SubqueriesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The kind of {::Google::Cloud::Spanner::V1::PlanNode PlanNode}. Distinguishes between + # the two different kinds of nodes that can appear in a query plan. + module Kind + # Not specified. + KIND_UNSPECIFIED = 0 + + # Denotes a Relational operator node in the expression tree. Relational + # operators represent iterative processing of rows during query execution. + # For example, a `TableScan` operation that reads rows from a table. + RELATIONAL = 1 + + # Denotes a Scalar node in the expression tree. Scalar nodes represent + # non-iterable entities in the query plan. For example, constants or + # arithmetic operators appearing inside predicate expressions or references + # to column names. + SCALAR = 2 + end + end + + # Output of query advisor analysis. + # @!attribute [rw] index_advice + # @return [::Array<::Google::Cloud::Spanner::V1::QueryAdvisorResult::IndexAdvice>] + # Optional. Index Recommendation for a query. This is an optional field and + # the recommendation will only be available when the recommendation + # guarantees significant improvement in query performance. + class QueryAdvisorResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Recommendation to add new indexes to run queries more efficiently. + # @!attribute [rw] ddl + # @return [::Array<::String>] + # Optional. DDL statements to add new indexes that will improve the query. + # @!attribute [rw] improvement_factor + # @return [::Float] + # Optional. Estimated latency improvement factor. For example if the query + # currently takes 500 ms to run and the estimated latency with new indexes + # is 100 ms this field will be 5. + class IndexAdvice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Contains an ordered list of nodes appearing in the query plan. + # @!attribute [rw] plan_nodes + # @return [::Array<::Google::Cloud::Spanner::V1::PlanNode>] + # The nodes in the query plan. Plan nodes are returned in pre-order starting + # with the plan root. Each {::Google::Cloud::Spanner::V1::PlanNode PlanNode}'s `id` + # corresponds to its index in `plan_nodes`. + # @!attribute [rw] query_advice + # @return [::Google::Cloud::Spanner::V1::QueryAdvisorResult] + # Optional. The advise/recommendations for a query. Currently this field will + # be serving index recommendations for a query. + class QueryPlan + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb new file mode 100644 index 000000000000..965cab4685b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.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! + + +module Google + module Cloud + module Spanner + module V1 + # Results from {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Spanner::V1::ResultSetMetadata] + # Metadata about the result set, such as row type information. + # @!attribute [rw] rows + # @return [::Array<::Google::Protobuf::ListValue>] + # Each element in `rows` is a row whose format is defined by + # {::Google::Cloud::Spanner::V1::ResultSetMetadata#row_type metadata.row_type}. The ith + # element in each row matches the ith field in + # {::Google::Cloud::Spanner::V1::ResultSetMetadata#row_type metadata.row_type}. Elements + # are encoded based on type as described {::Google::Cloud::Spanner::V1::TypeCode here}. + # @!attribute [rw] stats + # @return [::Google::Cloud::Spanner::V1::ResultSetStats] + # Query plan and execution statistics for the SQL statement that + # produced this result set. These can be requested by setting + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. + # DML statements always produce stats containing the number of rows + # modified, unless executed using the + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::PLAN ExecuteSqlRequest.QueryMode.PLAN} + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. + # Other fields might or might not be populated, based on the + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # Optional. A precommit token is included if the read-write transaction is on + # a multiplexed session. Pass the precommit token with the highest sequence + # number from this transaction attempt to the + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. + # @!attribute [rw] cache_update + # @return [::Google::Cloud::Spanner::V1::CacheUpdate] + # Optional. A cache update expresses a set of changes the client should + # incorporate into its location cache. The client should discard the changes + # if they are older than the data it already has. This data can be obtained + # in response to requests that included a `RoutingHint` field, but may also + # be obtained by explicit location-fetching RPCs which may be added in the + # future. + class ResultSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Partial results from a streaming read or SQL query. Streaming reads and + # SQL queries better tolerate large result sets, large rows, and large + # values, but are a little trickier to consume. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Spanner::V1::ResultSetMetadata] + # Metadata about the result set, such as row type information. + # Only present in the first response. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # A streamed result set consists of a stream of values, which might + # be split into many `PartialResultSet` messages to accommodate + # large rows and/or large values. Every N complete values defines a + # row, where N is equal to the number of entries in + # {::Google::Cloud::Spanner::V1::StructType#fields metadata.row_type.fields}. + # + # Most values are encoded based on type as described + # {::Google::Cloud::Spanner::V1::TypeCode here}. + # + # It's possible that the last value in values is "chunked", + # meaning that the rest of the value is sent in subsequent + # `PartialResultSet`(s). This is denoted by the + # {::Google::Cloud::Spanner::V1::PartialResultSet#chunked_value chunked_value} field. + # Two or more chunked values can be merged to form a complete value as + # follows: + # + # * `bool/number/null`: can't be chunked + # * `string`: concatenate the strings + # * `list`: concatenate the lists. If the last element in a list is a + # `string`, `list`, or `object`, merge it with the first element in + # the next list by applying these rules recursively. + # * `object`: concatenate the (field name, field value) pairs. If a + # field name is duplicated, then apply these rules recursively + # to merge the field values. + # + # Some examples of merging: + # + # Strings are concatenated. + # "foo", "bar" => "foobar" + # + # Lists of non-strings are concatenated. + # [2, 3], [4] => [2, 3, 4] + # + # Lists are concatenated, but the last and first elements are merged + # because they are strings. + # ["a", "b"], ["c", "d"] => ["a", "bc", "d"] + # + # Lists are concatenated, but the last and first elements are merged + # because they are lists. Recursively, the last and first elements + # of the inner lists are merged because they are strings. + # ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] + # + # Non-overlapping object fields are combined. + # {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} + # + # Overlapping object fields are merged. + # {"a": "1"}, {"a": "2"} => {"a": "12"} + # + # Examples of merging objects containing lists of strings. + # {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} + # + # For a more complete example, suppose a streaming SQL query is + # yielding a result set whose rows contain a single string + # field. The following `PartialResultSet`s might be yielded: + # + # { + # "metadata": { ... } + # "values": ["Hello", "W"] + # "chunked_value": true + # "resume_token": "Af65..." + # } + # { + # "values": ["orl"] + # "chunked_value": true + # } + # { + # "values": ["d"] + # "resume_token": "Zx1B..." + # } + # + # This sequence of `PartialResultSet`s encodes two rows, one + # containing the field value `"Hello"`, and a second containing the + # field value `"World" = "W" + "orl" + "d"`. + # + # Not all `PartialResultSet`s contain a `resume_token`. Execution can only be + # resumed from a previously yielded `resume_token`. For the above sequence of + # `PartialResultSet`s, resuming the query with `"resume_token": "Af65..."` + # yields results from the `PartialResultSet` with value "orl". + # @!attribute [rw] chunked_value + # @return [::Boolean] + # If true, then the final value in + # {::Google::Cloud::Spanner::V1::PartialResultSet#values values} is chunked, and must be + # combined with more values from subsequent `PartialResultSet`s to obtain a + # complete field value. + # @!attribute [rw] resume_token + # @return [::String] + # Streaming calls might be interrupted for a variety of reasons, such + # as TCP connection loss. If this occurs, the stream of results can + # be resumed by re-sending the original request and including + # `resume_token`. Note that executing any other transaction in the + # same session invalidates the token. + # @!attribute [rw] stats + # @return [::Google::Cloud::Spanner::V1::ResultSetStats] + # Query plan and execution statistics for the statement that produced this + # streaming result set. These can be requested by setting + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode} + # and are sent only once with the last response in the stream. This field is + # also present in the last response for DML statements. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # Optional. A precommit token is included if the read-write transaction + # has multiplexed sessions enabled. Pass the precommit token with the highest + # sequence number from this transaction attempt to the + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. + # @!attribute [rw] last + # @return [::Boolean] + # Optional. Indicates whether this is the last `PartialResultSet` in the + # stream. The server might optionally set this field. Clients shouldn't rely + # on this field being set in all cases. + # @!attribute [rw] cache_update + # @return [::Google::Cloud::Spanner::V1::CacheUpdate] + # Optional. A cache update expresses a set of changes the client should + # incorporate into its location cache. The client should discard the changes + # if they are older than the data it already has. This data can be obtained + # in response to requests that included a `RoutingHint` field, but may also + # be obtained by explicit location-fetching RPCs which may be added in the + # future. + class PartialResultSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about a {::Google::Cloud::Spanner::V1::ResultSet ResultSet} or + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet}. + # @!attribute [rw] row_type + # @return [::Google::Cloud::Spanner::V1::StructType] + # Indicates the field names and types for the rows in the result + # set. For example, a SQL query like `"SELECT UserId, UserName FROM + # Users"` could return a `row_type` value like: + # + # "fields": [ + # { "name": "UserId", "type": { "code": "INT64" } }, + # { "name": "UserName", "type": { "code": "STRING" } }, + # ] + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::Transaction] + # If the read or SQL query began a transaction as a side-effect, the + # information about the new transaction is yielded here. + # @!attribute [rw] undeclared_parameters + # @return [::Google::Cloud::Spanner::V1::StructType] + # A SQL query can be parameterized. In PLAN mode, these parameters can be + # undeclared. This indicates the field names and types for those undeclared + # parameters in the SQL query. For example, a SQL query like `"SELECT * FROM + # Users where UserId = @userId and UserName = @userName "` could return a + # `undeclared_parameters` value like: + # + # "fields": [ + # { "name": "UserId", "type": { "code": "INT64" } }, + # { "name": "UserName", "type": { "code": "STRING" } }, + # ] + class ResultSetMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional statistics about a {::Google::Cloud::Spanner::V1::ResultSet ResultSet} or + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet}. + # @!attribute [rw] query_plan + # @return [::Google::Cloud::Spanner::V1::QueryPlan] + # {::Google::Cloud::Spanner::V1::QueryPlan QueryPlan} for the query associated with this + # result. + # @!attribute [rw] query_stats + # @return [::Google::Protobuf::Struct] + # Aggregated statistics from the execution of the query. Only present when + # the query is profiled. For example, a query could return the statistics as + # follows: + # + # { + # "rows_returned": "3", + # "elapsed_time": "1.22 secs", + # "cpu_time": "1.19 secs" + # } + # @!attribute [rw] row_count_exact + # @return [::Integer] + # Standard DML returns an exact count of rows that were modified. + # + # Note: The following fields are mutually exclusive: `row_count_exact`, `row_count_lower_bound`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] row_count_lower_bound + # @return [::Integer] + # Partitioned DML doesn't offer exactly-once semantics, so it + # returns a lower bound of the rows modified. + # + # Note: The following fields are mutually exclusive: `row_count_lower_bound`, `row_count_exact`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ResultSetStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb new file mode 100644 index 000000000000..68f02ed42f40 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb @@ -0,0 +1,1203 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#create_session CreateSession}. + # @!attribute [rw] database + # @return [::String] + # Required. The database in which the new session is created. + # @!attribute [rw] session + # @return [::Google::Cloud::Spanner::V1::Session] + # Required. The session to create. + class CreateSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions}. + # @!attribute [rw] database + # @return [::String] + # Required. The database in which the new sessions are created. + # @!attribute [rw] session_template + # @return [::Google::Cloud::Spanner::V1::Session] + # Parameters to apply to each created session. + # @!attribute [rw] session_count + # @return [::Integer] + # Required. The number of sessions to be created in this batch call. At least + # one session is created. The API can return fewer than the requested number + # of sessions. If a specific number of sessions are desired, the client can + # make additional calls to `BatchCreateSessions` (adjusting + # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} + # as necessary). + class BatchCreateSessionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions}. + # @!attribute [rw] session + # @return [::Array<::Google::Cloud::Spanner::V1::Session>] + # The freshly created sessions. + class BatchCreateSessionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A session in the Cloud Spanner API. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the session. This is always system-assigned. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels for the session. + # + # * Label keys must be between 1 and 63 characters long and must conform to + # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + # * Label values must be between 0 and 63 characters long and must conform + # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + # * No more than 64 labels can be associated with a given session. + # + # See https://goo.gl/xmQnxf for more information on and examples of labels. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the session is created. + # @!attribute [r] approximate_last_use_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The approximate timestamp when the session is last used. It's + # typically earlier than the actual last use time. + # @!attribute [rw] creator_role + # @return [::String] + # The database role which created this session. + # @!attribute [rw] multiplexed + # @return [::Boolean] + # Optional. If `true`, specifies a multiplexed session. Use a multiplexed + # session for multiple, concurrent operations including any combination of + # read-only and read-write transactions. Use + # {::Google::Cloud::Spanner::V1::Spanner::Client#create_session `sessions.create`} to create + # multiplexed sessions. Don't use + # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions} to + # create a multiplexed session. You can't delete or list multiplexed + # sessions. + class Session + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#get_session GetSession}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session to retrieve. + class GetSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions}. + # @!attribute [rw] database + # @return [::String] + # Required. The database in which to list sessions. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of sessions to be returned in the response. If 0 or less, defaults + # to the server's maximum allowed page size. + # @!attribute [rw] page_token + # @return [::String] + # If non-empty, `page_token` should contain a + # {::Google::Cloud::Spanner::V1::ListSessionsResponse#next_page_token next_page_token} + # from a previous + # {::Google::Cloud::Spanner::V1::ListSessionsResponse ListSessionsResponse}. + # @!attribute [rw] filter + # @return [::String] + # An expression for filtering the results of the request. Filter rules are + # case insensitive. The fields eligible for filtering are: + # + # * `labels.key` where key is the name of a label + # + # Some examples of using filters are: + # + # * `labels.env:*` --> The session has the label "env". + # * `labels.env:dev` --> The session has the label "env" and the value of + # the label contains the string "dev". + class ListSessionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions}. + # @!attribute [rw] sessions + # @return [::Array<::Google::Cloud::Spanner::V1::Session>] + # The list of requested sessions. + # @!attribute [rw] next_page_token + # @return [::String] + # `next_page_token` can be sent in a subsequent + # {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions} call to fetch more + # of the matching sessions. + class ListSessionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#delete_session DeleteSession}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session to delete. + class DeleteSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Common request options for various APIs. + # @!attribute [rw] priority + # @return [::Google::Cloud::Spanner::V1::RequestOptions::Priority] + # Priority for the request. + # @!attribute [rw] request_tag + # @return [::String] + # A per-request tag which can be applied to queries or reads, used for + # statistics collection. + # Both `request_tag` and `transaction_tag` can be specified for a read or + # query that belongs to a transaction. + # This field is ignored for requests where it's not applicable (for example, + # `CommitRequest`). + # Legal characters for `request_tag` values are all printable characters + # (ASCII 32 - 126) and the length of a request_tag is limited to 50 + # characters. Values that exceed this limit are truncated. + # Any leading underscore (_) characters are removed from the string. + # @!attribute [rw] transaction_tag + # @return [::String] + # A tag used for statistics collection about this transaction. + # Both `request_tag` and `transaction_tag` can be specified for a read or + # query that belongs to a transaction. + # To enable tagging on a transaction, `transaction_tag` must be set to the + # same value for all requests belonging to the same transaction, including + # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. + # If this request doesn't belong to any transaction, `transaction_tag` is + # ignored. + # Legal characters for `transaction_tag` values are all printable characters + # (ASCII 32 - 126) and the length of a `transaction_tag` is limited to 50 + # characters. Values that exceed this limit are truncated. + # Any leading underscore (_) characters are removed from the string. + # @!attribute [rw] client_context + # @return [::Google::Cloud::Spanner::V1::RequestOptions::ClientContext] + # Optional. Optional context that may be needed for some requests. + class RequestOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Container for various pieces of client-owned context attached to a request. + # @!attribute [rw] secure_context + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Optional. Map of parameter name to value for this request. These values + # will be returned by any SECURE_CONTEXT() calls invoked by this request + # (e.g., by queries against Parameterized Secure Views). + class ClientContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class SecureContextEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The relative priority for requests. Note that priority isn't applicable + # for {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. + # + # The priority acts as a hint to the Cloud Spanner scheduler and doesn't + # guarantee priority or order of execution. For example: + # + # * Some parts of a write operation always execute at `PRIORITY_HIGH`, + # regardless of the specified priority. This can cause you to see an + # increase in high priority workload even when executing a low priority + # request. This can also potentially cause a priority inversion where a + # lower priority request is fulfilled ahead of a higher priority + # request. + # * If a transaction contains multiple operations with different priorities, + # Cloud Spanner doesn't guarantee to process the higher priority + # operations first. There might be other constraints to satisfy, such as + # the order of operations. + module Priority + # `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`. + PRIORITY_UNSPECIFIED = 0 + + # This specifies that the request is low priority. + PRIORITY_LOW = 1 + + # This specifies that the request is medium priority. + PRIORITY_MEDIUM = 2 + + # This specifies that the request is high priority. + PRIORITY_HIGH = 3 + end + end + + # The `DirectedReadOptions` can be used to indicate which replicas or regions + # should be used for non-transactional reads or queries. + # + # `DirectedReadOptions` can only be specified for a read-only transaction, + # otherwise the API returns an `INVALID_ARGUMENT` error. + # @!attribute [rw] include_replicas + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::IncludeReplicas] + # `Include_replicas` indicates the order of replicas (as they appear in + # this list) to process the request. If `auto_failover_disabled` is set to + # `true` and all replicas are exhausted without finding a healthy replica, + # Spanner waits for a replica in the list to become available, requests + # might fail due to `DEADLINE_EXCEEDED` errors. + # + # Note: The following fields are mutually exclusive: `include_replicas`, `exclude_replicas`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclude_replicas + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::ExcludeReplicas] + # `Exclude_replicas` indicates that specified replicas should be excluded + # from serving requests. Spanner doesn't route requests to the replicas + # in this list. + # + # Note: The following fields are mutually exclusive: `exclude_replicas`, `include_replicas`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class DirectedReadOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The directed read replica selector. + # Callers must provide one or more of the following fields for replica + # selection: + # + # * `location` - The location must be one of the regions within the + # multi-region configuration of your database. + # * `type` - The type of the replica. + # + # Some examples of using replica_selectors are: + # + # * `location:us-east1` --> The "us-east1" replica(s) of any available type + # is used to process the request. + # * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in the nearest + # available location are used to process the + # request. + # * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) + # in location "us-east1" is used to process + # the request. + # @!attribute [rw] location + # @return [::String] + # The location or region of the serving requests, for example, "us-east1". + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection::Type] + # The type of replica. + class ReplicaSelection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the type of replica. + module Type + # Not specified. + TYPE_UNSPECIFIED = 0 + + # Read-write replicas support both reads and writes. + READ_WRITE = 1 + + # Read-only replicas only support reads (not writes). + READ_ONLY = 2 + end + end + + # An `IncludeReplicas` contains a repeated set of `ReplicaSelection` which + # indicates the order in which replicas should be considered. + # @!attribute [rw] replica_selections + # @return [::Array<::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection>] + # The directed read replica selector. + # @!attribute [rw] auto_failover_disabled + # @return [::Boolean] + # If `true`, Spanner doesn't route requests to a replica outside the + # <`include_replicas` list when all of the specified replicas are + # unavailable or unhealthy. Default value is `false`. + class IncludeReplicas + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An ExcludeReplicas contains a repeated set of ReplicaSelection that should + # be excluded from serving requests. + # @!attribute [rw] replica_selections + # @return [::Array<::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection>] + # The directed read replica selector. + class ExcludeReplicas + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the SQL query should be performed. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # The transaction to use. + # + # For queries, if none is provided, the default is a temporary read-only + # transaction with strong concurrency. + # + # Standard DML statements require a read-write transaction. To protect + # against replays, single-use transactions are not supported. The caller + # must either supply an existing transaction ID or begin a new transaction. + # + # Partitioned DML requires an existing Partitioned DML transaction ID. + # @!attribute [rw] sql + # @return [::String] + # Required. The SQL string. + # @!attribute [rw] params + # @return [::Google::Protobuf::Struct] + # Parameter names and values that bind to placeholders in the SQL string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names must conform + # to the naming requirements of identifiers as specified at + # https://cloud.google.com/spanner/docs/lexical#identifiers. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @!attribute [rw] param_types + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] + # It isn't always possible for Cloud Spanner to infer the right SQL type + # from a JSON value. For example, values of type `BYTES` and values + # of type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. + # + # In these cases, you can use `param_types` to specify the exact + # SQL type for some or all of the SQL statement parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @!attribute [rw] resume_token + # @return [::String] + # If this request is resuming a previously interrupted SQL statement + # execution, `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new SQL statement execution to resume + # where the last one left off. The rest of the request parameters must + # exactly match the request that yielded this token. + # @!attribute [rw] query_mode + # @return [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] + # Used to control the amount of debugging information returned in + # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is + # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only + # be set to + # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. + # @!attribute [rw] partition_token + # @return [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionQuery`. There must be an exact + # match for the values of fields common to this message and the + # `PartitionQueryRequest` message used to create this `partition_token`. + # @!attribute [rw] seqno + # @return [::Integer] + # A per-transaction sequence number used to identify this request. This field + # makes each request idempotent such that if the request is received multiple + # times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction can be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # + # Required for DML statements. Ignored for queries. + # @!attribute [rw] query_options + # @return [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions] + # Query optimizer configuration to use for the given query. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] directed_read_options + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions] + # Directed read options for this request. + # @!attribute [rw] data_boost_enabled + # @return [::Boolean] + # If this is for a partitioned query and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @!attribute [rw] last_statement + # @return [::Boolean] + # Optional. If set to `true`, this statement marks the end of the + # transaction. After this statement executes, you must commit or abort the + # transaction. Attempts to execute any other requests against this + # transaction (including reads and queries) are rejected. + # + # For DML statements, setting this option might cause some error reporting to + # be deferred until commit time (for example, validation of unique + # constraints). Given this, successful execution of a DML statement shouldn't + # be assumed until a subsequent `Commit` call completes successfully. + # @!attribute [rw] routing_hint + # @return [::Google::Cloud::Spanner::V1::RoutingHint] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + class ExecuteSqlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Query optimizer configuration. + # @!attribute [rw] optimizer_version + # @return [::String] + # An option to control the selection of optimizer version. + # + # This parameter allows individual queries to pick different query + # optimizer versions. + # + # Specifying `latest` as a value instructs Cloud Spanner to use the + # latest supported query optimizer version. If not specified, Cloud Spanner + # uses the optimizer version set at the database level options. Any other + # positive integer (from the list of supported optimizer versions) + # overrides the default optimizer version for query execution. + # + # The list of supported optimizer versions can be queried from + # `SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS`. + # + # Executing a SQL statement with an invalid optimizer version fails with + # an `INVALID_ARGUMENT` error. + # + # See + # https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer + # for more information on managing the query optimizer. + # + # The `optimizer_version` statement hint has precedence over this setting. + # @!attribute [rw] optimizer_statistics_package + # @return [::String] + # An option to control the selection of optimizer statistics package. + # + # This parameter allows individual queries to use a different query + # optimizer statistics package. + # + # Specifying `latest` as a value instructs Cloud Spanner to use the latest + # generated statistics package. If not specified, Cloud Spanner uses + # the statistics package set at the database level options, or the latest + # package if the database option isn't set. + # + # The statistics package requested by the query has to be exempt from + # garbage collection. This can be achieved with the following DDL + # statement: + # + # ```sql + # ALTER STATISTICS SET OPTIONS (allow_gc=false) + # ``` + # + # The list of available statistics packages can be queried from + # `INFORMATION_SCHEMA.SPANNER_STATISTICS`. + # + # Executing a SQL statement with an invalid optimizer statistics package + # or with a statistics package that allows garbage collection fails with + # an `INVALID_ARGUMENT` error. + class QueryOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Spanner::V1::Type] + class ParamTypesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Mode in which the statement must be processed. + module QueryMode + # The default mode. Only the statement results are returned. + NORMAL = 0 + + # This mode returns only the query plan, without any results or + # execution statistics information. + PLAN = 1 + + # This mode returns the query plan, overall execution statistics, + # operator level execution statistics along with the results. This has a + # performance overhead compared to the other modes. It isn't recommended + # to use this mode for production traffic. + PROFILE = 2 + + # This mode returns the overall (but not operator-level) execution + # statistics along with the results. + WITH_STATS = 3 + + # This mode returns the query plan, overall (but not operator-level) + # execution statistics along with the results. + WITH_PLAN_AND_STATS = 4 + end + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml ExecuteBatchDml}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the DML statements should be performed. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # Required. The transaction to use. Must be a read-write transaction. + # + # To protect against replays, single-use transactions are not supported. The + # caller must either supply an existing transaction ID or begin a new + # transaction. + # @!attribute [rw] statements + # @return [::Array<::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement>] + # Required. The list of statements to execute in this batch. Statements are + # executed serially, such that the effects of statement `i` are visible to + # statement `i+1`. Each statement must be a DML statement. Execution stops at + # the first failed statement; the remaining statements are not executed. + # + # Callers must provide at least one statement. + # @!attribute [rw] seqno + # @return [::Integer] + # Required. A per-transaction sequence number used to identify this request. + # This field makes each request idempotent such that if the request is + # received multiple times, at most one succeeds. + # + # The sequence number must be monotonically increasing within the + # transaction. If a request arrives for the first time with an out-of-order + # sequence number, the transaction might be aborted. Replays of previously + # handled requests yield the same response as the first execution. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] last_statements + # @return [::Boolean] + # Optional. If set to `true`, this request marks the end of the transaction. + # After these statements execute, you must commit or abort the transaction. + # Attempts to execute any other requests against this transaction + # (including reads and queries) are rejected. + # + # Setting this option might cause some error reporting to be deferred until + # commit time (for example, validation of unique constraints). Given this, + # successful execution of statements shouldn't be assumed until a subsequent + # `Commit` call completes successfully. + class ExecuteBatchDmlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single DML statement. + # @!attribute [rw] sql + # @return [::String] + # Required. The DML string. + # @!attribute [rw] params + # @return [::Google::Protobuf::Struct] + # Parameter names and values that bind to placeholders in the DML string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names can contain + # letters, numbers, and underscores. + # + # Parameters can appear anywhere that a literal value is expected. The + # same parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @!attribute [rw] param_types + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] + # It isn't always possible for Cloud Spanner to infer the right SQL type + # from a JSON value. For example, values of type `BYTES` and values + # of type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement#params params} as + # JSON strings. + # + # In these cases, `param_types` can be used to specify the exact + # SQL type for some or all of the SQL statement parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + class Statement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Spanner::V1::Type] + class ParamTypesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # The response for + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml ExecuteBatchDml}. Contains a list + # of {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, one for each DML + # statement that has successfully executed, in the same order as the statements + # in the request. If a statement fails, the status in the response body + # identifies the cause of the failure. + # + # To check for DML statements that failed, use the following approach: + # + # 1. Check the status in the response message. The + # [google.rpc.Code][google.rpc.Code] enum + # value `OK` indicates that all statements were executed successfully. + # 2. If the status was not `OK`, check the number of result sets in the + # response. If the response contains `N` + # {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, then statement `N+1` in + # the request failed. + # + # Example 1: + # + # * Request: 5 DML statements, all executed successfully. + # * Response: 5 {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, with the + # status `OK`. + # + # Example 2: + # + # * Request: 5 DML statements. The third statement has a syntax error. + # * Response: 2 {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, and a syntax + # error (`INVALID_ARGUMENT`) + # status. The number of {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages + # indicates that the third statement failed, and the fourth and fifth + # statements were not executed. + # @!attribute [rw] result_sets + # @return [::Array<::Google::Cloud::Spanner::V1::ResultSet>] + # One {::Google::Cloud::Spanner::V1::ResultSet ResultSet} for each statement in the + # request that ran successfully, in the same order as the statements in the + # request. Each {::Google::Cloud::Spanner::V1::ResultSet ResultSet} does not contain any + # rows. The {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats} in each + # {::Google::Cloud::Spanner::V1::ResultSet ResultSet} contain the number of rows + # modified by the statement. + # + # Only the first {::Google::Cloud::Spanner::V1::ResultSet ResultSet} in the response + # contains valid {::Google::Cloud::Spanner::V1::ResultSetMetadata ResultSetMetadata}. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # If all DML statements are executed successfully, the status is `OK`. + # Otherwise, the error status of the first failed statement. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # Optional. A precommit token is included if the read-write transaction + # is on a multiplexed session. Pass the precommit token with the highest + # sequence number from this transaction attempt should be passed to the + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. + class ExecuteBatchDmlResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options for a `PartitionQueryRequest` and `PartitionReadRequest`. + # @!attribute [rw] partition_size_bytes + # @return [::Integer] + # **Note:** This hint is currently ignored by `PartitionQuery` and + # `PartitionRead` requests. + # + # The desired data size for each partition generated. The default for this + # option is currently 1 GiB. This is only a hint. The actual size of each + # partition can be smaller or larger than this size request. + # @!attribute [rw] max_partitions + # @return [::Integer] + # **Note:** This hint is currently ignored by `PartitionQuery` and + # `PartitionRead` requests. + # + # The desired maximum number of partitions to return. For example, this + # might be set to the number of workers available. The default for this + # option is currently 10,000. The maximum value is currently 200,000. This + # is only a hint. The actual number of partitions returned can be smaller or + # larger than this maximum count request. + class PartitionOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_query PartitionQuery} + # @!attribute [rw] session + # @return [::String] + # Required. The session used to create the partitions. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # Read-only snapshot transactions are supported, read and write and + # single-use transactions are not. + # @!attribute [rw] sql + # @return [::String] + # Required. The query request to generate partitions for. The request fails + # if the query isn't root partitionable. For a query to be root + # partitionable, it needs to satisfy a few conditions. For example, if the + # query execution plan contains a distributed union operator, then it must be + # the first operator in the plan. For more information about other + # conditions, see [Read data in + # parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). + # + # The query request must not contain DML commands, such as `INSERT`, + # `UPDATE`, or `DELETE`. Use + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql `ExecuteStreamingSql`} with + # a `PartitionedDml` transaction for large, partition-friendly DML + # operations. + # @!attribute [rw] params + # @return [::Google::Protobuf::Struct] + # Optional. Parameter names and values that bind to placeholders in the SQL + # string. + # + # A parameter placeholder consists of the `@` character followed by the + # parameter name (for example, `@firstName`). Parameter names can contain + # letters, numbers, and underscores. + # + # Parameters can appear anywhere that a literal value is expected. The same + # parameter name can be used more than once, for example: + # + # `"WHERE id > @msg_id AND id < @msg_id + 100"` + # + # It's an error to execute a SQL statement with unbound parameters. + # @!attribute [rw] param_types + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] + # Optional. It isn't always possible for Cloud Spanner to infer the right SQL + # type from a JSON value. For example, values of type `BYTES` and values of + # type `STRING` both appear in + # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. + # + # In these cases, `param_types` can be used to specify the exact + # SQL type for some or all of the SQL query parameters. See the + # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information + # about SQL types. + # @!attribute [rw] partition_options + # @return [::Google::Cloud::Spanner::V1::PartitionOptions] + # Additional options that affect how many partitions are created. + class PartitionQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Spanner::V1::Type] + class ParamTypesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_read PartitionRead} + # @!attribute [rw] session + # @return [::String] + # Required. The session used to create the partitions. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # Read only snapshot transactions are supported, read/write and single use + # transactions are not. + # @!attribute [rw] table + # @return [::String] + # Required. The name of the table in the database to be read. + # @!attribute [rw] index + # @return [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table}. This index is used + # instead of the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting + # result rows. See {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} + # for further information. + # @!attribute [rw] columns + # @return [::Array<::String>] + # The columns of {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be + # returned for each row matching this request. + # @!attribute [rw] key_set + # @return [::Google::Cloud::Spanner::V1::KeySet] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present. If + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} instead names + # index keys in {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index}. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @!attribute [rw] partition_options + # @return [::Google::Cloud::Spanner::V1::PartitionOptions] + # Additional options that affect how many partitions are created. + class PartitionReadRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information returned for each partition returned in a + # PartitionResponse. + # @!attribute [rw] partition_token + # @return [::String] + # This token can be passed to `Read`, `StreamingRead`, `ExecuteSql`, or + # `ExecuteStreamingSql` requests to restrict the results to those identified + # by this partition token. + class Partition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_query PartitionQuery} + # or {::Google::Cloud::Spanner::V1::Spanner::Client#partition_read PartitionRead} + # @!attribute [rw] partitions + # @return [::Array<::Google::Cloud::Spanner::V1::Partition>] + # Partitions created by this request. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::Transaction] + # Transaction created by this request. + class PartitionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the read should be performed. + # @!attribute [rw] transaction + # @return [::Google::Cloud::Spanner::V1::TransactionSelector] + # The transaction to use. If none is provided, the default is a + # temporary read-only transaction with strong concurrency. + # @!attribute [rw] table + # @return [::String] + # Required. The name of the table in the database to be read. + # @!attribute [rw] index + # @return [::String] + # If non-empty, the name of an index on + # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of + # the table primary key when interpreting + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. + # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further + # information. + # @!attribute [rw] columns + # @return [::Array<::String>] + # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be + # returned for each row matching this request. + # @!attribute [rw] key_set + # @return [::Google::Cloud::Spanner::V1::KeySet] + # Required. `key_set` identifies the rows to be yielded. `key_set` names the + # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to + # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. + # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then + # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys + # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. + # + # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} + # field is empty, rows are yielded in table primary key order (if + # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order + # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the + # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field + # isn't empty, rows are yielded in an unspecified order. + # + # It isn't an error for the `key_set` to name rows that don't + # exist in the database. Read yields nothing for nonexistent rows. + # @!attribute [rw] limit + # @return [::Integer] + # If greater than zero, only the first `limit` rows are yielded. If `limit` + # is zero, the default is no limit. A limit can't be specified if + # `partition_token` is set. + # @!attribute [rw] resume_token + # @return [::String] + # If this request is resuming a previously interrupted read, + # `resume_token` should be copied from the last + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the + # interruption. Doing this enables the new read to resume where the last read + # left off. The rest of the request parameters must exactly match the request + # that yielded this token. + # @!attribute [rw] partition_token + # @return [::String] + # If present, results are restricted to the specified partition + # previously created using `PartitionRead`. There must be an exact + # match for the values of fields common to this message and the + # PartitionReadRequest message used to create this partition_token. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] directed_read_options + # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions] + # Directed read options for this request. + # @!attribute [rw] data_boost_enabled + # @return [::Boolean] + # If this is for a partitioned read and this field is set to `true`, the + # request is executed with Spanner Data Boost independent compute resources. + # + # If the field is set to `true` but the request doesn't set + # `partition_token`, the API returns an `INVALID_ARGUMENT` error. + # @!attribute [rw] order_by + # @return [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] + # Optional. Order for the returned rows. + # + # By default, Spanner returns result rows in primary key order except for + # PartitionRead requests. For applications that don't require rows to be + # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting + # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, + # resulting in lower latencies in certain cases (for example, bulk point + # lookups). + # @!attribute [rw] lock_hint + # @return [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] + # Optional. Lock Hint for the request, it can only be used with read-write + # transactions. + # @!attribute [rw] routing_hint + # @return [::Google::Cloud::Spanner::V1::RoutingHint] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + class ReadRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An option to control the order in which rows are returned from a read. + module OrderBy + # Default value. + # + # `ORDER_BY_UNSPECIFIED` is equivalent to `ORDER_BY_PRIMARY_KEY`. + ORDER_BY_UNSPECIFIED = 0 + + # Read rows are returned in primary key order. + # + # In the event that this option is used in conjunction with the + # `partition_token` field, the API returns an `INVALID_ARGUMENT` error. + ORDER_BY_PRIMARY_KEY = 1 + + # Read rows are returned in any order. + ORDER_BY_NO_ORDER = 2 + end + + # A lock hint mechanism for reads done within a transaction. + module LockHint + # Default value. + # + # `LOCK_HINT_UNSPECIFIED` is equivalent to `LOCK_HINT_SHARED`. + LOCK_HINT_UNSPECIFIED = 0 + + # Acquire shared locks. + # + # By default when you perform a read as part of a read-write transaction, + # Spanner acquires shared read locks, which allows other reads to still + # access the data until your transaction is ready to commit. When your + # transaction is committing and writes are being applied, the transaction + # attempts to upgrade to an exclusive lock for any data you are writing. + # For more information about locks, see [Lock + # modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes). + LOCK_HINT_SHARED = 1 + + # Acquire exclusive locks. + # + # Requesting exclusive locks is beneficial if you observe high write + # contention, which means you notice that multiple transactions are + # concurrently trying to read and write to the same data, resulting in a + # large number of aborts. This problem occurs when two transactions + # initially acquire shared locks and then both try to upgrade to exclusive + # locks at the same time. In this situation both transactions are waiting + # for the other to give up their lock, resulting in a deadlocked situation. + # Spanner is able to detect this occurring and force one of the + # transactions to abort. However, this is a slow and expensive operation + # and results in lower performance. In this case it makes sense to acquire + # exclusive locks at the start of the transaction because then when + # multiple transactions try to act on the same data, they automatically get + # serialized. Each transaction waits its turn to acquire the lock and + # avoids getting into deadlock situations. + # + # Because the exclusive lock hint is just a hint, it shouldn't be + # considered equivalent to a mutex. In other words, you shouldn't use + # Spanner exclusive locks as a mutual exclusion mechanism for the execution + # of code outside of Spanner. + # + # **Note:** Request exclusive locks judiciously because they block others + # from reading that data for the entire transaction, rather than just when + # the writes are being performed. Unless you observe high write contention, + # you should use the default of shared read locks so you don't prematurely + # block other clients from reading the data that you're writing to. + LOCK_HINT_EXCLUSIVE = 2 + end + end + + # The request for + # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the transaction runs. + # @!attribute [rw] options + # @return [::Google::Cloud::Spanner::V1::TransactionOptions] + # Required. Options for the new transaction. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # Priority is ignored for this request. Setting the priority in this + # `request_options` struct doesn't do anything. To set the priority for a + # transaction, set it on the reads and writes that are part of this + # transaction instead. + # @!attribute [rw] mutation_key + # @return [::Google::Cloud::Spanner::V1::Mutation] + # Optional. Required for read-write transactions on a multiplexed session + # that commit mutations but don't perform any reads or queries. You must + # randomly select one of the mutations from the mutation set and send it as a + # part of this request. + # @!attribute [rw] routing_hint + # @return [::Google::Cloud::Spanner::V1::RoutingHint] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + class BeginTransactionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the transaction to be committed is running. + # @!attribute [rw] transaction_id + # @return [::String] + # Commit a previously-started transaction. + # + # Note: The following fields are mutually exclusive: `transaction_id`, `single_use_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] single_use_transaction + # @return [::Google::Cloud::Spanner::V1::TransactionOptions] + # Execute mutations in a temporary transaction. Note that unlike + # commit of a previously-started transaction, commit with a + # temporary transaction is non-idempotent. That is, if the + # `CommitRequest` is sent to Cloud Spanner more than once (for + # instance, due to retries in the application, or in the + # transport library), it's possible that the mutations are + # executed more than once. If this is undesirable, use + # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction} and + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} instead. + # + # Note: The following fields are mutually exclusive: `single_use_transaction`, `transaction_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] mutations + # @return [::Array<::Google::Cloud::Spanner::V1::Mutation>] + # The mutations to be executed when this transaction commits. All + # mutations are applied atomically, in the order they appear in + # this list. + # @!attribute [rw] return_commit_stats + # @return [::Boolean] + # If `true`, then statistics related to the transaction is included in + # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. + # Default value is `false`. + # @!attribute [rw] max_commit_delay + # @return [::Google::Protobuf::Duration] + # Optional. The amount of latency this request is configured to incur in + # order to improve throughput. If this field isn't set, Spanner assumes + # requests are relatively latency sensitive and automatically determines an + # appropriate delay time. You can specify a commit delay value between 0 and + # 500 ms. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # Optional. If the read-write transaction was executed on a multiplexed + # session, then you must include the precommit token with the highest + # sequence number received in this transaction attempt. Failing to do so + # results in a `FailedPrecondition` error. + # @!attribute [rw] routing_hint + # @return [::Google::Cloud::Spanner::V1::RoutingHint] + # Optional. Makes the Spanner requests location-aware if present. + # + # It gives the server hints that can be used to route the request + # to an appropriate server, potentially significantly decreasing latency and + # improving throughput. To achieve improved performance, most fields must be + # filled in with accurate values. + class CommitRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the transaction to roll back is running. + # @!attribute [rw] transaction_id + # @return [::String] + # Required. The transaction to roll back. + class RollbackRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#batch_write BatchWrite}. + # @!attribute [rw] session + # @return [::String] + # Required. The session in which the batch request is to be run. + # @!attribute [rw] request_options + # @return [::Google::Cloud::Spanner::V1::RequestOptions] + # Common options for this request. + # @!attribute [rw] mutation_groups + # @return [::Array<::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup>] + # Required. The groups of mutations to be applied. + # @!attribute [rw] exclude_txn_from_change_streams + # @return [::Boolean] + # Optional. If you don't set the `exclude_txn_from_change_streams` option or + # if it's set to `false`, then any change streams monitoring columns modified + # by transactions will capture the updates made within that transaction. + class BatchWriteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A group of mutations to be committed together. Related mutations should be + # placed in a group. For example, two mutations inserting rows with the same + # primary key prefix in both parent and child tables are related. + # @!attribute [rw] mutations + # @return [::Array<::Google::Cloud::Spanner::V1::Mutation>] + # Required. The mutations in this group. + class MutationGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The result of applying a batch of mutations. + # @!attribute [rw] indexes + # @return [::Array<::Integer>] + # The mutation groups applied in this batch. The values index into the + # `mutation_groups` field in the corresponding `BatchWriteRequest`. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # An `OK` status indicates success. Any other status indicates a failure. + # @!attribute [rw] commit_timestamp + # @return [::Google::Protobuf::Timestamp] + # The commit timestamp of the transaction that applied this batch. + # Present if status is OK and the mutation groups were applied, absent + # otherwise. + # + # For mutation groups with conditions, a status=OK and missing + # commit_timestamp means that the mutation groups were not applied due to the + # condition not being satisfied after evaluation. + class BatchWriteResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb new file mode 100644 index 000000000000..53ec83e49080 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb @@ -0,0 +1,357 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # Options to use for transactions. + # @!attribute [rw] read_write + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite] + # Transaction may write. + # + # Authorization to begin a read-write transaction requires + # `spanner.databases.beginOrRollbackReadWriteTransaction` permission + # on the `session` resource. + # + # Note: The following fields are mutually exclusive: `read_write`, `partitioned_dml`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] partitioned_dml + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::PartitionedDml] + # Partitioned DML transaction. + # + # Authorization to begin a Partitioned DML transaction requires + # `spanner.databases.beginPartitionedDmlTransaction` permission + # on the `session` resource. + # + # Note: The following fields are mutually exclusive: `partitioned_dml`, `read_write`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_only + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly] + # Transaction does not write. + # + # Authorization to begin a read-only transaction requires + # `spanner.databases.beginReadOnlyTransaction` permission + # on the `session` resource. + # + # Note: The following fields are mutually exclusive: `read_only`, `read_write`, `partitioned_dml`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclude_txn_from_change_streams + # @return [::Boolean] + # When `exclude_txn_from_change_streams` is set to `true`, it prevents read + # or write transactions from being tracked in change streams. + # + # * If the DDL option `allow_txn_exclusion` is set to `true`, then the + # updates + # made within this transaction aren't recorded in the change stream. + # + # * If you don't set the DDL option `allow_txn_exclusion` or if it's + # set to `false`, then the updates made within this transaction are + # recorded in the change stream. + # + # When `exclude_txn_from_change_streams` is set to `false` or not set, + # modifications from this transaction are recorded in all change streams + # that are tracking columns modified by these transactions. + # + # The `exclude_txn_from_change_streams` option can only be specified + # for read-write or partitioned DML transactions, otherwise the API returns + # an `INVALID_ARGUMENT` error. + # @!attribute [rw] isolation_level + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] + # Isolation level for the transaction. + class TransactionOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message type to initiate a read-write transaction. Currently this + # transaction type has no options. + # @!attribute [rw] read_lock_mode + # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite::ReadLockMode] + # Read lock mode for the transaction. + # @!attribute [rw] multiplexed_session_previous_transaction_id + # @return [::String] + # Optional. Clients should pass the transaction ID of the previous + # transaction attempt that was aborted if this transaction is being + # executed on a multiplexed session. + class ReadWrite + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # `ReadLockMode` is used to set the read lock mode for read-write + # transactions. + module ReadLockMode + # Default value. + # + # * If isolation level is + # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE}, + # locking semantics default to `PESSIMISTIC`. + # * If isolation level is + # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ}, + # locking semantics default to `OPTIMISTIC`. + # * See + # [Concurrency + # control](https://cloud.google.com/spanner/docs/concurrency-control) + # for more details. + READ_LOCK_MODE_UNSPECIFIED = 0 + + # Pessimistic lock mode. + # + # Lock acquisition behavior depends on the isolation level in use. In + # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} + # isolation, reads and writes acquire necessary locks during transaction + # statement execution. In + # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ} + # isolation, reads that explicitly request to be locked and writes + # acquire locks. + # See + # [Concurrency + # control](https://cloud.google.com/spanner/docs/concurrency-control) for + # details on the types of locks acquired at each transaction step. + PESSIMISTIC = 1 + + # Optimistic lock mode. + # + # Lock acquisition behavior depends on the isolation level in use. In + # both + # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} + # and + # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ} + # isolation, reads and writes do not acquire locks during transaction + # statement execution. + # See + # [Concurrency + # control](https://cloud.google.com/spanner/docs/concurrency-control) for + # details on how the guarantees of each isolation level are provided at + # commit time. + OPTIMISTIC = 2 + end + end + + # Message type to initiate a Partitioned DML transaction. + class PartitionedDml + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message type to initiate a read-only transaction. + # @!attribute [rw] strong + # @return [::Boolean] + # Read at a timestamp where all previously committed transactions + # are visible. + # + # Note: The following fields are mutually exclusive: `strong`, `min_read_timestamp`, `max_staleness`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] min_read_timestamp + # @return [::Google::Protobuf::Timestamp] + # Executes all reads at a timestamp >= `min_read_timestamp`. + # + # This is useful for requesting fresher data than some previous + # read, or data that is fresh enough to observe the effects of some + # previously committed transaction whose timestamp is known. + # + # Note that this option can only be used in single-use transactions. + # + # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + # Example: `"2014-10-02T15:01:23.045123456Z"`. + # + # Note: The following fields are mutually exclusive: `min_read_timestamp`, `strong`, `max_staleness`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] max_staleness + # @return [::Google::Protobuf::Duration] + # Read data at a timestamp >= `NOW - max_staleness` + # seconds. Guarantees that all writes that have committed more + # than the specified number of seconds ago are visible. Because + # Cloud Spanner chooses the exact timestamp, this mode works even if + # the client's local clock is substantially skewed from Cloud Spanner + # commit timestamps. + # + # Useful for reading the freshest data available at a nearby + # replica, while bounding the possible staleness if the local + # replica has fallen behind. + # + # Note that this option can only be used in single-use + # transactions. + # + # Note: The following fields are mutually exclusive: `max_staleness`, `strong`, `min_read_timestamp`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_timestamp + # @return [::Google::Protobuf::Timestamp] + # Executes all reads at the given timestamp. Unlike other modes, + # reads at a specific timestamp are repeatable; the same read at + # the same timestamp always returns the same data. If the + # timestamp is in the future, the read is blocked until the + # specified timestamp, modulo the read's deadline. + # + # Useful for large scale consistent reads such as mapreduces, or + # for coordinating many reads against a consistent snapshot of the + # data. + # + # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + # Example: `"2014-10-02T15:01:23.045123456Z"`. + # + # Note: The following fields are mutually exclusive: `read_timestamp`, `strong`, `min_read_timestamp`, `max_staleness`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exact_staleness + # @return [::Google::Protobuf::Duration] + # Executes all reads at a timestamp that is `exact_staleness` + # old. The timestamp is chosen soon after the read is started. + # + # Guarantees that all writes that have committed more than the + # specified number of seconds ago are visible. Because Cloud Spanner + # chooses the exact timestamp, this mode works even if the client's + # local clock is substantially skewed from Cloud Spanner commit + # timestamps. + # + # Useful for reading at nearby replicas without the distributed + # timestamp negotiation overhead of `max_staleness`. + # + # Note: The following fields are mutually exclusive: `exact_staleness`, `strong`, `min_read_timestamp`, `max_staleness`, `read_timestamp`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] return_read_timestamp + # @return [::Boolean] + # If true, the Cloud Spanner-selected read timestamp is included in + # the {::Google::Cloud::Spanner::V1::Transaction Transaction} message that describes + # the transaction. + class ReadOnly + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `IsolationLevel` is used when setting the [isolation + # level](https://cloud.google.com/spanner/docs/isolation-levels) for a + # transaction. + module IsolationLevel + # Default value. + # + # If the value is not specified, the `SERIALIZABLE` isolation level is + # used. + ISOLATION_LEVEL_UNSPECIFIED = 0 + + # All transactions appear as if they executed in a serial order, even if + # some of the reads, writes, and other operations of distinct transactions + # actually occurred in parallel. Spanner assigns commit timestamps that + # reflect the order of committed transactions to implement this property. + # Spanner offers a stronger guarantee than serializability called external + # consistency. For more information, see + # [TrueTime and external + # consistency](https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability). + SERIALIZABLE = 1 + + # All reads performed during the transaction observe a consistent snapshot + # of the database, and the transaction is only successfully committed in + # the absence of conflicts between its updates and any concurrent updates + # that have occurred since that snapshot. Consequently, in contrast to + # `SERIALIZABLE` transactions, only write-write conflicts are detected in + # snapshot transactions. + # + # This isolation level does not support read-only and partitioned DML + # transactions. + # + # When `REPEATABLE_READ` is specified on a read-write transaction, the + # locking semantics default to `OPTIMISTIC`. + REPEATABLE_READ = 2 + end + end + + # A transaction. + # @!attribute [rw] id + # @return [::String] + # `id` may be used to identify the transaction in subsequent + # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, + # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}, or + # {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} calls. + # + # Single-use read-only transactions do not have IDs, because + # single-use transactions do not support multiple requests. + # @!attribute [rw] read_timestamp + # @return [::Google::Protobuf::Timestamp] + # For snapshot read-only transactions, the read timestamp chosen + # for the transaction. Not returned by default: see + # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#return_read_timestamp TransactionOptions.ReadOnly.return_read_timestamp}. + # + # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + # Example: `"2014-10-02T15:01:23.045123456Z"`. + # @!attribute [rw] precommit_token + # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] + # A precommit token is included in the response of a BeginTransaction + # request if the read-write transaction is on a multiplexed session and + # a mutation_key was specified in the + # {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction}. + # The precommit token with the highest sequence number from this transaction + # attempt should be passed to the {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} + # request for this transaction. + # @!attribute [rw] cache_update + # @return [::Google::Cloud::Spanner::V1::CacheUpdate] + # Optional. A cache update expresses a set of changes the client should + # incorporate into its location cache. The client should discard the changes + # if they are older than the data it already has. This data can be obtained + # in response to requests that included a `RoutingHint` field, but may also + # be obtained by explicit location-fetching RPCs which may be added in the + # future. + class Transaction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message is used to select the transaction in which a + # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or + # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} call runs. + # + # See {::Google::Cloud::Spanner::V1::TransactionOptions TransactionOptions} for more + # information about transactions. + # @!attribute [rw] single_use + # @return [::Google::Cloud::Spanner::V1::TransactionOptions] + # Execute the read or SQL query in a temporary transaction. + # This is the most efficient way to execute a transaction that + # consists of a single SQL query. + # + # Note: The following fields are mutually exclusive: `single_use`, `id`, `begin`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] id + # @return [::String] + # Execute the read or SQL query in a previously-started transaction. + # + # Note: The following fields are mutually exclusive: `id`, `single_use`, `begin`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] begin + # @return [::Google::Cloud::Spanner::V1::TransactionOptions] + # Begin a new transaction and execute this read or SQL query in + # it. The transaction ID of the new transaction is returned in + # {::Google::Cloud::Spanner::V1::ResultSetMetadata#transaction ResultSetMetadata.transaction}, + # which is a {::Google::Cloud::Spanner::V1::Transaction Transaction}. + # + # Note: The following fields are mutually exclusive: `begin`, `single_use`, `id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class TransactionSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # When a read-write transaction is executed on a multiplexed session, + # this precommit token is sent back to the client + # as a part of the {::Google::Cloud::Spanner::V1::Transaction Transaction} message in the + # {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction} response and + # also as a part of the {::Google::Cloud::Spanner::V1::ResultSet ResultSet} and + # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} responses. + # @!attribute [rw] precommit_token + # @return [::String] + # Opaque precommit token. + # @!attribute [rw] seq_num + # @return [::Integer] + # An incrementing seq number is generated on every precommit token + # that is returned. Clients should remember the precommit token with the + # highest sequence number from the current transaction attempt. + class MultiplexedSessionPrecommitToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb new file mode 100644 index 000000000000..693060eddddf --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Spanner + module V1 + # `Type` indicates the type of a Cloud Spanner value, as might be stored in a + # table cell or returned from an SQL query. + # @!attribute [rw] code + # @return [::Google::Cloud::Spanner::V1::TypeCode] + # Required. The {::Google::Cloud::Spanner::V1::TypeCode TypeCode} for this type. + # @!attribute [rw] array_element_type + # @return [::Google::Cloud::Spanner::V1::Type] + # If {::Google::Cloud::Spanner::V1::Type#code code} == + # {::Google::Cloud::Spanner::V1::TypeCode::ARRAY ARRAY}, then `array_element_type` is the + # type of the array elements. + # @!attribute [rw] struct_type + # @return [::Google::Cloud::Spanner::V1::StructType] + # If {::Google::Cloud::Spanner::V1::Type#code code} == + # {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT}, then `struct_type` provides + # type information for the struct's fields. + # @!attribute [rw] type_annotation + # @return [::Google::Cloud::Spanner::V1::TypeAnnotationCode] + # The {::Google::Cloud::Spanner::V1::TypeAnnotationCode TypeAnnotationCode} that + # disambiguates SQL type that Spanner will use to represent values of this + # type during query processing. This is necessary for some type codes because + # a single {::Google::Cloud::Spanner::V1::TypeCode TypeCode} can be mapped to different + # SQL types depending on the SQL dialect. + # {::Google::Cloud::Spanner::V1::Type#type_annotation type_annotation} typically is not + # needed to process the content of a value (it doesn't affect serialization) + # and clients can ignore it on the read path. + # @!attribute [rw] proto_type_fqn + # @return [::String] + # If {::Google::Cloud::Spanner::V1::Type#code code} == + # {::Google::Cloud::Spanner::V1::TypeCode::PROTO PROTO} or + # {::Google::Cloud::Spanner::V1::Type#code code} == + # {::Google::Cloud::Spanner::V1::TypeCode::ENUM ENUM}, then `proto_type_fqn` is the fully + # qualified name of the proto type representing the proto/enum definition. + class Type + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `StructType` defines the fields of a + # {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT} type. + # @!attribute [rw] fields + # @return [::Array<::Google::Cloud::Spanner::V1::StructType::Field>] + # The list of fields that make up this struct. Order is + # significant, because values of this struct type are represented as + # lists, where the order of field values matches the order of + # fields in the {::Google::Cloud::Spanner::V1::StructType StructType}. In turn, the + # order of fields matches the order of columns in a read request, or the + # order of fields in the `SELECT` clause of a query. + class StructType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message representing a single field of a struct. + # @!attribute [rw] name + # @return [::String] + # The name of the field. For reads, this is the column name. For + # SQL queries, it is the column alias (e.g., `"Word"` in the + # query `"SELECT 'hello' AS Word"`), or the column name (e.g., + # `"ColName"` in the query `"SELECT ColName FROM Table"`). Some + # columns might have an empty name (e.g., `"SELECT + # UPPER(ColName)"`). Note that a query result can contain + # multiple fields with the same name. + # @!attribute [rw] type + # @return [::Google::Cloud::Spanner::V1::Type] + # The type of the field. + class Field + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `TypeCode` is used as part of {::Google::Cloud::Spanner::V1::Type Type} to + # indicate the type of a Cloud Spanner value. + # + # Each legal value of a type can be encoded to or decoded from a JSON + # value, using the encodings described below. All Cloud Spanner values can + # be `null`, regardless of type; `null`s are always encoded as a JSON + # `null`. + module TypeCode + # Not specified. + TYPE_CODE_UNSPECIFIED = 0 + + # Encoded as JSON `true` or `false`. + BOOL = 1 + + # Encoded as `string`, in decimal format. + INT64 = 2 + + # Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + # `"-Infinity"`. + FLOAT64 = 3 + + # Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + # `"-Infinity"`. + FLOAT32 = 15 + + # Encoded as `string` in RFC 3339 timestamp format. The time zone + # must be present, and must be `"Z"`. + # + # If the schema has the column option + # `allow_commit_timestamp=true`, the placeholder string + # `"spanner.commit_timestamp()"` can be used to instruct the system + # to insert the commit timestamp associated with the transaction + # commit. + TIMESTAMP = 4 + + # Encoded as `string` in RFC 3339 date format. + DATE = 5 + + # Encoded as `string`. + STRING = 6 + + # Encoded as a base64-encoded `string`, as described in RFC 4648, + # section 4. + BYTES = 7 + + # Encoded as `list`, where the list elements are represented + # according to + # {::Google::Cloud::Spanner::V1::Type#array_element_type array_element_type}. + ARRAY = 8 + + # Encoded as `list`, where list element `i` is represented according + # to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. + STRUCT = 9 + + # Encoded as `string`, in decimal format or scientific notation format. + # Decimal format: + # `[+-]Digits[.[Digits]]` or + # `[+-][Digits].Digits` + # + # Scientific notation: + # `[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or + # `[+-][Digits].Digits[ExponentIndicator[+-]Digits]` + # (ExponentIndicator is `"e"` or `"E"`) + NUMERIC = 10 + + # Encoded as a JSON-formatted `string` as described in RFC 7159. The + # following rules are applied when parsing JSON input: + # + # - Whitespace characters are not preserved. + # - If a JSON object has duplicate keys, only the first key is preserved. + # - Members of a JSON object are not guaranteed to have their order + # preserved. + # - JSON array elements will have their order preserved. + JSON = 11 + + # Encoded as a base64-encoded `string`, as described in RFC 4648, + # section 4. + PROTO = 13 + + # Encoded as `string`, in decimal format. + ENUM = 14 + + # Encoded as `string`, in `ISO8601` duration format - + # `P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S` + # where `n` is an integer. + # For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 + # months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. + INTERVAL = 16 + + # Encoded as `string`, in lower-case hexa-decimal format, as described + # in RFC 9562, section 4. + UUID = 17 + end + + # `TypeAnnotationCode` is used as a part of {::Google::Cloud::Spanner::V1::Type Type} to + # disambiguate SQL types that should be used for a given Cloud Spanner value. + # Disambiguation is needed because the same Cloud Spanner type can be mapped to + # different SQL types depending on SQL dialect. TypeAnnotationCode doesn't + # affect the way value is serialized. + module TypeAnnotationCode + # Not specified. + TYPE_ANNOTATION_CODE_UNSPECIFIED = 0 + + # PostgreSQL compatible NUMERIC type. This annotation needs to be applied to + # {::Google::Cloud::Spanner::V1::Type Type} instances having + # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} type code to specify that + # values of this type should be treated as PostgreSQL NUMERIC values. + # Currently this annotation is always needed for + # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} when a client interacts with + # PostgreSQL-enabled Spanner databases. + PG_NUMERIC = 2 + + # PostgreSQL compatible JSONB type. This annotation needs to be applied to + # {::Google::Cloud::Spanner::V1::Type Type} instances having + # {::Google::Cloud::Spanner::V1::TypeCode::JSON JSON} type code to specify that values of + # this type should be treated as PostgreSQL JSONB values. Currently this + # annotation is always needed for {::Google::Cloud::Spanner::V1::TypeCode::JSON JSON} + # when a client interacts with PostgreSQL-enabled Spanner databases. + PG_JSONB = 3 + + # PostgreSQL compatible OID type. This annotation can be used by a client + # interacting with PostgreSQL-enabled Spanner database to specify that a + # value should be treated using the semantics of the OID type. + PG_OID = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile new file mode 100644 index 000000000000..77b0e1097706 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-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-spanner-v1", path: "../" +else + gem "google-cloud-spanner-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-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json b/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json new file mode 100644 index 000000000000..7aed2197752d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json @@ -0,0 +1,655 @@ +{ + "client_library": { + "name": "google-cloud-spanner-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.spanner.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "spanner_v1_generated_Spanner_CreateSession_sync", + "title": "Snippet for the create_session call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#create_session.", + "file": "spanner/create_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_session", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#create_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::CreateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::Session", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "CreateSession", + "full_name": "google.spanner.v1.Spanner.CreateSession", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_BatchCreateSessions_sync", + "title": "Snippet for the batch_create_sessions call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions.", + "file": "spanner/batch_create_sessions.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_sessions", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "BatchCreateSessions", + "full_name": "google.spanner.v1.Spanner.BatchCreateSessions", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_GetSession_sync", + "title": "Snippet for the get_session call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#get_session.", + "file": "spanner/get_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_session", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#get_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::GetSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::Session", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "GetSession", + "full_name": "google.spanner.v1.Spanner.GetSession", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_ListSessions_sync", + "title": "Snippet for the list_sessions call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#list_sessions.", + "file": "spanner/list_sessions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sessions", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ListSessionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::ListSessionsResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "ListSessions", + "full_name": "google.spanner.v1.Spanner.ListSessions", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_DeleteSession_sync", + "title": "Snippet for the delete_session call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#delete_session.", + "file": "spanner/delete_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_session", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#delete_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::DeleteSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "DeleteSession", + "full_name": "google.spanner.v1.Spanner.DeleteSession", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_ExecuteSql_sync", + "title": "Snippet for the execute_sql call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_sql.", + "file": "spanner/execute_sql.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_sql", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ExecuteSqlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::ResultSet", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "ExecuteSql", + "full_name": "google.spanner.v1.Spanner.ExecuteSql", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_ExecuteStreamingSql_sync", + "title": "Snippet for the execute_streaming_sql call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql.", + "file": "spanner/execute_streaming_sql.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_streaming_sql", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ExecuteSqlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::PartialResultSet", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "ExecuteStreamingSql", + "full_name": "google.spanner.v1.Spanner.ExecuteStreamingSql", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_ExecuteBatchDml_sync", + "title": "Snippet for the execute_batch_dml call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml.", + "file": "spanner/execute_batch_dml.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_batch_dml", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "ExecuteBatchDml", + "full_name": "google.spanner.v1.Spanner.ExecuteBatchDml", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_Read_sync", + "title": "Snippet for the read call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#read.", + "file": "spanner/read.rb", + "language": "RUBY", + "client_method": { + "short_name": "read", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#read", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ReadRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::ResultSet", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "Read", + "full_name": "google.spanner.v1.Spanner.Read", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_StreamingRead_sync", + "title": "Snippet for the streaming_read call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#streaming_read.", + "file": "spanner/streaming_read.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_read", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::ReadRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::PartialResultSet", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "StreamingRead", + "full_name": "google.spanner.v1.Spanner.StreamingRead", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_BeginTransaction_sync", + "title": "Snippet for the begin_transaction call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction.", + "file": "spanner/begin_transaction.rb", + "language": "RUBY", + "client_method": { + "short_name": "begin_transaction", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::BeginTransactionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::Transaction", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "BeginTransaction", + "full_name": "google.spanner.v1.Spanner.BeginTransaction", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_Commit_sync", + "title": "Snippet for the commit call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#commit.", + "file": "spanner/commit.rb", + "language": "RUBY", + "client_method": { + "short_name": "commit", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#commit", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::CommitRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::CommitResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "Commit", + "full_name": "google.spanner.v1.Spanner.Commit", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_Rollback_sync", + "title": "Snippet for the rollback call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#rollback.", + "file": "spanner/rollback.rb", + "language": "RUBY", + "client_method": { + "short_name": "rollback", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#rollback", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::RollbackRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "Rollback", + "full_name": "google.spanner.v1.Spanner.Rollback", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_PartitionQuery_sync", + "title": "Snippet for the partition_query call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#partition_query.", + "file": "spanner/partition_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "partition_query", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#partition_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::PartitionQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::PartitionResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "PartitionQuery", + "full_name": "google.spanner.v1.Spanner.PartitionQuery", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_PartitionRead_sync", + "title": "Snippet for the partition_read call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#partition_read.", + "file": "spanner/partition_read.rb", + "language": "RUBY", + "client_method": { + "short_name": "partition_read", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#partition_read", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::PartitionReadRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::PartitionResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "PartitionRead", + "full_name": "google.spanner.v1.Spanner.PartitionRead", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "spanner_v1_generated_Spanner_BatchWrite_sync", + "title": "Snippet for the batch_write call in the Spanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#batch_write.", + "file": "spanner/batch_write.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_write", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#batch_write", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Spanner::V1::BatchWriteRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Spanner::V1::BatchWriteResponse", + "client": { + "short_name": "Spanner::Client", + "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" + }, + "method": { + "short_name": "BatchWrite", + "full_name": "google.spanner.v1.Spanner.BatchWrite", + "service": { + "short_name": "Spanner", + "full_name": "google.spanner.v1.Spanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb new file mode 100644 index 000000000000..0586ea617219 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_BatchCreateSessions_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the batch_create_sessions call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions. +# +def batch_create_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new + + # Call the batch_create_sessions method. + result = client.batch_create_sessions request + + # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. + p result +end +# [END spanner_v1_generated_Spanner_BatchCreateSessions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb new file mode 100644 index 000000000000..b95914412706 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_BatchWrite_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the batch_write call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#batch_write. +# +def batch_write + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::BatchWriteRequest.new + + # Call the batch_write method to start streaming. + output = client.batch_write request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Spanner::V1::BatchWriteResponse + output.each do |current_response| + p current_response + end +end +# [END spanner_v1_generated_Spanner_BatchWrite_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb new file mode 100644 index 000000000000..491b1932c86d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_BeginTransaction_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the begin_transaction call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction. +# +def begin_transaction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new + + # Call the begin_transaction method. + result = client.begin_transaction request + + # The returned object is of type Google::Cloud::Spanner::V1::Transaction. + p result +end +# [END spanner_v1_generated_Spanner_BeginTransaction_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb new file mode 100644 index 000000000000..bdef590c536b --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_Commit_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the commit call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#commit. +# +def commit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::CommitRequest.new + + # Call the commit method. + result = client.commit request + + # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. + p result +end +# [END spanner_v1_generated_Spanner_Commit_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb new file mode 100644 index 000000000000..2978e20b708d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_CreateSession_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the create_session call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#create_session. +# +def create_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::CreateSessionRequest.new + + # Call the create_session method. + result = client.create_session request + + # The returned object is of type Google::Cloud::Spanner::V1::Session. + p result +end +# [END spanner_v1_generated_Spanner_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb new file mode 100644 index 000000000000..0fe6714eefc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_DeleteSession_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the delete_session call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#delete_session. +# +def delete_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new + + # Call the delete_session method. + result = client.delete_session request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_Spanner_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb new file mode 100644 index 000000000000..0dfff556a81d --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_ExecuteBatchDml_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the execute_batch_dml call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml. +# +def execute_batch_dml + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new + + # Call the execute_batch_dml method. + result = client.execute_batch_dml request + + # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. + p result +end +# [END spanner_v1_generated_Spanner_ExecuteBatchDml_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb new file mode 100644 index 000000000000..25fda1b8ff3f --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_ExecuteSql_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the execute_sql call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#execute_sql. +# +def execute_sql + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + + # Call the execute_sql method. + result = client.execute_sql request + + # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + p result +end +# [END spanner_v1_generated_Spanner_ExecuteSql_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb new file mode 100644 index 000000000000..e96077064cca --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the execute_streaming_sql call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql. +# +def execute_streaming_sql + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + + # Call the execute_streaming_sql method to start streaming. + output = client.execute_streaming_sql request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Spanner::V1::PartialResultSet + output.each do |current_response| + p current_response + end +end +# [END spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb new file mode 100644 index 000000000000..57e3f09069af --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_GetSession_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the get_session call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#get_session. +# +def get_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::GetSessionRequest.new + + # Call the get_session method. + result = client.get_session request + + # The returned object is of type Google::Cloud::Spanner::V1::Session. + p result +end +# [END spanner_v1_generated_Spanner_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb new file mode 100644 index 000000000000..ad2e46e5db36 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.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 spanner_v1_generated_Spanner_ListSessions_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the list_sessions call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#list_sessions. +# +def list_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ListSessionsRequest.new + + # Call the list_sessions method. + result = client.list_sessions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Spanner::V1::Session. + p item + end +end +# [END spanner_v1_generated_Spanner_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb new file mode 100644 index 000000000000..fe7511916bee --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_PartitionQuery_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the partition_query call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#partition_query. +# +def partition_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new + + # Call the partition_query method. + result = client.partition_query request + + # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + p result +end +# [END spanner_v1_generated_Spanner_PartitionQuery_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb new file mode 100644 index 000000000000..548247d9a655 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_PartitionRead_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the partition_read call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#partition_read. +# +def partition_read + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::PartitionReadRequest.new + + # Call the partition_read method. + result = client.partition_read request + + # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + p result +end +# [END spanner_v1_generated_Spanner_PartitionRead_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb new file mode 100644 index 000000000000..e0ae8f6a89bd --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_Read_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the read call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#read. +# +def read + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ReadRequest.new + + # Call the read method. + result = client.read request + + # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + p result +end +# [END spanner_v1_generated_Spanner_Read_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb new file mode 100644 index 000000000000..aa46e63322b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_Rollback_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the rollback call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#rollback. +# +def rollback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::RollbackRequest.new + + # Call the rollback method. + result = client.rollback request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END spanner_v1_generated_Spanner_Rollback_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb new file mode 100644 index 000000000000..858dafcebeb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START spanner_v1_generated_Spanner_StreamingRead_sync] +require "google/cloud/spanner/v1" + +## +# Snippet for the streaming_read call in the Spanner service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#streaming_read. +# +def streaming_read + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ReadRequest.new + + # Call the streaming_read method to start streaming. + output = client.streaming_read request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Spanner::V1::PartialResultSet + output.each do |current_response| + p current_response + end +end +# [END spanner_v1_generated_Spanner_StreamingRead_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb new file mode 100644 index 000000000000..f1898edbaf00 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_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/spanner/v1/spanner" + +class ::Google::Cloud::Spanner::V1::Spanner::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_database_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.database_path project: "value0", instance: "value1", database: "value2" + assert_equal "projects/value0/instances/value1/databases/value2", path + end + end + + def test_session_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", instance: "value1", database: "value2", session: "value3" + assert_equal "projects/value0/instances/value1/databases/value2/sessions/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb new file mode 100644 index 000000000000..62239e5f3ad2 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb @@ -0,0 +1,1269 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/spanner/v1/spanner_pb" +require "google/cloud/spanner/v1/spanner" + +class ::Google::Cloud::Spanner::V1::Spanner::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_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + session = {} + + create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_session, name + assert_kind_of ::Google::Cloud::Spanner::V1::CreateSessionRequest, request + assert_equal "hello world", request["database"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Session), request["session"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_session({ database: database, session: session }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_session database: database, session: session do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_session ::Google::Cloud::Spanner::V1::CreateSessionRequest.new(database: database, session: session) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_session({ database: database, session: session }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_session(::Google::Cloud::Spanner::V1::CreateSessionRequest.new(database: database, session: session), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_session_client_stub.call_rpc_count + end + end + + def test_batch_create_sessions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + session_template = {} + session_count = 42 + + batch_create_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_sessions, name + assert_kind_of ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest, request + assert_equal "hello world", request["database"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Session), request["session_template"] + assert_equal 42, request["session_count"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_sessions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_sessions({ database: database, session_template: session_template, session_count: session_count }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_create_sessions database: database, session_template: session_template, session_count: session_count do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_create_sessions ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new(database: database, session_template: session_template, session_count: session_count) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_create_sessions({ database: database, session_template: session_template, session_count: session_count }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_create_sessions(::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new(database: database, session_template: session_template, session_count: session_count), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_create_sessions_client_stub.call_rpc_count + end + end + + def test_get_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_session, name + assert_kind_of ::Google::Cloud::Spanner::V1::GetSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_session({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_session name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_session ::Google::Cloud::Spanner::V1::GetSessionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_session({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_session(::Google::Cloud::Spanner::V1::GetSessionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_session_client_stub.call_rpc_count + end + end + + def test_list_sessions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::ListSessionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sessions, name + assert_kind_of ::Google::Cloud::Spanner::V1::ListSessionsRequest, request + assert_equal "hello world", request["database"] + 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_sessions_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sessions({ database: database, 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_sessions database: database, 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_sessions ::Google::Cloud::Spanner::V1::ListSessionsRequest.new(database: database, 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_sessions({ database: database, 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_sessions(::Google::Cloud::Spanner::V1::ListSessionsRequest.new(database: database, 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_sessions_client_stub.call_rpc_count + end + end + + def test_delete_session + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_session, name + assert_kind_of ::Google::Cloud::Spanner::V1::DeleteSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_session({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_session name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_session ::Google::Cloud::Spanner::V1::DeleteSessionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_session({ 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_session(::Google::Cloud::Spanner::V1::DeleteSessionRequest.new(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_session_client_stub.call_rpc_count + end + end + + def test_execute_sql + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::ResultSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + sql = "hello world" + params = {} + param_types = {} + resume_token = "hello world" + query_mode = :NORMAL + partition_token = "hello world" + seqno = 42 + query_options = {} + request_options = {} + directed_read_options = {} + data_boost_enabled = true + last_statement = true + routing_hint = {} + + execute_sql_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :execute_sql, name + assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteSqlRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["sql"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] + assert_equal({}, request["param_types"].to_h) + assert_equal "hello world", request["resume_token"] + assert_equal :NORMAL, request["query_mode"] + assert_equal "hello world", request["partition_token"] + assert_equal 42, request["seqno"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions), request["query_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] + assert_equal true, request["data_boost_enabled"] + assert_equal true, request["last_statement"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_sql_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_sql session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_sql ::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.execute_sql(::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, execute_sql_client_stub.call_rpc_count + end + end + + def test_execute_streaming_sql + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::PartialResultSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + session = "hello world" + transaction = {} + sql = "hello world" + params = {} + param_types = {} + resume_token = "hello world" + query_mode = :NORMAL + partition_token = "hello world" + seqno = 42 + query_options = {} + request_options = {} + directed_read_options = {} + data_boost_enabled = true + last_statement = true + routing_hint = {} + + execute_streaming_sql_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :execute_streaming_sql, name + assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteSqlRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["sql"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] + assert_equal({}, request["param_types"].to_h) + assert_equal "hello world", request["resume_token"] + assert_equal :NORMAL, request["query_mode"] + assert_equal "hello world", request["partition_token"] + assert_equal 42, request["seqno"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions), request["query_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] + assert_equal true, request["data_boost_enabled"] + assert_equal true, request["last_statement"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_streaming_sql_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_streaming_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_streaming_sql session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_streaming_sql ::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_streaming_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.execute_streaming_sql(::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, execute_streaming_sql_client_stub.call_rpc_count + end + end + + def test_execute_batch_dml + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + statements = [{}] + seqno = 42 + request_options = {} + last_statements = true + + execute_batch_dml_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :execute_batch_dml, name + assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement, request["statements"].first + assert_equal 42, request["seqno"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal true, request["last_statements"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_batch_dml_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_batch_dml({ session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_batch_dml session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_batch_dml ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new(session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_batch_dml({ session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.execute_batch_dml(::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new(session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, execute_batch_dml_client_stub.call_rpc_count + end + end + + def test_read + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::ResultSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + table = "hello world" + index = "hello world" + columns = ["hello world"] + key_set = {} + limit = 42 + resume_token = "hello world" + partition_token = "hello world" + request_options = {} + directed_read_options = {} + data_boost_enabled = true + order_by = :ORDER_BY_UNSPECIFIED + lock_hint = :LOCK_HINT_UNSPECIFIED + routing_hint = {} + + read_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :read, name + assert_kind_of ::Google::Cloud::Spanner::V1::ReadRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["table"] + assert_equal "hello world", request["index"] + assert_equal ["hello world"], request["columns"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] + assert_equal 42, request["limit"] + assert_equal "hello world", request["resume_token"] + assert_equal "hello world", request["partition_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] + assert_equal true, request["data_boost_enabled"] + assert_equal :ORDER_BY_UNSPECIFIED, request["order_by"] + assert_equal :LOCK_HINT_UNSPECIFIED, request["lock_hint"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, read_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.read ::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.read(::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, read_client_stub.call_rpc_count + end + end + + def test_streaming_read + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::PartialResultSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + session = "hello world" + transaction = {} + table = "hello world" + index = "hello world" + columns = ["hello world"] + key_set = {} + limit = 42 + resume_token = "hello world" + partition_token = "hello world" + request_options = {} + directed_read_options = {} + data_boost_enabled = true + order_by = :ORDER_BY_UNSPECIFIED + lock_hint = :LOCK_HINT_UNSPECIFIED + routing_hint = {} + + streaming_read_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_read, name + assert_kind_of ::Google::Cloud::Spanner::V1::ReadRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["table"] + assert_equal "hello world", request["index"] + assert_equal ["hello world"], request["columns"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] + assert_equal 42, request["limit"] + assert_equal "hello world", request["resume_token"] + assert_equal "hello world", request["partition_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] + assert_equal true, request["data_boost_enabled"] + assert_equal :ORDER_BY_UNSPECIFIED, request["order_by"] + assert_equal :LOCK_HINT_UNSPECIFIED, request["lock_hint"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, streaming_read_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.streaming_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.streaming_read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.streaming_read ::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.streaming_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.streaming_read(::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, streaming_read_client_stub.call_rpc_count + end + end + + def test_begin_transaction + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::Transaction.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + options = {} + request_options = {} + mutation_key = {} + routing_hint = {} + + begin_transaction_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :begin_transaction, name + assert_kind_of ::Google::Cloud::Spanner::V1::BeginTransactionRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionOptions), request["options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Mutation), request["mutation_key"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, begin_transaction_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.begin_transaction({ session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.begin_transaction session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.begin_transaction ::Google::Cloud::Spanner::V1::BeginTransactionRequest.new(session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.begin_transaction({ session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.begin_transaction(::Google::Cloud::Spanner::V1::BeginTransactionRequest.new(session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, begin_transaction_client_stub.call_rpc_count + end + end + + def test_commit + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::CommitResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction_id = "hello world" + mutations = [{}] + return_commit_stats = true + max_commit_delay = {} + request_options = {} + precommit_token = {} + routing_hint = {} + + commit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :commit, name + assert_kind_of ::Google::Cloud::Spanner::V1::CommitRequest, request + assert_equal "hello world", request["session"] + assert_equal "hello world", request["transaction_id"] + assert_equal :transaction_id, request.transaction + assert_kind_of ::Google::Cloud::Spanner::V1::Mutation, request["mutations"].first + assert_equal true, request["return_commit_stats"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["max_commit_delay"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken), request["precommit_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, commit_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.commit({ session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.commit session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.commit ::Google::Cloud::Spanner::V1::CommitRequest.new(session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.commit({ session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.commit(::Google::Cloud::Spanner::V1::CommitRequest.new(session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, commit_client_stub.call_rpc_count + end + end + + def test_rollback + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction_id = "hello world" + + rollback_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rollback, name + assert_kind_of ::Google::Cloud::Spanner::V1::RollbackRequest, request + assert_equal "hello world", request["session"] + assert_equal "hello world", request["transaction_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rollback_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rollback({ session: session, transaction_id: transaction_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.rollback session: session, transaction_id: transaction_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.rollback ::Google::Cloud::Spanner::V1::RollbackRequest.new(session: session, transaction_id: transaction_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.rollback({ session: session, transaction_id: transaction_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.rollback(::Google::Cloud::Spanner::V1::RollbackRequest.new(session: session, transaction_id: transaction_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, rollback_client_stub.call_rpc_count + end + end + + def test_partition_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::PartitionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + sql = "hello world" + params = {} + param_types = {} + partition_options = {} + + partition_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :partition_query, name + assert_kind_of ::Google::Cloud::Spanner::V1::PartitionQueryRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["sql"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] + assert_equal({}, request["param_types"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::PartitionOptions), request["partition_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, partition_query_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.partition_query({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.partition_query session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.partition_query ::Google::Cloud::Spanner::V1::PartitionQueryRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.partition_query({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.partition_query(::Google::Cloud::Spanner::V1::PartitionQueryRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, partition_query_client_stub.call_rpc_count + end + end + + def test_partition_read + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::PartitionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = "hello world" + transaction = {} + table = "hello world" + index = "hello world" + columns = ["hello world"] + key_set = {} + partition_options = {} + + partition_read_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :partition_read, name + assert_kind_of ::Google::Cloud::Spanner::V1::PartitionReadRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] + assert_equal "hello world", request["table"] + assert_equal "hello world", request["index"] + assert_equal ["hello world"], request["columns"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::PartitionOptions), request["partition_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, partition_read_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.partition_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.partition_read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.partition_read ::Google::Cloud::Spanner::V1::PartitionReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.partition_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.partition_read(::Google::Cloud::Spanner::V1::PartitionReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, partition_read_client_stub.call_rpc_count + end + end + + def test_batch_write + # Create GRPC objects. + grpc_response = ::Google::Cloud::Spanner::V1::BatchWriteResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + session = "hello world" + request_options = {} + mutation_groups = [{}] + exclude_txn_from_change_streams = true + + batch_write_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :batch_write, name + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup, request["mutation_groups"].first + assert_equal true, request["exclude_txn_from_change_streams"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_write_client_stub do + # Create client + client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_write({ session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_write session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_write ::Google::Cloud::Spanner::V1::BatchWriteRequest.new(session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_write({ session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_write(::Google::Cloud::Spanner::V1::BatchWriteRequest.new(session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_write_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Spanner::V1::Spanner::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::Spanner::V1::Spanner::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::Spanner::V1::Spanner::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Spanner::V1::Spanner::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-speech-v1/.gitignore b/owl-bot-staging/google-cloud-speech-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-speech-v1/.repo-metadata.json new file mode 100644 index 000000000000..2c94c817be63 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "speech.googleapis.com", + "api_shortname": "speech", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1/latest", + "distribution_name": "google-cloud-speech-v1", + "is_cloud": true, + "language": "ruby", + "name": "speech", + "name_pretty": "Cloud Speech-to-Text V1 API", + "product_documentation": "https://cloud.google.com/speech-to-text", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SPEECH", + "ruby-cloud-product-url": "https://cloud.google.com/speech-to-text", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-speech-v1/.rubocop.yml b/owl-bot-staging/google-cloud-speech-v1/.rubocop.yml new file mode 100644 index 000000000000..3c22305c5efd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-speech-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-speech-v1.rb" diff --git a/owl-bot-staging/google-cloud-speech-v1/.toys.rb b/owl-bot-staging/google-cloud-speech-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/.yardopts b/owl-bot-staging/google-cloud-speech-v1/.yardopts new file mode 100644 index 000000000000..a7bd0f2eaed7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Speech-to-Text 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-speech-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-speech-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..3c4dc7e2d2ce --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-speech-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-speech-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/speech/v1" + +client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/speech/v1" + +::Google::Cloud::Speech::V1::Speech::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Speech::V1::Speech::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-speech-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/speech/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Speech::V1::Speech::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-speech-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-speech-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-speech-v1/Gemfile b/owl-bot-staging/google-cloud-speech-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-speech-v1/LICENSE.md b/owl-bot-staging/google-cloud-speech-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/README.md b/owl-bot-staging/google-cloud-speech-v1/README.md new file mode 100644 index 000000000000..a7fe405d0c89 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Speech-to-Text V1 API + +Converts audio to text by applying powerful neural network models. + +Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. + +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 Speech-to-Text V1 API. Most users should consider using +the main client gem, +[google-cloud-speech](https://rubygems.org/gems/google-cloud-speech). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-speech-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/speech.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/speech/v1" + +client = ::Google::Cloud::Speech::V1::Speech::Client.new +request = ::Google::Cloud::Speech::V1::RecognizeRequest.new # (request fields as keyword arguments...) +response = client.recognize request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/speech-to-text) +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/speech/v1" +require "logger" + +client = ::Google::Cloud::Speech::V1::Speech::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-speech`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-speech-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-speech`. +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-speech-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-speech-v1/Rakefile b/owl-bot-staging/google-cloud-speech-v1/Rakefile new file mode 100644 index 000000000000..4e0a18b9fab2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SPEECH_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SPEECH_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SPEECH_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 SPEECH_TEST_PROJECT=test123 SPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/speech/v1/speech/credentials" + ::Google::Cloud::Speech::V1::Speech::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SPEECH_PROJECT"] = project + ENV["SPEECH_TEST_PROJECT"] = project + ENV["SPEECH_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-speech-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-speech-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-speech-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-speech-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-speech-v1" + header "google-cloud-speech-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-speech-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-speech-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-speech-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-speech-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-speech-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-speech-v1/gapic_metadata.json new file mode 100644 index 000000000000..b8215cef6ab6 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/gapic_metadata.json @@ -0,0 +1,92 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.speech.v1", + "libraryPackage": "::Google::Cloud::Speech::V1", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Speech::V1::Speech::Client", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "long_running_recognize" + ] + }, + "StreamingRecognize": { + "methods": [ + "streaming_recognize" + ] + } + } + } + } + }, + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Speech::V1::Adaptation::Client", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "create_phrase_set" + ] + }, + "GetPhraseSet": { + "methods": [ + "get_phrase_set" + ] + }, + "ListPhraseSet": { + "methods": [ + "list_phrase_set" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "update_phrase_set" + ] + }, + "DeletePhraseSet": { + "methods": [ + "delete_phrase_set" + ] + }, + "CreateCustomClass": { + "methods": [ + "create_custom_class" + ] + }, + "GetCustomClass": { + "methods": [ + "get_custom_class" + ] + }, + "ListCustomClasses": { + "methods": [ + "list_custom_classes" + ] + }, + "UpdateCustomClass": { + "methods": [ + "update_custom_class" + ] + }, + "DeleteCustomClass": { + "methods": [ + "delete_custom_class" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-speech-v1/google-cloud-speech-v1.gemspec b/owl-bot-staging/google-cloud-speech-v1/google-cloud-speech-v1.gemspec new file mode 100644 index 000000000000..992ca305023c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/google-cloud-speech-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/speech/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-speech-v1" + gem.version = Google::Cloud::Speech::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details." + gem.summary = "Converts audio to text by applying powerful neural network models." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google-cloud-speech-v1.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google-cloud-speech-v1.rb new file mode 100644 index 000000000000..203644080a2e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google-cloud-speech-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/speech/v1" diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1.rb new file mode 100644 index 000000000000..3a78a0bfcd8b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1.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/speech/v1/speech" +require "google/cloud/speech/v1/adaptation" +require "google/cloud/speech/v1/version" + +module Google + module Cloud + module Speech + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/speech/v1" + # client = ::Google::Cloud::Speech::V1::Speech::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/speech/v1" + # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/speech/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation.rb new file mode 100644 index 000000000000..13699cd76973 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation.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/speech/v1/version" + +require "google/cloud/speech/v1/adaptation/credentials" +require "google/cloud/speech/v1/adaptation/paths" +require "google/cloud/speech/v1/adaptation/client" +require "google/cloud/speech/v1/adaptation/rest" + +module Google + module Cloud + module Speech + module V1 + ## + # Service that implements Google Cloud Speech Adaptation API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/speech/v1/adaptation" + # client = ::Google::Cloud::Speech::V1::Adaptation::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/speech/v1/adaptation/rest" + # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + module Adaptation + end + end + end + end +end + +helper_path = ::File.join __dir__, "adaptation", "helpers.rb" +require "google/cloud/speech/v1/adaptation/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/client.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/client.rb new file mode 100644 index 000000000000..a04df217bffc --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/client.rb @@ -0,0 +1,1434 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v1/cloud_speech_adaptation_pb" + +module Google + module Cloud + module Speech + module V1 + module Adaptation + ## + # Client for the Adaptation service. + # + # Service that implements Google Cloud Speech Adaptation API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :adaptation_stub + + ## + # Configure the Adaptation Client class. + # + # See {::Google::Cloud::Speech::V1::Adaptation::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Adaptation clients + # ::Google::Cloud::Speech::V1::Adaptation::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Speech", "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 Adaptation Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V1::Adaptation::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @adaptation_stub.universe_domain + end + + ## + # Create a new Adaptation client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Adaptation 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/speech/v1/cloud_speech_adaptation_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 + + @adaptation_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Speech::V1::Adaptation::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 + ) + + @adaptation_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 + @adaptation_stub.logger + end + + # Service calls + + ## + # Create a set of phrase hints. Each item in the set can be a single word or + # a multi-word phrase. The items in the PhraseSet are favored by the + # recognition model when you send a call that includes the PhraseSet. + # + # @overload create_phrase_set(request, options = nil) + # Pass arguments to `create_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::CreatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::CreatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) + # Pass arguments to `create_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this phrase set will be created. + # Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param phrase_set_id [::String] + # Required. The ID to use for the phrase set, which will become the final + # component of the phrase set's resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @param phrase_set [::Google::Cloud::Speech::V1::PhraseSet, ::Hash] + # Required. The phrase set to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1::PhraseSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::CreatePhraseSetRequest.new + # + # # Call the create_phrase_set method. + # result = client.create_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + # p result + # + def create_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::CreatePhraseSetRequest + + # Converts hash and nil to 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :create_phrase_set, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a phrase set. + # + # @overload get_phrase_set(request, options = nil) + # Pass arguments to `get_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::GetPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::GetPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_phrase_set(name: nil) + # Pass arguments to `get_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 phrase set to retrieve. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1::PhraseSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::GetPhraseSetRequest.new + # + # # Call the get_phrase_set method. + # result = client.get_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + # p result + # + def get_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::GetPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :get_phrase_set, request, 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 phrase sets. + # + # @overload list_phrase_set(request, options = nil) + # Pass arguments to `list_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::ListPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::ListPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_phrase_set(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, 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 phrase set. Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param page_size [::Integer] + # The maximum number of phrase sets to return. The service may return + # fewer than this value. If unspecified, at most 50 phrase sets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous `ListPhraseSet` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPhraseSet` 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::Speech::V1::PhraseSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::ListPhraseSetRequest.new + # + # # Call the list_phrase_set method. + # result = client.list_phrase_set request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V1::PhraseSet. + # p item + # end + # + def list_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::ListPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :list_phrase_set, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_phrase_set, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a phrase set. + # + # @overload update_phrase_set(request, options = nil) + # Pass arguments to `update_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::UpdatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::UpdatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_phrase_set(phrase_set: nil, update_mask: nil) + # Pass arguments to `update_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V1::PhraseSet, ::Hash] + # Required. The phrase set to update. + # + # The phrase set's `name` field is used to identify the set to be + # updated. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1::PhraseSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new + # + # # Call the update_phrase_set method. + # result = client.update_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + # p result + # + def update_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest + + # Converts hash and nil to 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.phrase_set&.name + header_params["phrase_set.name"] = request.phrase_set.name + end + + request_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_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :update_phrase_set, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a phrase set. + # + # @overload delete_phrase_set(request, options = nil) + # Pass arguments to `delete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::DeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::DeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_phrase_set(name: nil) + # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 phrase set to delete. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::DeletePhraseSetRequest.new + # + # # Call the delete_phrase_set method. + # result = client.delete_phrase_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::DeletePhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :delete_phrase_set, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a custom class. + # + # @overload create_custom_class(request, options = nil) + # Pass arguments to `create_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1::CreateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::CreateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) + # Pass arguments to `create_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this custom class will be created. + # Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param custom_class_id [::String] + # Required. The ID to use for the custom class, which will become the final + # component of the custom class' resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @param custom_class [::Google::Cloud::Speech::V1::CustomClass, ::Hash] + # Required. The custom class to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1::CustomClass] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::CreateCustomClassRequest.new + # + # # Call the create_custom_class method. + # result = client.create_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + # p result + # + def create_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::CreateCustomClassRequest + + # Converts hash and nil to 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :create_custom_class, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a custom class. + # + # @overload get_custom_class(request, options = nil) + # Pass arguments to `get_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1::GetCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::GetCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_custom_class(name: nil) + # Pass arguments to `get_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 custom class to retrieve. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1::CustomClass] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::GetCustomClassRequest.new + # + # # Call the get_custom_class method. + # result = client.get_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + # p result + # + def get_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::GetCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :get_custom_class, request, 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 custom classes. + # + # @overload list_custom_classes(request, options = nil) + # Pass arguments to `list_custom_classes` via a request object, either of type + # {::Google::Cloud::Speech::V1::ListCustomClassesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::ListCustomClassesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_custom_classes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, 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 custom classes. Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param page_size [::Integer] + # The maximum number of custom classes to return. The service may return + # fewer than this value. If unspecified, at most 50 custom classes will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous `ListCustomClass` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCustomClass` 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::Speech::V1::CustomClass>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::CustomClass>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::ListCustomClassesRequest.new + # + # # Call the list_custom_classes method. + # result = client.list_custom_classes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V1::CustomClass. + # p item + # end + # + def list_custom_classes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::ListCustomClassesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_custom_classes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_custom_classes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :list_custom_classes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_custom_classes, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a custom class. + # + # @overload update_custom_class(request, options = nil) + # Pass arguments to `update_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1::UpdateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::UpdateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_custom_class(custom_class: nil, update_mask: nil) + # Pass arguments to `update_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V1::CustomClass, ::Hash] + # Required. The custom class to update. + # + # The custom class's `name` field is used to identify the custom class to be + # updated. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1::CustomClass] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::UpdateCustomClassRequest.new + # + # # Call the update_custom_class method. + # result = client.update_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + # p result + # + def update_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::UpdateCustomClassRequest + + # Converts hash and nil to 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.custom_class&.name + header_params["custom_class.name"] = request.custom_class.name + end + + request_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_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :update_custom_class, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a custom class. + # + # @overload delete_custom_class(request, options = nil) + # Pass arguments to `delete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1::DeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::DeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_custom_class(name: nil) + # Pass arguments to `delete_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 custom class to delete. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::DeleteCustomClassRequest.new + # + # # Call the delete_custom_class method. + # result = client.delete_custom_class request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::DeleteCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :delete_custom_class, request, 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 Adaptation API. + # + # This class represents the configuration for Adaptation, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V1::Adaptation::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_phrase_set to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V1::Adaptation::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_phrase_set.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_phrase_set.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Speech::V1::Adaptation::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Adaptation API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_phrase_set + ## + # RPC-specific configuration for `get_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_phrase_set + ## + # RPC-specific configuration for `list_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :list_phrase_set + ## + # RPC-specific configuration for `update_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_phrase_set + ## + # RPC-specific configuration for `delete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_phrase_set + ## + # RPC-specific configuration for `create_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_class + ## + # RPC-specific configuration for `get_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_class + ## + # RPC-specific configuration for `list_custom_classes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_classes + ## + # RPC-specific configuration for `update_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :update_custom_class + ## + # RPC-specific configuration for `delete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_class + + # @private + def initialize parent_rpcs = nil + create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set + @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config + get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set + @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config + list_phrase_set_config = parent_rpcs.list_phrase_set if parent_rpcs.respond_to? :list_phrase_set + @list_phrase_set = ::Gapic::Config::Method.new list_phrase_set_config + update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set + @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config + delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set + @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config + create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class + @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config + get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class + @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config + list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes + @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config + update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class + @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config + delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class + @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/credentials.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/credentials.rb new file mode 100644 index 000000000000..3d08fc44b076 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/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 Speech + module V1 + module Adaptation + # Credentials for the Adaptation API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SPEECH_CREDENTIALS", + "SPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPEECH_CREDENTIALS_JSON", + "SPEECH_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-speech-v1/lib/google/cloud/speech/v1/adaptation/paths.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/paths.rb new file mode 100644 index 000000000000..57c97718dd9d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/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 Speech + module V1 + module Adaptation + # Path helper methods for the Adaptation API. + module Paths + ## + # Create a fully-qualified CustomClass resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # @param project [String] + # @param location [String] + # @param custom_class [String] + # + # @return [::String] + def custom_class_path project:, location:, custom_class: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" + 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 PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest.rb new file mode 100644 index 000000000000..3b9be5472f5a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/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/speech/v1/version" + +require "google/cloud/speech/v1/adaptation/credentials" +require "google/cloud/speech/v1/adaptation/paths" +require "google/cloud/speech/v1/adaptation/rest/client" + +module Google + module Cloud + module Speech + module V1 + ## + # Service that implements Google Cloud Speech Adaptation API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/speech/v1/adaptation/rest" + # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + module Adaptation + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/speech/v1/adaptation/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/client.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/client.rb new file mode 100644 index 000000000000..4f61cb6d2536 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/client.rb @@ -0,0 +1,1321 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v1/cloud_speech_adaptation_pb" +require "google/cloud/speech/v1/adaptation/rest/service_stub" + +module Google + module Cloud + module Speech + module V1 + module Adaptation + module Rest + ## + # REST client for the Adaptation service. + # + # Service that implements Google Cloud Speech Adaptation API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :adaptation_stub + + ## + # Configure the Adaptation Client class. + # + # See {::Google::Cloud::Speech::V1::Adaptation::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Adaptation clients + # ::Google::Cloud::Speech::V1::Adaptation::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", "Speech", "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 Adaptation Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V1::Adaptation::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 + @adaptation_stub.universe_domain + end + + ## + # Create a new Adaptation REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Adaptation 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 + + @adaptation_stub = ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @adaptation_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 + @adaptation_stub.logger + end + + # Service calls + + ## + # Create a set of phrase hints. Each item in the set can be a single word or + # a multi-word phrase. The items in the PhraseSet are favored by the + # recognition model when you send a call that includes the PhraseSet. + # + # @overload create_phrase_set(request, options = nil) + # Pass arguments to `create_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::CreatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::CreatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) + # Pass arguments to `create_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this phrase set will be created. + # Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param phrase_set_id [::String] + # Required. The ID to use for the phrase set, which will become the final + # component of the phrase set's resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @param phrase_set [::Google::Cloud::Speech::V1::PhraseSet, ::Hash] + # Required. The phrase set to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::CreatePhraseSetRequest.new + # + # # Call the create_phrase_set method. + # result = client.create_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + # p result + # + def create_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::CreatePhraseSetRequest + + # Converts hash and nil to an 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.create_phrase_set request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a phrase set. + # + # @overload get_phrase_set(request, options = nil) + # Pass arguments to `get_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::GetPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::GetPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_phrase_set(name: nil) + # Pass arguments to `get_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 phrase set to retrieve. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::GetPhraseSetRequest.new + # + # # Call the get_phrase_set method. + # result = client.get_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + # p result + # + def get_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::GetPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.get_phrase_set request, 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 phrase sets. + # + # @overload list_phrase_set(request, options = nil) + # Pass arguments to `list_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::ListPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::ListPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_phrase_set(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, 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 phrase set. Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param page_size [::Integer] + # The maximum number of phrase sets to return. The service may return + # fewer than this value. If unspecified, at most 50 phrase sets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous `ListPhraseSet` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPhraseSet` 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::Speech::V1::PhraseSet>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::ListPhraseSetRequest.new + # + # # Call the list_phrase_set method. + # result = client.list_phrase_set request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V1::PhraseSet. + # p item + # end + # + def list_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::ListPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.list_phrase_set request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_phrase_set, "phrase_sets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a phrase set. + # + # @overload update_phrase_set(request, options = nil) + # Pass arguments to `update_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::UpdatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::UpdatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_phrase_set(phrase_set: nil, update_mask: nil) + # Pass arguments to `update_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V1::PhraseSet, ::Hash] + # Required. The phrase set to update. + # + # The phrase set's `name` field is used to identify the set to be + # updated. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new + # + # # Call the update_phrase_set method. + # result = client.update_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + # p result + # + def update_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest + + # Converts hash and nil to an 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.update_phrase_set request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a phrase set. + # + # @overload delete_phrase_set(request, options = nil) + # Pass arguments to `delete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1::DeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::DeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_phrase_set(name: nil) + # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 phrase set to delete. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::DeletePhraseSetRequest.new + # + # # Call the delete_phrase_set method. + # result = client.delete_phrase_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::DeletePhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.delete_phrase_set request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a custom class. + # + # @overload create_custom_class(request, options = nil) + # Pass arguments to `create_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1::CreateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::CreateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) + # Pass arguments to `create_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this custom class will be created. + # Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param custom_class_id [::String] + # Required. The ID to use for the custom class, which will become the final + # component of the custom class' resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @param custom_class [::Google::Cloud::Speech::V1::CustomClass, ::Hash] + # Required. The custom class to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::CreateCustomClassRequest.new + # + # # Call the create_custom_class method. + # result = client.create_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + # p result + # + def create_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::CreateCustomClassRequest + + # Converts hash and nil to an 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.create_custom_class request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a custom class. + # + # @overload get_custom_class(request, options = nil) + # Pass arguments to `get_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1::GetCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::GetCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_custom_class(name: nil) + # Pass arguments to `get_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 custom class to retrieve. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::GetCustomClassRequest.new + # + # # Call the get_custom_class method. + # result = client.get_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + # p result + # + def get_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::GetCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.get_custom_class request, 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 custom classes. + # + # @overload list_custom_classes(request, options = nil) + # Pass arguments to `list_custom_classes` via a request object, either of type + # {::Google::Cloud::Speech::V1::ListCustomClassesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::ListCustomClassesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_custom_classes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, 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 custom classes. Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param page_size [::Integer] + # The maximum number of custom classes to return. The service may return + # fewer than this value. If unspecified, at most 50 custom classes will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous `ListCustomClass` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCustomClass` 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::Speech::V1::CustomClass>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1::CustomClass>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::ListCustomClassesRequest.new + # + # # Call the list_custom_classes method. + # result = client.list_custom_classes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V1::CustomClass. + # p item + # end + # + def list_custom_classes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::ListCustomClassesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_custom_classes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_custom_classes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.list_custom_classes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_custom_classes, "custom_classes", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a custom class. + # + # @overload update_custom_class(request, options = nil) + # Pass arguments to `update_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1::UpdateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::UpdateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_custom_class(custom_class: nil, update_mask: nil) + # Pass arguments to `update_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V1::CustomClass, ::Hash] + # Required. The custom class to update. + # + # The custom class's `name` field is used to identify the custom class to be + # updated. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::UpdateCustomClassRequest.new + # + # # Call the update_custom_class method. + # result = client.update_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + # p result + # + def update_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::UpdateCustomClassRequest + + # Converts hash and nil to an 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.update_custom_class request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a custom class. + # + # @overload delete_custom_class(request, options = nil) + # Pass arguments to `delete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1::DeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::DeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_custom_class(name: nil) + # Pass arguments to `delete_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 custom class to delete. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::DeleteCustomClassRequest.new + # + # # Call the delete_custom_class method. + # result = client.delete_custom_class request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::DeleteCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.delete_custom_class request, 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 Adaptation REST API. + # + # This class represents the configuration for Adaptation REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V1::Adaptation::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_phrase_set to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_phrase_set.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_phrase_set.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Adaptation API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_phrase_set + ## + # RPC-specific configuration for `get_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_phrase_set + ## + # RPC-specific configuration for `list_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :list_phrase_set + ## + # RPC-specific configuration for `update_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_phrase_set + ## + # RPC-specific configuration for `delete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_phrase_set + ## + # RPC-specific configuration for `create_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_class + ## + # RPC-specific configuration for `get_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_class + ## + # RPC-specific configuration for `list_custom_classes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_classes + ## + # RPC-specific configuration for `update_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :update_custom_class + ## + # RPC-specific configuration for `delete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_class + + # @private + def initialize parent_rpcs = nil + create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set + @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config + get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set + @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config + list_phrase_set_config = parent_rpcs.list_phrase_set if parent_rpcs.respond_to? :list_phrase_set + @list_phrase_set = ::Gapic::Config::Method.new list_phrase_set_config + update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set + @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config + delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set + @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config + create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class + @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config + get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class + @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config + list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes + @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config + update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class + @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config + delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class + @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb new file mode 100644 index 000000000000..3eb09c2b9827 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb @@ -0,0 +1,695 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/speech/v1/cloud_speech_adaptation_pb" + +module Google + module Cloud + module Speech + module V1 + module Adaptation + module Rest + ## + # REST service stub for the Adaptation 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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::CreatePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # A result object deserialized from the server's reply + def create_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1::PhraseSet.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::GetPhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # A result object deserialized from the server's reply + def get_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1::PhraseSet.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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::ListPhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::ListPhraseSetResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::ListPhraseSetResponse] + # A result object deserialized from the server's reply + def list_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1::ListPhraseSetResponse.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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::UpdatePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # A result object deserialized from the server's reply + def update_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1::PhraseSet.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::DeletePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 create_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::CreateCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::CustomClass] + # A result object deserialized from the server's reply + def create_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1::CustomClass.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::GetCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::CustomClass] + # A result object deserialized from the server's reply + def get_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1::CustomClass.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_custom_classes REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::ListCustomClassesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::ListCustomClassesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::ListCustomClassesResponse] + # A result object deserialized from the server's reply + def list_custom_classes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_classes_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_custom_classes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1::ListCustomClassesResponse.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_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::UpdateCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::CustomClass] + # A result object deserialized from the server's reply + def update_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1::CustomClass.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::DeleteCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::CreatePhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/phraseSets", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::GetPhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::ListPhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/phraseSets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::UpdatePhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{phrase_set.name}", + body: "phrase_set", + matches: [ + ["phrase_set.name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::DeletePhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::CreateCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/customClasses", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::GetCustomClassRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_custom_classes REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::ListCustomClassesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_custom_classes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/customClasses", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::UpdateCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{custom_class.name}", + body: "custom_class", + matches: [ + ["custom_class.name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::DeleteCustomClassRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_pb.rb new file mode 100644 index 000000000000..602e53dc90e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_pb.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v1/cloud_speech_adaptation.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/speech/v1/resource_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n4google/cloud/speech/v1/cloud_speech_adaptation.proto\x12\x16google.cloud.speech.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/speech/v1/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa9\x01\n\x16\x43reatePhraseSetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\x12\x1a\n\rphrase_set_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\nphrase_set\x18\x03 \x01(\x0b\x32!.google.cloud.speech.v1.PhraseSetB\x03\xe0\x41\x02\"\x85\x01\n\x16UpdatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v1.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"v\n\x14ListPhraseSetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"h\n\x15ListPhraseSetResponse\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v1.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\xb3\x01\n\x18\x43reateCustomClassRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\x12\x1c\n\x0f\x63ustom_class_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12>\n\x0c\x63ustom_class\x18\x03 \x01(\x0b\x32#.google.cloud.speech.v1.CustomClassB\x03\xe0\x41\x02\"\x8b\x01\n\x18UpdateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v1.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"|\n\x18ListCustomClassesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"q\n\x19ListCustomClassesResponse\x12;\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32#.google.cloud.speech.v1.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass2\x8e\x0f\n\nAdaptation\x12\xc1\x01\n\x0f\x43reatePhraseSet\x12..google.cloud.speech.v1.CreatePhraseSetRequest\x1a!.google.cloud.speech.v1.PhraseSet\"[\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02\x33\"./v1/{parent=projects/*/locations/*}/phraseSets:\x01*\x12\x9d\x01\n\x0cGetPhraseSet\x12+.google.cloud.speech.v1.GetPhraseSetRequest\x1a!.google.cloud.speech.v1.PhraseSet\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/phraseSets/*}\x12\xad\x01\n\rListPhraseSet\x12,.google.cloud.speech.v1.ListPhraseSetRequest\x1a-.google.cloud.speech.v1.ListPhraseSetResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/phraseSets\x12\xcc\x01\n\x0fUpdatePhraseSet\x12..google.cloud.speech.v1.UpdatePhraseSetRequest\x1a!.google.cloud.speech.v1.PhraseSet\"f\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02G29/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\x98\x01\n\x0f\x44\x65letePhraseSet\x12..google.cloud.speech.v1.DeletePhraseSetRequest\x1a\x16.google.protobuf.Empty\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/phraseSets/*}\x12\xce\x01\n\x11\x43reateCustomClass\x12\x30.google.cloud.speech.v1.CreateCustomClassRequest\x1a#.google.cloud.speech.v1.CustomClass\"b\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02\x36\"1/v1/{parent=projects/*/locations/*}/customClasses:\x01*\x12\xa6\x01\n\x0eGetCustomClass\x12-.google.cloud.speech.v1.GetCustomClassRequest\x1a#.google.cloud.speech.v1.CustomClass\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=projects/*/locations/*/customClasses/*}\x12\xbc\x01\n\x11ListCustomClasses\x12\x30.google.cloud.speech.v1.ListCustomClassesRequest\x1a\x31.google.cloud.speech.v1.ListCustomClassesResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=projects/*/locations/*}/customClasses\x12\xdb\x01\n\x11UpdateCustomClass\x12\x30.google.cloud.speech.v1.UpdateCustomClassRequest\x1a#.google.cloud.speech.v1.CustomClass\"o\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02N2>/v1/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\x9f\x01\n\x11\x44\x65leteCustomClass\x12\x30.google.cloud.speech.v1.DeleteCustomClassRequest\x1a\x16.google.protobuf.Empty\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1/{name=projects/*/locations/*/customClasses/*}\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBr\n\x1a\x63om.google.cloud.speech.v1B\x15SpeechAdaptationProtoP\x01Z2cloud.google.com/go/speech/apiv1/speechpb;speechpb\xf8\x01\x01\xa2\x02\x03GCSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Speech + module V1 + CreatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CreatePhraseSetRequest").msgclass + UpdatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.UpdatePhraseSetRequest").msgclass + GetPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.GetPhraseSetRequest").msgclass + ListPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.ListPhraseSetRequest").msgclass + ListPhraseSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.ListPhraseSetResponse").msgclass + DeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.DeletePhraseSetRequest").msgclass + CreateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CreateCustomClassRequest").msgclass + UpdateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.UpdateCustomClassRequest").msgclass + GetCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.GetCustomClassRequest").msgclass + ListCustomClassesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.ListCustomClassesRequest").msgclass + ListCustomClassesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.ListCustomClassesResponse").msgclass + DeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.DeleteCustomClassRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_services_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_services_pb.rb new file mode 100644 index 000000000000..9cc7add34e77 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_services_pb.rb @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/speech/v1/cloud_speech_adaptation.proto for package 'google.cloud.speech.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/speech/v1/cloud_speech_adaptation_pb' + +module Google + module Cloud + module Speech + module V1 + module Adaptation + # Service that implements Google Cloud Speech Adaptation API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.speech.v1.Adaptation' + + # Create a set of phrase hints. Each item in the set can be a single word or + # a multi-word phrase. The items in the PhraseSet are favored by the + # recognition model when you send a call that includes the PhraseSet. + rpc :CreatePhraseSet, ::Google::Cloud::Speech::V1::CreatePhraseSetRequest, ::Google::Cloud::Speech::V1::PhraseSet + # Get a phrase set. + rpc :GetPhraseSet, ::Google::Cloud::Speech::V1::GetPhraseSetRequest, ::Google::Cloud::Speech::V1::PhraseSet + # List phrase sets. + rpc :ListPhraseSet, ::Google::Cloud::Speech::V1::ListPhraseSetRequest, ::Google::Cloud::Speech::V1::ListPhraseSetResponse + # Update a phrase set. + rpc :UpdatePhraseSet, ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest, ::Google::Cloud::Speech::V1::PhraseSet + # Delete a phrase set. + rpc :DeletePhraseSet, ::Google::Cloud::Speech::V1::DeletePhraseSetRequest, ::Google::Protobuf::Empty + # Create a custom class. + rpc :CreateCustomClass, ::Google::Cloud::Speech::V1::CreateCustomClassRequest, ::Google::Cloud::Speech::V1::CustomClass + # Get a custom class. + rpc :GetCustomClass, ::Google::Cloud::Speech::V1::GetCustomClassRequest, ::Google::Cloud::Speech::V1::CustomClass + # List custom classes. + rpc :ListCustomClasses, ::Google::Cloud::Speech::V1::ListCustomClassesRequest, ::Google::Cloud::Speech::V1::ListCustomClassesResponse + # Update a custom class. + rpc :UpdateCustomClass, ::Google::Cloud::Speech::V1::UpdateCustomClassRequest, ::Google::Cloud::Speech::V1::CustomClass + # Delete a custom class. + rpc :DeleteCustomClass, ::Google::Cloud::Speech::V1::DeleteCustomClassRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_pb.rb new file mode 100644 index 000000000000..1870ee42f8a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v1/cloud_speech.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/cloud/speech/v1/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n)google/cloud/speech/v1/cloud_speech.proto\x12\x16google.cloud.speech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a%google/cloud/speech/v1/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\"\x90\x01\n\x10RecognizeRequest\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfigB\x03\xe0\x41\x02\x12<\n\x05\x61udio\x18\x02 \x01(\x0b\x32(.google.cloud.speech.v1.RecognitionAudioB\x03\xe0\x41\x02\"\xe7\x01\n\x1bLongRunningRecognizeRequest\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfigB\x03\xe0\x41\x02\x12<\n\x05\x61udio\x18\x02 \x01(\x0b\x32(.google.cloud.speech.v1.RecognitionAudioB\x03\xe0\x41\x02\x12J\n\routput_config\x18\x04 \x01(\x0b\x32..google.cloud.speech.v1.TranscriptOutputConfigB\x03\xe0\x41\x01\":\n\x16TranscriptOutputConfig\x12\x11\n\x07gcs_uri\x18\x01 \x01(\tH\x00\x42\r\n\x0boutput_type\"\x99\x01\n\x19StreamingRecognizeRequest\x12N\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x32.google.cloud.speech.v1.StreamingRecognitionConfigH\x00\x12\x17\n\raudio_content\x18\x02 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\xa7\x03\n\x1aStreamingRecognitionConfig\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfigB\x03\xe0\x41\x02\x12\x18\n\x10single_utterance\x18\x02 \x01(\x08\x12\x17\n\x0finterim_results\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_voice_activity_events\x18\x05 \x01(\x08\x12g\n\x16voice_activity_timeout\x18\x06 \x01(\x0b\x32G.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xca\x08\n\x11RecognitionConfig\x12I\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32\x37.google.cloud.speech.v1.RecognitionConfig.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x1b\n\x13\x61udio_channel_count\x18\x07 \x01(\x05\x12/\n\'enable_separate_recognition_per_channel\x18\x0c \x01(\x08\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x1a\x61lternative_language_codes\x18\x12 \x03(\t\x12\x18\n\x10max_alternatives\x18\x04 \x01(\x05\x12\x18\n\x10profanity_filter\x18\x05 \x01(\x08\x12<\n\nadaptation\x18\x14 \x01(\x0b\x32(.google.cloud.speech.v1.SpeechAdaptation\x12V\n\x18transcript_normalization\x18\x18 \x01(\x0b\x32/.google.cloud.speech.v1.TranscriptNormalizationB\x03\xe0\x41\x01\x12>\n\x0fspeech_contexts\x18\x06 \x03(\x0b\x32%.google.cloud.speech.v1.SpeechContext\x12 \n\x18\x65nable_word_time_offsets\x18\x08 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x0f \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x0b \x01(\x08\x12=\n\x19\x65nable_spoken_punctuation\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x38\n\x14\x65nable_spoken_emojis\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12L\n\x12\x64iarization_config\x18\x13 \x01(\x0b\x32\x30.google.cloud.speech.v1.SpeakerDiarizationConfig\x12=\n\x08metadata\x18\t \x01(\x0b\x32+.google.cloud.speech.v1.RecognitionMetadata\x12\r\n\x05model\x18\r \x01(\t\x12\x14\n\x0cuse_enhanced\x18\x0e \x01(\x08\"\xa3\x01\n\rAudioEncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x08\n\x04\x46LAC\x10\x02\x12\t\n\x05MULAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x0c\n\x08OGG_OPUS\x10\x06\x12\x1a\n\x16SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x07\n\x03MP3\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\"\x90\x01\n\x18SpeakerDiarizationConfig\x12\"\n\x1a\x65nable_speaker_diarization\x18\x01 \x01(\x08\x12\x19\n\x11min_speaker_count\x18\x02 \x01(\x05\x12\x19\n\x11max_speaker_count\x18\x03 \x01(\x05\x12\x1a\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x05\x18\x01\xe0\x41\x03\"\xa4\x08\n\x13RecognitionMetadata\x12U\n\x10interaction_type\x18\x01 \x01(\x0e\x32;.google.cloud.speech.v1.RecognitionMetadata.InteractionType\x12$\n\x1cindustry_naics_code_of_audio\x18\x03 \x01(\r\x12[\n\x13microphone_distance\x18\x04 \x01(\x0e\x32>.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance\x12Z\n\x13original_media_type\x18\x05 \x01(\x0e\x32=.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType\x12^\n\x15recording_device_type\x18\x06 \x01(\x0e\x32?.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType\x12\x1d\n\x15recording_device_name\x18\x07 \x01(\t\x12\x1a\n\x12original_mime_type\x18\x08 \x01(\t\x12\x13\n\x0b\x61udio_topic\x18\n \x01(\t\"\xc5\x01\n\x0fInteractionType\x12 \n\x1cINTERACTION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nDISCUSSION\x10\x01\x12\x10\n\x0cPRESENTATION\x10\x02\x12\x0e\n\nPHONE_CALL\x10\x03\x12\r\n\tVOICEMAIL\x10\x04\x12\x1b\n\x17PROFESSIONALLY_PRODUCED\x10\x05\x12\x10\n\x0cVOICE_SEARCH\x10\x06\x12\x11\n\rVOICE_COMMAND\x10\x07\x12\r\n\tDICTATION\x10\x08\"d\n\x12MicrophoneDistance\x12#\n\x1fMICROPHONE_DISTANCE_UNSPECIFIED\x10\x00\x12\r\n\tNEARFIELD\x10\x01\x12\x0c\n\x08MIDFIELD\x10\x02\x12\x0c\n\x08\x46\x41RFIELD\x10\x03\"N\n\x11OriginalMediaType\x12#\n\x1fORIGINAL_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\t\n\x05VIDEO\x10\x02\"\xa4\x01\n\x13RecordingDeviceType\x12%\n!RECORDING_DEVICE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nSMARTPHONE\x10\x01\x12\x06\n\x02PC\x10\x02\x12\x0e\n\nPHONE_LINE\x10\x03\x12\x0b\n\x07VEHICLE\x10\x04\x12\x18\n\x14OTHER_OUTDOOR_DEVICE\x10\x05\x12\x17\n\x13OTHER_INDOOR_DEVICE\x10\x06:\x02\x18\x01\"/\n\rSpeechContext\x12\x0f\n\x07phrases\x18\x01 \x03(\t\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\"D\n\x10RecognitionAudio\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\xed\x01\n\x11RecognizeResponse\x12@\n\x07results\x18\x02 \x03(\x0b\x32/.google.cloud.speech.v1.SpeechRecognitionResult\x12\x34\n\x11total_billed_time\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12L\n\x16speech_adaptation_info\x18\x07 \x01(\x0b\x32,.google.cloud.speech.v1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\x08 \x01(\x03\"\xe9\x02\n\x1cLongRunningRecognizeResponse\x12@\n\x07results\x18\x02 \x03(\x0b\x32/.google.cloud.speech.v1.SpeechRecognitionResult\x12\x34\n\x11total_billed_time\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x45\n\routput_config\x18\x06 \x01(\x0b\x32..google.cloud.speech.v1.TranscriptOutputConfig\x12(\n\x0coutput_error\x18\x07 \x01(\x0b\x32\x12.google.rpc.Status\x12L\n\x16speech_adaptation_info\x18\x08 \x01(\x0b\x32,.google.cloud.speech.v1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\t \x01(\x03\"\xb0\x01\n\x1cLongRunningRecognizeMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10last_update_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x03uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\"\xd1\x04\n\x1aStreamingRecognizeResponse\x12!\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12\x43\n\x07results\x18\x02 \x03(\x0b\x32\x32.google.cloud.speech.v1.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x04 \x01(\x0e\x32\x42.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType\x12\x34\n\x11speech_event_time\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x11total_billed_time\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12L\n\x16speech_adaptation_info\x18\t \x01(\x0b\x32,.google.cloud.speech.v1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\n \x01(\x03\"\x9d\x01\n\x0fSpeechEventType\x12\x1c\n\x18SPEECH_EVENT_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\x12\x1b\n\x17SPEECH_ACTIVITY_TIMEOUT\x10\x04\"\xf2\x01\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v1.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xca\x01\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v1.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v1.WordInfo\"\xc0\x01\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x1a\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x05\x18\x01\xe0\x41\x03\x12\x1a\n\rspeaker_label\x18\x06 \x01(\tB\x03\xe0\x41\x03\"K\n\x14SpeechAdaptationInfo\x12\x1a\n\x12\x61\x64\x61ptation_timeout\x18\x01 \x01(\x08\x12\x17\n\x0ftimeout_message\x18\x04 \x01(\t2\xd1\x04\n\x06Speech\x12\x90\x01\n\tRecognize\x12(.google.cloud.speech.v1.RecognizeRequest\x1a).google.cloud.speech.v1.RecognizeResponse\".\xda\x41\x0c\x63onfig,audio\x82\xd3\xe4\x93\x02\x19\"\x14/v1/speech:recognize:\x01*\x12\xe4\x01\n\x14LongRunningRecognize\x12\x33.google.cloud.speech.v1.LongRunningRecognizeRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41<\n\x1cLongRunningRecognizeResponse\x12\x1cLongRunningRecognizeMetadata\xda\x41\x0c\x63onfig,audio\x82\xd3\xe4\x93\x02$\"\x1f/v1/speech:longrunningrecognize:\x01*\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v1.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v1.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBh\n\x1a\x63om.google.cloud.speech.v1B\x0bSpeechProtoP\x01Z2cloud.google.com/go/speech/apiv1/speechpb;speechpb\xf8\x01\x01\xa2\x02\x03GCSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Speech + module V1 + RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognizeRequest").msgclass + LongRunningRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.LongRunningRecognizeRequest").msgclass + TranscriptOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.TranscriptOutputConfig").msgclass + StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognizeRequest").msgclass + StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognitionConfig").msgclass + StreamingRecognitionConfig::VoiceActivityTimeout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout").msgclass + RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionConfig").msgclass + RecognitionConfig::AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionConfig.AudioEncoding").enummodule + SpeakerDiarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeakerDiarizationConfig").msgclass + RecognitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata").msgclass + RecognitionMetadata::InteractionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata.InteractionType").enummodule + RecognitionMetadata::MicrophoneDistance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance").enummodule + RecognitionMetadata::OriginalMediaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType").enummodule + RecognitionMetadata::RecordingDeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType").enummodule + SpeechContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechContext").msgclass + RecognitionAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionAudio").msgclass + RecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognizeResponse").msgclass + LongRunningRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.LongRunningRecognizeResponse").msgclass + LongRunningRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.LongRunningRecognizeMetadata").msgclass + StreamingRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognizeResponse").msgclass + StreamingRecognizeResponse::SpeechEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType").enummodule + StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognitionResult").msgclass + SpeechRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechRecognitionResult").msgclass + SpeechRecognitionAlternative = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechRecognitionAlternative").msgclass + WordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.WordInfo").msgclass + SpeechAdaptationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechAdaptationInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb new file mode 100644 index 000000000000..872e6df62f83 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/speech/v1/cloud_speech.proto for package 'google.cloud.speech.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/speech/v1/cloud_speech_pb' + +module Google + module Cloud + module Speech + module V1 + module Speech + # Service that implements Google Cloud Speech API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.speech.v1.Speech' + + # Performs synchronous speech recognition: receive results after all audio + # has been sent and processed. + rpc :Recognize, ::Google::Cloud::Speech::V1::RecognizeRequest, ::Google::Cloud::Speech::V1::RecognizeResponse + # Performs asynchronous speech recognition: receive results via the + # google.longrunning.Operations interface. Returns either an + # `Operation.error` or an `Operation.response` which contains + # a `LongRunningRecognizeResponse` message. + # For more information on asynchronous speech recognition, see the + # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + rpc :LongRunningRecognize, ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest, ::Google::Longrunning::Operation + # Performs bidirectional streaming speech recognition: receive results while + # sending audio. This method is only available via the gRPC API (not REST). + rpc :StreamingRecognize, stream(::Google::Cloud::Speech::V1::StreamingRecognizeRequest), stream(::Google::Cloud::Speech::V1::StreamingRecognizeResponse) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/resource_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/resource_pb.rb new file mode 100644 index 000000000000..2b910a6cea8b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/resource_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v1/resource.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n%google/cloud/speech/v1/resource.proto\x12\x16google.cloud.speech.v1\x1a\x19google/api/resource.proto\"\xfc\x01\n\x0b\x43ustomClass\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0f\x63ustom_class_id\x18\x02 \x01(\t\x12<\n\x05items\x18\x03 \x03(\x0b\x32-.google.cloud.speech.v1.CustomClass.ClassItem\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \x01(\t:l\xea\x41i\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}\"\xf2\x01\n\tPhraseSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x07phrases\x18\x02 \x03(\x0b\x32(.google.cloud.speech.v1.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02:e\xea\x41\x62\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}\"\xbd\x02\n\x10SpeechAdaptation\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v1.PhraseSet\x12\x43\n\x15phrase_set_references\x18\x02 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12;\n\x0e\x63ustom_classes\x18\x03 \x03(\x0b\x32#.google.cloud.speech.v1.CustomClass\x12J\n\x0c\x61\x62nf_grammar\x18\x04 \x01(\x0b\x32\x34.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar\x1a#\n\x0b\x41\x42NFGrammar\x12\x14\n\x0c\x61\x62nf_strings\x18\x01 \x03(\t\"\xa3\x01\n\x17TranscriptNormalization\x12\x46\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x35.google.cloud.speech.v1.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\x42p\n\x1a\x63om.google.cloud.speech.v1B\x13SpeechResourceProtoP\x01Z2cloud.google.com/go/speech/apiv1/speechpb;speechpb\xf8\x01\x01\xa2\x02\x03GCSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Speech + module V1 + CustomClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CustomClass").msgclass + CustomClass::ClassItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CustomClass.ClassItem").msgclass + PhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.PhraseSet").msgclass + PhraseSet::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.PhraseSet.Phrase").msgclass + SpeechAdaptation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechAdaptation").msgclass + SpeechAdaptation::ABNFGrammar = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar").msgclass + TranscriptNormalization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.TranscriptNormalization").msgclass + TranscriptNormalization::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.TranscriptNormalization.Entry").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/rest.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/rest.rb new file mode 100644 index 000000000000..b039262b9bb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/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/speech/v1/speech/rest" +require "google/cloud/speech/v1/adaptation/rest" +require "google/cloud/speech/v1/version" + +module Google + module Cloud + module Speech + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/speech/v1/rest" + # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech.rb new file mode 100644 index 000000000000..b88111d1fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech.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/speech/v1/version" + +require "google/cloud/speech/v1/speech/credentials" +require "google/cloud/speech/v1/speech/paths" +require "google/cloud/speech/v1/speech/operations" +require "google/cloud/speech/v1/speech/client" +require "google/cloud/speech/v1/speech/rest" + +module Google + module Cloud + module Speech + module V1 + ## + # Service that implements Google Cloud Speech API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/speech/v1/speech" + # client = ::Google::Cloud::Speech::V1::Speech::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/speech/v1/speech/rest" + # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new + # + module Speech + end + end + end + end +end + +helper_path = ::File.join __dir__, "speech", "helpers.rb" +require "google/cloud/speech/v1/speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/client.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/client.rb new file mode 100644 index 000000000000..aa61e8e18391 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/client.rb @@ -0,0 +1,685 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v1/cloud_speech_pb" + +module Google + module Cloud + module Speech + module V1 + module Speech + ## + # Client for the Speech service. + # + # Service that implements Google Cloud Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :speech_stub + + ## + # Configure the Speech Client class. + # + # See {::Google::Cloud::Speech::V1::Speech::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Speech clients + # ::Google::Cloud::Speech::V1::Speech::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Speech", "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.recognize.timeout = 5000.0 + default_config.rpcs.recognize.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.long_running_recognize.timeout = 5000.0 + + default_config.rpcs.streaming_recognize.timeout = 5000.0 + default_config.rpcs.streaming_recognize.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 Speech Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V1::Speech::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @speech_stub.universe_domain + end + + ## + # Create a new Speech client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V1::Speech::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Speech 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/speech/v1/cloud_speech_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 + + @speech_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Speech::V1::Speech::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 + ) + + @speech_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::Speech::V1::Speech::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @speech_stub.logger + end + + # Service calls + + ## + # Performs synchronous speech recognition: receive results after all audio + # has been sent and processed. + # + # @overload recognize(request, options = nil) + # Pass arguments to `recognize` via a request object, either of type + # {::Google::Cloud::Speech::V1::RecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::RecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload recognize(config: nil, audio: nil) + # Pass arguments to `recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash] + # Required. The audio data to be recognized. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1::RecognizeResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1::RecognizeResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::RecognizeRequest.new + # + # # Call the recognize method. + # result = client.recognize request + # + # # The returned object is of type Google::Cloud::Speech::V1::RecognizeResponse. + # p result + # + def recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::RecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::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.recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :recognize, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs asynchronous speech recognition: receive results via the + # google.longrunning.Operations interface. Returns either an + # `Operation.error` or an `Operation.response` which contains + # a `LongRunningRecognizeResponse` message. + # For more information on asynchronous speech recognition, see the + # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + # + # @overload long_running_recognize(request, options = nil) + # Pass arguments to `long_running_recognize` via a request object, either of type + # {::Google::Cloud::Speech::V1::LongRunningRecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::LongRunningRecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload long_running_recognize(config: nil, audio: nil, output_config: nil) + # Pass arguments to `long_running_recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash] + # Required. The audio data to be recognized. + # @param output_config [::Google::Cloud::Speech::V1::TranscriptOutputConfig, ::Hash] + # Optional. Specifies an optional destination for the recognition results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new + # + # # Call the long_running_recognize method. + # result = client.long_running_recognize request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def long_running_recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.long_running_recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::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.long_running_recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.long_running_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :long_running_recognize, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs bidirectional streaming speech recognition: receive results while + # sending audio. This method is only available via the gRPC API (not REST). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Speech::V1::StreamingRecognizeRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Speech::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_recognize method to start streaming. + # output = client.streaming_recognize input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new + # input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Speech::V1::StreamingRecognizeResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_recognize request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V1::StreamingRecognizeRequest + end + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.streaming_recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::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.streaming_recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :streaming_recognize, request, 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 Speech API. + # + # This class represents the configuration for Speech, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V1::Speech::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # recognize to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V1::Speech::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.recognize.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.recognize.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Speech::V1::Speech::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Speech API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :recognize + ## + # RPC-specific configuration for `long_running_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :long_running_recognize + ## + # RPC-specific configuration for `streaming_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_recognize + + # @private + def initialize parent_rpcs = nil + recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize + @recognize = ::Gapic::Config::Method.new recognize_config + long_running_recognize_config = parent_rpcs.long_running_recognize if parent_rpcs.respond_to? :long_running_recognize + @long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config + streaming_recognize_config = parent_rpcs.streaming_recognize if parent_rpcs.respond_to? :streaming_recognize + @streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/credentials.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/credentials.rb new file mode 100644 index 000000000000..b98a12db51ab --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/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 Speech + module V1 + module Speech + # Credentials for the Speech API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SPEECH_CREDENTIALS", + "SPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPEECH_CREDENTIALS_JSON", + "SPEECH_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-speech-v1/lib/google/cloud/speech/v1/speech/operations.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/operations.rb new file mode 100644 index 000000000000..430b79286138 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/operations.rb @@ -0,0 +1,833 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 Speech + module V1 + module Speech + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Speech 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 Speech 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::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_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::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Speech::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::Speech::V1::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 = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-speech-v1/lib/google/cloud/speech/v1/speech/paths.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/paths.rb new file mode 100644 index 000000000000..ae06954b3904 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Speech + module V1 + module Speech + # Path helper methods for the Speech API. + module Paths + ## + # Create a fully-qualified CustomClass resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # @param project [String] + # @param location [String] + # @param custom_class [String] + # + # @return [::String] + def custom_class_path project:, location:, custom_class: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" + end + + ## + # Create a fully-qualified PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest.rb new file mode 100644 index 000000000000..bf0e8c48b909 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/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/speech/v1/version" + +require "google/cloud/speech/v1/speech/credentials" +require "google/cloud/speech/v1/speech/paths" +require "google/cloud/speech/v1/speech/rest/operations" +require "google/cloud/speech/v1/speech/rest/client" + +module Google + module Cloud + module Speech + module V1 + ## + # Service that implements Google Cloud Speech API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/speech/v1/speech/rest" + # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new + # + module Speech + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/speech/v1/speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/client.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/client.rb new file mode 100644 index 000000000000..f60b595eeb4b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/client.rb @@ -0,0 +1,553 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v1/cloud_speech_pb" +require "google/cloud/speech/v1/speech/rest/service_stub" + +module Google + module Cloud + module Speech + module V1 + module Speech + module Rest + ## + # REST client for the Speech service. + # + # Service that implements Google Cloud Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :speech_stub + + ## + # Configure the Speech Client class. + # + # See {::Google::Cloud::Speech::V1::Speech::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Speech clients + # ::Google::Cloud::Speech::V1::Speech::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", "Speech", "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.recognize.timeout = 5000.0 + default_config.rpcs.recognize.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.long_running_recognize.timeout = 5000.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Speech Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V1::Speech::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 + @speech_stub.universe_domain + end + + ## + # Create a new Speech REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Speech 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::Speech::V1::Speech::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 + + @speech_stub = ::Google::Cloud::Speech::V1::Speech::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @speech_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::Speech::V1::Speech::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @speech_stub.logger + end + + # Service calls + + ## + # Performs synchronous speech recognition: receive results after all audio + # has been sent and processed. + # + # @overload recognize(request, options = nil) + # Pass arguments to `recognize` via a request object, either of type + # {::Google::Cloud::Speech::V1::RecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::RecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload recognize(config: nil, audio: nil) + # Pass arguments to `recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash] + # Required. The audio data to be recognized. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::RecognizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::RecognizeResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::RecognizeRequest.new + # + # # Call the recognize method. + # result = client.recognize request + # + # # The returned object is of type Google::Cloud::Speech::V1::RecognizeResponse. + # p result + # + def recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::RecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.recognize.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.recognize request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs asynchronous speech recognition: receive results via the + # google.longrunning.Operations interface. Returns either an + # `Operation.error` or an `Operation.response` which contains + # a `LongRunningRecognizeResponse` message. + # For more information on asynchronous speech recognition, see the + # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + # + # @overload long_running_recognize(request, options = nil) + # Pass arguments to `long_running_recognize` via a request object, either of type + # {::Google::Cloud::Speech::V1::LongRunningRecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1::LongRunningRecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload long_running_recognize(config: nil, audio: nil, output_config: nil) + # Pass arguments to `long_running_recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash] + # Required. The audio data to be recognized. + # @param output_config [::Google::Cloud::Speech::V1::TranscriptOutputConfig, ::Hash] + # Optional. Specifies an optional destination for the recognition results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new + # + # # Call the long_running_recognize method. + # result = client.long_running_recognize request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def long_running_recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.long_running_recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.long_running_recognize.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.long_running_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.long_running_recognize request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 Speech REST API. + # + # This class represents the configuration for Speech REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V1::Speech::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # recognize to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V1::Speech::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.recognize.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.recognize.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Speech API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :recognize + ## + # RPC-specific configuration for `long_running_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :long_running_recognize + + # @private + def initialize parent_rpcs = nil + recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize + @recognize = ::Gapic::Config::Method.new recognize_config + long_running_recognize_config = parent_rpcs.long_running_recognize if parent_rpcs.respond_to? :long_running_recognize + @long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/operations.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/operations.rb new file mode 100644 index 000000000000..24ff8022221f --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/operations.rb @@ -0,0 +1,923 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Speech + module V1 + module Speech + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Speech 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 Speech 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::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_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/operations", + matches: [] + ) + 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/operations/{name}", + matches: [ + ["name", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb new file mode 100644 index 000000000000..6394ec823985 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/speech/v1/cloud_speech_pb" + +module Google + module Cloud + module Speech + module V1 + module Speech + module Rest + ## + # REST service stub for the Speech 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 recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::RecognizeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1::RecognizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1::RecognizeResponse] + # A result object deserialized from the server's reply + def recognize request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_recognize_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "recognize", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1::RecognizeResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the long_running_recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::LongRunningRecognizeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def long_running_recognize request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_long_running_recognize_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "long_running_recognize", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::RecognizeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_recognize_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/speech:recognize", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the long_running_recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V1::LongRunningRecognizeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_long_running_recognize_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/speech:longrunningrecognize", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/version.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/version.rb new file mode 100644 index 000000000000..1a5ee1f9dace --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/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 Speech + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-speech-v1/proto_docs/README.md new file mode 100644 index 000000000000..9ab7063008bf --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Speech-to-Text 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-speech-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech.rb new file mode 100644 index 000000000000..c7a315d42f57 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech.rb @@ -0,0 +1,1003 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Speech + module V1 + # The top-level message sent by the client for the `Recognize` method. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V1::RecognitionConfig] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @!attribute [rw] audio + # @return [::Google::Cloud::Speech::V1::RecognitionAudio] + # Required. The audio data to be recognized. + class RecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message sent by the client for the `LongRunningRecognize` + # method. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V1::RecognitionConfig] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @!attribute [rw] audio + # @return [::Google::Cloud::Speech::V1::RecognitionAudio] + # Required. The audio data to be recognized. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Speech::V1::TranscriptOutputConfig] + # Optional. Specifies an optional destination for the recognition results. + class LongRunningRecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies an optional destination for the recognition results. + # @!attribute [rw] gcs_uri + # @return [::String] + # Specifies a Cloud Storage URI for the recognition results. Must be + # specified in the format: `gs://bucket_name/object_name`, and the bucket + # must already exist. + class TranscriptOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message sent by the client for the `StreamingRecognize` method. + # Multiple `StreamingRecognizeRequest` messages are sent. The first message + # must contain a `streaming_config` message and must not contain + # `audio_content`. All subsequent messages must contain `audio_content` and + # must not contain a `streaming_config` message. + # @!attribute [rw] streaming_config + # @return [::Google::Cloud::Speech::V1::StreamingRecognitionConfig] + # Provides information to the recognizer that specifies how to process the + # request. The first `StreamingRecognizeRequest` message must contain a + # `streaming_config` message. + # + # Note: The following fields are mutually exclusive: `streaming_config`, `audio_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] audio_content + # @return [::String] + # The audio data to be recognized. Sequential chunks of audio data are sent + # in sequential `StreamingRecognizeRequest` messages. The first + # `StreamingRecognizeRequest` message must not contain `audio_content` data + # and all subsequent `StreamingRecognizeRequest` messages must contain + # `audio_content` data. The audio bytes must be encoded as specified in + # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + # pure binary representation (not base64). See + # [content limits](https://cloud.google.com/speech-to-text/quotas#content). + # + # Note: The following fields are mutually exclusive: `audio_content`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class StreamingRecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides information to the recognizer that specifies how to process the + # request. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V1::RecognitionConfig] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @!attribute [rw] single_utterance + # @return [::Boolean] + # If `false` or omitted, the recognizer will perform continuous + # recognition (continuing to wait for and process audio even if the user + # pauses speaking) until the client closes the input stream (gRPC API) or + # until the maximum time limit has been reached. May return multiple + # `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + # + # If `true`, the recognizer will detect a single spoken utterance. When it + # detects that the user has paused or stopped speaking, it will return an + # `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + # more than one `StreamingRecognitionResult` with the `is_final` flag set to + # `true`. + # + # The `single_utterance` field can only be used with specified models, + # otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + # must be set to: + # + # * `command_and_search` + # * `phone_call` AND additional field `useEnhanced`=`true` + # * The `model` field is left undefined. In this case the API auto-selects + # a model based on any other parameters that you set in + # `RecognitionConfig`. + # @!attribute [rw] interim_results + # @return [::Boolean] + # If `true`, interim results (tentative hypotheses) may be + # returned as they become available (these interim results are indicated with + # the `is_final=false` flag). + # If `false` or omitted, only `is_final=true` result(s) are returned. + # @!attribute [rw] enable_voice_activity_events + # @return [::Boolean] + # If `true`, responses with voice activity speech events will be returned as + # they are detected. + # @!attribute [rw] voice_activity_timeout + # @return [::Google::Cloud::Speech::V1::StreamingRecognitionConfig::VoiceActivityTimeout] + # If set, the server will automatically close the stream after the specified + # duration has elapsed after the last VOICE_ACTIVITY speech event has been + # sent. The field `voice_activity_events` must also be set to true. + class StreamingRecognitionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Events that a timeout can be set on for voice activity. + # @!attribute [rw] speech_start_timeout + # @return [::Google::Protobuf::Duration] + # Duration to timeout the stream if no speech begins. + # @!attribute [rw] speech_end_timeout + # @return [::Google::Protobuf::Duration] + # Duration to timeout the stream after speech ends. + class VoiceActivityTimeout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Provides information to the recognizer that specifies how to process the + # request. + # @!attribute [rw] encoding + # @return [::Google::Cloud::Speech::V1::RecognitionConfig::AudioEncoding] + # Encoding of audio data sent in all `RecognitionAudio` messages. + # This field is optional for `FLAC` and `WAV` audio files and required + # for all other audio formats. For details, see + # {::Google::Cloud::Speech::V1::RecognitionConfig::AudioEncoding AudioEncoding}. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Sample rate in Hertz of the audio data sent in all + # `RecognitionAudio` messages. Valid values are: 8000-48000. + # 16000 is optimal. For best results, set the sampling rate of the audio + # source to 16000 Hz. If that's not possible, use the native sample rate of + # the audio source (instead of re-sampling). + # This field is optional for FLAC and WAV audio files, but is + # required for all other audio formats. For details, see + # {::Google::Cloud::Speech::V1::RecognitionConfig::AudioEncoding AudioEncoding}. + # @!attribute [rw] audio_channel_count + # @return [::Integer] + # The number of channels in the input audio data. + # ONLY set this for MULTI-CHANNEL recognition. + # Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. + # Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. + # If `0` or omitted, defaults to one channel (mono). + # Note: We only recognize the first channel by default. + # To perform independent recognition on each channel set + # `enable_separate_recognition_per_channel` to 'true'. + # @!attribute [rw] enable_separate_recognition_per_channel + # @return [::Boolean] + # This needs to be set to `true` explicitly and `audio_channel_count` > 1 + # to get each channel recognized separately. The recognition result will + # contain a `channel_tag` field to state which channel that result belongs + # to. If this is not true, we will only recognize the first channel. The + # request is billed cumulatively for all channels recognized: + # `audio_channel_count` multiplied by the length of the audio. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language of the supplied audio as a + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # Example: "en-US". + # See [Language + # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + # of the currently supported language codes. + # @!attribute [rw] alternative_language_codes + # @return [::Array<::String>] + # A list of up to 3 additional + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, + # listing possible alternative languages of the supplied audio. + # See [Language + # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + # of the currently supported language codes. If alternative languages are + # listed, recognition result will contain recognition in the most likely + # language detected including the main language_code. The recognition result + # will include the language tag of the language detected in the audio. Note: + # This feature is only supported for Voice Command and Voice Search use cases + # and performance may vary for other use cases (e.g., phone call + # transcription). + # @!attribute [rw] max_alternatives + # @return [::Integer] + # Maximum number of recognition hypotheses to be returned. + # Specifically, the maximum number of `SpeechRecognitionAlternative` messages + # within each `SpeechRecognitionResult`. + # The server may return fewer than `max_alternatives`. + # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + # one. If omitted, will return a maximum of one. + # @!attribute [rw] profanity_filter + # @return [::Boolean] + # If set to `true`, the server will attempt to filter out + # profanities, replacing all but the initial character in each filtered word + # with asterisks, e.g. "f***". If set to `false` or omitted, profanities + # won't be filtered out. + # @!attribute [rw] adaptation + # @return [::Google::Cloud::Speech::V1::SpeechAdaptation] + # Speech adaptation configuration improves the accuracy of speech + # recognition. For more information, see the [speech + # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) + # documentation. + # When speech adaptation is set it supersedes the `speech_contexts` field. + # @!attribute [rw] transcript_normalization + # @return [::Google::Cloud::Speech::V1::TranscriptNormalization] + # Optional. Use transcription normalization to automatically replace parts of + # the transcript with phrases of your choosing. For StreamingRecognize, this + # normalization only applies to stable partial transcripts (stability > 0.8) + # and final transcripts. + # @!attribute [rw] speech_contexts + # @return [::Array<::Google::Cloud::Speech::V1::SpeechContext>] + # Array of {::Google::Cloud::Speech::V1::SpeechContext SpeechContext}. + # A means to provide context to assist the speech recognition. For more + # information, see + # [speech + # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). + # @!attribute [rw] enable_word_time_offsets + # @return [::Boolean] + # If `true`, the top result includes a list of words and + # the start and end time offsets (timestamps) for those words. If + # `false`, no word-level time offset information is returned. The default is + # `false`. + # @!attribute [rw] enable_word_confidence + # @return [::Boolean] + # If `true`, the top result includes a list of words and the + # confidence for those words. If `false`, no word-level confidence + # information is returned. The default is `false`. + # @!attribute [rw] enable_automatic_punctuation + # @return [::Boolean] + # If 'true', adds punctuation to recognition result hypotheses. + # This feature is only available in select languages. Setting this for + # requests in other languages has no effect at all. + # The default 'false' value does not add punctuation to result hypotheses. + # @!attribute [rw] enable_spoken_punctuation + # @return [::Google::Protobuf::BoolValue] + # The spoken punctuation behavior for the call + # If not set, uses default behavior based on model of choice + # e.g. command_and_search will enable spoken punctuation by default + # If 'true', replaces spoken punctuation with the corresponding symbols in + # the request. For example, "how are you question mark" becomes "how are + # you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation + # for support. If 'false', spoken punctuation is not replaced. + # @!attribute [rw] enable_spoken_emojis + # @return [::Google::Protobuf::BoolValue] + # The spoken emoji behavior for the call + # If not set, uses default behavior based on model of choice + # If 'true', adds spoken emoji formatting for the request. This will replace + # spoken emojis with the corresponding Unicode symbols in the final + # transcript. If 'false', spoken emojis are not replaced. + # @!attribute [rw] diarization_config + # @return [::Google::Cloud::Speech::V1::SpeakerDiarizationConfig] + # Config to enable speaker diarization and set additional + # parameters to make diarization better suited for your application. + # Note: When this is enabled, we send all the words from the beginning of the + # audio for the top alternative in every consecutive STREAMING responses. + # This is done in order to improve our speaker tags as our models learn to + # identify the speakers in the conversation over time. + # For non-streaming requests, the diarization results will be provided only + # in the top alternative of the FINAL SpeechRecognitionResult. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V1::RecognitionMetadata] + # Metadata regarding this request. + # @!attribute [rw] model + # @return [::String] + # Which model to select for the given request. Select the model + # best suited to your domain to get best results. If a model is not + # explicitly specified, then we auto-select a model based on the parameters + # in the RecognitionConfig. + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + #
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed + # speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically + # recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple + # speakers. Ideally the audio is recorded at a 16khz or greater + # sampling rate. This is a premium model that costs more than the + # standard rate.
defaultBest for audio that is not one of the specific audio models. + # For example, long-form audio. Ideally the audio is high-fidelity, + # recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a + # medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical + # provider.
+ # @!attribute [rw] use_enhanced + # @return [::Boolean] + # Set to true to use an enhanced model for speech recognition. + # If `use_enhanced` is set to true and the `model` field is not set, then + # an appropriate enhanced model is chosen if an enhanced model exists for + # the audio. + # + # If `use_enhanced` is true and an enhanced version of the specified model + # does not exist, then the speech is recognized using the standard version + # of the specified model. + class RecognitionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The encoding of the audio data sent in the request. + # + # All encodings support only 1 channel (mono) audio, unless the + # `audio_channel_count` and `enable_separate_recognition_per_channel` fields + # are set. + # + # For best results, the audio source should be captured and transmitted using + # a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech + # recognition can be reduced if lossy codecs are used to capture or transmit + # audio, particularly if background noise is present. Lossy codecs include + # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, + # and `WEBM_OPUS`. + # + # The `FLAC` and `WAV` audio file formats include a header that describes the + # included audio content. You can request recognition for `WAV` files that + # contain either `LINEAR16` or `MULAW` encoded audio. + # If you send `FLAC` or `WAV` audio file format in + # your request, you do not need to specify an `AudioEncoding`; the audio + # encoding format is determined from the file header. If you specify + # an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the + # encoding configuration must match the encoding described in the audio + # header; otherwise the request returns an + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error + # code. + module AudioEncoding + # Not specified. + ENCODING_UNSPECIFIED = 0 + + # Uncompressed 16-bit signed little-endian samples (Linear PCM). + LINEAR16 = 1 + + # `FLAC` (Free Lossless Audio + # Codec) is the recommended encoding because it is + # lossless--therefore recognition is not compromised--and + # requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + # encoding supports 16-bit and 24-bit samples, however, not all fields in + # `STREAMINFO` are supported. + FLAC = 2 + + # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 3 + + # Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AMR = 4 + + # Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AMR_WB = 5 + + # Opus encoded audio frames in Ogg container + # ([OggOpus](https://wiki.xiph.org/OggOpus)). + # `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + OGG_OPUS = 6 + + # Although the use of lossy encodings is not recommended, if a very low + # bitrate encoding is required, `OGG_OPUS` is highly preferred over + # Speex encoding. The [Speex](https://speex.org/) encoding supported by + # Cloud Speech API has a header byte in each block, as in MIME type + # `audio/x-speex-with-header-byte`. + # It is a variant of the RTP Speex encoding defined in + # [RFC 5574](https://tools.ietf.org/html/rfc5574). + # The stream is a sequence of blocks, one block per RTP packet. Each block + # starts with a byte containing the length of the block, in bytes, followed + # by one or more frames of Speex data, padded to an integral number of + # bytes (octets) as specified in RFC 5574. In other words, each RTP header + # is replaced with a single byte containing the block length. Only Speex + # wideband is supported. `sample_rate_hertz` must be 16000. + SPEEX_WITH_HEADER_BYTE = 7 + + # MP3 audio. MP3 encoding is a Beta feature and only available in + # v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 + # kbps). When using this encoding, `sample_rate_hertz` has to match the + # sample rate of the file being used. + MP3 = 8 + + # Opus encoded audio frames in WebM container + # ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be + # one of 8000, 12000, 16000, 24000, or 48000. + WEBM_OPUS = 9 + end + end + + # Config to enable speaker diarization. + # @!attribute [rw] enable_speaker_diarization + # @return [::Boolean] + # If 'true', enables speaker detection for each recognized word in + # the top alternative of the recognition result using a speaker_label + # provided in the WordInfo. + # @!attribute [rw] min_speaker_count + # @return [::Integer] + # Minimum number of speakers in the conversation. This range gives you more + # flexibility by allowing the system to automatically determine the correct + # number of speakers. If not set, the default value is 2. + # @!attribute [rw] max_speaker_count + # @return [::Integer] + # Maximum number of speakers in the conversation. This range gives you more + # flexibility by allowing the system to automatically determine the correct + # number of speakers. If not set, the default value is 6. + # @!attribute [r] speaker_tag + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Output only. Unused. + class SpeakerDiarizationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of audio data to be recognized. + # @deprecated This message is deprecated and may be removed in the next major version update. + # @!attribute [rw] interaction_type + # @return [::Google::Cloud::Speech::V1::RecognitionMetadata::InteractionType] + # The use case most closely describing the audio content to be recognized. + # @!attribute [rw] industry_naics_code_of_audio + # @return [::Integer] + # The industry vertical to which this speech recognition request most + # closely applies. This is most indicative of the topics contained + # in the audio. Use the 6-digit NAICS code to identify the industry + # vertical - see https://www.naics.com/search/. + # @!attribute [rw] microphone_distance + # @return [::Google::Cloud::Speech::V1::RecognitionMetadata::MicrophoneDistance] + # The audio type that most closely describes the audio being recognized. + # @!attribute [rw] original_media_type + # @return [::Google::Cloud::Speech::V1::RecognitionMetadata::OriginalMediaType] + # The original media the speech was recorded on. + # @!attribute [rw] recording_device_type + # @return [::Google::Cloud::Speech::V1::RecognitionMetadata::RecordingDeviceType] + # The type of device the speech was recorded with. + # @!attribute [rw] recording_device_name + # @return [::String] + # The device used to make the recording. Examples 'Nexus 5X' or + # 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + # 'Cardioid Microphone'. + # @!attribute [rw] original_mime_type + # @return [::String] + # Mime type of the original audio file. For example `audio/m4a`, + # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + # A list of possible audio mime types is maintained at + # http://www.iana.org/assignments/media-types/media-types.xhtml#audio + # @!attribute [rw] audio_topic + # @return [::String] + # Description of the content. Eg. "Recordings of federal supreme court + # hearings from 2012". + class RecognitionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Use case categories that the audio recognition request can be described + # by. + module InteractionType + # Use case is either unknown or is something other than one of the other + # values below. + INTERACTION_TYPE_UNSPECIFIED = 0 + + # Multiple people in a conversation or discussion. For example in a + # meeting with two or more people actively participating. Typically + # all the primary people speaking would be in the same room (if not, + # see PHONE_CALL) + DISCUSSION = 1 + + # One or more persons lecturing or presenting to others, mostly + # uninterrupted. + PRESENTATION = 2 + + # A phone-call or video-conference in which two or more people, who are + # not in the same room, are actively participating. + PHONE_CALL = 3 + + # A recorded message intended for another person to listen to. + VOICEMAIL = 4 + + # Professionally produced audio (eg. TV Show, Podcast). + PROFESSIONALLY_PRODUCED = 5 + + # Transcribe spoken questions and queries into text. + VOICE_SEARCH = 6 + + # Transcribe voice commands, such as for controlling a device. + VOICE_COMMAND = 7 + + # Transcribe speech to text to create a written document, such as a + # text-message, email or report. + DICTATION = 8 + end + + # Enumerates the types of capture settings describing an audio file. + module MicrophoneDistance + # Audio type is not known. + MICROPHONE_DISTANCE_UNSPECIFIED = 0 + + # The audio was captured from a closely placed microphone. Eg. phone, + # dictaphone, or handheld microphone. Generally if there speaker is within + # 1 meter of the microphone. + NEARFIELD = 1 + + # The speaker if within 3 meters of the microphone. + MIDFIELD = 2 + + # The speaker is more than 3 meters away from the microphone. + FARFIELD = 3 + end + + # The original media the speech was recorded on. + module OriginalMediaType + # Unknown original media type. + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0 + + # The speech data is an audio recording. + AUDIO = 1 + + # The speech data originally recorded on a video. + VIDEO = 2 + end + + # The type of device the speech was recorded with. + module RecordingDeviceType + # The recording device is unknown. + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0 + + # Speech was recorded on a smartphone. + SMARTPHONE = 1 + + # Speech was recorded using a personal computer or tablet. + PC = 2 + + # Speech was recorded over a phone line. + PHONE_LINE = 3 + + # Speech was recorded in a vehicle. + VEHICLE = 4 + + # Speech was recorded outdoors. + OTHER_OUTDOOR_DEVICE = 5 + + # Speech was recorded indoors. + OTHER_INDOOR_DEVICE = 6 + end + end + + # Provides "hints" to the speech recognizer to favor specific words and phrases + # in the results. + # @!attribute [rw] phrases + # @return [::Array<::String>] + # A list of strings containing words and phrases "hints" so that + # the speech recognition is more likely to recognize them. This can be used + # to improve the accuracy for specific words and phrases, for example, if + # specific commands are typically spoken by the user. This can also be used + # to add additional words to the vocabulary of the recognizer. See + # [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + # + # List items can also be set to classes for groups of words that represent + # common concepts that occur in natural language. For example, rather than + # providing phrase hints for every month of the year, using the $MONTH class + # improves the likelihood of correctly transcribing audio that includes + # months. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Positive value will increase the probability that a specific + # phrase will be recognized over other similar sounding phrases. The higher + # the boost, the higher the chance of false positive recognition as well. + # Negative boost values would correspond to anti-biasing. Anti-biasing is not + # enabled, so negative boost will simply be ignored. Though `boost` can + # accept a wide range of positive values, most use cases are best served with + # values between 0 and 20. We recommend using a binary search approach to + # finding the optimal value for your use case. + class SpeechContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains audio data in the encoding specified in the `RecognitionConfig`. + # Either `content` or `uri` must be supplied. Supplying both or neither + # returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + # See [content limits](https://cloud.google.com/speech-to-text/quotas#content). + # @!attribute [rw] content + # @return [::String] + # The audio data bytes encoded as specified in + # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + # pure binary representation, whereas JSON representations use base64. + # + # Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uri + # @return [::String] + # URI that points to a file that contains audio data bytes as specified in + # `RecognitionConfig`. The file must not be compressed (for example, gzip). + # Currently, only Google Cloud Storage URIs are + # supported, which must be specified in the following format: + # `gs://bucket_name/object_name` (other URI formats return + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). + # For more information, see [Request + # URIs](https://cloud.google.com/storage/docs/reference-uris). + # + # Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class RecognitionAudio + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The only message returned to the client by the `Recognize` method. It + # contains the result as zero or more sequential `SpeechRecognitionResult` + # messages. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionResult>] + # Sequential list of transcription results corresponding to + # sequential portions of audio. + # @!attribute [rw] total_billed_time + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the corresponding request. + # @!attribute [rw] speech_adaptation_info + # @return [::Google::Cloud::Speech::V1::SpeechAdaptationInfo] + # Provides information on adaptation behavior in response + # @!attribute [rw] request_id + # @return [::Integer] + # The ID associated with the request. This is a unique ID specific only to + # the given request. + class RecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The only message returned to the client by the `LongRunningRecognize` method. + # It contains the result as zero or more sequential `SpeechRecognitionResult` + # messages. It is included in the `result.response` field of the `Operation` + # returned by the `GetOperation` call of the `google::longrunning::Operations` + # service. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionResult>] + # Sequential list of transcription results corresponding to + # sequential portions of audio. + # @!attribute [rw] total_billed_time + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the corresponding request. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Speech::V1::TranscriptOutputConfig] + # Original output config if present in the request. + # @!attribute [rw] output_error + # @return [::Google::Rpc::Status] + # If the transcript output fails this field contains the relevant error. + # @!attribute [rw] speech_adaptation_info + # @return [::Google::Cloud::Speech::V1::SpeechAdaptationInfo] + # Provides information on speech adaptation behavior in response + # @!attribute [rw] request_id + # @return [::Integer] + # The ID associated with the request. This is a unique ID specific only to + # the given request. + class LongRunningRecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the progress of a long-running `LongRunningRecognize` call. It is + # included in the `metadata` field of the `Operation` returned by the + # `GetOperation` call of the `google::longrunning::Operations` service. + # @!attribute [rw] progress_percent + # @return [::Integer] + # Approximate percentage of audio processed thus far. Guaranteed to be 100 + # when the audio is fully processed and the results are available. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Time when the request was received. + # @!attribute [rw] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Time of the most recent processing update. + # @!attribute [r] uri + # @return [::String] + # Output only. The URI of the audio file being transcribed. Empty if the + # audio was sent as byte content. + class LongRunningRecognizeMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `StreamingRecognizeResponse` is the only message returned to the client by + # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` + # messages are streamed back to the client. If there is no recognizable + # audio, and `single_utterance` is set to false, then no messages are streamed + # back to the client. + # + # Here's an example of a series of `StreamingRecognizeResponse`s that might be + # returned while processing audio: + # + # 1. results { alternatives { transcript: "tube" } stability: 0.01 } + # + # 2. results { alternatives { transcript: "to be a" } stability: 0.01 } + # + # 3. results { alternatives { transcript: "to be" } stability: 0.9 } + # results { alternatives { transcript: " or not to be" } stability: 0.01 } + # + # 4. results { alternatives { transcript: "to be or not to be" + # confidence: 0.92 } + # alternatives { transcript: "to bee or not to bee" } + # is_final: true } + # + # 5. results { alternatives { transcript: " that's" } stability: 0.01 } + # + # 6. results { alternatives { transcript: " that is" } stability: 0.9 } + # results { alternatives { transcript: " the question" } stability: 0.01 } + # + # 7. results { alternatives { transcript: " that is the question" + # confidence: 0.98 } + # alternatives { transcript: " that was the question" } + # is_final: true } + # + # Notes: + # + # - Only two of the above responses #4 and #7 contain final results; they are + # indicated by `is_final: true`. Concatenating these together generates the + # full transcript: "to be or not to be that is the question". + # + # - The others contain interim `results`. #3 and #6 contain two interim + # `results`: the first portion has a high stability and is less likely to + # change; the second portion has a low stability and is very likely to + # change. A UI designer might choose to show only high stability `results`. + # + # - The specific `stability` and `confidence` values shown above are only for + # illustrative purposes. Actual values may vary. + # + # - In each response, only one of these fields will be set: + # `error`, + # `speech_event_type`, or + # one or more (repeated) `results`. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # If set, returns a {::Google::Rpc::Status google.rpc.Status} message that + # specifies the error for the operation. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V1::StreamingRecognitionResult>] + # This repeated list contains zero or more results that + # correspond to consecutive portions of the audio currently being processed. + # It contains zero or one `is_final=true` result (the newly settled portion), + # followed by zero or more `is_final=false` results (the interim results). + # @!attribute [rw] speech_event_type + # @return [::Google::Cloud::Speech::V1::StreamingRecognizeResponse::SpeechEventType] + # Indicates the type of speech event. + # @!attribute [rw] speech_event_time + # @return [::Google::Protobuf::Duration] + # Time offset between the beginning of the audio and event emission. + # @!attribute [rw] total_billed_time + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the stream. + # Set only if this is the last response in the stream. + # @!attribute [rw] speech_adaptation_info + # @return [::Google::Cloud::Speech::V1::SpeechAdaptationInfo] + # Provides information on adaptation behavior in response + # @!attribute [rw] request_id + # @return [::Integer] + # The ID associated with the request. This is a unique ID specific only to + # the given request. + class StreamingRecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the type of speech event. + module SpeechEventType + # No speech event specified. + SPEECH_EVENT_UNSPECIFIED = 0 + + # This event indicates that the server has detected the end of the user's + # speech utterance and expects no additional speech. Therefore, the server + # will not process additional audio (although it may subsequently return + # additional results). The client should stop sending additional audio + # data, half-close the gRPC connection, and wait for any additional results + # until the server closes the gRPC connection. This event is only sent if + # `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 1 + + # This event indicates that the server has detected the beginning of human + # voice activity in the stream. This event can be returned multiple times + # if speech starts and stops repeatedly throughout the stream. This event + # is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2 + + # This event indicates that the server has detected the end of human voice + # activity in the stream. This event can be returned multiple times if + # speech starts and stops repeatedly throughout the stream. This event is + # only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3 + + # This event indicates that the user-set timeout for speech activity begin + # or end has exceeded. Upon receiving this event, the client is expected to + # send a half close. Further audio will not be processed. + SPEECH_ACTIVITY_TIMEOUT = 4 + end + end + + # A streaming speech recognition result corresponding to a portion of the audio + # that is currently being processed. + # @!attribute [rw] alternatives + # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionAlternative>] + # May contain one or more recognition hypotheses (up to the + # maximum specified in `max_alternatives`). + # These alternatives are ordered in terms of accuracy, with the top (first) + # alternative being the most probable, as ranked by the recognizer. + # @!attribute [rw] is_final + # @return [::Boolean] + # If `false`, this `StreamingRecognitionResult` represents an + # interim result that may change. If `true`, this is the final time the + # speech service will return this particular `StreamingRecognitionResult`, + # the recognizer will not return any further hypotheses for this portion of + # the transcript and corresponding audio. + # @!attribute [rw] stability + # @return [::Float] + # An estimate of the likelihood that the recognizer will not + # change its guess about this interim result. Values range from 0.0 + # (completely unstable) to 1.0 (completely stable). + # This field is only provided for interim results (`is_final=false`). + # The default of 0.0 is a sentinel value indicating `stability` was not set. + # @!attribute [rw] result_end_time + # @return [::Google::Protobuf::Duration] + # Time offset of the end of this result relative to the + # beginning of the audio. + # @!attribute [rw] channel_tag + # @return [::Integer] + # For multi-channel audio, this is the channel number corresponding to the + # recognized result for the audio from that channel. + # For audio_channel_count = N, its output values can range from '1' to 'N'. + # @!attribute [r] language_code + # @return [::String] + # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag of the language in this result. This language code was + # detected to have the most likelihood of being spoken in the audio. + class StreamingRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A speech recognition result corresponding to a portion of the audio. + # @!attribute [rw] alternatives + # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionAlternative>] + # May contain one or more recognition hypotheses (up to the + # maximum specified in `max_alternatives`). + # These alternatives are ordered in terms of accuracy, with the top (first) + # alternative being the most probable, as ranked by the recognizer. + # @!attribute [rw] channel_tag + # @return [::Integer] + # For multi-channel audio, this is the channel number corresponding to the + # recognized result for the audio from that channel. + # For audio_channel_count = N, its output values can range from '1' to 'N'. + # @!attribute [rw] result_end_time + # @return [::Google::Protobuf::Duration] + # Time offset of the end of this result relative to the + # beginning of the audio. + # @!attribute [r] language_code + # @return [::String] + # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag of the language in this result. This language code was + # detected to have the most likelihood of being spoken in the audio. + class SpeechRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Alternative hypotheses (a.k.a. n-best list). + # @!attribute [rw] transcript + # @return [::String] + # Transcript text representing the words that the user spoke. + # In languages that use spaces to separate words, the transcript might have a + # leading space if it isn't the first result. You can concatenate each result + # to obtain the full transcript without using a separator. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence estimate between 0.0 and 1.0. A higher number + # indicates an estimated greater likelihood that the recognized words are + # correct. This field is set only for the top alternative of a non-streaming + # result or, of a streaming result where `is_final=true`. + # This field is not guaranteed to be accurate and users should not rely on it + # to be always provided. + # The default of 0.0 is a sentinel value indicating `confidence` was not set. + # @!attribute [rw] words + # @return [::Array<::Google::Cloud::Speech::V1::WordInfo>] + # A list of word-specific information for each recognized word. + # Note: When `enable_speaker_diarization` is true, you will see all the words + # from the beginning of the audio. + class SpeechRecognitionAlternative + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Word-specific information for recognized words. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio, + # and corresponding to the start of the spoken word. + # This field is only set if `enable_word_time_offsets=true` and only + # in the top hypothesis. + # This is an experimental feature and the accuracy of the time offset can + # vary. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio, + # and corresponding to the end of the spoken word. + # This field is only set if `enable_word_time_offsets=true` and only + # in the top hypothesis. + # This is an experimental feature and the accuracy of the time offset can + # vary. + # @!attribute [rw] word + # @return [::String] + # The word corresponding to this set of information. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence estimate between 0.0 and 1.0. A higher number + # indicates an estimated greater likelihood that the recognized words are + # correct. This field is set only for the top alternative of a non-streaming + # result or, of a streaming result where `is_final=true`. + # This field is not guaranteed to be accurate and users should not rely on it + # to be always provided. + # The default of 0.0 is a sentinel value indicating `confidence` was not set. + # @!attribute [r] speaker_tag + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Output only. A distinct integer value is assigned for every speaker within + # the audio. This field specifies which one of those speakers was detected to + # have spoken this word. Value ranges from '1' to diarization_speaker_count. + # speaker_tag is set if enable_speaker_diarization = 'true' and only for the + # top alternative. + # Note: Use speaker_label instead. + # @!attribute [r] speaker_label + # @return [::String] + # Output only. A label value assigned for every unique speaker within the + # audio. This field specifies which speaker was detected to have spoken this + # word. For some models, like medical_conversation this can be actual speaker + # role, for example "patient" or "provider", but generally this would be a + # number identifying a speaker. This field is only set if + # enable_speaker_diarization = 'true' and only for the top alternative. + class WordInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information on speech adaptation use in results + # @!attribute [rw] adaptation_timeout + # @return [::Boolean] + # Whether there was a timeout when applying speech adaptation. If true, + # adaptation had no effect in the response transcript. + # @!attribute [rw] timeout_message + # @return [::String] + # If set, returns a message specifying which part of the speech adaptation + # request timed out. + class SpeechAdaptationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech_adaptation.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech_adaptation.rb new file mode 100644 index 000000000000..73416b556c1c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech_adaptation.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! + + +module Google + module Cloud + module Speech + module V1 + # Message sent by the client for the `CreatePhraseSet` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this phrase set will be created. + # Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] phrase_set_id + # @return [::String] + # Required. The ID to use for the phrase set, which will become the final + # component of the phrase set's resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @!attribute [rw] phrase_set + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # Required. The phrase set to create. + class CreatePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `UpdatePhraseSet` method. + # @!attribute [rw] phrase_set + # @return [::Google::Cloud::Speech::V1::PhraseSet] + # Required. The phrase set to update. + # + # The phrase set's `name` field is used to identify the set to be + # updated. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdatePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `GetPhraseSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the phrase set to retrieve. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + class GetPhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `ListPhraseSet` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of phrase set. Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of phrase sets to return. The service may return + # fewer than this value. If unspecified, at most 50 phrase sets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListPhraseSet` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPhraseSet` must + # match the call that provided the page token. + class ListPhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned to the client by the `ListPhraseSet` method. + # @!attribute [rw] phrase_sets + # @return [::Array<::Google::Cloud::Speech::V1::PhraseSet>] + # The phrase set. + # @!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 ListPhraseSetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `DeletePhraseSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the phrase set to delete. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + class DeletePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `CreateCustomClass` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this custom class will be created. + # Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] custom_class_id + # @return [::String] + # Required. The ID to use for the custom class, which will become the final + # component of the custom class' resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @!attribute [rw] custom_class + # @return [::Google::Cloud::Speech::V1::CustomClass] + # Required. The custom class to create. + class CreateCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `UpdateCustomClass` method. + # @!attribute [rw] custom_class + # @return [::Google::Cloud::Speech::V1::CustomClass] + # Required. The custom class to update. + # + # The custom class's `name` field is used to identify the custom class to be + # updated. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `GetCustomClass` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the custom class to retrieve. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + class GetCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `ListCustomClasses` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of custom classes. Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of custom classes to return. The service may return + # fewer than this value. If unspecified, at most 50 custom classes will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListCustomClass` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCustomClass` must + # match the call that provided the page token. + class ListCustomClassesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned to the client by the `ListCustomClasses` method. + # @!attribute [rw] custom_classes + # @return [::Array<::Google::Cloud::Speech::V1::CustomClass>] + # The custom classes. + # @!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 ListCustomClassesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `DeleteCustomClass` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the custom class to delete. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + class DeleteCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/resource.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/resource.rb new file mode 100644 index 000000000000..91ddc97572db --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/resource.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Speech + module V1 + # A set of words or phrases that represents a common concept likely to appear + # in your audio, for example a list of passenger ship names. CustomClass items + # can be substituted into placeholders that you set in PhraseSet phrases. + # @!attribute [rw] name + # @return [::String] + # The resource name of the custom class. + # @!attribute [rw] custom_class_id + # @return [::String] + # If this custom class is a resource, the custom_class_id is the resource id + # of the CustomClass. Case sensitive. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::Speech::V1::CustomClass::ClassItem>] + # A collection of class items. + class CustomClass + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An item of the class. + # @!attribute [rw] value + # @return [::String] + # The class item's value. + class ClassItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Provides "hints" to the speech recognizer to favor specific words and phrases + # in the results. + # @!attribute [rw] name + # @return [::String] + # The resource name of the phrase set. + # @!attribute [rw] phrases + # @return [::Array<::Google::Cloud::Speech::V1::PhraseSet::Phrase>] + # A list of word and phrases. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Positive value will increase the probability that a specific + # phrase will be recognized over other similar sounding phrases. The higher + # the boost, the higher the chance of false positive recognition as well. + # Negative boost values would correspond to anti-biasing. Anti-biasing is not + # enabled, so negative boost will simply be ignored. Though `boost` can + # accept a wide range of positive values, most use cases are best served with + # values between 0 (exclusive) and 20. We recommend using a binary search + # approach to finding the optimal value for your use case as well as adding + # phrases both with and without boost to your requests. + class PhraseSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A phrases containing words and phrase "hints" so that + # the speech recognition is more likely to recognize them. This can be used + # to improve the accuracy for specific words and phrases, for example, if + # specific commands are typically spoken by the user. This can also be used + # to add additional words to the vocabulary of the recognizer. See + # [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + # + # List items can also include pre-built or custom classes containing groups + # of words that represent common concepts that occur in natural language. For + # example, rather than providing a phrase hint for every month of the + # year (e.g. "i was born in january", "i was born in febuary", ...), use the + # pre-built `$MONTH` class improves the likelihood of correctly transcribing + # audio that includes months (e.g. "i was born in $month"). + # To refer to pre-built classes, use the class' symbol prepended with `$` + # e.g. `$MONTH`. To refer to custom classes that were defined inline in the + # request, set the class's `custom_class_id` to a string unique to all class + # resources and inline classes. Then use the class' id wrapped in $`{...}` + # e.g. "$\\{my-months}". To refer to custom classes resources, use the class' + # id wrapped in `${}` (e.g. `${my-months}`). + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] value + # @return [::String] + # The phrase itself. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Overrides the boost set at the phrase set level. + # Positive value will increase the probability that a specific phrase will + # be recognized over other similar sounding phrases. The higher the boost, + # the higher the chance of false positive recognition as well. Negative + # boost will simply be ignored. Though `boost` can accept a wide range of + # positive values, most use cases are best served + # with values between 0 and 20. We recommend using a binary search approach + # to finding the optimal value for your use case as well as adding + # phrases both with and without boost to your requests. + class Phrase + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Speech adaptation configuration. + # @!attribute [rw] phrase_sets + # @return [::Array<::Google::Cloud::Speech::V1::PhraseSet>] + # A collection of phrase sets. To specify the hints inline, leave the + # phrase set's `name` blank and fill in the rest of its fields. Any + # phrase set can use any custom class. + # @!attribute [rw] phrase_set_references + # @return [::Array<::String>] + # A collection of phrase set resource names to use. + # @!attribute [rw] custom_classes + # @return [::Array<::Google::Cloud::Speech::V1::CustomClass>] + # A collection of custom classes. To specify the classes inline, leave the + # class' `name` blank and fill in the rest of its fields, giving it a unique + # `custom_class_id`. Refer to the inline defined class in phrase hints by its + # `custom_class_id`. + # @!attribute [rw] abnf_grammar + # @return [::Google::Cloud::Speech::V1::SpeechAdaptation::ABNFGrammar] + # Augmented Backus-Naur form (ABNF) is a standardized grammar notation + # comprised by a set of derivation rules. + # See specifications: https://www.w3.org/TR/speech-grammar + class SpeechAdaptation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] abnf_strings + # @return [::Array<::String>] + # All declarations and rules of an ABNF grammar broken up into multiple + # strings that will end up concatenated. + class ABNFGrammar + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Transcription normalization configuration. Use transcription normalization + # to automatically replace parts of the transcript with phrases of your + # choosing. For StreamingRecognize, this normalization only applies to stable + # partial transcripts (stability > 0.8) and final transcripts. + # @!attribute [rw] entries + # @return [::Array<::Google::Cloud::Speech::V1::TranscriptNormalization::Entry>] + # A list of replacement entries. We will perform replacement with one entry + # at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + # => "mountain dog"] will never be applied because we will always process the + # first entry before it. At most 100 entries. + class TranscriptNormalization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single replacement configuration. + # @!attribute [rw] search + # @return [::String] + # What to replace. Max length is 100 characters. + # @!attribute [rw] replace + # @return [::String] + # What to replace with. Max length is 100 characters. + # @!attribute [rw] case_sensitive + # @return [::Boolean] + # Whether the search is case sensitive. + class Entry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..9a7c0269fa42 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-speech-v1/snippets/Gemfile new file mode 100644 index 000000000000..cbcc9d84c51b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v1", path: "../" +else + gem "google-cloud-speech-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-speech-v1/snippets/adaptation/create_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb new file mode 100644 index 000000000000..fc51d3e2daca --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Adaptation_CreateCustomClass_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the create_custom_class call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#create_custom_class. +# +def create_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::CreateCustomClassRequest.new + + # Call the create_custom_class method. + result = client.create_custom_class request + + # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + p result +end +# [END speech_v1_generated_Adaptation_CreateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb new file mode 100644 index 000000000000..7240501837bc --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Adaptation_CreatePhraseSet_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the create_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#create_phrase_set. +# +def create_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::CreatePhraseSetRequest.new + + # Call the create_phrase_set method. + result = client.create_phrase_set request + + # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + p result +end +# [END speech_v1_generated_Adaptation_CreatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb new file mode 100644 index 000000000000..29e6c8d7cfb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Adaptation_DeleteCustomClass_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the delete_custom_class call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#delete_custom_class. +# +def delete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::DeleteCustomClassRequest.new + + # Call the delete_custom_class method. + result = client.delete_custom_class request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END speech_v1_generated_Adaptation_DeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb new file mode 100644 index 000000000000..b2c8ad998b0b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Adaptation_DeletePhraseSet_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the delete_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#delete_phrase_set. +# +def delete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::DeletePhraseSetRequest.new + + # Call the delete_phrase_set method. + result = client.delete_phrase_set request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END speech_v1_generated_Adaptation_DeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb new file mode 100644 index 000000000000..087735c5f1c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Adaptation_GetCustomClass_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the get_custom_class call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#get_custom_class. +# +def get_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::GetCustomClassRequest.new + + # Call the get_custom_class method. + result = client.get_custom_class request + + # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + p result +end +# [END speech_v1_generated_Adaptation_GetCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb new file mode 100644 index 000000000000..25a23e7f955f --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Adaptation_GetPhraseSet_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the get_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#get_phrase_set. +# +def get_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::GetPhraseSetRequest.new + + # Call the get_phrase_set method. + result = client.get_phrase_set request + + # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + p result +end +# [END speech_v1_generated_Adaptation_GetPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb new file mode 100644 index 000000000000..dacfa57bd4ff --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.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 speech_v1_generated_Adaptation_ListCustomClasses_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the list_custom_classes call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#list_custom_classes. +# +def list_custom_classes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::ListCustomClassesRequest.new + + # Call the list_custom_classes method. + result = client.list_custom_classes request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Speech::V1::CustomClass. + p item + end +end +# [END speech_v1_generated_Adaptation_ListCustomClasses_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb new file mode 100644 index 000000000000..44d69fb6efab --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.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 speech_v1_generated_Adaptation_ListPhraseSet_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the list_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#list_phrase_set. +# +def list_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::ListPhraseSetRequest.new + + # Call the list_phrase_set method. + result = client.list_phrase_set request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Speech::V1::PhraseSet. + p item + end +end +# [END speech_v1_generated_Adaptation_ListPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb new file mode 100644 index 000000000000..2d1b25dcb582 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Adaptation_UpdateCustomClass_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the update_custom_class call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#update_custom_class. +# +def update_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::UpdateCustomClassRequest.new + + # Call the update_custom_class method. + result = client.update_custom_class request + + # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + p result +end +# [END speech_v1_generated_Adaptation_UpdateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb new file mode 100644 index 000000000000..ff2decbbb48a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Adaptation_UpdatePhraseSet_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the update_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#update_phrase_set. +# +def update_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new + + # Call the update_phrase_set method. + result = client.update_phrase_set request + + # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + p result +end +# [END speech_v1_generated_Adaptation_UpdatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json b/owl-bot-staging/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json new file mode 100644 index 000000000000..356aec9f11f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json @@ -0,0 +1,535 @@ +{ + "client_library": { + "name": "google-cloud-speech-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.speech.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "speech_v1_generated_Speech_Recognize_sync", + "title": "Snippet for the recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Speech::Client#recognize.", + "file": "speech/recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "recognize", + "full_name": "::Google::Cloud::Speech::V1::Speech::Client#recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::RecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::RecognizeResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V1::Speech::Client" + }, + "method": { + "short_name": "Recognize", + "full_name": "google.cloud.speech.v1.Speech.Recognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v1.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Speech_LongRunningRecognize_sync", + "title": "Snippet for the long_running_recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Speech::Client#long_running_recognize.", + "file": "speech/long_running_recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "long_running_recognize", + "full_name": "::Google::Cloud::Speech::V1::Speech::Client#long_running_recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::LongRunningRecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V1::Speech::Client" + }, + "method": { + "short_name": "LongRunningRecognize", + "full_name": "google.cloud.speech.v1.Speech.LongRunningRecognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v1.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Speech_StreamingRecognize_sync", + "title": "Snippet for the streaming_recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Speech::Client#streaming_recognize.", + "file": "speech/streaming_recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_recognize", + "full_name": "::Google::Cloud::Speech::V1::Speech::Client#streaming_recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::StreamingRecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::StreamingRecognizeResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V1::Speech::Client" + }, + "method": { + "short_name": "StreamingRecognize", + "full_name": "google.cloud.speech.v1.Speech.StreamingRecognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v1.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_CreatePhraseSet_sync", + "title": "Snippet for the create_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#create_phrase_set.", + "file": "adaptation/create_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_phrase_set", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#create_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::CreatePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::PhraseSet", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "CreatePhraseSet", + "full_name": "google.cloud.speech.v1.Adaptation.CreatePhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_GetPhraseSet_sync", + "title": "Snippet for the get_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#get_phrase_set.", + "file": "adaptation/get_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_phrase_set", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#get_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::GetPhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::PhraseSet", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "GetPhraseSet", + "full_name": "google.cloud.speech.v1.Adaptation.GetPhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_ListPhraseSet_sync", + "title": "Snippet for the list_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#list_phrase_set.", + "file": "adaptation/list_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_phrase_set", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#list_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::ListPhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::ListPhraseSetResponse", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "ListPhraseSet", + "full_name": "google.cloud.speech.v1.Adaptation.ListPhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_UpdatePhraseSet_sync", + "title": "Snippet for the update_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#update_phrase_set.", + "file": "adaptation/update_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_phrase_set", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#update_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::UpdatePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::PhraseSet", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "UpdatePhraseSet", + "full_name": "google.cloud.speech.v1.Adaptation.UpdatePhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_DeletePhraseSet_sync", + "title": "Snippet for the delete_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#delete_phrase_set.", + "file": "adaptation/delete_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_phrase_set", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#delete_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::DeletePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "DeletePhraseSet", + "full_name": "google.cloud.speech.v1.Adaptation.DeletePhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_CreateCustomClass_sync", + "title": "Snippet for the create_custom_class call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#create_custom_class.", + "file": "adaptation/create_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_custom_class", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#create_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::CreateCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::CustomClass", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "CreateCustomClass", + "full_name": "google.cloud.speech.v1.Adaptation.CreateCustomClass", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_GetCustomClass_sync", + "title": "Snippet for the get_custom_class call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#get_custom_class.", + "file": "adaptation/get_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_custom_class", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#get_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::GetCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::CustomClass", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "GetCustomClass", + "full_name": "google.cloud.speech.v1.Adaptation.GetCustomClass", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_ListCustomClasses_sync", + "title": "Snippet for the list_custom_classes call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#list_custom_classes.", + "file": "adaptation/list_custom_classes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_custom_classes", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#list_custom_classes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::ListCustomClassesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::ListCustomClassesResponse", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "ListCustomClasses", + "full_name": "google.cloud.speech.v1.Adaptation.ListCustomClasses", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_UpdateCustomClass_sync", + "title": "Snippet for the update_custom_class call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#update_custom_class.", + "file": "adaptation/update_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_custom_class", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#update_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::UpdateCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1::CustomClass", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "UpdateCustomClass", + "full_name": "google.cloud.speech.v1.Adaptation.UpdateCustomClass", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1_generated_Adaptation_DeleteCustomClass_sync", + "title": "Snippet for the delete_custom_class call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#delete_custom_class.", + "file": "adaptation/delete_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_custom_class", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#delete_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1::DeleteCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" + }, + "method": { + "short_name": "DeleteCustomClass", + "full_name": "google.cloud.speech.v1.Adaptation.DeleteCustomClass", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1.Adaptation" + } + } + }, + "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-speech-v1/snippets/speech/long_running_recognize.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb new file mode 100644 index 000000000000..5b94dc5d192e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Speech_LongRunningRecognize_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the long_running_recognize call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Speech::Client#long_running_recognize. +# +def long_running_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new + + # Call the long_running_recognize method. + result = client.long_running_recognize request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v1_generated_Speech_LongRunningRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/speech/recognize.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/speech/recognize.rb new file mode 100644 index 000000000000..20864502c3ca --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/speech/recognize.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1_generated_Speech_Recognize_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the recognize call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Speech::Client#recognize. +# +def recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::RecognizeRequest.new + + # Call the recognize method. + result = client.recognize request + + # The returned object is of type Google::Cloud::Speech::V1::RecognizeResponse. + p result +end +# [END speech_v1_generated_Speech_Recognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb new file mode 100644 index 000000000000..fa73922ac483 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/snippets/speech/streaming_recognize.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! + +# [START speech_v1_generated_Speech_StreamingRecognize_sync] +require "google/cloud/speech/v1" + +## +# Snippet for the streaming_recognize call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1::Speech::Client#streaming_recognize. +# +def streaming_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Speech::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the streaming_recognize method to start streaming. + output = client.streaming_recognize input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new + input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Speech::V1::StreamingRecognizeResponse + output.each do |current_response| + p current_response + end +end +# [END speech_v1_generated_Speech_StreamingRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb new file mode 100644 index 000000000000..952b7e04e59a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_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/speech/v1/adaptation" + +class ::Google::Cloud::Speech::V1::Adaptation::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_custom_class_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" + assert_equal "projects/value0/locations/value1/customClasses/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::Speech::V1::Adaptation::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_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb new file mode 100644 index 000000000000..5e53064c446b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb @@ -0,0 +1,649 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/speech/v1/cloud_speech_adaptation_pb" +require "google/cloud/speech/v1/adaptation/rest" + + +class ::Google::Cloud::Speech::V1::Adaptation::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_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V1::PhraseSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + phrase_set_id = "hello world" + phrase_set = {} + + create_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_create_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_phrase_set parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_phrase_set ::Google::Cloud::Speech::V1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_phrase_set(::Google::Cloud::Speech::V1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_phrase_set_client_stub.call_count + end + end + end + + def test_get_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V1::PhraseSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_get_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_phrase_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_phrase_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_phrase_set ::Google::Cloud::Speech::V1::GetPhraseSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_phrase_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_phrase_set(::Google::Cloud::Speech::V1::GetPhraseSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_phrase_set_client_stub.call_count + end + end + end + + def test_list_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V1::ListPhraseSetResponse.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_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_list_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_phrase_set({ 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_phrase_set 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_phrase_set ::Google::Cloud::Speech::V1::ListPhraseSetRequest.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_phrase_set({ 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_phrase_set(::Google::Cloud::Speech::V1::ListPhraseSetRequest.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_phrase_set_client_stub.call_count + end + end + end + + def test_update_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V1::PhraseSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + phrase_set = {} + update_mask = {} + + update_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_update_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_phrase_set ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_phrase_set(::Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_phrase_set_client_stub.call_count + end + end + end + + def test_delete_phrase_set + # 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_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_delete_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_phrase_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_phrase_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_phrase_set ::Google::Cloud::Speech::V1::DeletePhraseSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_phrase_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_phrase_set(::Google::Cloud::Speech::V1::DeletePhraseSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_phrase_set_client_stub.call_count + end + end + end + + def test_create_custom_class + # Create test objects. + client_result = ::Google::Cloud::Speech::V1::CustomClass.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + custom_class_id = "hello world" + custom_class = {} + + create_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_create_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_custom_class parent: parent, custom_class_id: custom_class_id, custom_class: custom_class do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_custom_class ::Google::Cloud::Speech::V1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_custom_class(::Google::Cloud::Speech::V1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_custom_class_client_stub.call_count + end + end + end + + def test_get_custom_class + # Create test objects. + client_result = ::Google::Cloud::Speech::V1::CustomClass.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_get_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_custom_class({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_custom_class name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_custom_class ::Google::Cloud::Speech::V1::GetCustomClassRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_custom_class({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_custom_class(::Google::Cloud::Speech::V1::GetCustomClassRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_custom_class_client_stub.call_count + end + end + end + + def test_list_custom_classes + # Create test objects. + client_result = ::Google::Cloud::Speech::V1::ListCustomClassesResponse.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_custom_classes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_list_custom_classes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_custom_classes_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_custom_classes({ 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_custom_classes 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_custom_classes ::Google::Cloud::Speech::V1::ListCustomClassesRequest.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_custom_classes({ 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_custom_classes(::Google::Cloud::Speech::V1::ListCustomClassesRequest.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_custom_classes_client_stub.call_count + end + end + end + + def test_update_custom_class + # Create test objects. + client_result = ::Google::Cloud::Speech::V1::CustomClass.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + custom_class = {} + update_mask = {} + + update_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_update_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_custom_class custom_class: custom_class, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_custom_class ::Google::Cloud::Speech::V1::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_custom_class(::Google::Cloud::Speech::V1::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_custom_class_client_stub.call_count + end + end + end + + def test_delete_custom_class + # 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_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_delete_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_custom_class({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_custom_class name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_custom_class ::Google::Cloud::Speech::V1::DeleteCustomClassRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_custom_class({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_custom_class(::Google::Cloud::Speech::V1::DeleteCustomClassRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_custom_class_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::Speech::V1::Adaptation::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::Speech::V1::Adaptation::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb new file mode 100644 index 000000000000..a5b12ab7a6d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb @@ -0,0 +1,714 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/speech/v1/cloud_speech_adaptation_pb" +require "google/cloud/speech/v1/adaptation" + +class ::Google::Cloud::Speech::V1::Adaptation::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_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::PhraseSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + phrase_set_id = "hello world" + phrase_set = {} + + create_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1::CreatePhraseSetRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["phrase_set_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::PhraseSet), request["phrase_set"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_phrase_set parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_phrase_set ::Google::Cloud::Speech::V1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_phrase_set(::Google::Cloud::Speech::V1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_phrase_set_client_stub.call_rpc_count + end + end + + def test_get_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::PhraseSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1::GetPhraseSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_phrase_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_phrase_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_phrase_set ::Google::Cloud::Speech::V1::GetPhraseSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_phrase_set({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_phrase_set(::Google::Cloud::Speech::V1::GetPhraseSetRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_phrase_set_client_stub.call_rpc_count + end + end + + def test_list_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::ListPhraseSetResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1::ListPhraseSetRequest, 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_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_phrase_set({ parent: parent, page_size: page_size, page_token: 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_phrase_set parent: parent, page_size: page_size, page_token: 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_phrase_set ::Google::Cloud::Speech::V1::ListPhraseSetRequest.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_phrase_set({ parent: parent, page_size: page_size, page_token: page_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_phrase_set(::Google::Cloud::Speech::V1::ListPhraseSetRequest.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_phrase_set_client_stub.call_rpc_count + end + end + + def test_update_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::PhraseSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + phrase_set = {} + update_mask = {} + + update_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::PhraseSet), request["phrase_set"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_phrase_set ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set({ phrase_set: phrase_set, 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_phrase_set(::Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set_client_stub.call_rpc_count + end + end + + def test_delete_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1::DeletePhraseSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_phrase_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_phrase_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_phrase_set ::Google::Cloud::Speech::V1::DeletePhraseSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_phrase_set({ 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_phrase_set(::Google::Cloud::Speech::V1::DeletePhraseSetRequest.new(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_phrase_set_client_stub.call_rpc_count + end + end + + def test_create_custom_class + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::CustomClass.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + custom_class_id = "hello world" + custom_class = {} + + create_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V1::CreateCustomClassRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["custom_class_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::CustomClass), request["custom_class"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_custom_class parent: parent, custom_class_id: custom_class_id, custom_class: custom_class do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_custom_class ::Google::Cloud::Speech::V1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_custom_class(::Google::Cloud::Speech::V1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_custom_class_client_stub.call_rpc_count + end + end + + def test_get_custom_class + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::CustomClass.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V1::GetCustomClassRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_custom_class({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_custom_class name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_custom_class ::Google::Cloud::Speech::V1::GetCustomClassRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_custom_class({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_custom_class(::Google::Cloud::Speech::V1::GetCustomClassRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_custom_class_client_stub.call_rpc_count + end + end + + def test_list_custom_classes + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::ListCustomClassesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_custom_classes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_custom_classes, name + assert_kind_of ::Google::Cloud::Speech::V1::ListCustomClassesRequest, 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_custom_classes_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: 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_custom_classes parent: parent, page_size: page_size, page_token: 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_custom_classes ::Google::Cloud::Speech::V1::ListCustomClassesRequest.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_custom_classes({ parent: parent, page_size: page_size, page_token: page_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_custom_classes(::Google::Cloud::Speech::V1::ListCustomClassesRequest.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_custom_classes_client_stub.call_rpc_count + end + end + + def test_update_custom_class + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::CustomClass.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + custom_class = {} + update_mask = {} + + update_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V1::UpdateCustomClassRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::CustomClass), request["custom_class"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_custom_class custom_class: custom_class, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_custom_class ::Google::Cloud::Speech::V1::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class({ custom_class: custom_class, 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_custom_class(::Google::Cloud::Speech::V1::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class_client_stub.call_rpc_count + end + end + + def test_delete_custom_class + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V1::DeleteCustomClassRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_custom_class({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_custom_class name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_custom_class ::Google::Cloud::Speech::V1::DeleteCustomClassRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_custom_class({ 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_custom_class(::Google::Cloud::Speech::V1::DeleteCustomClassRequest.new(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_custom_class_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V1::Adaptation::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::Speech::V1::Adaptation::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::Speech::V1::Adaptation::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Speech::V1::Adaptation::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb new file mode 100644 index 000000000000..dd3639fdf7b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_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/speech/v1/cloud_speech_pb" +require "google/cloud/speech/v1/cloud_speech_services_pb" +require "google/cloud/speech/v1/speech" + +class ::Google::Cloud::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb new file mode 100644 index 000000000000..f90ecd2284cc --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_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/speech/v1/speech" + +class ::Google::Cloud::Speech::V1::Speech::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_custom_class_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" + assert_equal "projects/value0/locations/value1/customClasses/value2", path + end + end + + def test_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb new file mode 100644 index 000000000000..f6fc60db3501 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/speech/v1/cloud_speech_pb" +require "google/cloud/speech/v1/speech/rest" + + +class ::Google::Cloud::Speech::V1::Speech::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_recognize + # Create test objects. + client_result = ::Google::Cloud::Speech::V1::RecognizeResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + config = {} + audio = {} + + recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Speech::Rest::ServiceStub.stub :transcode_recognize_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.recognize({ config: config, audio: audio }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.recognize config: config, audio: audio do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.recognize ::Google::Cloud::Speech::V1::RecognizeRequest.new(config: config, audio: audio) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.recognize({ config: config, audio: audio }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.recognize(::Google::Cloud::Speech::V1::RecognizeRequest.new(config: config, audio: audio), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, recognize_client_stub.call_count + end + end + end + + def test_long_running_recognize + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + config = {} + audio = {} + output_config = {} + + long_running_recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1::Speech::Rest::ServiceStub.stub :transcode_long_running_recognize_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, long_running_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.long_running_recognize({ config: config, audio: audio, output_config: output_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.long_running_recognize config: config, audio: audio, output_config: output_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.long_running_recognize ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.long_running_recognize({ config: config, audio: audio, output_config: output_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.long_running_recognize(::Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, long_running_recognize_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::Speech::V1::Speech::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::Speech::V1::Speech::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb new file mode 100644 index 000000000000..31036f772d1f --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb @@ -0,0 +1,334 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/speech/v1/cloud_speech_pb" +require "google/cloud/speech/v1/speech" + +class ::Google::Cloud::Speech::V1::Speech::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_recognize + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::RecognizeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + config = {} + audio = {} + + recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :recognize, name + assert_kind_of ::Google::Cloud::Speech::V1::RecognizeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::RecognitionConfig), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::RecognitionAudio), request["audio"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.recognize({ config: config, audio: audio }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.recognize config: config, audio: audio do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.recognize ::Google::Cloud::Speech::V1::RecognizeRequest.new(config: config, audio: audio) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.recognize({ config: config, audio: audio }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.recognize(::Google::Cloud::Speech::V1::RecognizeRequest.new(config: config, audio: audio), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, recognize_client_stub.call_rpc_count + end + end + + def test_long_running_recognize + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + config = {} + audio = {} + output_config = {} + + long_running_recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :long_running_recognize, name + assert_kind_of ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::RecognitionConfig), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::RecognitionAudio), request["audio"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::TranscriptOutputConfig), request["output_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, long_running_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.long_running_recognize({ config: config, audio: audio, output_config: output_config }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.long_running_recognize config: config, audio: audio, output_config: output_config do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.long_running_recognize ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.long_running_recognize({ config: config, audio: audio, output_config: output_config }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.long_running_recognize(::Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, long_running_recognize_client_stub.call_rpc_count + end + end + + def test_streaming_recognize + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1::StreamingRecognizeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a bidi streaming method. + streaming_config = {} + + streaming_recognize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_recognize, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V1::StreamingRecognizeRequest.new streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_recognize enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V1::StreamingRecognizeRequest.new streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_recognize stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V1::StreamingRecognizeRequest.new streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_recognize enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V1::StreamingRecognizeRequest.new streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_recognize stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, streaming_recognize_client_stub.call_rpc_count + streaming_recognize_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeRequest, r + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::StreamingRecognitionConfig), r["streaming_config"] + assert_equal :streaming_config, r.streaming_request + end + end + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Speech::V1::Speech::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::Speech::V1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Speech::V1::Speech::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/helper.rb b/owl-bot-staging/google-cloud-speech-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.gitignore b/owl-bot-staging/google-cloud-speech-v1p1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-speech-v1p1beta1/.repo-metadata.json new file mode 100644 index 000000000000..0f33931b5a91 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "speech.googleapis.com", + "api_shortname": "speech", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1p1beta1/latest", + "distribution_name": "google-cloud-speech-v1p1beta1", + "is_cloud": true, + "language": "ruby", + "name": "speech", + "name_pretty": "Cloud Speech-to-Text V1p1beta1 API", + "product_documentation": "https://cloud.google.com/speech-to-text", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v1p1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SPEECH", + "ruby-cloud-product-url": "https://cloud.google.com/speech-to-text", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-speech-v1p1beta1/.rubocop.yml new file mode 100644 index 000000000000..6e64dd5a1ded --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-speech-v1p1beta1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-speech-v1p1beta1.rb" diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.toys.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.yardopts b/owl-bot-staging/google-cloud-speech-v1p1beta1/.yardopts new file mode 100644 index 000000000000..5265c1e63603 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Speech-to-Text V1p1beta1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..234cd17b2900 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-speech-v1p1beta1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-speech-v1p1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/speech/v1p1beta1" + +client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/speech/v1p1beta1" + +::Google::Cloud::Speech::V1p1beta1::Speech::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Speech::V1p1beta1::Speech::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-speech-v1p1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/speech/v1p1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Speech::V1p1beta1::Speech::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-speech-v1p1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/Gemfile b/owl-bot-staging/google-cloud-speech-v1p1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/LICENSE.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/README.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/README.md new file mode 100644 index 000000000000..fb487dc9164c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Speech-to-Text V1p1beta1 API + +Converts audio to text by applying powerful neural network models. + +Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. + +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 Speech-to-Text V1p1beta1 API. Most users should consider using +the main client gem, +[google-cloud-speech](https://rubygems.org/gems/google-cloud-speech). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-speech-v1p1beta1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/speech.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/speech/v1p1beta1" + +client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new +request = ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new # (request fields as keyword arguments...) +response = client.recognize request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1p1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/speech-to-text) +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/speech/v1p1beta1" +require "logger" + +client = ::Google::Cloud::Speech::V1p1beta1::Speech::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-speech`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-speech-v1p1beta1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-speech`. +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-speech-v1p1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/Rakefile b/owl-bot-staging/google-cloud-speech-v1p1beta1/Rakefile new file mode 100644 index 000000000000..0e12b1140bcd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-speech-v1p1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SPEECH_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SPEECH_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SPEECH_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 SPEECH_TEST_PROJECT=test123 SPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/speech/v1p1beta1/speech/credentials" + ::Google::Cloud::Speech::V1p1beta1::Speech::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SPEECH_PROJECT"] = project + ENV["SPEECH_TEST_PROJECT"] = project + ENV["SPEECH_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-speech-v1p1beta1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-speech-v1p1beta1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-speech-v1p1beta1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-speech-v1p1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-speech-v1p1beta1" + header "google-cloud-speech-v1p1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-speech-v1p1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-speech-v1p1beta1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-speech-v1p1beta1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-speech-v1p1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-speech-v1p1beta1/gapic_metadata.json new file mode 100644 index 000000000000..763b43de9241 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/gapic_metadata.json @@ -0,0 +1,92 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.speech.v1p1beta1", + "libraryPackage": "::Google::Cloud::Speech::V1p1beta1", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Speech::V1p1beta1::Speech::Client", + "rpcs": { + "Recognize": { + "methods": [ + "recognize" + ] + }, + "LongRunningRecognize": { + "methods": [ + "long_running_recognize" + ] + }, + "StreamingRecognize": { + "methods": [ + "streaming_recognize" + ] + } + } + } + } + }, + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client", + "rpcs": { + "CreatePhraseSet": { + "methods": [ + "create_phrase_set" + ] + }, + "GetPhraseSet": { + "methods": [ + "get_phrase_set" + ] + }, + "ListPhraseSet": { + "methods": [ + "list_phrase_set" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "update_phrase_set" + ] + }, + "DeletePhraseSet": { + "methods": [ + "delete_phrase_set" + ] + }, + "CreateCustomClass": { + "methods": [ + "create_custom_class" + ] + }, + "GetCustomClass": { + "methods": [ + "get_custom_class" + ] + }, + "ListCustomClasses": { + "methods": [ + "list_custom_classes" + ] + }, + "UpdateCustomClass": { + "methods": [ + "update_custom_class" + ] + }, + "DeleteCustomClass": { + "methods": [ + "delete_custom_class" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/google-cloud-speech-v1p1beta1.gemspec b/owl-bot-staging/google-cloud-speech-v1p1beta1/google-cloud-speech-v1p1beta1.gemspec new file mode 100644 index 000000000000..c7097081b744 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/google-cloud-speech-v1p1beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/speech/v1p1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-speech-v1p1beta1" + gem.version = Google::Cloud::Speech::V1p1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v1p1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details." + gem.summary = "Converts audio to text by applying powerful neural network models." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google-cloud-speech-v1p1beta1.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google-cloud-speech-v1p1beta1.rb new file mode 100644 index 000000000000..f30b25947a2c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google-cloud-speech-v1p1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/speech/v1p1beta1" diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1.rb new file mode 100644 index 000000000000..29aac12bfb2a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1.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/speech/v1p1beta1/speech" +require "google/cloud/speech/v1p1beta1/adaptation" +require "google/cloud/speech/v1p1beta1/version" + +module Google + module Cloud + module Speech + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/speech/v1p1beta1" + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/speech/v1p1beta1" + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new + # + module V1p1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1p1beta1", "_helpers.rb" +require "google/cloud/speech/v1p1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation.rb new file mode 100644 index 000000000000..304cdacc9735 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation.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/speech/v1p1beta1/version" + +require "google/cloud/speech/v1p1beta1/adaptation/credentials" +require "google/cloud/speech/v1p1beta1/adaptation/paths" +require "google/cloud/speech/v1p1beta1/adaptation/client" +require "google/cloud/speech/v1p1beta1/adaptation/rest" + +module Google + module Cloud + module Speech + module V1p1beta1 + ## + # Service that implements Google Cloud Speech Adaptation API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/speech/v1p1beta1/adaptation" + # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/speech/v1p1beta1/adaptation/rest" + # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + module Adaptation + end + end + end + end +end + +helper_path = ::File.join __dir__, "adaptation", "helpers.rb" +require "google/cloud/speech/v1p1beta1/adaptation/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb new file mode 100644 index 000000000000..63a6c18a54d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb @@ -0,0 +1,1434 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb" + +module Google + module Cloud + module Speech + module V1p1beta1 + module Adaptation + ## + # Client for the Adaptation service. + # + # Service that implements Google Cloud Speech Adaptation API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :adaptation_stub + + ## + # Configure the Adaptation Client class. + # + # See {::Google::Cloud::Speech::V1p1beta1::Adaptation::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Adaptation clients + # ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Speech", "V1p1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Adaptation Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V1p1beta1::Adaptation::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @adaptation_stub.universe_domain + end + + ## + # Create a new Adaptation client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Adaptation 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/speech/v1p1beta1/cloud_speech_adaptation_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 + + @adaptation_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Speech::V1p1beta1::Adaptation::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 + ) + + @adaptation_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 + @adaptation_stub.logger + end + + # Service calls + + ## + # Create a set of phrase hints. Each item in the set can be a single word or + # a multi-word phrase. The items in the PhraseSet are favored by the + # recognition model when you send a call that includes the PhraseSet. + # + # @overload create_phrase_set(request, options = nil) + # Pass arguments to `create_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) + # Pass arguments to `create_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this phrase set will be created. + # Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param phrase_set_id [::String] + # Required. The ID to use for the phrase set, which will become the final + # component of the phrase set's resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @param phrase_set [::Google::Cloud::Speech::V1p1beta1::PhraseSet, ::Hash] + # Required. The phrase set to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new + # + # # Call the create_phrase_set method. + # result = client.create_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + # p result + # + def create_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest + + # Converts hash and nil to 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :create_phrase_set, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a phrase set. + # + # @overload get_phrase_set(request, options = nil) + # Pass arguments to `get_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_phrase_set(name: nil) + # Pass arguments to `get_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 phrase set to retrieve. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new + # + # # Call the get_phrase_set method. + # result = client.get_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + # p result + # + def get_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :get_phrase_set, request, 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 phrase sets. + # + # @overload list_phrase_set(request, options = nil) + # Pass arguments to `list_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_phrase_set(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, 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 phrase set. Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param page_size [::Integer] + # The maximum number of phrase sets to return. The service may return + # fewer than this value. If unspecified, at most 50 phrase sets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous `ListPhraseSet` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPhraseSet` 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::Speech::V1p1beta1::PhraseSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::PhraseSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new + # + # # Call the list_phrase_set method. + # result = client.list_phrase_set request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet. + # p item + # end + # + def list_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :list_phrase_set, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_phrase_set, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a phrase set. + # + # @overload update_phrase_set(request, options = nil) + # Pass arguments to `update_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_phrase_set(phrase_set: nil, update_mask: nil) + # Pass arguments to `update_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V1p1beta1::PhraseSet, ::Hash] + # Required. The phrase set to update. + # + # The phrase set's `name` field is used to identify the set to be + # updated. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new + # + # # Call the update_phrase_set method. + # result = client.update_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + # p result + # + def update_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest + + # Converts hash and nil to 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.phrase_set&.name + header_params["phrase_set.name"] = request.phrase_set.name + end + + request_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_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :update_phrase_set, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a phrase set. + # + # @overload delete_phrase_set(request, options = nil) + # Pass arguments to `delete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_phrase_set(name: nil) + # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 phrase set to delete. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new + # + # # Call the delete_phrase_set method. + # result = client.delete_phrase_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :delete_phrase_set, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a custom class. + # + # @overload create_custom_class(request, options = nil) + # Pass arguments to `create_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) + # Pass arguments to `create_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this custom class will be created. + # Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param custom_class_id [::String] + # Required. The ID to use for the custom class, which will become the final + # component of the custom class' resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @param custom_class [::Google::Cloud::Speech::V1p1beta1::CustomClass, ::Hash] + # Required. The custom class to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new + # + # # Call the create_custom_class method. + # result = client.create_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + # p result + # + def create_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest + + # Converts hash and nil to 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :create_custom_class, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a custom class. + # + # @overload get_custom_class(request, options = nil) + # Pass arguments to `get_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_custom_class(name: nil) + # Pass arguments to `get_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 custom class to retrieve. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new + # + # # Call the get_custom_class method. + # result = client.get_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + # p result + # + def get_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :get_custom_class, request, 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 custom classes. + # + # @overload list_custom_classes(request, options = nil) + # Pass arguments to `list_custom_classes` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_custom_classes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, 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 custom classes. Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param page_size [::Integer] + # The maximum number of custom classes to return. The service may return + # fewer than this value. If unspecified, at most 50 custom classes will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous `ListCustomClass` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCustomClass` 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::Speech::V1p1beta1::CustomClass>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::CustomClass>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new + # + # # Call the list_custom_classes method. + # result = client.list_custom_classes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass. + # p item + # end + # + def list_custom_classes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_custom_classes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_custom_classes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :list_custom_classes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_custom_classes, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a custom class. + # + # @overload update_custom_class(request, options = nil) + # Pass arguments to `update_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_custom_class(custom_class: nil, update_mask: nil) + # Pass arguments to `update_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V1p1beta1::CustomClass, ::Hash] + # Required. The custom class to update. + # + # The custom class's `name` field is used to identify the custom class to be + # updated. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new + # + # # Call the update_custom_class method. + # result = client.update_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + # p result + # + def update_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest + + # Converts hash and nil to 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.custom_class&.name + header_params["custom_class.name"] = request.custom_class.name + end + + request_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_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :update_custom_class, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a custom class. + # + # @overload delete_custom_class(request, options = nil) + # Pass arguments to `delete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_custom_class(name: nil) + # Pass arguments to `delete_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 custom class to delete. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new + # + # # Call the delete_custom_class method. + # result = client.delete_custom_class request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.call_rpc :delete_custom_class, request, 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 Adaptation API. + # + # This class represents the configuration for Adaptation, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V1p1beta1::Adaptation::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_phrase_set to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_phrase_set.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_phrase_set.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Speech::V1p1beta1::Adaptation::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Adaptation API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_phrase_set + ## + # RPC-specific configuration for `get_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_phrase_set + ## + # RPC-specific configuration for `list_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :list_phrase_set + ## + # RPC-specific configuration for `update_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_phrase_set + ## + # RPC-specific configuration for `delete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_phrase_set + ## + # RPC-specific configuration for `create_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_class + ## + # RPC-specific configuration for `get_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_class + ## + # RPC-specific configuration for `list_custom_classes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_classes + ## + # RPC-specific configuration for `update_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :update_custom_class + ## + # RPC-specific configuration for `delete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_class + + # @private + def initialize parent_rpcs = nil + create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set + @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config + get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set + @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config + list_phrase_set_config = parent_rpcs.list_phrase_set if parent_rpcs.respond_to? :list_phrase_set + @list_phrase_set = ::Gapic::Config::Method.new list_phrase_set_config + update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set + @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config + delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set + @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config + create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class + @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config + get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class + @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config + list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes + @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config + update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class + @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config + delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class + @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/credentials.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/credentials.rb new file mode 100644 index 000000000000..0752ca8a8cf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/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 Speech + module V1p1beta1 + module Adaptation + # Credentials for the Adaptation API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SPEECH_CREDENTIALS", + "SPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPEECH_CREDENTIALS_JSON", + "SPEECH_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-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb new file mode 100644 index 000000000000..e5086c847d19 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/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 Speech + module V1p1beta1 + module Adaptation + # Path helper methods for the Adaptation API. + module Paths + ## + # 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 CustomClass resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # @param project [String] + # @param location [String] + # @param custom_class [String] + # + # @return [::String] + def custom_class_path project:, location:, custom_class: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" + 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 PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest.rb new file mode 100644 index 000000000000..06d9364c931d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/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/speech/v1p1beta1/version" + +require "google/cloud/speech/v1p1beta1/adaptation/credentials" +require "google/cloud/speech/v1p1beta1/adaptation/paths" +require "google/cloud/speech/v1p1beta1/adaptation/rest/client" + +module Google + module Cloud + module Speech + module V1p1beta1 + ## + # Service that implements Google Cloud Speech Adaptation API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/speech/v1p1beta1/adaptation/rest" + # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + module Adaptation + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/speech/v1p1beta1/adaptation/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/client.rb new file mode 100644 index 000000000000..25cfba7fdb20 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/client.rb @@ -0,0 +1,1321 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb" +require "google/cloud/speech/v1p1beta1/adaptation/rest/service_stub" + +module Google + module Cloud + module Speech + module V1p1beta1 + module Adaptation + module Rest + ## + # REST client for the Adaptation service. + # + # Service that implements Google Cloud Speech Adaptation API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :adaptation_stub + + ## + # Configure the Adaptation Client class. + # + # See {::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Adaptation clients + # ::Google::Cloud::Speech::V1p1beta1::Adaptation::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", "Speech", "V1p1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Adaptation Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V1p1beta1::Adaptation::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 + @adaptation_stub.universe_domain + end + + ## + # Create a new Adaptation REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Adaptation 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 + + @adaptation_stub = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @adaptation_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 + @adaptation_stub.logger + end + + # Service calls + + ## + # Create a set of phrase hints. Each item in the set can be a single word or + # a multi-word phrase. The items in the PhraseSet are favored by the + # recognition model when you send a call that includes the PhraseSet. + # + # @overload create_phrase_set(request, options = nil) + # Pass arguments to `create_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) + # Pass arguments to `create_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this phrase set will be created. + # Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param phrase_set_id [::String] + # Required. The ID to use for the phrase set, which will become the final + # component of the phrase set's resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @param phrase_set [::Google::Cloud::Speech::V1p1beta1::PhraseSet, ::Hash] + # Required. The phrase set to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new + # + # # Call the create_phrase_set method. + # result = client.create_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + # p result + # + def create_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest + + # Converts hash and nil to an 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.create_phrase_set request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a phrase set. + # + # @overload get_phrase_set(request, options = nil) + # Pass arguments to `get_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_phrase_set(name: nil) + # Pass arguments to `get_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 phrase set to retrieve. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new + # + # # Call the get_phrase_set method. + # result = client.get_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + # p result + # + def get_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.get_phrase_set request, 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 phrase sets. + # + # @overload list_phrase_set(request, options = nil) + # Pass arguments to `list_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_phrase_set(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, 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 phrase set. Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param page_size [::Integer] + # The maximum number of phrase sets to return. The service may return + # fewer than this value. If unspecified, at most 50 phrase sets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous `ListPhraseSet` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPhraseSet` 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::Speech::V1p1beta1::PhraseSet>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::PhraseSet>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new + # + # # Call the list_phrase_set method. + # result = client.list_phrase_set request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet. + # p item + # end + # + def list_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.list_phrase_set request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_phrase_set, "phrase_sets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a phrase set. + # + # @overload update_phrase_set(request, options = nil) + # Pass arguments to `update_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_phrase_set(phrase_set: nil, update_mask: nil) + # Pass arguments to `update_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V1p1beta1::PhraseSet, ::Hash] + # Required. The phrase set to update. + # + # The phrase set's `name` field is used to identify the set to be + # updated. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new + # + # # Call the update_phrase_set method. + # result = client.update_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + # p result + # + def update_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest + + # Converts hash and nil to an 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.update_phrase_set request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a phrase set. + # + # @overload delete_phrase_set(request, options = nil) + # Pass arguments to `delete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_phrase_set(name: nil) + # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 phrase set to delete. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new + # + # # Call the delete_phrase_set method. + # result = client.delete_phrase_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.delete_phrase_set request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a custom class. + # + # @overload create_custom_class(request, options = nil) + # Pass arguments to `create_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) + # Pass arguments to `create_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this custom class will be created. + # Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param custom_class_id [::String] + # Required. The ID to use for the custom class, which will become the final + # component of the custom class' resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @param custom_class [::Google::Cloud::Speech::V1p1beta1::CustomClass, ::Hash] + # Required. The custom class to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new + # + # # Call the create_custom_class method. + # result = client.create_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + # p result + # + def create_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest + + # Converts hash and nil to an 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.create_custom_class request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a custom class. + # + # @overload get_custom_class(request, options = nil) + # Pass arguments to `get_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_custom_class(name: nil) + # Pass arguments to `get_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 custom class to retrieve. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new + # + # # Call the get_custom_class method. + # result = client.get_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + # p result + # + def get_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.get_custom_class request, 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 custom classes. + # + # @overload list_custom_classes(request, options = nil) + # Pass arguments to `list_custom_classes` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_custom_classes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, 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 custom classes. Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param page_size [::Integer] + # The maximum number of custom classes to return. The service may return + # fewer than this value. If unspecified, at most 50 custom classes will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # A page token, received from a previous `ListCustomClass` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCustomClass` 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::Speech::V1p1beta1::CustomClass>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::CustomClass>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new + # + # # Call the list_custom_classes method. + # result = client.list_custom_classes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass. + # p item + # end + # + def list_custom_classes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_custom_classes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_custom_classes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.list_custom_classes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_custom_classes, "custom_classes", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a custom class. + # + # @overload update_custom_class(request, options = nil) + # Pass arguments to `update_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_custom_class(custom_class: nil, update_mask: nil) + # Pass arguments to `update_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V1p1beta1::CustomClass, ::Hash] + # Required. The custom class to update. + # + # The custom class's `name` field is used to identify the custom class to be + # updated. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new + # + # # Call the update_custom_class method. + # result = client.update_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + # p result + # + def update_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest + + # Converts hash and nil to an 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.update_custom_class request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a custom class. + # + # @overload delete_custom_class(request, options = nil) + # Pass arguments to `delete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_custom_class(name: nil) + # Pass arguments to `delete_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 custom class to delete. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new + # + # # Call the delete_custom_class method. + # result = client.delete_custom_class request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @adaptation_stub.delete_custom_class request, 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 Adaptation REST API. + # + # This class represents the configuration for Adaptation REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_phrase_set to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_phrase_set.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_phrase_set.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Adaptation API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_phrase_set + ## + # RPC-specific configuration for `get_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_phrase_set + ## + # RPC-specific configuration for `list_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :list_phrase_set + ## + # RPC-specific configuration for `update_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_phrase_set + ## + # RPC-specific configuration for `delete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_phrase_set + ## + # RPC-specific configuration for `create_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_class + ## + # RPC-specific configuration for `get_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_class + ## + # RPC-specific configuration for `list_custom_classes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_classes + ## + # RPC-specific configuration for `update_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :update_custom_class + ## + # RPC-specific configuration for `delete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_class + + # @private + def initialize parent_rpcs = nil + create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set + @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config + get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set + @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config + list_phrase_set_config = parent_rpcs.list_phrase_set if parent_rpcs.respond_to? :list_phrase_set + @list_phrase_set = ::Gapic::Config::Method.new list_phrase_set_config + update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set + @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config + delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set + @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config + create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class + @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config + get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class + @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config + list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes + @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config + update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class + @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config + delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class + @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb new file mode 100644 index 000000000000..bd467300f761 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb @@ -0,0 +1,695 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb" + +module Google + module Cloud + module Speech + module V1p1beta1 + module Adaptation + module Rest + ## + # REST service stub for the Adaptation 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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # A result object deserialized from the server's reply + def create_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # A result object deserialized from the server's reply + def get_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse] + # A result object deserialized from the server's reply + def list_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse.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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # A result object deserialized from the server's reply + def update_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 create_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # A result object deserialized from the server's reply + def create_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # A result object deserialized from the server's reply + def get_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.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_custom_classes REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse] + # A result object deserialized from the server's reply + def list_custom_classes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_classes_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_custom_classes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse.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_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # A result object deserialized from the server's reply + def update_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/phraseSets", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/phraseSets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{phrase_set.name}", + body: "phrase_set", + matches: [ + ["phrase_set.name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/{parent}/customClasses", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_custom_classes REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_custom_classes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/{parent}/customClasses", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p1beta1/{custom_class.name}", + body: "custom_class", + matches: [ + ["custom_class.name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1p1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb new file mode 100644 index 000000000000..5b0bc2fff55e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.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/speech/v1p1beta1/resource_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n;google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto\x12\x1dgoogle.cloud.speech.v1p1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/speech/v1p1beta1/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb0\x01\n\x16\x43reatePhraseSetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\x12\x1a\n\rphrase_set_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\nphrase_set\x18\x03 \x01(\x0b\x32(.google.cloud.speech.v1p1beta1.PhraseSetB\x03\xe0\x41\x02\"\x8c\x01\n\x16UpdatePhraseSetRequest\x12\x41\n\nphrase_set\x18\x01 \x01(\x0b\x32(.google.cloud.speech.v1p1beta1.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"v\n\x14ListPhraseSetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"o\n\x15ListPhraseSetResponse\x12=\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32(.google.cloud.speech.v1p1beta1.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\xba\x01\n\x18\x43reateCustomClassRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\x12\x1c\n\x0f\x63ustom_class_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\x0c\x63ustom_class\x18\x03 \x01(\x0b\x32*.google.cloud.speech.v1p1beta1.CustomClassB\x03\xe0\x41\x02\"\x92\x01\n\x18UpdateCustomClassRequest\x12\x45\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32*.google.cloud.speech.v1p1beta1.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"|\n\x18ListCustomClassesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"x\n\x19ListCustomClassesResponse\x12\x42\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32*.google.cloud.speech.v1p1beta1.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass2\xd2\x10\n\nAdaptation\x12\xd6\x01\n\x0f\x43reatePhraseSet\x12\x35.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest\x1a(.google.cloud.speech.v1p1beta1.PhraseSet\"b\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02:\"5/v1p1beta1/{parent=projects/*/locations/*}/phraseSets:\x01*\x12\xb2\x01\n\x0cGetPhraseSet\x12\x32.google.cloud.speech.v1p1beta1.GetPhraseSetRequest\x1a(.google.cloud.speech.v1p1beta1.PhraseSet\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}\x12\xc2\x01\n\rListPhraseSet\x12\x33.google.cloud.speech.v1p1beta1.ListPhraseSetRequest\x1a\x34.google.cloud.speech.v1p1beta1.ListPhraseSetResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1p1beta1/{parent=projects/*/locations/*}/phraseSets\x12\xe1\x01\n\x0fUpdatePhraseSet\x12\x35.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest\x1a(.google.cloud.speech.v1p1beta1.PhraseSet\"m\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02N2@/v1p1beta1/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\xa6\x01\n\x0f\x44\x65letePhraseSet\x12\x35.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}\x12\xe3\x01\n\x11\x43reateCustomClass\x12\x37.google.cloud.speech.v1p1beta1.CreateCustomClassRequest\x1a*.google.cloud.speech.v1p1beta1.CustomClass\"i\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02=\"8/v1p1beta1/{parent=projects/*/locations/*}/customClasses:\x01*\x12\xbb\x01\n\x0eGetCustomClass\x12\x34.google.cloud.speech.v1p1beta1.GetCustomClassRequest\x1a*.google.cloud.speech.v1p1beta1.CustomClass\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1p1beta1/{name=projects/*/locations/*/customClasses/*}\x12\xd1\x01\n\x11ListCustomClasses\x12\x37.google.cloud.speech.v1p1beta1.ListCustomClassesRequest\x1a\x38.google.cloud.speech.v1p1beta1.ListCustomClassesResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1p1beta1/{parent=projects/*/locations/*}/customClasses\x12\xf0\x01\n\x11UpdateCustomClass\x12\x37.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest\x1a*.google.cloud.speech.v1p1beta1.CustomClass\"v\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02U2E/v1p1beta1/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\xad\x01\n\x11\x44\x65leteCustomClass\x12\x37.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1p1beta1/{name=projects/*/locations/*/customClasses/*}\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB}\n!com.google.cloud.speech.v1p1beta1B\x15SpeechAdaptationProtoP\x01Z9cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb\xa2\x02\x03GCSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Speech + module V1p1beta1 + CreatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CreatePhraseSetRequest").msgclass + UpdatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest").msgclass + GetPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.GetPhraseSetRequest").msgclass + ListPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListPhraseSetRequest").msgclass + ListPhraseSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListPhraseSetResponse").msgclass + DeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.DeletePhraseSetRequest").msgclass + CreateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CreateCustomClassRequest").msgclass + UpdateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.UpdateCustomClassRequest").msgclass + GetCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.GetCustomClassRequest").msgclass + ListCustomClassesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListCustomClassesRequest").msgclass + ListCustomClassesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListCustomClassesResponse").msgclass + DeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.DeleteCustomClassRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb new file mode 100644 index 000000000000..e7fe2aa9bbdf --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto for package 'google.cloud.speech.v1p1beta1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb' + +module Google + module Cloud + module Speech + module V1p1beta1 + module Adaptation + # Service that implements Google Cloud Speech Adaptation API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.speech.v1p1beta1.Adaptation' + + # Create a set of phrase hints. Each item in the set can be a single word or + # a multi-word phrase. The items in the PhraseSet are favored by the + # recognition model when you send a call that includes the PhraseSet. + rpc :CreatePhraseSet, ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::PhraseSet + # Get a phrase set. + rpc :GetPhraseSet, ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::PhraseSet + # List phrase sets. + rpc :ListPhraseSet, ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse + # Update a phrase set. + rpc :UpdatePhraseSet, ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::PhraseSet + # Delete a phrase set. + rpc :DeletePhraseSet, ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest, ::Google::Protobuf::Empty + # Create a custom class. + rpc :CreateCustomClass, ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest, ::Google::Cloud::Speech::V1p1beta1::CustomClass + # Get a custom class. + rpc :GetCustomClass, ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest, ::Google::Cloud::Speech::V1p1beta1::CustomClass + # List custom classes. + rpc :ListCustomClasses, ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest, ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse + # Update a custom class. + rpc :UpdateCustomClass, ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest, ::Google::Cloud::Speech::V1p1beta1::CustomClass + # Delete a custom class. + rpc :DeleteCustomClass, ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb new file mode 100644 index 000000000000..b33181f5fa56 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/cloud/speech/v1p1beta1/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n0google/cloud/speech/v1p1beta1/cloud_speech.proto\x12\x1dgoogle.cloud.speech.v1p1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/speech/v1p1beta1/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\"\x9e\x01\n\x10RecognizeRequest\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x30.google.cloud.speech.v1p1beta1.RecognitionConfigB\x03\xe0\x41\x02\x12\x43\n\x05\x61udio\x18\x02 \x01(\x0b\x32/.google.cloud.speech.v1p1beta1.RecognitionAudioB\x03\xe0\x41\x02\"\xfc\x01\n\x1bLongRunningRecognizeRequest\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x30.google.cloud.speech.v1p1beta1.RecognitionConfigB\x03\xe0\x41\x02\x12\x43\n\x05\x61udio\x18\x02 \x01(\x0b\x32/.google.cloud.speech.v1p1beta1.RecognitionAudioB\x03\xe0\x41\x02\x12Q\n\routput_config\x18\x04 \x01(\x0b\x32\x35.google.cloud.speech.v1p1beta1.TranscriptOutputConfigB\x03\xe0\x41\x01\":\n\x16TranscriptOutputConfig\x12\x11\n\x07gcs_uri\x18\x01 \x01(\tH\x00\x42\r\n\x0boutput_type\"\xa0\x01\n\x19StreamingRecognizeRequest\x12U\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x39.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigH\x00\x12\x17\n\raudio_content\x18\x02 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\xb5\x03\n\x1aStreamingRecognitionConfig\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x30.google.cloud.speech.v1p1beta1.RecognitionConfigB\x03\xe0\x41\x02\x12\x18\n\x10single_utterance\x18\x02 \x01(\x08\x12\x17\n\x0finterim_results\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_voice_activity_events\x18\x05 \x01(\x08\x12n\n\x16voice_activity_timeout\x18\x06 \x01(\x0b\x32N.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xcd\t\n\x11RecognitionConfig\x12P\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32>.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x1b\n\x13\x61udio_channel_count\x18\x07 \x01(\x05\x12/\n\'enable_separate_recognition_per_channel\x18\x0c \x01(\x08\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x1a\x61lternative_language_codes\x18\x12 \x03(\t\x12\x18\n\x10max_alternatives\x18\x04 \x01(\x05\x12\x18\n\x10profanity_filter\x18\x05 \x01(\x08\x12\x43\n\nadaptation\x18\x14 \x01(\x0b\x32/.google.cloud.speech.v1p1beta1.SpeechAdaptation\x12]\n\x18transcript_normalization\x18\x18 \x01(\x0b\x32\x36.google.cloud.speech.v1p1beta1.TranscriptNormalizationB\x03\xe0\x41\x01\x12\x45\n\x0fspeech_contexts\x18\x06 \x03(\x0b\x32,.google.cloud.speech.v1p1beta1.SpeechContext\x12 \n\x18\x65nable_word_time_offsets\x18\x08 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x0f \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x0b \x01(\x08\x12=\n\x19\x65nable_spoken_punctuation\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x38\n\x14\x65nable_spoken_emojis\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12&\n\x1a\x65nable_speaker_diarization\x18\x10 \x01(\x08\x42\x02\x18\x01\x12%\n\x19\x64iarization_speaker_count\x18\x11 \x01(\x05\x42\x02\x18\x01\x12S\n\x12\x64iarization_config\x18\x13 \x01(\x0b\x32\x37.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig\x12\x44\n\x08metadata\x18\t \x01(\x0b\x32\x32.google.cloud.speech.v1p1beta1.RecognitionMetadata\x12\r\n\x05model\x18\r \x01(\t\x12\x14\n\x0cuse_enhanced\x18\x0e \x01(\x08\"\xad\x01\n\rAudioEncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x08\n\x04\x46LAC\x10\x02\x12\t\n\x05MULAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x0c\n\x08OGG_OPUS\x10\x06\x12\x1a\n\x16SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x07\n\x03MP3\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\x12\x08\n\x04\x41LAW\x10\n\"\x90\x01\n\x18SpeakerDiarizationConfig\x12\"\n\x1a\x65nable_speaker_diarization\x18\x01 \x01(\x08\x12\x19\n\x11min_speaker_count\x18\x02 \x01(\x05\x12\x19\n\x11max_speaker_count\x18\x03 \x01(\x05\x12\x1a\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x05\x18\x01\xe0\x41\x03\"\xdb\x08\n\x13RecognitionMetadata\x12\\\n\x10interaction_type\x18\x01 \x01(\x0e\x32\x42.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType\x12$\n\x1cindustry_naics_code_of_audio\x18\x03 \x01(\r\x12\x62\n\x13microphone_distance\x18\x04 \x01(\x0e\x32\x45.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance\x12\x61\n\x13original_media_type\x18\x05 \x01(\x0e\x32\x44.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType\x12\x65\n\x15recording_device_type\x18\x06 \x01(\x0e\x32\x46.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType\x12\x1d\n\x15recording_device_name\x18\x07 \x01(\t\x12\x1a\n\x12original_mime_type\x18\x08 \x01(\t\x12\x19\n\robfuscated_id\x18\t \x01(\x03\x42\x02\x18\x01\x12\x13\n\x0b\x61udio_topic\x18\n \x01(\t\"\xc5\x01\n\x0fInteractionType\x12 \n\x1cINTERACTION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nDISCUSSION\x10\x01\x12\x10\n\x0cPRESENTATION\x10\x02\x12\x0e\n\nPHONE_CALL\x10\x03\x12\r\n\tVOICEMAIL\x10\x04\x12\x1b\n\x17PROFESSIONALLY_PRODUCED\x10\x05\x12\x10\n\x0cVOICE_SEARCH\x10\x06\x12\x11\n\rVOICE_COMMAND\x10\x07\x12\r\n\tDICTATION\x10\x08\"d\n\x12MicrophoneDistance\x12#\n\x1fMICROPHONE_DISTANCE_UNSPECIFIED\x10\x00\x12\r\n\tNEARFIELD\x10\x01\x12\x0c\n\x08MIDFIELD\x10\x02\x12\x0c\n\x08\x46\x41RFIELD\x10\x03\"N\n\x11OriginalMediaType\x12#\n\x1fORIGINAL_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\t\n\x05VIDEO\x10\x02\"\xa4\x01\n\x13RecordingDeviceType\x12%\n!RECORDING_DEVICE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nSMARTPHONE\x10\x01\x12\x06\n\x02PC\x10\x02\x12\x0e\n\nPHONE_LINE\x10\x03\x12\x0b\n\x07VEHICLE\x10\x04\x12\x18\n\x14OTHER_OUTDOOR_DEVICE\x10\x05\x12\x17\n\x13OTHER_INDOOR_DEVICE\x10\x06:\x02\x18\x01\"/\n\rSpeechContext\x12\x0f\n\x07phrases\x18\x01 \x03(\t\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\"D\n\x10RecognitionAudio\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\x98\x02\n\x11RecognizeResponse\x12G\n\x07results\x18\x02 \x03(\x0b\x32\x36.google.cloud.speech.v1p1beta1.SpeechRecognitionResult\x12\x34\n\x11total_billed_time\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12S\n\x16speech_adaptation_info\x18\x07 \x01(\x0b\x32\x33.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\x08 \x01(\x03\x12\x1b\n\x13using_legacy_models\x18\t \x01(\x08\"\xfe\x02\n\x1cLongRunningRecognizeResponse\x12G\n\x07results\x18\x02 \x03(\x0b\x32\x36.google.cloud.speech.v1p1beta1.SpeechRecognitionResult\x12\x34\n\x11total_billed_time\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12L\n\routput_config\x18\x06 \x01(\x0b\x32\x35.google.cloud.speech.v1p1beta1.TranscriptOutputConfig\x12(\n\x0coutput_error\x18\x07 \x01(\x0b\x32\x12.google.rpc.Status\x12S\n\x16speech_adaptation_info\x18\x08 \x01(\x0b\x32\x33.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\t \x01(\x03\"\x83\x02\n\x1cLongRunningRecognizeMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10last_update_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x03uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12Q\n\routput_config\x18\x05 \x01(\x0b\x32\x35.google.cloud.speech.v1p1beta1.TranscriptOutputConfigB\x03\xe0\x41\x03\"\xe6\x04\n\x1aStreamingRecognizeResponse\x12!\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12J\n\x07results\x18\x02 \x03(\x0b\x32\x39.google.cloud.speech.v1p1beta1.StreamingRecognitionResult\x12\x64\n\x11speech_event_type\x18\x04 \x01(\x0e\x32I.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType\x12\x34\n\x11speech_event_time\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x11total_billed_time\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12S\n\x16speech_adaptation_info\x18\t \x01(\x0b\x32\x33.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\n \x01(\x03\"\x9d\x01\n\x0fSpeechEventType\x12\x1c\n\x18SPEECH_EVENT_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\x12\x1b\n\x17SPEECH_ACTIVITY_TIMEOUT\x10\x04\"\xf9\x01\n\x1aStreamingRecognitionResult\x12Q\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xd1\x01\n\x17SpeechRecognitionResult\x12Q\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"~\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x36\n\x05words\x18\x03 \x03(\x0b\x32\'.google.cloud.speech.v1p1beta1.WordInfo\"\xc0\x01\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x1a\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x05\x18\x01\xe0\x41\x03\x12\x1a\n\rspeaker_label\x18\x06 \x01(\tB\x03\xe0\x41\x03\"K\n\x14SpeechAdaptationInfo\x12\x1a\n\x12\x61\x64\x61ptation_timeout\x18\x01 \x01(\x08\x12\x17\n\x0ftimeout_message\x18\x04 \x01(\t2\x82\x05\n\x06Speech\x12\xa5\x01\n\tRecognize\x12/.google.cloud.speech.v1p1beta1.RecognizeRequest\x1a\x30.google.cloud.speech.v1p1beta1.RecognizeResponse\"5\xda\x41\x0c\x63onfig,audio\x82\xd3\xe4\x93\x02 \"\x1b/v1p1beta1/speech:recognize:\x01*\x12\xf2\x01\n\x14LongRunningRecognize\x12:.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41<\n\x1cLongRunningRecognizeResponse\x12\x1cLongRunningRecognizeMetadata\xda\x41\x0c\x63onfig,audio\x82\xd3\xe4\x93\x02+\"&/v1p1beta1/speech:longrunningrecognize:\x01*\x12\x8f\x01\n\x12StreamingRecognize\x12\x38.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest\x1a\x39.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBs\n!com.google.cloud.speech.v1p1beta1B\x0bSpeechProtoP\x01Z9cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb\xa2\x02\x03GCSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Speech + module V1p1beta1 + RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognizeRequest").msgclass + LongRunningRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest").msgclass + TranscriptOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.TranscriptOutputConfig").msgclass + StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeRequest").msgclass + StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionConfig").msgclass + StreamingRecognitionConfig::VoiceActivityTimeout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout").msgclass + RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionConfig").msgclass + RecognitionConfig::AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding").enummodule + SpeakerDiarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig").msgclass + RecognitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata").msgclass + RecognitionMetadata::InteractionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType").enummodule + RecognitionMetadata::MicrophoneDistance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance").enummodule + RecognitionMetadata::OriginalMediaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType").enummodule + RecognitionMetadata::RecordingDeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType").enummodule + SpeechContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechContext").msgclass + RecognitionAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionAudio").msgclass + RecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognizeResponse").msgclass + LongRunningRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse").msgclass + LongRunningRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata").msgclass + StreamingRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeResponse").msgclass + StreamingRecognizeResponse::SpeechEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType").enummodule + StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionResult").msgclass + SpeechRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechRecognitionResult").msgclass + SpeechRecognitionAlternative = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative").msgclass + WordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.WordInfo").msgclass + SpeechAdaptationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechAdaptationInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb new file mode 100644 index 000000000000..7a757ba1b34b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/speech/v1p1beta1/cloud_speech.proto for package 'google.cloud.speech.v1p1beta1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/speech/v1p1beta1/cloud_speech_pb' + +module Google + module Cloud + module Speech + module V1p1beta1 + module Speech + # Service that implements Google Cloud Speech API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.speech.v1p1beta1.Speech' + + # Performs synchronous speech recognition: receive results after all audio + # has been sent and processed. + rpc :Recognize, ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest, ::Google::Cloud::Speech::V1p1beta1::RecognizeResponse + # Performs asynchronous speech recognition: receive results via the + # google.longrunning.Operations interface. Returns either an + # `Operation.error` or an `Operation.response` which contains + # a `LongRunningRecognizeResponse` message. + # For more information on asynchronous speech recognition, see the + # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + rpc :LongRunningRecognize, ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest, ::Google::Longrunning::Operation + # Performs bidirectional streaming speech recognition: receive results while + # sending audio. This method is only available via the gRPC API (not REST). + rpc :StreamingRecognize, stream(::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest), stream(::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/resource_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/resource_pb.rb new file mode 100644 index 000000000000..debdb5df1fa0 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/resource_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v1p1beta1/resource.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/speech/v1p1beta1/resource.proto\x12\x1dgoogle.cloud.speech.v1p1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe4\x06\n\x0b\x43ustomClass\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0f\x63ustom_class_id\x18\x02 \x01(\t\x12\x43\n\x05items\x18\x03 \x03(\x0b\x32\x34.google.cloud.speech.v1p1beta1.CustomClass.ClassItem\x12?\n\x0ckms_key_name\x18\x06 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x07 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x10\n\x03uid\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\n \x01(\x0e\x32\x30.google.cloud.speech.v1p1beta1.CustomClass.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x0b\x61nnotations\x18\r \x03(\x0b\x32;.google.cloud.speech.v1p1beta1.CustomClass.AnnotationsEntryB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:l\xea\x41i\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}\"\xd6\x06\n\tPhraseSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12@\n\x07phrases\x18\x02 \x03(\x0b\x32/.google.cloud.speech.v1p1beta1.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x12?\n\x0ckms_key_name\x18\x07 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x08 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x05state\x18\x0b \x01(\x0e\x32..google.cloud.speech.v1p1beta1.PhraseSet.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12S\n\x0b\x61nnotations\x18\x0e \x03(\x0b\x32\x39.google.cloud.speech.v1p1beta1.PhraseSet.AnnotationsEntryB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:e\xea\x41\x62\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}\"\xd2\x02\n\x10SpeechAdaptation\x12=\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32(.google.cloud.speech.v1p1beta1.PhraseSet\x12\x43\n\x15phrase_set_references\x18\x02 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x42\n\x0e\x63ustom_classes\x18\x03 \x03(\x0b\x32*.google.cloud.speech.v1p1beta1.CustomClass\x12Q\n\x0c\x61\x62nf_grammar\x18\x04 \x01(\x0b\x32;.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar\x1a#\n\x0b\x41\x42NFGrammar\x12\x14\n\x0c\x61\x62nf_strings\x18\x01 \x03(\t\"\xaa\x01\n\x17TranscriptNormalization\x12M\n\x07\x65ntries\x18\x01 \x03(\x0b\x32<.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\x42\xa0\x03\n!com.google.cloud.speech.v1p1beta1B\x13SpeechResourceProtoP\x01Z9cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb\xa2\x02\x03GCS\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Speech + module V1p1beta1 + CustomClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CustomClass").msgclass + CustomClass::ClassItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CustomClass.ClassItem").msgclass + CustomClass::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CustomClass.State").enummodule + PhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.PhraseSet").msgclass + PhraseSet::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.PhraseSet.Phrase").msgclass + PhraseSet::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.PhraseSet.State").enummodule + SpeechAdaptation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechAdaptation").msgclass + SpeechAdaptation::ABNFGrammar = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar").msgclass + TranscriptNormalization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.TranscriptNormalization").msgclass + TranscriptNormalization::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/rest.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/rest.rb new file mode 100644 index 000000000000..6c94920321b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/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/speech/v1p1beta1/speech/rest" +require "google/cloud/speech/v1p1beta1/adaptation/rest" +require "google/cloud/speech/v1p1beta1/version" + +module Google + module Cloud + module Speech + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/speech/v1p1beta1/rest" + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new + # + module V1p1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech.rb new file mode 100644 index 000000000000..bd0aec88faf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech.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/speech/v1p1beta1/version" + +require "google/cloud/speech/v1p1beta1/speech/credentials" +require "google/cloud/speech/v1p1beta1/speech/paths" +require "google/cloud/speech/v1p1beta1/speech/operations" +require "google/cloud/speech/v1p1beta1/speech/client" +require "google/cloud/speech/v1p1beta1/speech/rest" + +module Google + module Cloud + module Speech + module V1p1beta1 + ## + # Service that implements Google Cloud Speech API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/speech/v1p1beta1/speech" + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/speech/v1p1beta1/speech/rest" + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new + # + module Speech + end + end + end + end +end + +helper_path = ::File.join __dir__, "speech", "helpers.rb" +require "google/cloud/speech/v1p1beta1/speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/client.rb new file mode 100644 index 000000000000..4f672a626f58 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/client.rb @@ -0,0 +1,685 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v1p1beta1/cloud_speech_pb" + +module Google + module Cloud + module Speech + module V1p1beta1 + module Speech + ## + # Client for the Speech service. + # + # Service that implements Google Cloud Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :speech_stub + + ## + # Configure the Speech Client class. + # + # See {::Google::Cloud::Speech::V1p1beta1::Speech::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Speech clients + # ::Google::Cloud::Speech::V1p1beta1::Speech::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Speech", "V1p1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.recognize.timeout = 5000.0 + default_config.rpcs.recognize.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.long_running_recognize.timeout = 5000.0 + + default_config.rpcs.streaming_recognize.timeout = 5000.0 + default_config.rpcs.streaming_recognize.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Speech Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V1p1beta1::Speech::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @speech_stub.universe_domain + end + + ## + # Create a new Speech client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Speech 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/speech/v1p1beta1/cloud_speech_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 + + @speech_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Speech::V1p1beta1::Speech::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 + ) + + @speech_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::Speech::V1p1beta1::Speech::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @speech_stub.logger + end + + # Service calls + + ## + # Performs synchronous speech recognition: receive results after all audio + # has been sent and processed. + # + # @overload recognize(request, options = nil) + # Pass arguments to `recognize` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::RecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::RecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload recognize(config: nil, audio: nil) + # Pass arguments to `recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig, ::Hash] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @param audio [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio, ::Hash] + # Required. The audio data to be recognized. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new + # + # # Call the recognize method. + # result = client.recognize request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::RecognizeResponse. + # p result + # + def recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :recognize, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs asynchronous speech recognition: receive results via the + # google.longrunning.Operations interface. Returns either an + # `Operation.error` or an `Operation.response` which contains + # a `LongRunningRecognizeResponse` message. + # For more information on asynchronous speech recognition, see the + # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + # + # @overload long_running_recognize(request, options = nil) + # Pass arguments to `long_running_recognize` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload long_running_recognize(config: nil, audio: nil, output_config: nil) + # Pass arguments to `long_running_recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig, ::Hash] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @param audio [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio, ::Hash] + # Required. The audio data to be recognized. + # @param output_config [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig, ::Hash] + # Optional. Specifies an optional destination for the recognition results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new + # + # # Call the long_running_recognize method. + # result = client.long_running_recognize request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def long_running_recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.long_running_recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.long_running_recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.long_running_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :long_running_recognize, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs bidirectional streaming speech recognition: receive results while + # sending audio. This method is only available via the gRPC API (not REST). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_recognize method to start streaming. + # output = client.streaming_recognize input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new + # input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_recognize request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest + end + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.streaming_recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.streaming_recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :streaming_recognize, request, 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 Speech API. + # + # This class represents the configuration for Speech, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V1p1beta1::Speech::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # recognize to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V1p1beta1::Speech::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.recognize.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.recognize.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Speech::V1p1beta1::Speech::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Speech API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :recognize + ## + # RPC-specific configuration for `long_running_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :long_running_recognize + ## + # RPC-specific configuration for `streaming_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_recognize + + # @private + def initialize parent_rpcs = nil + recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize + @recognize = ::Gapic::Config::Method.new recognize_config + long_running_recognize_config = parent_rpcs.long_running_recognize if parent_rpcs.respond_to? :long_running_recognize + @long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config + streaming_recognize_config = parent_rpcs.streaming_recognize if parent_rpcs.respond_to? :streaming_recognize + @streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/credentials.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/credentials.rb new file mode 100644 index 000000000000..f83c21f0ed37 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/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 Speech + module V1p1beta1 + module Speech + # Credentials for the Speech API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SPEECH_CREDENTIALS", + "SPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPEECH_CREDENTIALS_JSON", + "SPEECH_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-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/operations.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/operations.rb new file mode 100644 index 000000000000..6a9b3255798d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/operations.rb @@ -0,0 +1,833 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 Speech + module V1p1beta1 + module Speech + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Speech 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 Speech 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::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.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::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/paths.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/paths.rb new file mode 100644 index 000000000000..9e690dc1410d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/paths.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! + + +module Google + module Cloud + module Speech + module V1p1beta1 + module Speech + # Path helper methods for the Speech API. + module Paths + ## + # 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 CustomClass resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # @param project [String] + # @param location [String] + # @param custom_class [String] + # + # @return [::String] + def custom_class_path project:, location:, custom_class: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" + end + + ## + # Create a fully-qualified PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest.rb new file mode 100644 index 000000000000..cd4e47947364 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/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/speech/v1p1beta1/version" + +require "google/cloud/speech/v1p1beta1/speech/credentials" +require "google/cloud/speech/v1p1beta1/speech/paths" +require "google/cloud/speech/v1p1beta1/speech/rest/operations" +require "google/cloud/speech/v1p1beta1/speech/rest/client" + +module Google + module Cloud + module Speech + module V1p1beta1 + ## + # Service that implements Google Cloud Speech API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/speech/v1p1beta1/speech/rest" + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new + # + module Speech + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/speech/v1p1beta1/speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb new file mode 100644 index 000000000000..cf9a596bd24d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb @@ -0,0 +1,553 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v1p1beta1/cloud_speech_pb" +require "google/cloud/speech/v1p1beta1/speech/rest/service_stub" + +module Google + module Cloud + module Speech + module V1p1beta1 + module Speech + module Rest + ## + # REST client for the Speech service. + # + # Service that implements Google Cloud Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :speech_stub + + ## + # Configure the Speech Client class. + # + # See {::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Speech clients + # ::Google::Cloud::Speech::V1p1beta1::Speech::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", "Speech", "V1p1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.recognize.timeout = 5000.0 + default_config.rpcs.recognize.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.long_running_recognize.timeout = 5000.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Speech Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V1p1beta1::Speech::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 + @speech_stub.universe_domain + end + + ## + # Create a new Speech REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Speech 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::Speech::V1p1beta1::Speech::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 + + @speech_stub = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @speech_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::Speech::V1p1beta1::Speech::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @speech_stub.logger + end + + # Service calls + + ## + # Performs synchronous speech recognition: receive results after all audio + # has been sent and processed. + # + # @overload recognize(request, options = nil) + # Pass arguments to `recognize` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::RecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::RecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload recognize(config: nil, audio: nil) + # Pass arguments to `recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig, ::Hash] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @param audio [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio, ::Hash] + # Required. The audio data to be recognized. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new + # + # # Call the recognize method. + # result = client.recognize request + # + # # The returned object is of type Google::Cloud::Speech::V1p1beta1::RecognizeResponse. + # p result + # + def recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.recognize.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.recognize request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs asynchronous speech recognition: receive results via the + # google.longrunning.Operations interface. Returns either an + # `Operation.error` or an `Operation.response` which contains + # a `LongRunningRecognizeResponse` message. + # For more information on asynchronous speech recognition, see the + # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + # + # @overload long_running_recognize(request, options = nil) + # Pass arguments to `long_running_recognize` via a request object, either of type + # {::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload long_running_recognize(config: nil, audio: nil, output_config: nil) + # Pass arguments to `long_running_recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig, ::Hash] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @param audio [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio, ::Hash] + # Required. The audio data to be recognized. + # @param output_config [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig, ::Hash] + # Optional. Specifies an optional destination for the recognition results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v1p1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new + # + # # Call the long_running_recognize method. + # result = client.long_running_recognize request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def long_running_recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.long_running_recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.long_running_recognize.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.long_running_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.long_running_recognize request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 Speech REST API. + # + # This class represents the configuration for Speech REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # recognize to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.recognize.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.recognize.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Speech API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :recognize + ## + # RPC-specific configuration for `long_running_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :long_running_recognize + + # @private + def initialize parent_rpcs = nil + recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize + @recognize = ::Gapic::Config::Method.new recognize_config + long_running_recognize_config = parent_rpcs.long_running_recognize if parent_rpcs.respond_to? :long_running_recognize + @long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/operations.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/operations.rb new file mode 100644 index 000000000000..6334c916e3b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/operations.rb @@ -0,0 +1,923 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Speech + module V1p1beta1 + module Speech + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Speech 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 Speech 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::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/operations", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p1beta1/operations/{name}", + matches: [ + ["name", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb new file mode 100644 index 000000000000..5822dffd5c1b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/speech/v1p1beta1/cloud_speech_pb" + +module Google + module Cloud + module Speech + module V1p1beta1 + module Speech + module Rest + ## + # REST service stub for the Speech 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 recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::RecognizeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] + # A result object deserialized from the server's reply + def recognize request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_recognize_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "recognize", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V1p1beta1::RecognizeResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the long_running_recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def long_running_recognize request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_long_running_recognize_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "long_running_recognize", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::RecognizeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_recognize_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/speech:recognize", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the long_running_recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_long_running_recognize_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p1beta1/speech:longrunningrecognize", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/version.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/version.rb new file mode 100644 index 000000000000..44ab865d9484 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Speech + module V1p1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/README.md new file mode 100644 index 000000000000..61d72528ac28 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Speech-to-Text V1p1beta1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb new file mode 100644 index 000000000000..00d8a38fa769 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb @@ -0,0 +1,1033 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Speech + module V1p1beta1 + # The top-level message sent by the client for the `Recognize` method. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @!attribute [rw] audio + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio] + # Required. The audio data to be recognized. + class RecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message sent by the client for the `LongRunningRecognize` + # method. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @!attribute [rw] audio + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio] + # Required. The audio data to be recognized. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig] + # Optional. Specifies an optional destination for the recognition results. + class LongRunningRecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies an optional destination for the recognition results. + # @!attribute [rw] gcs_uri + # @return [::String] + # Specifies a Cloud Storage URI for the recognition results. Must be + # specified in the format: `gs://bucket_name/object_name`, and the bucket + # must already exist. + class TranscriptOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message sent by the client for the `StreamingRecognize` method. + # Multiple `StreamingRecognizeRequest` messages are sent. The first message + # must contain a `streaming_config` message and must not contain + # `audio_content`. All subsequent messages must contain `audio_content` and + # must not contain a `streaming_config` message. + # @!attribute [rw] streaming_config + # @return [::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionConfig] + # Provides information to the recognizer that specifies how to process the + # request. The first `StreamingRecognizeRequest` message must contain a + # `streaming_config` message. + # + # Note: The following fields are mutually exclusive: `streaming_config`, `audio_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] audio_content + # @return [::String] + # The audio data to be recognized. Sequential chunks of audio data are sent + # in sequential `StreamingRecognizeRequest` messages. The first + # `StreamingRecognizeRequest` message must not contain `audio_content` data + # and all subsequent `StreamingRecognizeRequest` messages must contain + # `audio_content` data. The audio bytes must be encoded as specified in + # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + # pure binary representation (not base64). See + # [content limits](https://cloud.google.com/speech-to-text/quotas#content). + # + # Note: The following fields are mutually exclusive: `audio_content`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class StreamingRecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides information to the recognizer that specifies how to process the + # request. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig] + # Required. Provides information to the recognizer that specifies how to + # process the request. + # @!attribute [rw] single_utterance + # @return [::Boolean] + # If `false` or omitted, the recognizer will perform continuous + # recognition (continuing to wait for and process audio even if the user + # pauses speaking) until the client closes the input stream (gRPC API) or + # until the maximum time limit has been reached. May return multiple + # `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + # + # If `true`, the recognizer will detect a single spoken utterance. When it + # detects that the user has paused or stopped speaking, it will return an + # `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + # more than one `StreamingRecognitionResult` with the `is_final` flag set to + # `true`. + # + # The `single_utterance` field can only be used with specified models, + # otherwise an error is thrown. The `model` field in + # {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig RecognitionConfig} must + # be set to: + # + # * `command_and_search` + # * `phone_call` AND additional field `useEnhanced`=`true` + # * The `model` field is left undefined. In this case the API auto-selects + # a model based on any other parameters that you set in + # `RecognitionConfig`. + # @!attribute [rw] interim_results + # @return [::Boolean] + # If `true`, interim results (tentative hypotheses) may be + # returned as they become available (these interim results are indicated with + # the `is_final=false` flag). + # If `false` or omitted, only `is_final=true` result(s) are returned. + # @!attribute [rw] enable_voice_activity_events + # @return [::Boolean] + # If `true`, responses with voice activity speech events will be returned as + # they are detected. + # @!attribute [rw] voice_activity_timeout + # @return [::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionConfig::VoiceActivityTimeout] + # If set, the server will automatically close the stream after the specified + # duration has elapsed after the last VOICE_ACTIVITY speech event has been + # sent. The field `voice_activity_events` must also be set to true. + class StreamingRecognitionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Events that a timeout can be set on for voice activity. + # @!attribute [rw] speech_start_timeout + # @return [::Google::Protobuf::Duration] + # Duration to timeout the stream if no speech begins. + # @!attribute [rw] speech_end_timeout + # @return [::Google::Protobuf::Duration] + # Duration to timeout the stream after speech ends. + class VoiceActivityTimeout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Provides information to the recognizer that specifies how to process the + # request. + # @!attribute [rw] encoding + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding] + # Encoding of audio data sent in all `RecognitionAudio` messages. + # This field is optional for `FLAC` and `WAV` audio files and required + # for all other audio formats. For details, see + # {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Sample rate in Hertz of the audio data sent in all + # `RecognitionAudio` messages. Valid values are: 8000-48000. + # 16000 is optimal. For best results, set the sampling rate of the audio + # source to 16000 Hz. If that's not possible, use the native sample rate of + # the audio source (instead of re-sampling). + # This field is optional for FLAC and WAV audio files, but is + # required for all other audio formats. For details, see + # {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}. + # @!attribute [rw] audio_channel_count + # @return [::Integer] + # The number of channels in the input audio data. + # ONLY set this for MULTI-CHANNEL recognition. + # Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. + # Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. + # If `0` or omitted, defaults to one channel (mono). + # Note: We only recognize the first channel by default. + # To perform independent recognition on each channel set + # `enable_separate_recognition_per_channel` to 'true'. + # @!attribute [rw] enable_separate_recognition_per_channel + # @return [::Boolean] + # This needs to be set to `true` explicitly and `audio_channel_count` > 1 + # to get each channel recognized separately. The recognition result will + # contain a `channel_tag` field to state which channel that result belongs + # to. If this is not true, we will only recognize the first channel. The + # request is billed cumulatively for all channels recognized: + # `audio_channel_count` multiplied by the length of the audio. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language of the supplied audio as a + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # Example: "en-US". + # See [Language + # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + # of the currently supported language codes. + # @!attribute [rw] alternative_language_codes + # @return [::Array<::String>] + # A list of up to 3 additional + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, + # listing possible alternative languages of the supplied audio. + # See [Language + # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + # of the currently supported language codes. If alternative languages are + # listed, recognition result will contain recognition in the most likely + # language detected including the main language_code. The recognition result + # will include the language tag of the language detected in the audio. Note: + # This feature is only supported for Voice Command and Voice Search use cases + # and performance may vary for other use cases (e.g., phone call + # transcription). + # @!attribute [rw] max_alternatives + # @return [::Integer] + # Maximum number of recognition hypotheses to be returned. + # Specifically, the maximum number of `SpeechRecognitionAlternative` messages + # within each `SpeechRecognitionResult`. + # The server may return fewer than `max_alternatives`. + # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + # one. If omitted, will return a maximum of one. + # @!attribute [rw] profanity_filter + # @return [::Boolean] + # If set to `true`, the server will attempt to filter out + # profanities, replacing all but the initial character in each filtered word + # with asterisks, e.g. "f***". If set to `false` or omitted, profanities + # won't be filtered out. + # @!attribute [rw] adaptation + # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptation] + # Speech adaptation configuration improves the accuracy of speech + # recognition. For more information, see the [speech + # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) + # documentation. + # When speech adaptation is set it supersedes the `speech_contexts` field. + # @!attribute [rw] transcript_normalization + # @return [::Google::Cloud::Speech::V1p1beta1::TranscriptNormalization] + # Optional. Use transcription normalization to automatically replace parts of + # the transcript with phrases of your choosing. For StreamingRecognize, this + # normalization only applies to stable partial transcripts (stability > 0.8) + # and final transcripts. + # @!attribute [rw] speech_contexts + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechContext>] + # Array of {::Google::Cloud::Speech::V1p1beta1::SpeechContext SpeechContext}. + # A means to provide context to assist the speech recognition. For more + # information, see + # [speech + # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). + # @!attribute [rw] enable_word_time_offsets + # @return [::Boolean] + # If `true`, the top result includes a list of words and + # the start and end time offsets (timestamps) for those words. If + # `false`, no word-level time offset information is returned. The default is + # `false`. + # @!attribute [rw] enable_word_confidence + # @return [::Boolean] + # If `true`, the top result includes a list of words and the + # confidence for those words. If `false`, no word-level confidence + # information is returned. The default is `false`. + # @!attribute [rw] enable_automatic_punctuation + # @return [::Boolean] + # If 'true', adds punctuation to recognition result hypotheses. + # This feature is only available in select languages. Setting this for + # requests in other languages has no effect at all. + # The default 'false' value does not add punctuation to result hypotheses. + # @!attribute [rw] enable_spoken_punctuation + # @return [::Google::Protobuf::BoolValue] + # The spoken punctuation behavior for the call + # If not set, uses default behavior based on model of choice + # e.g. command_and_search will enable spoken punctuation by default + # If 'true', replaces spoken punctuation with the corresponding symbols in + # the request. For example, "how are you question mark" becomes "how are + # you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation + # for support. If 'false', spoken punctuation is not replaced. + # @!attribute [rw] enable_spoken_emojis + # @return [::Google::Protobuf::BoolValue] + # The spoken emoji behavior for the call + # If not set, uses default behavior based on model of choice + # If 'true', adds spoken emoji formatting for the request. This will replace + # spoken emojis with the corresponding Unicode symbols in the final + # transcript. If 'false', spoken emojis are not replaced. + # @!attribute [rw] enable_speaker_diarization + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # If 'true', enables speaker detection for each recognized word in + # the top alternative of the recognition result using a speaker_label + # provided in the WordInfo. + # Note: Use diarization_config instead. + # @!attribute [rw] diarization_speaker_count + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # If set, specifies the estimated number of speakers in the conversation. + # Defaults to '2'. Ignored unless enable_speaker_diarization is set to true. + # Note: Use diarization_config instead. + # @!attribute [rw] diarization_config + # @return [::Google::Cloud::Speech::V1p1beta1::SpeakerDiarizationConfig] + # Config to enable speaker diarization and set additional + # parameters to make diarization better suited for your application. + # Note: When this is enabled, we send all the words from the beginning of the + # audio for the top alternative in every consecutive STREAMING responses. + # This is done in order to improve our speaker tags as our models learn to + # identify the speakers in the conversation over time. + # For non-streaming requests, the diarization results will be provided only + # in the top alternative of the FINAL SpeechRecognitionResult. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata] + # Metadata regarding this request. + # @!attribute [rw] model + # @return [::String] + # Which model to select for the given request. Select the model + # best suited to your domain to get best results. If a model is not + # explicitly specified, then we auto-select a model based on the parameters + # in the RecognitionConfig. + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + #
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed + # speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically + # recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple + # speakers. Ideally the audio is recorded at a 16khz or greater + # sampling rate. This is a premium model that costs more than the + # standard rate.
defaultBest for audio that is not one of the specific audio models. + # For example, long-form audio. Ideally the audio is high-fidelity, + # recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a + # medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical + # provider.
+ # @!attribute [rw] use_enhanced + # @return [::Boolean] + # Set to true to use an enhanced model for speech recognition. + # If `use_enhanced` is set to true and the `model` field is not set, then + # an appropriate enhanced model is chosen if an enhanced model exists for + # the audio. + # + # If `use_enhanced` is true and an enhanced version of the specified model + # does not exist, then the speech is recognized using the standard version + # of the specified model. + class RecognitionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The encoding of the audio data sent in the request. + # + # All encodings support only 1 channel (mono) audio, unless the + # `audio_channel_count` and `enable_separate_recognition_per_channel` fields + # are set. + # + # For best results, the audio source should be captured and transmitted using + # a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech + # recognition can be reduced if lossy codecs are used to capture or transmit + # audio, particularly if background noise is present. Lossy codecs include + # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, + # and `WEBM_OPUS`. + # + # The `FLAC` and `WAV` audio file formats include a header that describes the + # included audio content. You can request recognition for `WAV` files that + # contain either `LINEAR16` or `MULAW` encoded audio. + # If you send `FLAC` or `WAV` audio file format in + # your request, you do not need to specify an `AudioEncoding`; the audio + # encoding format is determined from the file header. If you specify + # an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the + # encoding configuration must match the encoding described in the audio + # header; otherwise the request returns an + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error + # code. + module AudioEncoding + # Not specified. + ENCODING_UNSPECIFIED = 0 + + # Uncompressed 16-bit signed little-endian samples (Linear PCM). + LINEAR16 = 1 + + # `FLAC` (Free Lossless Audio + # Codec) is the recommended encoding because it is + # lossless--therefore recognition is not compromised--and + # requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + # encoding supports 16-bit and 24-bit samples, however, not all fields in + # `STREAMINFO` are supported. + FLAC = 2 + + # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 3 + + # Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AMR = 4 + + # Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AMR_WB = 5 + + # Opus encoded audio frames in Ogg container + # ([OggOpus](https://wiki.xiph.org/OggOpus)). + # `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + OGG_OPUS = 6 + + # Although the use of lossy encodings is not recommended, if a very low + # bitrate encoding is required, `OGG_OPUS` is highly preferred over + # Speex encoding. The [Speex](https://speex.org/) encoding supported by + # Cloud Speech API has a header byte in each block, as in MIME type + # `audio/x-speex-with-header-byte`. + # It is a variant of the RTP Speex encoding defined in + # [RFC 5574](https://tools.ietf.org/html/rfc5574). + # The stream is a sequence of blocks, one block per RTP packet. Each block + # starts with a byte containing the length of the block, in bytes, followed + # by one or more frames of Speex data, padded to an integral number of + # bytes (octets) as specified in RFC 5574. In other words, each RTP header + # is replaced with a single byte containing the block length. Only Speex + # wideband is supported. `sample_rate_hertz` must be 16000. + SPEEX_WITH_HEADER_BYTE = 7 + + # MP3 audio. MP3 encoding is a Beta feature and only available in + # v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 + # kbps). When using this encoding, `sample_rate_hertz` has to match the + # sample rate of the file being used. + MP3 = 8 + + # Opus encoded audio frames in WebM container + # ([WebM](https://www.webmproject.org/docs/container/)). + # `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + WEBM_OPUS = 9 + + # 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + ALAW = 10 + end + end + + # Config to enable speaker diarization. + # @!attribute [rw] enable_speaker_diarization + # @return [::Boolean] + # If 'true', enables speaker detection for each recognized word in + # the top alternative of the recognition result using a speaker_label + # provided in the WordInfo. + # @!attribute [rw] min_speaker_count + # @return [::Integer] + # Minimum number of speakers in the conversation. This range gives you more + # flexibility by allowing the system to automatically determine the correct + # number of speakers. If not set, the default value is 2. + # @!attribute [rw] max_speaker_count + # @return [::Integer] + # Maximum number of speakers in the conversation. This range gives you more + # flexibility by allowing the system to automatically determine the correct + # number of speakers. If not set, the default value is 6. + # @!attribute [r] speaker_tag + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Output only. Unused. + class SpeakerDiarizationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of audio data to be recognized. + # @deprecated This message is deprecated and may be removed in the next major version update. + # @!attribute [rw] interaction_type + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::InteractionType] + # The use case most closely describing the audio content to be recognized. + # @!attribute [rw] industry_naics_code_of_audio + # @return [::Integer] + # The industry vertical to which this speech recognition request most + # closely applies. This is most indicative of the topics contained + # in the audio. Use the 6-digit NAICS code to identify the industry + # vertical - see https://www.naics.com/search/. + # @!attribute [rw] microphone_distance + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::MicrophoneDistance] + # The audio type that most closely describes the audio being recognized. + # @!attribute [rw] original_media_type + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::OriginalMediaType] + # The original media the speech was recorded on. + # @!attribute [rw] recording_device_type + # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::RecordingDeviceType] + # The type of device the speech was recorded with. + # @!attribute [rw] recording_device_name + # @return [::String] + # The device used to make the recording. Examples 'Nexus 5X' or + # 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + # 'Cardioid Microphone'. + # @!attribute [rw] original_mime_type + # @return [::String] + # Mime type of the original audio file. For example `audio/m4a`, + # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + # A list of possible audio mime types is maintained at + # http://www.iana.org/assignments/media-types/media-types.xhtml#audio + # @!attribute [rw] obfuscated_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Obfuscated (privacy-protected) ID of the user, to identify number of + # unique users using the service. + # @!attribute [rw] audio_topic + # @return [::String] + # Description of the content. Eg. "Recordings of federal supreme court + # hearings from 2012". + class RecognitionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Use case categories that the audio recognition request can be described + # by. + module InteractionType + # Use case is either unknown or is something other than one of the other + # values below. + INTERACTION_TYPE_UNSPECIFIED = 0 + + # Multiple people in a conversation or discussion. For example in a + # meeting with two or more people actively participating. Typically + # all the primary people speaking would be in the same room (if not, + # see PHONE_CALL) + DISCUSSION = 1 + + # One or more persons lecturing or presenting to others, mostly + # uninterrupted. + PRESENTATION = 2 + + # A phone-call or video-conference in which two or more people, who are + # not in the same room, are actively participating. + PHONE_CALL = 3 + + # A recorded message intended for another person to listen to. + VOICEMAIL = 4 + + # Professionally produced audio (eg. TV Show, Podcast). + PROFESSIONALLY_PRODUCED = 5 + + # Transcribe spoken questions and queries into text. + VOICE_SEARCH = 6 + + # Transcribe voice commands, such as for controlling a device. + VOICE_COMMAND = 7 + + # Transcribe speech to text to create a written document, such as a + # text-message, email or report. + DICTATION = 8 + end + + # Enumerates the types of capture settings describing an audio file. + module MicrophoneDistance + # Audio type is not known. + MICROPHONE_DISTANCE_UNSPECIFIED = 0 + + # The audio was captured from a closely placed microphone. Eg. phone, + # dictaphone, or handheld microphone. Generally if there speaker is within + # 1 meter of the microphone. + NEARFIELD = 1 + + # The speaker if within 3 meters of the microphone. + MIDFIELD = 2 + + # The speaker is more than 3 meters away from the microphone. + FARFIELD = 3 + end + + # The original media the speech was recorded on. + module OriginalMediaType + # Unknown original media type. + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0 + + # The speech data is an audio recording. + AUDIO = 1 + + # The speech data originally recorded on a video. + VIDEO = 2 + end + + # The type of device the speech was recorded with. + module RecordingDeviceType + # The recording device is unknown. + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0 + + # Speech was recorded on a smartphone. + SMARTPHONE = 1 + + # Speech was recorded using a personal computer or tablet. + PC = 2 + + # Speech was recorded over a phone line. + PHONE_LINE = 3 + + # Speech was recorded in a vehicle. + VEHICLE = 4 + + # Speech was recorded outdoors. + OTHER_OUTDOOR_DEVICE = 5 + + # Speech was recorded indoors. + OTHER_INDOOR_DEVICE = 6 + end + end + + # Provides "hints" to the speech recognizer to favor specific words and phrases + # in the results. + # @!attribute [rw] phrases + # @return [::Array<::String>] + # A list of strings containing words and phrases "hints" so that + # the speech recognition is more likely to recognize them. This can be used + # to improve the accuracy for specific words and phrases, for example, if + # specific commands are typically spoken by the user. This can also be used + # to add additional words to the vocabulary of the recognizer. See + # [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + # + # List items can also be set to classes for groups of words that represent + # common concepts that occur in natural language. For example, rather than + # providing phrase hints for every month of the year, using the $MONTH class + # improves the likelihood of correctly transcribing audio that includes + # months. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Positive value will increase the probability that a specific + # phrase will be recognized over other similar sounding phrases. The higher + # the boost, the higher the chance of false positive recognition as well. + # Negative boost values would correspond to anti-biasing. Anti-biasing is not + # enabled, so negative boost will simply be ignored. Though `boost` can + # accept a wide range of positive values, most use cases are best served with + # values between 0 and 20. We recommend using a binary search approach to + # finding the optimal value for your use case. + class SpeechContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains audio data in the encoding specified in the `RecognitionConfig`. + # Either `content` or `uri` must be supplied. Supplying both or neither + # returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + # See [content limits](https://cloud.google.com/speech-to-text/quotas#content). + # @!attribute [rw] content + # @return [::String] + # The audio data bytes encoded as specified in + # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + # pure binary representation, whereas JSON representations use base64. + # + # Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uri + # @return [::String] + # URI that points to a file that contains audio data bytes as specified in + # `RecognitionConfig`. The file must not be compressed (for example, gzip). + # Currently, only Google Cloud Storage URIs are + # supported, which must be specified in the following format: + # `gs://bucket_name/object_name` (other URI formats return + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). + # For more information, see [Request + # URIs](https://cloud.google.com/storage/docs/reference-uris). + # + # Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class RecognitionAudio + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The only message returned to the client by the `Recognize` method. It + # contains the result as zero or more sequential `SpeechRecognitionResult` + # messages. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>] + # Sequential list of transcription results corresponding to + # sequential portions of audio. + # @!attribute [rw] total_billed_time + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the corresponding request. + # @!attribute [rw] speech_adaptation_info + # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptationInfo] + # Provides information on adaptation behavior in response + # @!attribute [rw] request_id + # @return [::Integer] + # The ID associated with the request. This is a unique ID specific only to + # the given request. + # @!attribute [rw] using_legacy_models + # @return [::Boolean] + # Whether request used legacy asr models (was not automatically migrated to + # use conformer models). + class RecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The only message returned to the client by the `LongRunningRecognize` method. + # It contains the result as zero or more sequential `SpeechRecognitionResult` + # messages. It is included in the `result.response` field of the `Operation` + # returned by the `GetOperation` call of the `google::longrunning::Operations` + # service. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>] + # Sequential list of transcription results corresponding to + # sequential portions of audio. + # @!attribute [rw] total_billed_time + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the corresponding request. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig] + # Original output config if present in the request. + # @!attribute [rw] output_error + # @return [::Google::Rpc::Status] + # If the transcript output fails this field contains the relevant error. + # @!attribute [rw] speech_adaptation_info + # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptationInfo] + # Provides information on speech adaptation behavior in response + # @!attribute [rw] request_id + # @return [::Integer] + # The ID associated with the request. This is a unique ID specific only to + # the given request. + class LongRunningRecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the progress of a long-running `LongRunningRecognize` call. It is + # included in the `metadata` field of the `Operation` returned by the + # `GetOperation` call of the `google::longrunning::Operations` service. + # @!attribute [rw] progress_percent + # @return [::Integer] + # Approximate percentage of audio processed thus far. Guaranteed to be 100 + # when the audio is fully processed and the results are available. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Time when the request was received. + # @!attribute [rw] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Time of the most recent processing update. + # @!attribute [r] uri + # @return [::String] + # Output only. The URI of the audio file being transcribed. Empty if the + # audio was sent as byte content. + # @!attribute [r] output_config + # @return [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig] + # Output only. A copy of the TranscriptOutputConfig if it was set in the + # request. + class LongRunningRecognizeMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `StreamingRecognizeResponse` is the only message returned to the client by + # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` + # messages are streamed back to the client. If there is no recognizable + # audio, and `single_utterance` is set to false, then no messages are streamed + # back to the client. + # + # Here's an example of a series of `StreamingRecognizeResponse`s that might be + # returned while processing audio: + # + # 1. results { alternatives { transcript: "tube" } stability: 0.01 } + # + # 2. results { alternatives { transcript: "to be a" } stability: 0.01 } + # + # 3. results { alternatives { transcript: "to be" } stability: 0.9 } + # results { alternatives { transcript: " or not to be" } stability: 0.01 } + # + # 4. results { alternatives { transcript: "to be or not to be" + # confidence: 0.92 } + # alternatives { transcript: "to bee or not to bee" } + # is_final: true } + # + # 5. results { alternatives { transcript: " that's" } stability: 0.01 } + # + # 6. results { alternatives { transcript: " that is" } stability: 0.9 } + # results { alternatives { transcript: " the question" } stability: 0.01 } + # + # 7. results { alternatives { transcript: " that is the question" + # confidence: 0.98 } + # alternatives { transcript: " that was the question" } + # is_final: true } + # + # Notes: + # + # - Only two of the above responses #4 and #7 contain final results; they are + # indicated by `is_final: true`. Concatenating these together generates the + # full transcript: "to be or not to be that is the question". + # + # - The others contain interim `results`. #3 and #6 contain two interim + # `results`: the first portion has a high stability and is less likely to + # change; the second portion has a low stability and is very likely to + # change. A UI designer might choose to show only high stability `results`. + # + # - The specific `stability` and `confidence` values shown above are only for + # illustrative purposes. Actual values may vary. + # + # - In each response, only one of these fields will be set: + # `error`, + # `speech_event_type`, or + # one or more (repeated) `results`. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # If set, returns a {::Google::Rpc::Status google.rpc.Status} message that + # specifies the error for the operation. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionResult>] + # This repeated list contains zero or more results that + # correspond to consecutive portions of the audio currently being processed. + # It contains zero or one `is_final=true` result (the newly settled portion), + # followed by zero or more `is_final=false` results (the interim results). + # @!attribute [rw] speech_event_type + # @return [::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse::SpeechEventType] + # Indicates the type of speech event. + # @!attribute [rw] speech_event_time + # @return [::Google::Protobuf::Duration] + # Time offset between the beginning of the audio and event emission. + # @!attribute [rw] total_billed_time + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the stream. + # Set only if this is the last response in the stream. + # @!attribute [rw] speech_adaptation_info + # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptationInfo] + # Provides information on adaptation behavior in response + # @!attribute [rw] request_id + # @return [::Integer] + # The ID associated with the request. This is a unique ID specific only to + # the given request. + class StreamingRecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the type of speech event. + module SpeechEventType + # No speech event specified. + SPEECH_EVENT_UNSPECIFIED = 0 + + # This event indicates that the server has detected the end of the user's + # speech utterance and expects no additional speech. Therefore, the server + # will not process additional audio (although it may subsequently return + # additional results). The client should stop sending additional audio + # data, half-close the gRPC connection, and wait for any additional results + # until the server closes the gRPC connection. This event is only sent if + # `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 1 + + # This event indicates that the server has detected the beginning of human + # voice activity in the stream. This event can be returned multiple times + # if speech starts and stops repeatedly throughout the stream. This event + # is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2 + + # This event indicates that the server has detected the end of human voice + # activity in the stream. This event can be returned multiple times if + # speech starts and stops repeatedly throughout the stream. This event is + # only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3 + + # This event indicates that the user-set timeout for speech activity begin + # or end has exceeded. Upon receiving this event, the client is expected to + # send a half close. Further audio will not be processed. + SPEECH_ACTIVITY_TIMEOUT = 4 + end + end + + # A streaming speech recognition result corresponding to a portion of the audio + # that is currently being processed. + # @!attribute [rw] alternatives + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>] + # May contain one or more recognition hypotheses (up to the + # maximum specified in `max_alternatives`). + # These alternatives are ordered in terms of accuracy, with the top (first) + # alternative being the most probable, as ranked by the recognizer. + # @!attribute [rw] is_final + # @return [::Boolean] + # If `false`, this `StreamingRecognitionResult` represents an + # interim result that may change. If `true`, this is the final time the + # speech service will return this particular `StreamingRecognitionResult`, + # the recognizer will not return any further hypotheses for this portion of + # the transcript and corresponding audio. + # @!attribute [rw] stability + # @return [::Float] + # An estimate of the likelihood that the recognizer will not + # change its guess about this interim result. Values range from 0.0 + # (completely unstable) to 1.0 (completely stable). + # This field is only provided for interim results (`is_final=false`). + # The default of 0.0 is a sentinel value indicating `stability` was not set. + # @!attribute [rw] result_end_time + # @return [::Google::Protobuf::Duration] + # Time offset of the end of this result relative to the + # beginning of the audio. + # @!attribute [rw] channel_tag + # @return [::Integer] + # For multi-channel audio, this is the channel number corresponding to the + # recognized result for the audio from that channel. + # For audio_channel_count = N, its output values can range from '1' to 'N'. + # @!attribute [r] language_code + # @return [::String] + # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag of the language in this result. This language code was + # detected to have the most likelihood of being spoken in the audio. + class StreamingRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A speech recognition result corresponding to a portion of the audio. + # @!attribute [rw] alternatives + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>] + # May contain one or more recognition hypotheses (up to the + # maximum specified in `max_alternatives`). + # These alternatives are ordered in terms of accuracy, with the top (first) + # alternative being the most probable, as ranked by the recognizer. + # @!attribute [rw] channel_tag + # @return [::Integer] + # For multi-channel audio, this is the channel number corresponding to the + # recognized result for the audio from that channel. + # For audio_channel_count = N, its output values can range from '1' to 'N'. + # @!attribute [rw] result_end_time + # @return [::Google::Protobuf::Duration] + # Time offset of the end of this result relative to the + # beginning of the audio. + # @!attribute [r] language_code + # @return [::String] + # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag of the language in this result. This language code was + # detected to have the most likelihood of being spoken in the audio. + class SpeechRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Alternative hypotheses (a.k.a. n-best list). + # @!attribute [rw] transcript + # @return [::String] + # Transcript text representing the words that the user spoke. + # In languages that use spaces to separate words, the transcript might have a + # leading space if it isn't the first result. You can concatenate each result + # to obtain the full transcript without using a separator. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence estimate between 0.0 and 1.0. A higher number + # indicates an estimated greater likelihood that the recognized words are + # correct. This field is set only for the top alternative of a non-streaming + # result or, of a streaming result where `is_final=true`. + # This field is not guaranteed to be accurate and users should not rely on it + # to be always provided. + # The default of 0.0 is a sentinel value indicating `confidence` was not set. + # @!attribute [rw] words + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::WordInfo>] + # A list of word-specific information for each recognized word. + # Note: When `enable_speaker_diarization` is true, you will see all the words + # from the beginning of the audio. + class SpeechRecognitionAlternative + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Word-specific information for recognized words. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio, + # and corresponding to the start of the spoken word. + # This field is only set if `enable_word_time_offsets=true` and only + # in the top hypothesis. + # This is an experimental feature and the accuracy of the time offset can + # vary. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio, + # and corresponding to the end of the spoken word. + # This field is only set if `enable_word_time_offsets=true` and only + # in the top hypothesis. + # This is an experimental feature and the accuracy of the time offset can + # vary. + # @!attribute [rw] word + # @return [::String] + # The word corresponding to this set of information. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence estimate between 0.0 and 1.0. A higher number + # indicates an estimated greater likelihood that the recognized words are + # correct. This field is set only for the top alternative of a non-streaming + # result or, of a streaming result where `is_final=true`. + # This field is not guaranteed to be accurate and users should not rely on it + # to be always provided. + # The default of 0.0 is a sentinel value indicating `confidence` was not set. + # @!attribute [r] speaker_tag + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Output only. A distinct integer value is assigned for every speaker within + # the audio. This field specifies which one of those speakers was detected to + # have spoken this word. Value ranges from '1' to diarization_speaker_count. + # speaker_tag is set if enable_speaker_diarization = 'true' and only for the + # top alternative. + # Note: Use speaker_label instead. + # @!attribute [r] speaker_label + # @return [::String] + # Output only. A label value assigned for every unique speaker within the + # audio. This field specifies which speaker was detected to have spoken this + # word. For some models, like medical_conversation this can be actual speaker + # role, for example "patient" or "provider", but generally this would be a + # number identifying a speaker. This field is only set if + # enable_speaker_diarization = 'true' and only for the top alternative. + class WordInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information on speech adaptation use in results + # @!attribute [rw] adaptation_timeout + # @return [::Boolean] + # Whether there was a timeout when applying speech adaptation. If true, + # adaptation had no effect in the response transcript. + # @!attribute [rw] timeout_message + # @return [::String] + # If set, returns a message specifying which part of the speech adaptation + # request timed out. + class SpeechAdaptationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb new file mode 100644 index 000000000000..9d33bec8a1dd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.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! + + +module Google + module Cloud + module Speech + module V1p1beta1 + # Message sent by the client for the `CreatePhraseSet` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this phrase set will be created. + # Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] phrase_set_id + # @return [::String] + # Required. The ID to use for the phrase set, which will become the final + # component of the phrase set's resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @!attribute [rw] phrase_set + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # Required. The phrase set to create. + class CreatePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `UpdatePhraseSet` method. + # @!attribute [rw] phrase_set + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] + # Required. The phrase set to update. + # + # The phrase set's `name` field is used to identify the set to be + # updated. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdatePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `GetPhraseSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the phrase set to retrieve. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + class GetPhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `ListPhraseSet` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of phrase set. Format: + # + # `projects/{project}/locations/{location}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of phrase sets to return. The service may return + # fewer than this value. If unspecified, at most 50 phrase sets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListPhraseSet` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPhraseSet` must + # match the call that provided the page token. + class ListPhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned to the client by the `ListPhraseSet` method. + # @!attribute [rw] phrase_sets + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::PhraseSet>] + # The phrase set. + # @!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 ListPhraseSetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `DeletePhraseSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the phrase set to delete. Format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + class DeletePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `CreateCustomClass` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this custom class will be created. + # Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] custom_class_id + # @return [::String] + # Required. The ID to use for the custom class, which will become the final + # component of the custom class' resource name. + # + # This value should restrict to letters, numbers, and hyphens, with the first + # character a letter, the last a letter or a number, and be 4-63 characters. + # @!attribute [rw] custom_class + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # Required. The custom class to create. + class CreateCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `UpdateCustomClass` method. + # @!attribute [rw] custom_class + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] + # Required. The custom class to update. + # + # The custom class's `name` field is used to identify the custom class to be + # updated. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `GetCustomClass` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the custom class to retrieve. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + class GetCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `ListCustomClasses` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of custom classes. Format: + # + # `projects/{project}/locations/{location}/customClasses` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of custom classes to return. The service may return + # fewer than this value. If unspecified, at most 50 custom classes will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListCustomClass` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCustomClass` must + # match the call that provided the page token. + class ListCustomClassesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned to the client by the `ListCustomClasses` method. + # @!attribute [rw] custom_classes + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::CustomClass>] + # The custom classes. + # @!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 ListCustomClassesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message sent by the client for the `DeleteCustomClass` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the custom class to delete. Format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + class DeleteCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/resource.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/resource.rb new file mode 100644 index 000000000000..09887768ca8a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/resource.rb @@ -0,0 +1,325 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Speech + module V1p1beta1 + # A set of words or phrases that represents a common concept likely to appear + # in your audio, for example a list of passenger ship names. CustomClass items + # can be substituted into placeholders that you set in PhraseSet phrases. + # @!attribute [rw] name + # @return [::String] + # The resource name of the custom class. + # @!attribute [rw] custom_class_id + # @return [::String] + # If this custom class is a resource, the custom_class_id is the resource id + # of the CustomClass. Case sensitive. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::CustomClass::ClassItem>] + # A collection of class items. + # @!attribute [r] kms_key_name + # @return [::String] + # Output only. The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the content of the ClassItem is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] kms_key_version_name + # @return [::String] + # Output only. The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which content of the ClassItem is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + # @!attribute [r] uid + # @return [::String] + # Output only. System-assigned unique identifier for the CustomClass. + # This field is not used. + # @!attribute [r] display_name + # @return [::String] + # Output only. User-settable, human-readable name for the CustomClass. Must + # be 63 characters or less. This field is not used. + # @!attribute [r] state + # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass::State] + # Output only. The CustomClass lifecycle state. + # This field is not used. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource was requested for deletion. + # This field is not used. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource will be purged. + # This field is not used. + # @!attribute [r] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. Allows users to store small amounts of arbitrary data. + # Both the key and the value must be 63 characters or less each. + # At most 100 annotations. + # This field is not used. + # @!attribute [r] etag + # @return [::String] + # Output only. This checksum is computed by the server based on the value of + # other fields. This may be sent on update, undelete, and delete requests to + # ensure the client has an up-to-date value before proceeding. This field is + # not used. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Whether or not this CustomClass is in the process of being + # updated. This field is not used. + class CustomClass + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An item of the class. + # @!attribute [rw] value + # @return [::String] + # The class item's value. + class ClassItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of states that define the lifecycle of a CustomClass. + module State + # Unspecified state. This is only used/useful for distinguishing + # unset values. + STATE_UNSPECIFIED = 0 + + # The normal and active state. + ACTIVE = 2 + + # This CustomClass has been deleted. + DELETED = 4 + end + end + + # Provides "hints" to the speech recognizer to favor specific words and phrases + # in the results. + # @!attribute [rw] name + # @return [::String] + # The resource name of the phrase set. + # @!attribute [rw] phrases + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::PhraseSet::Phrase>] + # A list of word and phrases. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Positive value will increase the probability that a specific + # phrase will be recognized over other similar sounding phrases. The higher + # the boost, the higher the chance of false positive recognition as well. + # Negative boost values would correspond to anti-biasing. Anti-biasing is not + # enabled, so negative boost will simply be ignored. Though `boost` can + # accept a wide range of positive values, most use cases are best served with + # values between 0 (exclusive) and 20. We recommend using a binary search + # approach to finding the optimal value for your use case as well as adding + # phrases both with and without boost to your requests. + # @!attribute [r] kms_key_name + # @return [::String] + # Output only. The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the content of the PhraseSet is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] kms_key_version_name + # @return [::String] + # Output only. The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which content of the PhraseSet is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + # @!attribute [r] uid + # @return [::String] + # Output only. System-assigned unique identifier for the PhraseSet. + # This field is not used. + # @!attribute [r] display_name + # @return [::String] + # Output only. User-settable, human-readable name for the PhraseSet. Must be + # 63 characters or less. This field is not used. + # @!attribute [r] state + # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet::State] + # Output only. The CustomClass lifecycle state. + # This field is not used. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource was requested for deletion. + # This field is not used. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource will be purged. + # This field is not used. + # @!attribute [r] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. Allows users to store small amounts of arbitrary data. + # Both the key and the value must be 63 characters or less each. + # At most 100 annotations. + # This field is not used. + # @!attribute [r] etag + # @return [::String] + # Output only. This checksum is computed by the server based on the value of + # other fields. This may be sent on update, undelete, and delete requests to + # ensure the client has an up-to-date value before proceeding. This field is + # not used. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Whether or not this PhraseSet is in the process of being + # updated. This field is not used. + class PhraseSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A phrases containing words and phrase "hints" so that + # the speech recognition is more likely to recognize them. This can be used + # to improve the accuracy for specific words and phrases, for example, if + # specific commands are typically spoken by the user. This can also be used + # to add additional words to the vocabulary of the recognizer. See + # [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + # + # List items can also include pre-built or custom classes containing groups + # of words that represent common concepts that occur in natural language. For + # example, rather than providing a phrase hint for every month of the + # year (e.g. "i was born in january", "i was born in febuary", ...), use the + # pre-built `$MONTH` class improves the likelihood of correctly transcribing + # audio that includes months (e.g. "i was born in $month"). + # To refer to pre-built classes, use the class' symbol prepended with `$` + # e.g. `$MONTH`. To refer to custom classes that were defined inline in the + # request, set the class's `custom_class_id` to a string unique to all class + # resources and inline classes. Then use the class' id wrapped in $`{...}` + # e.g. "$\\{my-months}". To refer to custom classes resources, use the class' + # id wrapped in `${}` (e.g. `${my-months}`). + # + # Speech-to-Text supports three locations: `global`, `us` (US North America), + # and `eu` (Europe). If you are calling the `speech.googleapis.com` + # endpoint, use the `global` location. To specify a region, use a + # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + # with matching `us` or `eu` location value. + # @!attribute [rw] value + # @return [::String] + # The phrase itself. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Overrides the boost set at the phrase set level. + # Positive value will increase the probability that a specific phrase will + # be recognized over other similar sounding phrases. The higher the boost, + # the higher the chance of false positive recognition as well. Negative + # boost will simply be ignored. Though `boost` can accept a wide range of + # positive values, most use cases are best served + # with values between 0 and 20. We recommend using a binary search approach + # to finding the optimal value for your use case as well as adding + # phrases both with and without boost to your requests. + class Phrase + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of states that define the lifecycle of a CustomClass. + module State + # Unspecified state. This is only used/useful for distinguishing + # unset values. + STATE_UNSPECIFIED = 0 + + # The normal and active state. + ACTIVE = 2 + + # This CustomClass has been deleted. + DELETED = 4 + end + end + + # Speech adaptation configuration. + # @!attribute [rw] phrase_sets + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::PhraseSet>] + # A collection of phrase sets. To specify the hints inline, leave the + # phrase set's `name` blank and fill in the rest of its fields. Any + # phrase set can use any custom class. + # @!attribute [rw] phrase_set_references + # @return [::Array<::String>] + # A collection of phrase set resource names to use. + # @!attribute [rw] custom_classes + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::CustomClass>] + # A collection of custom classes. To specify the classes inline, leave the + # class' `name` blank and fill in the rest of its fields, giving it a unique + # `custom_class_id`. Refer to the inline defined class in phrase hints by its + # `custom_class_id`. + # @!attribute [rw] abnf_grammar + # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptation::ABNFGrammar] + # Augmented Backus-Naur form (ABNF) is a standardized grammar notation + # comprised by a set of derivation rules. + # See specifications: https://www.w3.org/TR/speech-grammar + class SpeechAdaptation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] abnf_strings + # @return [::Array<::String>] + # All declarations and rules of an ABNF grammar broken up into multiple + # strings that will end up concatenated. + class ABNFGrammar + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Transcription normalization configuration. Use transcription normalization + # to automatically replace parts of the transcript with phrases of your + # choosing. For StreamingRecognize, this normalization only applies to stable + # partial transcripts (stability > 0.8) and final transcripts. + # @!attribute [rw] entries + # @return [::Array<::Google::Cloud::Speech::V1p1beta1::TranscriptNormalization::Entry>] + # A list of replacement entries. We will perform replacement with one entry + # at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + # => "mountain dog"] will never be applied because we will always process the + # first entry before it. At most 100 entries. + class TranscriptNormalization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single replacement configuration. + # @!attribute [rw] search + # @return [::String] + # What to replace. Max length is 100 characters. + # @!attribute [rw] replace + # @return [::String] + # What to replace with. Max length is 100 characters. + # @!attribute [rw] case_sensitive + # @return [::Boolean] + # Whether the search is case sensitive. + class Entry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..9a7c0269fa42 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/Gemfile new file mode 100644 index 000000000000..4acec445659b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-speech-v1p1beta1", path: "../" +else + gem "google-cloud-speech-v1p1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb new file mode 100644 index 000000000000..5c73bb5dd521 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Adaptation_CreateCustomClass_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the create_custom_class call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_custom_class. +# +def create_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new + + # Call the create_custom_class method. + result = client.create_custom_class request + + # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + p result +end +# [END speech_v1p1beta1_generated_Adaptation_CreateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb new file mode 100644 index 000000000000..7d85b9d76fde --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the create_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_phrase_set. +# +def create_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new + + # Call the create_phrase_set method. + result = client.create_phrase_set request + + # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + p result +end +# [END speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb new file mode 100644 index 000000000000..4093e3e479b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the delete_custom_class call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_custom_class. +# +def delete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new + + # Call the delete_custom_class method. + result = client.delete_custom_class request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb new file mode 100644 index 000000000000..742847acd058 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the delete_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_phrase_set. +# +def delete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new + + # Call the delete_phrase_set method. + result = client.delete_phrase_set request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb new file mode 100644 index 000000000000..67374d53dcb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Adaptation_GetCustomClass_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the get_custom_class call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_custom_class. +# +def get_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new + + # Call the get_custom_class method. + result = client.get_custom_class request + + # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + p result +end +# [END speech_v1p1beta1_generated_Adaptation_GetCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb new file mode 100644 index 000000000000..292ba87e414c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Adaptation_GetPhraseSet_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the get_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_phrase_set. +# +def get_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new + + # Call the get_phrase_set method. + result = client.get_phrase_set request + + # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + p result +end +# [END speech_v1p1beta1_generated_Adaptation_GetPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb new file mode 100644 index 000000000000..0bc4f30f6be8 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.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 speech_v1p1beta1_generated_Adaptation_ListCustomClasses_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the list_custom_classes call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_custom_classes. +# +def list_custom_classes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new + + # Call the list_custom_classes method. + result = client.list_custom_classes request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass. + p item + end +end +# [END speech_v1p1beta1_generated_Adaptation_ListCustomClasses_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb new file mode 100644 index 000000000000..6ad4f5cc6487 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.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 speech_v1p1beta1_generated_Adaptation_ListPhraseSet_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the list_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_phrase_set. +# +def list_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new + + # Call the list_phrase_set method. + result = client.list_phrase_set request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet. + p item + end +end +# [END speech_v1p1beta1_generated_Adaptation_ListPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb new file mode 100644 index 000000000000..6cf5ff2deb0c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the update_custom_class call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_custom_class. +# +def update_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new + + # Call the update_custom_class method. + result = client.update_custom_class request + + # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + p result +end +# [END speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb new file mode 100644 index 000000000000..4b35a1ba1fff --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the update_phrase_set call in the Adaptation service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_phrase_set. +# +def update_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new + + # Call the update_phrase_set method. + result = client.update_phrase_set request + + # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + p result +end +# [END speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json new file mode 100644 index 000000000000..ab7bf03ae9a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json @@ -0,0 +1,535 @@ +{ + "client_library": { + "name": "google-cloud-speech-v1p1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.speech.v1p1beta1", + "version": "v1p1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "speech_v1p1beta1_generated_Speech_Recognize_sync", + "title": "Snippet for the recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Speech::Client#recognize.", + "file": "speech/recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "recognize", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client#recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::RecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::RecognizeResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client" + }, + "method": { + "short_name": "Recognize", + "full_name": "google.cloud.speech.v1p1beta1.Speech.Recognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v1p1beta1.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Speech_LongRunningRecognize_sync", + "title": "Snippet for the long_running_recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Speech::Client#long_running_recognize.", + "file": "speech/long_running_recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "long_running_recognize", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client#long_running_recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client" + }, + "method": { + "short_name": "LongRunningRecognize", + "full_name": "google.cloud.speech.v1p1beta1.Speech.LongRunningRecognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v1p1beta1.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Speech_StreamingRecognize_sync", + "title": "Snippet for the streaming_recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Speech::Client#streaming_recognize.", + "file": "speech/streaming_recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_recognize", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client#streaming_recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client" + }, + "method": { + "short_name": "StreamingRecognize", + "full_name": "google.cloud.speech.v1p1beta1.Speech.StreamingRecognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v1p1beta1.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_sync", + "title": "Snippet for the create_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_phrase_set.", + "file": "adaptation/create_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_phrase_set", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::PhraseSet", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "CreatePhraseSet", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_GetPhraseSet_sync", + "title": "Snippet for the get_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_phrase_set.", + "file": "adaptation/get_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_phrase_set", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::PhraseSet", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "GetPhraseSet", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_ListPhraseSet_sync", + "title": "Snippet for the list_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_phrase_set.", + "file": "adaptation/list_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_phrase_set", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "ListPhraseSet", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_sync", + "title": "Snippet for the update_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_phrase_set.", + "file": "adaptation/update_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_phrase_set", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::PhraseSet", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "UpdatePhraseSet", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_sync", + "title": "Snippet for the delete_phrase_set call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_phrase_set.", + "file": "adaptation/delete_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_phrase_set", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "DeletePhraseSet", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSet", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_CreateCustomClass_sync", + "title": "Snippet for the create_custom_class call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_custom_class.", + "file": "adaptation/create_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_custom_class", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::CustomClass", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "CreateCustomClass", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClass", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_GetCustomClass_sync", + "title": "Snippet for the get_custom_class call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_custom_class.", + "file": "adaptation/get_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_custom_class", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::CustomClass", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "GetCustomClass", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.GetCustomClass", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_ListCustomClasses_sync", + "title": "Snippet for the list_custom_classes call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_custom_classes.", + "file": "adaptation/list_custom_classes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_custom_classes", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_custom_classes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "ListCustomClasses", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.ListCustomClasses", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_sync", + "title": "Snippet for the update_custom_class call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_custom_class.", + "file": "adaptation/update_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_custom_class", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V1p1beta1::CustomClass", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "UpdateCustomClass", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClass", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_sync", + "title": "Snippet for the delete_custom_class call in the Adaptation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_custom_class.", + "file": "adaptation/delete_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_custom_class", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Adaptation::Client", + "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" + }, + "method": { + "short_name": "DeleteCustomClass", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClass", + "service": { + "short_name": "Adaptation", + "full_name": "google.cloud.speech.v1p1beta1.Adaptation" + } + } + }, + "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-speech-v1p1beta1/snippets/speech/long_running_recognize.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb new file mode 100644 index 000000000000..eb1d313092dd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Speech_LongRunningRecognize_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the long_running_recognize call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Speech::Client#long_running_recognize. +# +def long_running_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new + + # Call the long_running_recognize method. + result = client.long_running_recognize request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v1p1beta1_generated_Speech_LongRunningRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb new file mode 100644 index 000000000000..cd26986de973 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v1p1beta1_generated_Speech_Recognize_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the recognize call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Speech::Client#recognize. +# +def recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new + + # Call the recognize method. + result = client.recognize request + + # The returned object is of type Google::Cloud::Speech::V1p1beta1::RecognizeResponse. + p result +end +# [END speech_v1p1beta1_generated_Speech_Recognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb new file mode 100644 index 000000000000..719413e3c9a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.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! + +# [START speech_v1p1beta1_generated_Speech_StreamingRecognize_sync] +require "google/cloud/speech/v1p1beta1" + +## +# Snippet for the streaming_recognize call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Speech::Client#streaming_recognize. +# +def streaming_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the streaming_recognize method to start streaming. + output = client.streaming_recognize input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new + input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse + output.each do |current_response| + p current_response + end +end +# [END speech_v1p1beta1_generated_Speech_StreamingRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb new file mode 100644 index 000000000000..5b544b26135c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/speech/v1p1beta1/adaptation" + +class ::Google::Cloud::Speech::V1p1beta1::Adaptation::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_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::Speech::V1p1beta1::Adaptation::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::Speech::V1p1beta1::Adaptation::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_custom_class_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" + assert_equal "projects/value0/locations/value1/customClasses/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::Speech::V1p1beta1::Adaptation::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_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb new file mode 100644 index 000000000000..306bcdc93477 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb @@ -0,0 +1,649 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/speech/v1p1beta1/cloud_speech_adaptation_pb" +require "google/cloud/speech/v1p1beta1/adaptation/rest" + + +class ::Google::Cloud::Speech::V1p1beta1::Adaptation::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_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + phrase_set_id = "hello world" + phrase_set = {} + + create_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_create_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_phrase_set parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_phrase_set ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_phrase_set(::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_phrase_set_client_stub.call_count + end + end + end + + def test_get_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_get_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_phrase_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_phrase_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_phrase_set ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_phrase_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_phrase_set(::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_phrase_set_client_stub.call_count + end + end + end + + def test_list_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse.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_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_list_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_phrase_set({ 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_phrase_set 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_phrase_set ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.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_phrase_set({ 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_phrase_set(::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.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_phrase_set_client_stub.call_count + end + end + end + + def test_update_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + phrase_set = {} + update_mask = {} + + update_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_update_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_phrase_set ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_phrase_set(::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_phrase_set_client_stub.call_count + end + end + end + + def test_delete_phrase_set + # 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_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_delete_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_phrase_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_phrase_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_phrase_set ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_phrase_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_phrase_set(::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_phrase_set_client_stub.call_count + end + end + end + + def test_create_custom_class + # Create test objects. + client_result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + custom_class_id = "hello world" + custom_class = {} + + create_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_create_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_custom_class parent: parent, custom_class_id: custom_class_id, custom_class: custom_class do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_custom_class ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_custom_class(::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_custom_class_client_stub.call_count + end + end + end + + def test_get_custom_class + # Create test objects. + client_result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_get_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_custom_class({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_custom_class name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_custom_class ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_custom_class({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_custom_class(::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_custom_class_client_stub.call_count + end + end + end + + def test_list_custom_classes + # Create test objects. + client_result = ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse.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_custom_classes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_list_custom_classes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_custom_classes_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_custom_classes({ 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_custom_classes 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_custom_classes ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.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_custom_classes({ 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_custom_classes(::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.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_custom_classes_client_stub.call_count + end + end + end + + def test_update_custom_class + # Create test objects. + client_result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + custom_class = {} + update_mask = {} + + update_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_update_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_custom_class custom_class: custom_class, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_custom_class ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_custom_class(::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_custom_class_client_stub.call_count + end + end + end + + def test_delete_custom_class + # 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_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_delete_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_custom_class({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_custom_class name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_custom_class ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_custom_class({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_custom_class(::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_custom_class_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::Speech::V1p1beta1::Adaptation::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::Speech::V1p1beta1::Adaptation::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb new file mode 100644 index 000000000000..c47dd787a294 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb @@ -0,0 +1,714 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb" +require "google/cloud/speech/v1p1beta1/adaptation" + +class ::Google::Cloud::Speech::V1p1beta1::Adaptation::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_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + phrase_set_id = "hello world" + phrase_set = {} + + create_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["phrase_set_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::PhraseSet), request["phrase_set"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_phrase_set parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_phrase_set ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_phrase_set(::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_phrase_set_client_stub.call_rpc_count + end + end + + def test_get_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_phrase_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_phrase_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_phrase_set ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_phrase_set({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_phrase_set(::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_phrase_set_client_stub.call_rpc_count + end + end + + def test_list_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest, 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_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_phrase_set({ parent: parent, page_size: page_size, page_token: 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_phrase_set parent: parent, page_size: page_size, page_token: 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_phrase_set ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.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_phrase_set({ parent: parent, page_size: page_size, page_token: page_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_phrase_set(::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.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_phrase_set_client_stub.call_rpc_count + end + end + + def test_update_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + phrase_set = {} + update_mask = {} + + update_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::PhraseSet), request["phrase_set"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_phrase_set ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set({ phrase_set: phrase_set, 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_phrase_set(::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set_client_stub.call_rpc_count + end + end + + def test_delete_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_phrase_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_phrase_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_phrase_set ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_phrase_set({ 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_phrase_set(::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new(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_phrase_set_client_stub.call_rpc_count + end + end + + def test_create_custom_class + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + custom_class_id = "hello world" + custom_class = {} + + create_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["custom_class_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::CustomClass), request["custom_class"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_custom_class parent: parent, custom_class_id: custom_class_id, custom_class: custom_class do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_custom_class ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_custom_class(::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_custom_class_client_stub.call_rpc_count + end + end + + def test_get_custom_class + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_custom_class({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_custom_class name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_custom_class ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_custom_class({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_custom_class(::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_custom_class_client_stub.call_rpc_count + end + end + + def test_list_custom_classes + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_custom_classes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_custom_classes, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest, 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_custom_classes_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: 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_custom_classes parent: parent, page_size: page_size, page_token: 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_custom_classes ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.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_custom_classes({ parent: parent, page_size: page_size, page_token: page_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_custom_classes(::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.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_custom_classes_client_stub.call_rpc_count + end + end + + def test_update_custom_class + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + custom_class = {} + update_mask = {} + + update_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::CustomClass), request["custom_class"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_custom_class custom_class: custom_class, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_custom_class ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class({ custom_class: custom_class, 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_custom_class(::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class_client_stub.call_rpc_count + end + end + + def test_delete_custom_class + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_custom_class({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_custom_class name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_custom_class ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_custom_class({ 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_custom_class(::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new(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_custom_class_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V1p1beta1::Adaptation::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::Speech::V1p1beta1::Adaptation::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::Speech::V1p1beta1::Adaptation::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb new file mode 100644 index 000000000000..d36047600a78 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_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/speech/v1p1beta1/cloud_speech_pb" +require "google/cloud/speech/v1p1beta1/cloud_speech_services_pb" +require "google/cloud/speech/v1p1beta1/speech" + +class ::Google::Cloud::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb new file mode 100644 index 000000000000..9572a99afe91 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/speech/v1p1beta1/speech" + +class ::Google::Cloud::Speech::V1p1beta1::Speech::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_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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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_custom_class_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" + assert_equal "projects/value0/locations/value1/customClasses/value2", path + end + end + + def test_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb new file mode 100644 index 000000000000..99ea6cbebd0d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/speech/v1p1beta1/cloud_speech_pb" +require "google/cloud/speech/v1p1beta1/speech/rest" + + +class ::Google::Cloud::Speech::V1p1beta1::Speech::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_recognize + # Create test objects. + client_result = ::Google::Cloud::Speech::V1p1beta1::RecognizeResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + config = {} + audio = {} + + recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::ServiceStub.stub :transcode_recognize_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.recognize({ config: config, audio: audio }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.recognize config: config, audio: audio do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.recognize ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new(config: config, audio: audio) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.recognize({ config: config, audio: audio }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.recognize(::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new(config: config, audio: audio), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, recognize_client_stub.call_count + end + end + end + + def test_long_running_recognize + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + config = {} + audio = {} + output_config = {} + + long_running_recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::ServiceStub.stub :transcode_long_running_recognize_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, long_running_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.long_running_recognize({ config: config, audio: audio, output_config: output_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.long_running_recognize config: config, audio: audio, output_config: output_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.long_running_recognize ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.long_running_recognize({ config: config, audio: audio, output_config: output_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.long_running_recognize(::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, long_running_recognize_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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb new file mode 100644 index 000000000000..704771621ccf --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb @@ -0,0 +1,334 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/speech/v1p1beta1/cloud_speech_pb" +require "google/cloud/speech/v1p1beta1/speech" + +class ::Google::Cloud::Speech::V1p1beta1::Speech::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_recognize + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::RecognizeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + config = {} + audio = {} + + recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :recognize, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::RecognitionConfig), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::RecognitionAudio), request["audio"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.recognize({ config: config, audio: audio }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.recognize config: config, audio: audio do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.recognize ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new(config: config, audio: audio) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.recognize({ config: config, audio: audio }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.recognize(::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new(config: config, audio: audio), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, recognize_client_stub.call_rpc_count + end + end + + def test_long_running_recognize + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + config = {} + audio = {} + output_config = {} + + long_running_recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :long_running_recognize, name + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::RecognitionConfig), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::RecognitionAudio), request["audio"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig), request["output_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, long_running_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.long_running_recognize({ config: config, audio: audio, output_config: output_config }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.long_running_recognize config: config, audio: audio, output_config: output_config do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.long_running_recognize ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.long_running_recognize({ config: config, audio: audio, output_config: output_config }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.long_running_recognize(::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, long_running_recognize_client_stub.call_rpc_count + end + end + + def test_streaming_recognize + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a bidi streaming method. + streaming_config = {} + + streaming_recognize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_recognize, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_recognize enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_recognize stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_recognize enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_recognize stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, streaming_recognize_client_stub.call_rpc_count + streaming_recognize_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest, r + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionConfig), r["streaming_config"] + assert_equal :streaming_config, r.streaming_request + end + end + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Speech::V1p1beta1::Speech::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/helper.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-speech-v2/.gitignore b/owl-bot-staging/google-cloud-speech-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json new file mode 100644 index 000000000000..a731ceb554c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "speech.googleapis.com", + "api_shortname": "speech", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest", + "distribution_name": "google-cloud-speech-v2", + "is_cloud": true, + "language": "ruby", + "name": "speech", + "name_pretty": "Cloud Speech-to-Text V2 API", + "product_documentation": "https://cloud.google.com/speech-to-text", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SPEECH", + "ruby-cloud-product-url": "https://cloud.google.com/speech-to-text", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml b/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml new file mode 100644 index 000000000000..11a141b34f5b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-speech-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-speech-v2.rb" diff --git a/owl-bot-staging/google-cloud-speech-v2/.toys.rb b/owl-bot-staging/google-cloud-speech-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2/.yardopts b/owl-bot-staging/google-cloud-speech-v2/.yardopts new file mode 100644 index 000000000000..bbc8579c72a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Speech-to-Text 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-speech-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..d5ea6bd0837e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-speech-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-speech-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/speech/v2" + +client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/speech/v2" + +::Google::Cloud::Speech::V2::Speech::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Speech::V2::Speech::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-speech-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/speech/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Speech::V2::Speech::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-speech-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-speech-v2/Gemfile b/owl-bot-staging/google-cloud-speech-v2/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-speech-v2/LICENSE.md b/owl-bot-staging/google-cloud-speech-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2/README.md b/owl-bot-staging/google-cloud-speech-v2/README.md new file mode 100644 index 000000000000..357f59f2dd7b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Speech-to-Text V2 API + +Converts audio to text by applying powerful neural network models. + +Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. + +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 Speech-to-Text V2 API. Most users should consider using +the main client gem, +[google-cloud-speech](https://rubygems.org/gems/google-cloud-speech). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-speech-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/speech.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/speech/v2" + +client = ::Google::Cloud::Speech::V2::Speech::Client.new +request = ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new # (request fields as keyword arguments...) +response = client.create_recognizer request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/speech-to-text) +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/speech/v2" +require "logger" + +client = ::Google::Cloud::Speech::V2::Speech::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-speech`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-speech-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-speech`. +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-speech-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-speech-v2/Rakefile b/owl-bot-staging/google-cloud-speech-v2/Rakefile new file mode 100644 index 000000000000..d2dc0b8f0e77 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SPEECH_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SPEECH_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SPEECH_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 SPEECH_TEST_PROJECT=test123 SPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/speech/v2/speech/credentials" + ::Google::Cloud::Speech::V2::Speech::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SPEECH_PROJECT"] = project + ENV["SPEECH_TEST_PROJECT"] = project + ENV["SPEECH_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-speech-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-speech-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-speech-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-speech-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-speech-v2" + header "google-cloud-speech-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-speech-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-speech-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-speech-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-speech-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-speech-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json new file mode 100644 index 000000000000..d420dfa5479a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json @@ -0,0 +1,133 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.speech.v2", + "libraryPackage": "::Google::Cloud::Speech::V2", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Speech::V2::Speech::Client", + "rpcs": { + "CreateRecognizer": { + "methods": [ + "create_recognizer" + ] + }, + "ListRecognizers": { + "methods": [ + "list_recognizers" + ] + }, + "GetRecognizer": { + "methods": [ + "get_recognizer" + ] + }, + "UpdateRecognizer": { + "methods": [ + "update_recognizer" + ] + }, + "DeleteRecognizer": { + "methods": [ + "delete_recognizer" + ] + }, + "UndeleteRecognizer": { + "methods": [ + "undelete_recognizer" + ] + }, + "Recognize": { + "methods": [ + "recognize" + ] + }, + "StreamingRecognize": { + "methods": [ + "streaming_recognize" + ] + }, + "BatchRecognize": { + "methods": [ + "batch_recognize" + ] + }, + "GetConfig": { + "methods": [ + "get_config" + ] + }, + "UpdateConfig": { + "methods": [ + "update_config" + ] + }, + "CreateCustomClass": { + "methods": [ + "create_custom_class" + ] + }, + "ListCustomClasses": { + "methods": [ + "list_custom_classes" + ] + }, + "GetCustomClass": { + "methods": [ + "get_custom_class" + ] + }, + "UpdateCustomClass": { + "methods": [ + "update_custom_class" + ] + }, + "DeleteCustomClass": { + "methods": [ + "delete_custom_class" + ] + }, + "UndeleteCustomClass": { + "methods": [ + "undelete_custom_class" + ] + }, + "CreatePhraseSet": { + "methods": [ + "create_phrase_set" + ] + }, + "ListPhraseSets": { + "methods": [ + "list_phrase_sets" + ] + }, + "GetPhraseSet": { + "methods": [ + "get_phrase_set" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "update_phrase_set" + ] + }, + "DeletePhraseSet": { + "methods": [ + "delete_phrase_set" + ] + }, + "UndeletePhraseSet": { + "methods": [ + "undelete_phrase_set" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec b/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec new file mode 100644 index 000000000000..a5e16d628d34 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/speech/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-speech-v2" + gem.version = Google::Cloud::Speech::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details." + gem.summary = "Converts audio to text by applying powerful neural network models." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb new file mode 100644 index 000000000000..ca01b088ebe3 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-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/speech/v2" diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb new file mode 100644 index 000000000000..e2a296043fce --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/speech/v2/speech" +require "google/cloud/speech/v2/version" + +module Google + module Cloud + module Speech + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/speech/v2" + # client = ::Google::Cloud::Speech::V2::Speech::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/speech/v2" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module V2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/speech/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb new file mode 100644 index 000000000000..a89a217f0dc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/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 Speech + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/speech/v2/rest" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module V2 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Speech"] + parent_config = while namespace.any? + parent_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: "/v2/{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: "/v2/{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-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb new file mode 100644 index 000000000000..09b1f1cec71a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v2/cloud_speech.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/duration_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n)google/cloud/speech/v2/cloud_speech.proto\x12\x16google.cloud.speech.v2\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\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xbe\x01\n\x17\x43reateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rrecognizer_id\x18\x03 \x01(\t\x12\x38\n\x06parent\x18\x04 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 speech.googleapis.com/Recognizer\"\xe7\x0c\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08resource\x18\x03 \x01(\t\x12\x0e\n\x06method\x18\x04 \x01(\t\x12<\n\x0ckms_key_name\x18\x06 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12K\n\x14kms_key_version_name\x18\x07 \x01(\tB-\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12P\n\x17\x62\x61tch_recognize_request\x18\x08 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeRequestH\x00\x12T\n\x19\x63reate_recognizer_request\x18\t \x01(\x0b\x32/.google.cloud.speech.v2.CreateRecognizerRequestH\x00\x12T\n\x19update_recognizer_request\x18\n \x01(\x0b\x32/.google.cloud.speech.v2.UpdateRecognizerRequestH\x00\x12T\n\x19\x64\x65lete_recognizer_request\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.DeleteRecognizerRequestH\x00\x12X\n\x1bundelete_recognizer_request\x18\x0c \x01(\x0b\x32\x31.google.cloud.speech.v2.UndeleteRecognizerRequestH\x00\x12W\n\x1b\x63reate_custom_class_request\x18\r \x01(\x0b\x32\x30.google.cloud.speech.v2.CreateCustomClassRequestH\x00\x12W\n\x1bupdate_custom_class_request\x18\x0e \x01(\x0b\x32\x30.google.cloud.speech.v2.UpdateCustomClassRequestH\x00\x12W\n\x1b\x64\x65lete_custom_class_request\x18\x0f \x01(\x0b\x32\x30.google.cloud.speech.v2.DeleteCustomClassRequestH\x00\x12[\n\x1dundelete_custom_class_request\x18\x10 \x01(\x0b\x32\x32.google.cloud.speech.v2.UndeleteCustomClassRequestH\x00\x12S\n\x19\x63reate_phrase_set_request\x18\x11 \x01(\x0b\x32..google.cloud.speech.v2.CreatePhraseSetRequestH\x00\x12S\n\x19update_phrase_set_request\x18\x12 \x01(\x0b\x32..google.cloud.speech.v2.UpdatePhraseSetRequestH\x00\x12S\n\x19\x64\x65lete_phrase_set_request\x18\x13 \x01(\x0b\x32..google.cloud.speech.v2.DeletePhraseSetRequestH\x00\x12W\n\x1bundelete_phrase_set_request\x18\x14 \x01(\x0b\x32\x30.google.cloud.speech.v2.UndeletePhraseSetRequestH\x00\x12P\n\x15update_config_request\x18\x15 \x01(\x0b\x32+.google.cloud.speech.v2.UpdateConfigRequestB\x02\x18\x01H\x00\x12\x18\n\x10progress_percent\x18\x16 \x01(\x05\x12R\n\x18\x62\x61tch_recognize_metadata\x18\x17 \x01(\x0b\x32..google.cloud.speech.v2.BatchRecognizeMetadataH\x01\x42\t\n\x07requestB\n\n\x08metadata\"\x90\x01\n\x16ListRecognizersRequest\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\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"k\n\x17ListRecognizersResponse\x12\x37\n\x0brecognizers\x18\x01 \x03(\x0b\x32\".google.cloud.speech.v2.Recognizer\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\"\x9e\x01\n\x17UpdateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8d\x01\n\x17\x44\x65leteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"x\n\x19UndeleteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xc5\x07\n\nRecognizer\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x14\n\x05model\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x1d\n\x0elanguage_codes\x18\x11 \x03(\tB\x05\x18\x01\xe0\x41\x01\x12M\n\x1a\x64\x65\x66\x61ult_recognition_config\x18\x06 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12H\n\x0b\x61nnotations\x18\x07 \x03(\x0b\x32\x33.google.cloud.speech.v2.Recognizer.AnnotationsEntry\x12<\n\x05state\x18\x08 \x01(\x0e\x32(.google.cloud.speech.v2.Recognizer.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\x0f \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x10 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:j\xea\x41g\n speech.googleapis.com/Recognizer\x12@projects/{project}/locations/{location}/recognizers/{recognizer}R\x01\x01\"\x1a\n\x18\x41utoDetectDecodingConfig\"\xf0\x02\n\x16\x45xplicitDecodingConfig\x12S\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32<.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13\x61udio_channel_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xbe\x01\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\t\n\x05MULAW\x10\x02\x12\x08\n\x04\x41LAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x08\n\x04\x46LAC\x10\x06\x12\x07\n\x03MP3\x10\x07\x12\x0c\n\x08OGG_OPUS\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\x12\x0b\n\x07MP4_AAC\x10\n\x12\x0b\n\x07M4A_AAC\x10\x0b\x12\x0b\n\x07MOV_AAC\x10\x0c\"Z\n\x18SpeakerDiarizationConfig\x12\x1e\n\x11min_speaker_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11max_speaker_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"0\n\x12\x43ustomPromptConfig\x12\x1a\n\rcustom_prompt\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xc7\x04\n\x13RecognitionFeatures\x12\x18\n\x10profanity_filter\x18\x01 \x01(\x08\x12 \n\x18\x65nable_word_time_offsets\x18\x02 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x04 \x01(\x08\x12!\n\x19\x65nable_spoken_punctuation\x18\x0e \x01(\x08\x12\x1c\n\x14\x65nable_spoken_emojis\x18\x0f \x01(\x08\x12X\n\x12multi_channel_mode\x18\x11 \x01(\x0e\x32<.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode\x12L\n\x12\x64iarization_config\x18\t \x01(\x0b\x32\x30.google.cloud.speech.v2.SpeakerDiarizationConfig\x12\x18\n\x10max_alternatives\x18\x10 \x01(\x05\x12M\n\x14\x63ustom_prompt_config\x18\x12 \x01(\x0b\x32*.google.cloud.speech.v2.CustomPromptConfigB\x03\xe0\x41\x01\"\\\n\x10MultiChannelMode\x12\"\n\x1eMULTI_CHANNEL_MODE_UNSPECIFIED\x10\x00\x12$\n SEPARATE_RECOGNITION_PER_CHANNEL\x10\x01\"\xa3\x01\n\x17TranscriptNormalization\x12\x46\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x35.google.cloud.speech.v2.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\"1\n\x11TranslationConfig\x12\x1c\n\x0ftarget_language\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xbf\x02\n\x10SpeechAdaptation\x12Q\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32<.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet\x12;\n\x0e\x63ustom_classes\x18\x02 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x1a\x9a\x01\n\x13\x41\x64\x61ptationPhraseSet\x12:\n\nphrase_set\x18\x01 \x01(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSetH\x00\x12>\n\x11inline_phrase_set\x18\x02 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetH\x00\x42\x07\n\x05value\">\n\x0e\x44\x65noiserConfig\x12\x15\n\rdenoise_audio\x18\x01 \x01(\x08\x12\x15\n\rsnr_threshold\x18\x02 \x01(\x02\"\xe4\x04\n\x11RecognitionConfig\x12P\n\x14\x61uto_decoding_config\x18\x07 \x01(\x0b\x32\x30.google.cloud.speech.v2.AutoDetectDecodingConfigH\x00\x12R\n\x18\x65xplicit_decoding_config\x18\x08 \x01(\x0b\x32..google.cloud.speech.v2.ExplicitDecodingConfigH\x00\x12\x12\n\x05model\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0elanguage_codes\x18\n \x03(\tB\x03\xe0\x41\x01\x12=\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32+.google.cloud.speech.v2.RecognitionFeatures\x12<\n\nadaptation\x18\x06 \x01(\x0b\x32(.google.cloud.speech.v2.SpeechAdaptation\x12V\n\x18transcript_normalization\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.TranscriptNormalizationB\x03\xe0\x41\x01\x12J\n\x12translation_config\x18\x0f \x01(\x0b\x32).google.cloud.speech.v2.TranslationConfigB\x03\xe0\x41\x01\x12\x44\n\x0f\x64\x65noiser_config\x18\x10 \x01(\x0b\x32&.google.cloud.speech.v2.DenoiserConfigB\x03\xe0\x41\x01\x42\x11\n\x0f\x64\x65\x63oding_config\"\xee\x01\n\x10RecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x11\n\x07\x63ontent\x18\x05 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x06 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\x9d\x01\n\x1bRecognitionResponseMetadata\x12\x1c\n\nrequest_id\x18\t \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x38\n\x15total_billed_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1b\n\x06prompt\x18\n \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\t\n\x07_prompt\"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v2.WordInfo\"\xa3\x01\n\x08WordInfo\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x15\n\rspeaker_label\x18\x06 \x01(\t\"\xcc\x01\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"\x9c\x01\n\x11RecognizeResponse\x12@\n\x07results\x18\x03 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\xf9\x04\n\x1cStreamingRecognitionFeatures\x12$\n\x1c\x65nable_voice_activity_events\x18\x01 \x01(\x08\x12\x17\n\x0finterim_results\x18\x02 \x01(\x08\x12i\n\x16voice_activity_timeout\x18\x03 \x01(\x0b\x32I.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout\x12q\n\x17\x65ndpointing_sensitivity\x18\x08 \x01(\x0e\x32K.google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivityB\x03\xe0\x41\x01\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xb2\x01\n\x16\x45ndpointingSensitivity\x12\'\n#ENDPOINTING_SENSITIVITY_UNSPECIFIED\x10\x00\x12$\n ENDPOINTING_SENSITIVITY_STANDARD\x10\x01\x12&\n\"ENDPOINTING_SENSITIVITY_SUPERSHORT\x10\x02\x12!\n\x1d\x45NDPOINTING_SENSITIVITY_SHORT\x10\x03\"\xdf\x01\n\x1aStreamingRecognitionConfig\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfigB\x03\xe0\x41\x02\x12/\n\x0b\x63onfig_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12P\n\x12streaming_features\x18\x02 \x01(\x0b\x32\x34.google.cloud.speech.v2.StreamingRecognitionFeatures\"\xcf\x01\n\x19StreamingRecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12N\n\x10streaming_config\x18\x06 \x01(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionConfigH\x00\x12\x0f\n\x05\x61udio\x18\x05 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\x88\x04\n\x15\x42\x61tchRecognizeRequest\x12<\n\nrecognizer\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x41\n\x05\x66iles\x18\x03 \x03(\x0b\x32\x32.google.cloud.speech.v2.BatchRecognizeFileMetadata\x12R\n\x19recognition_output_config\x18\x06 \x01(\x0b\x32/.google.cloud.speech.v2.RecognitionOutputConfig\x12]\n\x13processing_strategy\x18\x07 \x01(\x0e\x32@.google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy\"O\n\x12ProcessingStrategy\x12#\n\x1fPROCESSING_STRATEGY_UNSPECIFIED\x10\x00\x12\x14\n\x10\x44YNAMIC_BATCHING\x10\x01\"\x1e\n\x0fGcsOutputConfig\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x14\n\x12InlineOutputConfig\"\x1e\n\x1cNativeOutputFileFormatConfig\"\x1b\n\x19VttOutputFileFormatConfig\"\x1b\n\x19SrtOutputFileFormatConfig\"\xda\x01\n\x12OutputFormatConfig\x12\x44\n\x06native\x18\x01 \x01(\x0b\x32\x34.google.cloud.speech.v2.NativeOutputFileFormatConfig\x12>\n\x03vtt\x18\x02 \x01(\x0b\x32\x31.google.cloud.speech.v2.VttOutputFileFormatConfig\x12>\n\x03srt\x18\x03 \x01(\x0b\x32\x31.google.cloud.speech.v2.SrtOutputFileFormatConfig\"\x86\x02\n\x17RecognitionOutputConfig\x12\x44\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\'.google.cloud.speech.v2.GcsOutputConfigH\x00\x12L\n\x16inline_response_config\x18\x02 \x01(\x0b\x32*.google.cloud.speech.v2.InlineOutputConfigH\x00\x12M\n\x14output_format_config\x18\x03 \x01(\x0b\x32*.google.cloud.speech.v2.OutputFormatConfigB\x03\xe0\x41\x01\x42\x08\n\x06output\"\x82\x02\n\x16\x42\x61tchRecognizeResponse\x12L\n\x07results\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeResponse.ResultsEntry\x12\x38\n\x15total_billed_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a`\n\x0cResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.speech.v2.BatchRecognizeFileResult:\x02\x38\x01\"\xa0\x01\n\x15\x42\x61tchRecognizeResults\x12@\n\x07results\x18\x01 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"Q\n\x12\x43loudStorageResult\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x16\n\x0evtt_format_uri\x18\x02 \x01(\t\x12\x16\n\x0esrt_format_uri\x18\x03 \x01(\t\"}\n\x0cInlineResult\x12\x41\n\ntranscript\x18\x01 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResults\x12\x14\n\x0cvtt_captions\x18\x02 \x01(\t\x12\x14\n\x0csrt_captions\x18\x03 \x01(\t\"\xf1\x02\n\x18\x42\x61tchRecognizeFileResult\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\x08metadata\x18\x03 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\x12J\n\x14\x63loud_storage_result\x18\x05 \x01(\x0b\x32*.google.cloud.speech.v2.CloudStorageResultH\x00\x12=\n\rinline_result\x18\x06 \x01(\x0b\x32$.google.cloud.speech.v2.InlineResultH\x00\x12\x0f\n\x03uri\x18\x01 \x01(\tB\x02\x18\x01\x12\x45\n\ntranscript\x18\x04 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResultsB\x02\x18\x01\x42\x08\n\x06result\"o\n#BatchRecognizeTranscriptionMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x0b\n\x03uri\x18\x03 \x01(\t\"\xfe\x01\n\x16\x42\x61tchRecognizeMetadata\x12i\n\x16transcription_metadata\x18\x01 \x03(\x0b\x32I.google.cloud.speech.v2.BatchRecognizeMetadata.TranscriptionMetadataEntry\x1ay\n\x1aTranscriptionMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata:\x02\x38\x01\"\xa7\x01\n\x1a\x42\x61tchRecognizeFileMetadata\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x0e\n\x0c\x61udio_source\"\xf4\x01\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xc7\x03\n\x1aStreamingRecognizeResponse\x12\x43\n\x07results\x18\x06 \x03(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x03 \x01(\x0e\x32\x42.google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType\x12\x36\n\x13speech_event_offset\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x45\n\x08metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\x85\x01\n\x0fSpeechEventType\x12!\n\x1dSPEECH_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\"\xe8\x01\n\x06\x43onfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:Q\xea\x41N\n\x1cspeech.googleapis.com/Config\x12.projects/{project}/locations/{location}/config\"F\n\x10GetConfigRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cspeech.googleapis.com/Config\"{\n\x13UpdateConfigRequest\x12\x33\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1e.google.cloud.speech.v2.ConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xad\x07\n\x0b\x43ustomClass\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12<\n\x05items\x18\x05 \x03(\x0b\x32-.google.cloud.speech.v2.CustomClass.ClassItem\x12=\n\x05state\x18\x0f \x01(\x0e\x32).google.cloud.speech.v2.CustomClass.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x34.google.cloud.speech.v2.CustomClass.AnnotationsEntryB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:o\xea\x41l\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}R\x01\x01\"\xae\x07\n\tPhraseSet\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x07phrases\x18\x03 \x03(\x0b\x32(.google.cloud.speech.v2.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12;\n\x05state\x18\x0f \x01(\x0e\x32\'.google.cloud.speech.v2.PhraseSet.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x32.google.cloud.speech.v2.PhraseSet.AnnotationsEntry\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:h\xea\x41\x65\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}R\x01\x01\"\xc5\x01\n\x18\x43reateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x17\n\x0f\x63ustom_class_id\x18\x03 \x01(\t\x12\x39\n\x06parent\x18\x04 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\"\x92\x01\n\x18ListCustomClassesRequest\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\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"q\n\x19ListCustomClassesResponse\x12;\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"\xa2\x01\n\x18UpdateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8f\x01\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"z\n\x1aUndeleteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xbb\x01\n\x16\x43reatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rphrase_set_id\x18\x03 \x01(\t\x12\x37\n\x06parent\x18\x04 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\"\x8f\x01\n\x15ListPhraseSetsRequest\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\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"i\n\x16ListPhraseSetsResponse\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v2.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\x9c\x01\n\x16UpdatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8b\x01\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"v\n\x18UndeletePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t2\xbf%\n\x06Speech\x12\xec\x01\n\x10\x43reateRecognizer\x12/.google.cloud.speech.v2.CreateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x1fparent,recognizer,recognizer_id\x82\xd3\xe4\x93\x02=\"//v2/{parent=projects/*/locations/*}/recognizers:\nrecognizer\x12\xb4\x01\n\x0fListRecognizers\x12..google.cloud.speech.v2.ListRecognizersRequest\x1a/.google.cloud.speech.v2.ListRecognizersResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2/{parent=projects/*/locations/*}/recognizers\x12\xa1\x01\n\rGetRecognizer\x12,.google.cloud.speech.v2.GetRecognizerRequest\x1a\".google.cloud.speech.v2.Recognizer\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2/{name=projects/*/locations/*/recognizers/*}\x12\xee\x01\n\x10UpdateRecognizer\x12/.google.cloud.speech.v2.UpdateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x16recognizer,update_mask\x82\xd3\xe4\x93\x02H2:/v2/{recognizer.name=projects/*/locations/*/recognizers/*}:\nrecognizer\x12\xc4\x01\n\x10\x44\x65leteRecognizer\x12/.google.cloud.speech.v2.DeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"`\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2/{name=projects/*/locations/*/recognizers/*}\x12\xd4\x01\n\x12UndeleteRecognizer\x12\x31.google.cloud.speech.v2.UndeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v2/{name=projects/*/locations/*/recognizers/*}:undelete:\x01*\x12\xf9\x01\n\tRecognize\x12(.google.cloud.speech.v2.RecognizeRequest\x1a).google.cloud.speech.v2.RecognizeResponse\"\x96\x01\xda\x41%recognizer,config,config_mask,content\xda\x41!recognizer,config,config_mask,uri\x82\xd3\xe4\x93\x02\x44\"?/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize:\x01*\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v2.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v2.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x12\x84\x02\n\x0e\x42\x61tchRecognize\x12-.google.cloud.speech.v2.BatchRecognizeRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41+\n\x16\x42\x61tchRecognizeResponse\x12\x11OperationMetadata\xda\x41#recognizer,config,config_mask,files\x82\xd3\xe4\x93\x02I\"D/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize:\x01*\x12\x8e\x01\n\tGetConfig\x12(.google.cloud.speech.v2.GetConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v2/{name=projects/*/locations/*/config}\x12\xb1\x01\n\x0cUpdateConfig\x12+.google.cloud.speech.v2.UpdateConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"T\xda\x41\x12\x63onfig,update_mask\x82\xd3\xe4\x93\x02\x39\x32//v2/{config.name=projects/*/locations/*/config}:\x06\x63onfig\x12\xf7\x01\n\x11\x43reateCustomClass\x12\x30.google.cloud.speech.v2.CreateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02\x41\"1/v2/{parent=projects/*/locations/*}/customClasses:\x0c\x63ustom_class\x12\xbc\x01\n\x11ListCustomClasses\x12\x30.google.cloud.speech.v2.ListCustomClassesRequest\x1a\x31.google.cloud.speech.v2.ListCustomClassesResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{parent=projects/*/locations/*}/customClasses\x12\xa6\x01\n\x0eGetCustomClass\x12-.google.cloud.speech.v2.GetCustomClassRequest\x1a#.google.cloud.speech.v2.CustomClass\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{name=projects/*/locations/*/customClasses/*}\x12\xf9\x01\n\x11UpdateCustomClass\x12\x30.google.cloud.speech.v2.UpdateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02N2>/v2/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\xc9\x01\n\x11\x44\x65leteCustomClass\x12\x30.google.cloud.speech.v2.DeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"c\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v2/{name=projects/*/locations/*/customClasses/*}\x12\xd9\x01\n\x13UndeleteCustomClass\x12\x32.google.cloud.speech.v2.UndeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?\":/v2/{name=projects/*/locations/*/customClasses/*}:undelete:\x01*\x12\xe8\x01\n\x0f\x43reatePhraseSet\x12..google.cloud.speech.v2.CreatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02<\"./v2/{parent=projects/*/locations/*}/phraseSets:\nphrase_set\x12\xb0\x01\n\x0eListPhraseSets\x12-.google.cloud.speech.v2.ListPhraseSetsRequest\x1a..google.cloud.speech.v2.ListPhraseSetsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v2/{parent=projects/*/locations/*}/phraseSets\x12\x9d\x01\n\x0cGetPhraseSet\x12+.google.cloud.speech.v2.GetPhraseSetRequest\x1a!.google.cloud.speech.v2.PhraseSet\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xea\x01\n\x0fUpdatePhraseSet\x12..google.cloud.speech.v2.UpdatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02G29/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\xc0\x01\n\x0f\x44\x65letePhraseSet\x12..google.cloud.speech.v2.DeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"^\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xd0\x01\n\x11UndeletePhraseSet\x12\x30.google.cloud.speech.v2.UndeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v2/{name=projects/*/locations/*/phraseSets/*}:undelete:\x01*\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x03\n\x1a\x63om.google.cloud.speech.v2B\x10\x43loudSpeechProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpb\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Speech + module V2 + CreateRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreateRecognizerRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.OperationMetadata").msgclass + ListRecognizersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListRecognizersRequest").msgclass + ListRecognizersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListRecognizersResponse").msgclass + GetRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetRecognizerRequest").msgclass + UpdateRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateRecognizerRequest").msgclass + DeleteRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeleteRecognizerRequest").msgclass + UndeleteRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeleteRecognizerRequest").msgclass + Recognizer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Recognizer").msgclass + Recognizer::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Recognizer.State").enummodule + AutoDetectDecodingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AutoDetectDecodingConfig").msgclass + ExplicitDecodingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ExplicitDecodingConfig").msgclass + ExplicitDecodingConfig::AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding").enummodule + SpeakerDiarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeakerDiarizationConfig").msgclass + CustomPromptConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomPromptConfig").msgclass + RecognitionFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionFeatures").msgclass + RecognitionFeatures::MultiChannelMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode").enummodule + TranscriptNormalization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranscriptNormalization").msgclass + TranscriptNormalization::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranscriptNormalization.Entry").msgclass + TranslationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranslationConfig").msgclass + SpeechAdaptation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechAdaptation").msgclass + SpeechAdaptation::AdaptationPhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet").msgclass + DenoiserConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DenoiserConfig").msgclass + RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionConfig").msgclass + RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognizeRequest").msgclass + RecognitionResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionResponseMetadata").msgclass + SpeechRecognitionAlternative = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechRecognitionAlternative").msgclass + WordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.WordInfo").msgclass + SpeechRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechRecognitionResult").msgclass + RecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognizeResponse").msgclass + StreamingRecognitionFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures").msgclass + StreamingRecognitionFeatures::VoiceActivityTimeout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout").msgclass + StreamingRecognitionFeatures::EndpointingSensitivity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivity").enummodule + StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionConfig").msgclass + StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeRequest").msgclass + BatchRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest").msgclass + BatchRecognizeRequest::ProcessingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy").enummodule + GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GcsOutputConfig").msgclass + InlineOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineOutputConfig").msgclass + NativeOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.NativeOutputFileFormatConfig").msgclass + VttOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.VttOutputFileFormatConfig").msgclass + SrtOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SrtOutputFileFormatConfig").msgclass + OutputFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.OutputFormatConfig").msgclass + RecognitionOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionOutputConfig").msgclass + BatchRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResponse").msgclass + BatchRecognizeResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResults").msgclass + CloudStorageResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CloudStorageResult").msgclass + InlineResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineResult").msgclass + BatchRecognizeFileResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileResult").msgclass + BatchRecognizeTranscriptionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata").msgclass + BatchRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeMetadata").msgclass + BatchRecognizeFileMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileMetadata").msgclass + StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionResult").msgclass + StreamingRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeResponse").msgclass + StreamingRecognizeResponse::SpeechEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType").enummodule + Config = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Config").msgclass + GetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetConfigRequest").msgclass + UpdateConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateConfigRequest").msgclass + CustomClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass").msgclass + CustomClass::ClassItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass.ClassItem").msgclass + CustomClass::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass.State").enummodule + PhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet").msgclass + PhraseSet::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet.Phrase").msgclass + PhraseSet::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet.State").enummodule + CreateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreateCustomClassRequest").msgclass + ListCustomClassesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListCustomClassesRequest").msgclass + ListCustomClassesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListCustomClassesResponse").msgclass + GetCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetCustomClassRequest").msgclass + UpdateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateCustomClassRequest").msgclass + DeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeleteCustomClassRequest").msgclass + UndeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeleteCustomClassRequest").msgclass + CreatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreatePhraseSetRequest").msgclass + ListPhraseSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListPhraseSetsRequest").msgclass + ListPhraseSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListPhraseSetsResponse").msgclass + GetPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetPhraseSetRequest").msgclass + UpdatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdatePhraseSetRequest").msgclass + DeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeletePhraseSetRequest").msgclass + UndeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeletePhraseSetRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb new file mode 100644 index 000000000000..5a22ae3fcf4a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb @@ -0,0 +1,98 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/speech/v2/cloud_speech.proto for package 'google.cloud.speech.v2' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/speech/v2/cloud_speech_pb' + +module Google + module Cloud + module Speech + module V2 + module Speech + # Enables speech transcription and resource management. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.speech.v2.Speech' + + # Creates a [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc :CreateRecognizer, ::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Google::Longrunning::Operation + # Lists Recognizers. + rpc :ListRecognizers, ::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Google::Cloud::Speech::V2::ListRecognizersResponse + # Returns the requested + # [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't + # exist. + rpc :GetRecognizer, ::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Google::Cloud::Speech::V2::Recognizer + # Updates the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc :UpdateRecognizer, ::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Google::Longrunning::Operation + # Deletes the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc :DeleteRecognizer, ::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Google::Longrunning::Operation + # Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer]. + rpc :UndeleteRecognizer, ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Google::Longrunning::Operation + # Performs synchronous Speech recognition: receive results after all audio + # has been sent and processed. + rpc :Recognize, ::Google::Cloud::Speech::V2::RecognizeRequest, ::Google::Cloud::Speech::V2::RecognizeResponse + # Performs bidirectional streaming speech recognition: receive results while + # sending audio. This method is only available via the gRPC API (not REST). + rpc :StreamingRecognize, stream(::Google::Cloud::Speech::V2::StreamingRecognizeRequest), stream(::Google::Cloud::Speech::V2::StreamingRecognizeResponse) + # Performs batch asynchronous speech recognition: send a request with N + # audio files and receive a long running operation that can be polled to see + # when the transcriptions are finished. + rpc :BatchRecognize, ::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Google::Longrunning::Operation + # Returns the requested [Config][google.cloud.speech.v2.Config]. + rpc :GetConfig, ::Google::Cloud::Speech::V2::GetConfigRequest, ::Google::Cloud::Speech::V2::Config + # Updates the [Config][google.cloud.speech.v2.Config]. + rpc :UpdateConfig, ::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Google::Cloud::Speech::V2::Config + # Creates a [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :CreateCustomClass, ::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Google::Longrunning::Operation + # Lists CustomClasses. + rpc :ListCustomClasses, ::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Google::Cloud::Speech::V2::ListCustomClassesResponse + # Returns the requested + # [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :GetCustomClass, ::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Google::Cloud::Speech::V2::CustomClass + # Updates the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :UpdateCustomClass, ::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Google::Longrunning::Operation + # Deletes the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :DeleteCustomClass, ::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Google::Longrunning::Operation + # Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass]. + rpc :UndeleteCustomClass, ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Google::Longrunning::Operation + # Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :CreatePhraseSet, ::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Google::Longrunning::Operation + # Lists PhraseSets. + rpc :ListPhraseSets, ::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Google::Cloud::Speech::V2::ListPhraseSetsResponse + # Returns the requested + # [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :GetPhraseSet, ::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Google::Cloud::Speech::V2::PhraseSet + # Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :UpdatePhraseSet, ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Google::Longrunning::Operation + # Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :DeletePhraseSet, ::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Google::Longrunning::Operation + # Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. + rpc :UndeletePhraseSet, ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb new file mode 100644 index 000000000000..c6f970cacdd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/speech/v2/locations_metadata.proto + +require 'google/protobuf' + + +descriptor_data = "\n/google/cloud/speech/v2/locations_metadata.proto\x12\x16google.cloud.speech.v2\"6\n\x0cModelFeature\x12\x0f\n\x07\x66\x65\x61ture\x18\x01 \x01(\t\x12\x15\n\rrelease_state\x18\x02 \x01(\t\"L\n\rModelFeatures\x12;\n\rmodel_feature\x18\x01 \x03(\x0b\x32$.google.cloud.speech.v2.ModelFeature\"\xbe\x01\n\rModelMetadata\x12P\n\x0emodel_features\x18\x01 \x03(\x0b\x32\x38.google.cloud.speech.v2.ModelMetadata.ModelFeaturesEntry\x1a[\n\x12ModelFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.speech.v2.ModelFeatures:\x02\x38\x01\"\xae\x01\n\x10LanguageMetadata\x12\x44\n\x06models\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.LanguageMetadata.ModelsEntry\x1aT\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.speech.v2.ModelMetadata:\x02\x38\x01\"\xc8\x01\n\x0e\x41\x63\x63\x65ssMetadata\x12N\n\x0f\x63onstraint_type\x18\x01 \x01(\x0e\x32\x35.google.cloud.speech.v2.AccessMetadata.ConstraintType\"f\n\x0e\x43onstraintType\x12\x1f\n\x1b\x43ONSTRAINT_TYPE_UNSPECIFIED\x10\x00\x12\x33\n/RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT\x10\x01\"\x91\x01\n\x11LocationsMetadata\x12;\n\tlanguages\x18\x01 \x01(\x0b\x32(.google.cloud.speech.v2.LanguageMetadata\x12?\n\x0f\x61\x63\x63\x65ss_metadata\x18\x02 \x01(\x0b\x32&.google.cloud.speech.v2.AccessMetadataBj\n\x1a\x63om.google.cloud.speech.v2B\x16LocationsMetadataProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Speech + module V2 + ModelFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelFeature").msgclass + ModelFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelFeatures").msgclass + ModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelMetadata").msgclass + LanguageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.LanguageMetadata").msgclass + AccessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AccessMetadata").msgclass + AccessMetadata::ConstraintType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AccessMetadata.ConstraintType").enummodule + LocationsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.LocationsMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb new file mode 100644 index 000000000000..9f0d92b6e97b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/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/speech/v2/speech/rest" +require "google/cloud/speech/v2/bindings_override" +require "google/cloud/speech/v2/version" + +module Google + module Cloud + module Speech + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/speech/v2/rest" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module V2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb new file mode 100644 index 000000000000..5a66d0bd8b48 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.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/speech/v2/version" + +require "google/cloud/speech/v2/speech/credentials" +require "google/cloud/speech/v2/speech/paths" +require "google/cloud/speech/v2/speech/operations" +require "google/cloud/speech/v2/speech/client" +require "google/cloud/speech/v2/speech/rest" + +module Google + module Cloud + module Speech + module V2 + ## + # Enables speech transcription and resource management. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/speech/v2/speech" + # client = ::Google::Cloud::Speech::V2::Speech::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/speech/v2/speech/rest" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module Speech + end + end + end + end +end + +helper_path = ::File.join __dir__, "speech", "helpers.rb" +require "google/cloud/speech/v2/speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb new file mode 100644 index 000000000000..eddbc08258d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb @@ -0,0 +1,2922 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v2/cloud_speech_pb" +require "google/cloud/location" + +module Google + module Cloud + module Speech + module V2 + module Speech + ## + # Client for the Speech service. + # + # Enables speech transcription and resource management. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :speech_stub + + ## + # Configure the Speech Client class. + # + # See {::Google::Cloud::Speech::V2::Speech::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Speech clients + # ::Google::Cloud::Speech::V2::Speech::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Speech", "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 = 5000.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Speech Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V2::Speech::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @speech_stub.universe_domain + end + + ## + # Create a new Speech client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Speech 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/speech/v2/cloud_speech_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 + + @speech_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Speech::V2::Speech::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 + ) + + @speech_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 = @speech_stub.endpoint + config.universe_domain = @speech_stub.universe_domain + config.logger = @speech_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Speech::V2::Speech::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 + @speech_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload create_recognizer(request, options = nil) + # Pass arguments to `create_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreateRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) + # Pass arguments to `create_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] + # Required. The Recognizer to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the Recognizer, but do not + # actually create it. + # @param recognizer_id [::String] + # The ID to use for the Recognizer, which will become the final component of + # the Recognizer's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this Recognizer will be created. + # The expected format is `projects/{project}/locations/{location}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new + # + # # Call the create_recognizer method. + # result = client.create_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateRecognizerRequest + + # Converts hash and nil to 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_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :create_recognizer, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 Recognizers. + # + # @overload list_recognizers(request, options = nil) + # Pass arguments to `list_recognizers` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListRecognizersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_recognizers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of Recognizers to list. The expected + # format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of Recognizers to return. The service may return fewer + # than this value. If unspecified, at most 5 Recognizers will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} must match + # the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListRecognizersRequest.new + # + # # Call the list_recognizers method. + # result = client.list_recognizers request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V2::Recognizer. + # p item + # end + # + def list_recognizers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListRecognizersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_recognizers.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_recognizers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_recognizers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :list_recognizers, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @speech_stub, :list_recognizers, request, response, 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 requested + # {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't + # exist. + # + # @overload get_recognizer(request, options = nil) + # Pass arguments to `get_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_recognizer(name: nil) + # Pass arguments to `get_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 Recognizer to retrieve. The expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::Recognizer] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::Recognizer] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetRecognizerRequest.new + # + # # Call the get_recognizer method. + # result = client.get_recognizer request + # + # # The returned object is of type Google::Cloud::Speech::V2::Recognizer. + # p result + # + def get_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetRecognizerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :get_recognizer, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload update_recognizer(request, options = nil) + # Pass arguments to `update_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] + # Required. The Recognizer to update. + # + # The Recognizer's `name` field is used to identify the Recognizer to update. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire Recognizer resource. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated Recognizer, but do not + # actually update it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new + # + # # Call the update_recognizer method. + # result = client.update_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateRecognizerRequest + + # Converts hash and nil to 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_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.recognizer&.name + header_params["recognizer.name"] = request.recognizer.name + end + + request_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_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :update_recognizer, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload delete_recognizer(request, options = nil) + # Pass arguments to `delete_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeleteRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 Recognizer to delete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted Recognizer, but do not + # actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the Recognizer is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new + # + # # Call the delete_recognizer method. + # result = client.delete_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteRecognizerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :delete_recognizer, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Undeletes the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload undelete_recognizer(request, options = nil) + # Pass arguments to `undelete_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeleteRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_recognizer(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 Recognizer to undelete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted Recognizer, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new + # + # # Call the undelete_recognizer method. + # result = client.undelete_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.undelete_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.undelete_recognizer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :undelete_recognizer, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs synchronous Speech recognition: receive results after all audio + # has been sent and processed. + # + # @overload recognize(request, options = nil) + # Pass arguments to `recognize` via a request object, either of type + # {::Google::Cloud::Speech::V2::RecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::RecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) + # Pass arguments to `recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field + # can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the + # values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @param content [::String] + # The audio data bytes encoded as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As + # with all bytes fields, proto buffers use a pure binary representation, + # whereas JSON representations use base64. + # + # Note: The following parameters are mutually exclusive: `content`, `uri`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param uri [::String] + # URI that points to a file that contains audio data bytes as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file + # must not be compressed (for example, gzip). Currently, only Google Cloud + # Storage URIs are supported, which must be specified in the following + # format: `gs://bucket_name/object_name` (other URI formats return + # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more + # information, see [Request + # URIs](https://cloud.google.com/storage/docs/reference-uris). + # + # Note: The following parameters are mutually exclusive: `uri`, `content`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::RecognizeResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::RecognizeResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::RecognizeRequest.new + # + # # Call the recognize method. + # result = client.recognize request + # + # # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. + # p result + # + def recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::RecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.recognizer + header_params["recognizer"] = request.recognizer + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :recognize, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs bidirectional streaming speech recognition: receive results while + # sending audio. This method is only available via the gRPC API (not REST). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Speech::V2::StreamingRecognizeRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_recognize method to start streaming. + # output = client.streaming_recognize input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_recognize request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V2::StreamingRecognizeRequest + end + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.streaming_recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::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.streaming_recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :streaming_recognize, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs batch asynchronous speech recognition: send a request with N + # audio files and receive a long running operation that can be polled to see + # when the transcriptions are finished. + # + # @overload batch_recognize(request, options = nil) + # Pass arguments to `batch_recognize` via a request object, either of type + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) + # Pass arguments to `batch_recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override + # the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all given fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>] + # Audio files with file metadata for ASR. + # The maximum number of files allowed to be specified is 15. + # @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash] + # Configuration options for where to output the transcripts of each file. + # @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] + # Processing strategy to use for this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new + # + # # Call the batch_recognize method. + # result = client.batch_recognize request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::BatchRecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.recognizer + header_params["recognizer"] = request.recognizer + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_recognize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :batch_recognize, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested {::Google::Cloud::Speech::V2::Config Config}. + # + # @overload get_config(request, options = nil) + # Pass arguments to `get_config` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_config(name: nil) + # Pass arguments to `get_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the config to retrieve. There is exactly one config + # resource per project per location. The expected format is + # `projects/{project}/locations/{location}/config`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetConfigRequest.new + # + # # Call the get_config method. + # result = client.get_config request + # + # # The returned object is of type Google::Cloud::Speech::V2::Config. + # p result + # + def get_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_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::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :get_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Speech::V2::Config Config}. + # + # @overload update_config(request, options = nil) + # Pass arguments to `update_config` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_config(config: nil, update_mask: nil) + # Pass arguments to `update_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 config [::Google::Cloud::Speech::V2::Config, ::Hash] + # Required. The config to update. + # + # The config's `name` field is used to identify the config to be updated. + # The expected format is `projects/{project}/locations/{location}/config`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateConfigRequest.new + # + # # Call the update_config method. + # result = client.update_config request + # + # # The returned object is of type Google::Cloud::Speech::V2::Config. + # p result + # + def update_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateConfigRequest + + # Converts hash and nil to 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_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::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.config&.name + header_params["config.name"] = request.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_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :update_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload create_custom_class(request, options = nil) + # Pass arguments to `create_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) + # Pass arguments to `create_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] + # Required. The CustomClass to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the CustomClass, but do not + # actually create it. + # @param custom_class_id [::String] + # The ID to use for the CustomClass, which will become the final component of + # the CustomClass's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this CustomClass will be created. + # The expected format is `projects/{project}/locations/{location}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new + # + # # Call the create_custom_class method. + # result = client.create_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateCustomClassRequest + + # Converts hash and nil to 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :create_custom_class, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 CustomClasses. + # + # @overload list_custom_classes(request, options = nil) + # Pass arguments to `list_custom_classes` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListCustomClassesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_custom_classes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of CustomClass resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # Number of results per requests. A valid page_size ranges from 0 to 100 + # inclusive. If the page_size is zero or unspecified, a page size of 5 will + # be chosen. If the page size exceeds 100, it will be coerced down to 100. + # Note that a call might return fewer results than the requested page size. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} must + # match the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new + # + # # Call the list_custom_classes method. + # result = client.list_custom_classes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V2::CustomClass. + # p item + # end + # + def list_custom_classes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListCustomClassesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_custom_classes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_custom_classes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :list_custom_classes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @speech_stub, :list_custom_classes, request, response, 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 requested + # {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload get_custom_class(request, options = nil) + # Pass arguments to `get_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_custom_class(name: nil) + # Pass arguments to `get_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 CustomClass to retrieve. The expected format is + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::CustomClass] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::CustomClass] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetCustomClassRequest.new + # + # # Call the get_custom_class method. + # result = client.get_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V2::CustomClass. + # p result + # + def get_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :get_custom_class, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload update_custom_class(request, options = nil) + # Pass arguments to `update_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] + # Required. The CustomClass to update. + # + # The CustomClass's `name` field is used to identify the CustomClass to + # update. Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. If empty, all fields are considered for + # update. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated CustomClass, but do + # not actually update it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new + # + # # Call the update_custom_class method. + # result = client.update_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateCustomClassRequest + + # Converts hash and nil to 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.custom_class&.name + header_params["custom_class.name"] = request.custom_class.name + end + + request_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_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :update_custom_class, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload delete_custom_class(request, options = nil) + # Pass arguments to `delete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 CustomClass to delete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted CustomClass, but do + # not actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the CustomClass is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new + # + # # Call the delete_custom_class method. + # result = client.delete_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :delete_custom_class, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Undeletes the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload undelete_custom_class(request, options = nil) + # Pass arguments to `undelete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_custom_class(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 CustomClass to undelete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted CustomClass, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new + # + # # Call the undelete_custom_class method. + # result = client.undelete_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.undelete_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.undelete_custom_class.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :undelete_custom_class, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload create_phrase_set(request, options = nil) + # Pass arguments to `create_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) + # Pass arguments to `create_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] + # Required. The PhraseSet to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the PhraseSet, but do not + # actually create it. + # @param phrase_set_id [::String] + # The ID to use for the PhraseSet, which will become the final component of + # the PhraseSet's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this PhraseSet will be created. + # The expected format is `projects/{project}/locations/{location}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new + # + # # Call the create_phrase_set method. + # result = client.create_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreatePhraseSetRequest + + # Converts hash and nil to 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :create_phrase_set, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 PhraseSets. + # + # @overload list_phrase_sets(request, options = nil) + # Pass arguments to `list_phrase_sets` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_phrase_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of PhraseSet resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of PhraseSets to return. The service may return fewer + # than this value. If unspecified, at most 5 PhraseSets will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} must match + # the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new + # + # # Call the list_phrase_sets method. + # result = client.list_phrase_sets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet. + # p item + # end + # + def list_phrase_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListPhraseSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_phrase_sets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_phrase_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_phrase_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :list_phrase_sets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @speech_stub, :list_phrase_sets, request, response, 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 requested + # {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload get_phrase_set(request, options = nil) + # Pass arguments to `get_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_phrase_set(name: nil) + # Pass arguments to `get_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 PhraseSet to retrieve. The expected format is + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Speech::V2::PhraseSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new + # + # # Call the get_phrase_set method. + # result = client.get_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. + # p result + # + def get_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :get_phrase_set, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload update_phrase_set(request, options = nil) + # Pass arguments to `update_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] + # Required. The PhraseSet to update. + # + # The PhraseSet's `name` field is used to identify the PhraseSet to update. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire PhraseSet resource. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated PhraseSet, but do not + # actually update it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new + # + # # Call the update_phrase_set method. + # result = client.update_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest + + # Converts hash and nil to 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.phrase_set&.name + header_params["phrase_set.name"] = request.phrase_set.name + end + + request_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_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :update_phrase_set, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload delete_phrase_set(request, options = nil) + # Pass arguments to `delete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 PhraseSet to delete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted PhraseSet, but do not + # actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the PhraseSet is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new + # + # # Call the delete_phrase_set method. + # result = client.delete_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeletePhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :delete_phrase_set, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Undeletes the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload undelete_phrase_set(request, options = nil) + # Pass arguments to `undelete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_phrase_set(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 PhraseSet to undelete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted PhraseSet, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new + # + # # Call the undelete_phrase_set method. + # result = client.undelete_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.undelete_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.undelete_phrase_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.call_rpc :undelete_phrase_set, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 Speech API. + # + # This class represents the configuration for Speech, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V2::Speech::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_recognizer to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V2::Speech::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_recognizer.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_recognizer.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Speech::V2::Speech::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Speech API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :create_recognizer + ## + # RPC-specific configuration for `list_recognizers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_recognizers + ## + # RPC-specific configuration for `get_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :get_recognizer + ## + # RPC-specific configuration for `update_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :update_recognizer + ## + # RPC-specific configuration for `delete_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_recognizer + ## + # RPC-specific configuration for `undelete_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_recognizer + ## + # RPC-specific configuration for `recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :recognize + ## + # RPC-specific configuration for `streaming_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_recognize + ## + # RPC-specific configuration for `batch_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_recognize + ## + # RPC-specific configuration for `get_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_config + ## + # RPC-specific configuration for `update_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_config + ## + # RPC-specific configuration for `create_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_class + ## + # RPC-specific configuration for `list_custom_classes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_classes + ## + # RPC-specific configuration for `get_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_class + ## + # RPC-specific configuration for `update_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :update_custom_class + ## + # RPC-specific configuration for `delete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_class + ## + # RPC-specific configuration for `undelete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_custom_class + ## + # RPC-specific configuration for `create_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_phrase_set + ## + # RPC-specific configuration for `list_phrase_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_phrase_sets + ## + # RPC-specific configuration for `get_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_phrase_set + ## + # RPC-specific configuration for `update_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_phrase_set + ## + # RPC-specific configuration for `delete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_phrase_set + ## + # RPC-specific configuration for `undelete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_phrase_set + + # @private + def initialize parent_rpcs = nil + create_recognizer_config = parent_rpcs.create_recognizer if parent_rpcs.respond_to? :create_recognizer + @create_recognizer = ::Gapic::Config::Method.new create_recognizer_config + list_recognizers_config = parent_rpcs.list_recognizers if parent_rpcs.respond_to? :list_recognizers + @list_recognizers = ::Gapic::Config::Method.new list_recognizers_config + get_recognizer_config = parent_rpcs.get_recognizer if parent_rpcs.respond_to? :get_recognizer + @get_recognizer = ::Gapic::Config::Method.new get_recognizer_config + update_recognizer_config = parent_rpcs.update_recognizer if parent_rpcs.respond_to? :update_recognizer + @update_recognizer = ::Gapic::Config::Method.new update_recognizer_config + delete_recognizer_config = parent_rpcs.delete_recognizer if parent_rpcs.respond_to? :delete_recognizer + @delete_recognizer = ::Gapic::Config::Method.new delete_recognizer_config + undelete_recognizer_config = parent_rpcs.undelete_recognizer if parent_rpcs.respond_to? :undelete_recognizer + @undelete_recognizer = ::Gapic::Config::Method.new undelete_recognizer_config + recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize + @recognize = ::Gapic::Config::Method.new recognize_config + streaming_recognize_config = parent_rpcs.streaming_recognize if parent_rpcs.respond_to? :streaming_recognize + @streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config + batch_recognize_config = parent_rpcs.batch_recognize if parent_rpcs.respond_to? :batch_recognize + @batch_recognize = ::Gapic::Config::Method.new batch_recognize_config + get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config + @get_config = ::Gapic::Config::Method.new get_config_config + update_config_config = parent_rpcs.update_config if parent_rpcs.respond_to? :update_config + @update_config = ::Gapic::Config::Method.new update_config_config + create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class + @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config + list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes + @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config + get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class + @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config + update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class + @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config + delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class + @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config + undelete_custom_class_config = parent_rpcs.undelete_custom_class if parent_rpcs.respond_to? :undelete_custom_class + @undelete_custom_class = ::Gapic::Config::Method.new undelete_custom_class_config + create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set + @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config + list_phrase_sets_config = parent_rpcs.list_phrase_sets if parent_rpcs.respond_to? :list_phrase_sets + @list_phrase_sets = ::Gapic::Config::Method.new list_phrase_sets_config + get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set + @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config + update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set + @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config + delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set + @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config + undelete_phrase_set_config = parent_rpcs.undelete_phrase_set if parent_rpcs.respond_to? :undelete_phrase_set + @undelete_phrase_set = ::Gapic::Config::Method.new undelete_phrase_set_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb new file mode 100644 index 000000000000..815acecc565d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/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 Speech + module V2 + module Speech + # Credentials for the Speech API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SPEECH_CREDENTIALS", + "SPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SPEECH_CREDENTIALS_JSON", + "SPEECH_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-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb new file mode 100644 index 000000000000..7972b3add947 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/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 Speech + module V2 + module Speech + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Speech 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 Speech 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::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Speech::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::Speech::V2::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 = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb new file mode 100644 index 000000000000..b1310528c078 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.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 Speech + module V2 + module Speech + # Path helper methods for the Speech API. + module Paths + ## + # Create a fully-qualified Config resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/config` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def config_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/config" + 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 CustomClass resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # + # @param project [String] + # @param location [String] + # @param custom_class [String] + # + # @return [::String] + def custom_class_path project:, location:, custom_class: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" + 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 PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + ## + # Create a fully-qualified Recognizer resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/recognizers/{recognizer}` + # + # @param project [String] + # @param location [String] + # @param recognizer [String] + # + # @return [::String] + def recognizer_path project:, location:, recognizer: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/recognizers/#{recognizer}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb new file mode 100644 index 000000000000..c28a87547a1b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/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/speech/v2/version" +require "google/cloud/speech/v2/bindings_override" + +require "google/cloud/speech/v2/speech/credentials" +require "google/cloud/speech/v2/speech/paths" +require "google/cloud/speech/v2/speech/rest/operations" +require "google/cloud/speech/v2/speech/rest/client" + +module Google + module Cloud + module Speech + module V2 + ## + # Enables speech transcription and resource management. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/speech/v2/speech/rest" + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + module Speech + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/speech/v2/speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb new file mode 100644 index 000000000000..5baef8881324 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb @@ -0,0 +1,2647 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/speech/v2/cloud_speech_pb" +require "google/cloud/speech/v2/speech/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Speech + module V2 + module Speech + module Rest + ## + # REST client for the Speech service. + # + # Enables speech transcription and resource management. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :speech_stub + + ## + # Configure the Speech Client class. + # + # See {::Google::Cloud::Speech::V2::Speech::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Speech clients + # ::Google::Cloud::Speech::V2::Speech::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", "Speech", "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 = 5000.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Speech Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Speech::V2::Speech::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 + @speech_stub.universe_domain + end + + ## + # Create a new Speech REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Speech 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::Speech::V2::Speech::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 + + @speech_stub = ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @speech_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 = @speech_stub.endpoint + config.universe_domain = @speech_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @speech_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Speech::V2::Speech::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 + @speech_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload create_recognizer(request, options = nil) + # Pass arguments to `create_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreateRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) + # Pass arguments to `create_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] + # Required. The Recognizer to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the Recognizer, but do not + # actually create it. + # @param recognizer_id [::String] + # The ID to use for the Recognizer, which will become the final component of + # the Recognizer's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this Recognizer will be created. + # The expected format is `projects/{project}/locations/{location}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new + # + # # Call the create_recognizer method. + # result = client.create_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateRecognizerRequest + + # Converts hash and nil to an 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_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.create_recognizer request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 Recognizers. + # + # @overload list_recognizers(request, options = nil) + # Pass arguments to `list_recognizers` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListRecognizersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_recognizers` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of Recognizers to list. The expected + # format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of Recognizers to return. The service may return fewer + # than this value. If unspecified, at most 5 Recognizers will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers ListRecognizers} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers ListRecognizers} must match + # the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListRecognizersRequest.new + # + # # Call the list_recognizers method. + # result = client.list_recognizers request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V2::Recognizer. + # p item + # end + # + def list_recognizers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListRecognizersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_recognizers.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_recognizers.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_recognizers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.list_recognizers request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_recognizers, "recognizers", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested + # {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't + # exist. + # + # @overload get_recognizer(request, options = nil) + # Pass arguments to `get_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_recognizer(name: nil) + # Pass arguments to `get_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 Recognizer to retrieve. The expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::Recognizer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Recognizer] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetRecognizerRequest.new + # + # # Call the get_recognizer method. + # result = client.get_recognizer request + # + # # The returned object is of type Google::Cloud::Speech::V2::Recognizer. + # p result + # + def get_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetRecognizerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.get_recognizer request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload update_recognizer(request, options = nil) + # Pass arguments to `update_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] + # Required. The Recognizer to update. + # + # The Recognizer's `name` field is used to identify the Recognizer to update. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire Recognizer resource. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated Recognizer, but do not + # actually update it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new + # + # # Call the update_recognizer method. + # result = client.update_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateRecognizerRequest + + # Converts hash and nil to an 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_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.update_recognizer request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload delete_recognizer(request, options = nil) + # Pass arguments to `delete_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeleteRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 Recognizer to delete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted Recognizer, but do not + # actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the Recognizer is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new + # + # # Call the delete_recognizer method. + # result = client.delete_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteRecognizerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.delete_recognizer request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Undeletes the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. + # + # @overload undelete_recognizer(request, options = nil) + # Pass arguments to `undelete_recognizer` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeleteRecognizerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_recognizer(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_recognizer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 Recognizer to undelete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted Recognizer, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new + # + # # Call the undelete_recognizer method. + # result = client.undelete_recognizer request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_recognizer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.undelete_recognizer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.undelete_recognizer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_recognizer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.undelete_recognizer request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs synchronous Speech recognition: receive results after all audio + # has been sent and processed. + # + # @overload recognize(request, options = nil) + # Pass arguments to `recognize` via a request object, either of type + # {::Google::Cloud::Speech::V2::RecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::RecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) + # Pass arguments to `recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field + # can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the + # values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @param content [::String] + # The audio data bytes encoded as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As + # with all bytes fields, proto buffers use a pure binary representation, + # whereas JSON representations use base64. + # + # Note: The following parameters are mutually exclusive: `content`, `uri`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param uri [::String] + # URI that points to a file that contains audio data bytes as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file + # must not be compressed (for example, gzip). Currently, only Google Cloud + # Storage URIs are supported, which must be specified in the following + # format: `gs://bucket_name/object_name` (other URI formats return + # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more + # information, see [Request + # URIs](https://cloud.google.com/storage/docs/reference-uris). + # + # Note: The following parameters are mutually exclusive: `uri`, `content`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::RecognizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::RecognizeResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::RecognizeRequest.new + # + # # Call the recognize method. + # result = client.recognize request + # + # # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. + # p result + # + def recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::RecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.recognize.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.recognize request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs batch asynchronous speech recognition: send a request with N + # audio files and receive a long running operation that can be polled to see + # when the transcriptions are finished. + # + # @overload batch_recognize(request, options = nil) + # Pass arguments to `batch_recognize` via a request object, either of type + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) + # Pass arguments to `batch_recognize` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param recognizer [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override + # the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all given fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>] + # Audio files with file metadata for ASR. + # The maximum number of files allowed to be specified is 15. + # @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash] + # Configuration options for where to output the transcripts of each file. + # @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] + # Processing strategy to use for this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new + # + # # Call the batch_recognize method. + # result = client.batch_recognize request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_recognize request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::BatchRecognizeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_recognize.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_recognize.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_recognize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.batch_recognize request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested {::Google::Cloud::Speech::V2::Config Config}. + # + # @overload get_config(request, options = nil) + # Pass arguments to `get_config` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_config(name: nil) + # Pass arguments to `get_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the config to retrieve. There is exactly one config + # resource per project per location. The expected format is + # `projects/{project}/locations/{location}/config`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetConfigRequest.new + # + # # Call the get_config method. + # result = client.get_config request + # + # # The returned object is of type Google::Cloud::Speech::V2::Config. + # p result + # + def get_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_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::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.get_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Speech::V2::Config Config}. + # + # @overload update_config(request, options = nil) + # Pass arguments to `update_config` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_config(config: nil, update_mask: nil) + # Pass arguments to `update_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 config [::Google::Cloud::Speech::V2::Config, ::Hash] + # Required. The config to update. + # + # The config's `name` field is used to identify the config to be updated. + # The expected format is `projects/{project}/locations/{location}/config`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateConfigRequest.new + # + # # Call the update_config method. + # result = client.update_config request + # + # # The returned object is of type Google::Cloud::Speech::V2::Config. + # p result + # + def update_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateConfigRequest + + # Converts hash and nil to an 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_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::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.update_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload create_custom_class(request, options = nil) + # Pass arguments to `create_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) + # Pass arguments to `create_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] + # Required. The CustomClass to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the CustomClass, but do not + # actually create it. + # @param custom_class_id [::String] + # The ID to use for the CustomClass, which will become the final component of + # the CustomClass's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this CustomClass will be created. + # The expected format is `projects/{project}/locations/{location}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new + # + # # Call the create_custom_class method. + # result = client.create_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateCustomClassRequest + + # Converts hash and nil to an 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.create_custom_class request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 CustomClasses. + # + # @overload list_custom_classes(request, options = nil) + # Pass arguments to `list_custom_classes` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListCustomClassesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_custom_classes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of CustomClass resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # Number of results per requests. A valid page_size ranges from 0 to 100 + # inclusive. If the page_size is zero or unspecified, a page size of 5 will + # be chosen. If the page size exceeds 100, it will be coerced down to 100. + # Note that a call might return fewer results than the requested page size. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes ListCustomClasses} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes ListCustomClasses} must + # match the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new + # + # # Call the list_custom_classes method. + # result = client.list_custom_classes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V2::CustomClass. + # p item + # end + # + def list_custom_classes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListCustomClassesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_custom_classes.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_custom_classes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.list_custom_classes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_custom_classes, "custom_classes", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested + # {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload get_custom_class(request, options = nil) + # Pass arguments to `get_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_custom_class(name: nil) + # Pass arguments to `get_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 CustomClass to retrieve. The expected format is + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::CustomClass] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetCustomClassRequest.new + # + # # Call the get_custom_class method. + # result = client.get_custom_class request + # + # # The returned object is of type Google::Cloud::Speech::V2::CustomClass. + # p result + # + def get_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.get_custom_class request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload update_custom_class(request, options = nil) + # Pass arguments to `update_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdateCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] + # Required. The CustomClass to update. + # + # The CustomClass's `name` field is used to identify the CustomClass to + # update. Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. If empty, all fields are considered for + # update. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated CustomClass, but do + # not actually update it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new + # + # # Call the update_custom_class method. + # result = client.update_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateCustomClassRequest + + # Converts hash and nil to an 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_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.update_custom_class request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload delete_custom_class(request, options = nil) + # Pass arguments to `delete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 CustomClass to delete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted CustomClass, but do + # not actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the CustomClass is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new + # + # # Call the delete_custom_class method. + # result = client.delete_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.delete_custom_class request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Undeletes the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. + # + # @overload undelete_custom_class(request, options = nil) + # Pass arguments to `undelete_custom_class` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeleteCustomClassRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_custom_class(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_custom_class` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 CustomClass to undelete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted CustomClass, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new + # + # # Call the undelete_custom_class method. + # result = client.undelete_custom_class request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_custom_class request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.undelete_custom_class.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.undelete_custom_class.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_custom_class.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.undelete_custom_class request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload create_phrase_set(request, options = nil) + # Pass arguments to `create_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::CreatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) + # Pass arguments to `create_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] + # Required. The PhraseSet to create. + # @param validate_only [::Boolean] + # If set, validate the request and preview the PhraseSet, but do not + # actually create it. + # @param phrase_set_id [::String] + # The ID to use for the PhraseSet, which will become the final component of + # the PhraseSet's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @param parent [::String] + # Required. The project and location where this PhraseSet will be created. + # The expected format is `projects/{project}/locations/{location}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new + # + # # Call the create_phrase_set method. + # result = client.create_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreatePhraseSetRequest + + # Converts hash and nil to an 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.create_phrase_set request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 PhraseSets. + # + # @overload list_phrase_sets(request, options = nil) + # Pass arguments to `list_phrase_sets` via a request object, either of type + # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_phrase_sets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The project and location of PhraseSet resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of PhraseSets to return. The service may return fewer + # than this value. If unspecified, at most 5 PhraseSets will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets ListPhraseSets} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets ListPhraseSets} must match + # the call that provided the page token. + # @param show_deleted [::Boolean] + # Whether, or not, to show resources that have been deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new + # + # # Call the list_phrase_sets method. + # result = client.list_phrase_sets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet. + # p item + # end + # + def list_phrase_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListPhraseSetsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_phrase_sets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_phrase_sets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_phrase_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.list_phrase_sets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_phrase_sets, "phrase_sets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested + # {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload get_phrase_set(request, options = nil) + # Pass arguments to `get_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::GetPhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_phrase_set(name: nil) + # Pass arguments to `get_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 PhraseSet to retrieve. The expected format is + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new + # + # # Call the get_phrase_set method. + # result = client.get_phrase_set request + # + # # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. + # p result + # + def get_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetPhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.get_phrase_set request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload update_phrase_set(request, options = nil) + # Pass arguments to `update_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::UpdatePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] + # Required. The PhraseSet to update. + # + # The PhraseSet's `name` field is used to identify the PhraseSet to update. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire PhraseSet resource. + # @param validate_only [::Boolean] + # If set, validate the request and preview the updated PhraseSet, but do not + # actually update it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new + # + # # Call the update_phrase_set method. + # result = client.update_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest + + # Converts hash and nil to an 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_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.update_phrase_set request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload delete_phrase_set(request, options = nil) + # Pass arguments to `delete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::DeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) + # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 PhraseSet to delete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the deleted PhraseSet, but do not + # actually delete it. + # @param allow_missing [::Boolean] + # If set to true, and the PhraseSet is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new + # + # # Call the delete_phrase_set method. + # result = client.delete_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeletePhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.delete_phrase_set request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Undeletes the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. + # + # @overload undelete_phrase_set(request, options = nil) + # Pass arguments to `undelete_phrase_set` via a request object, either of type + # {::Google::Cloud::Speech::V2::UndeletePhraseSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_phrase_set(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `undelete_phrase_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 PhraseSet to undelete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @param validate_only [::Boolean] + # If set, validate the request and preview the undeleted PhraseSet, but do + # not actually undelete it. + # @param etag [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/speech/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new + # + # # Call the undelete_phrase_set method. + # result = client.undelete_phrase_set request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def undelete_phrase_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.undelete_phrase_set.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.undelete_phrase_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_phrase_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @speech_stub.undelete_phrase_set request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 Speech REST API. + # + # This class represents the configuration for Speech REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Speech::V2::Speech::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_recognizer to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Speech::V2::Speech::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_recognizer.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_recognizer.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 Speech API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :create_recognizer + ## + # RPC-specific configuration for `list_recognizers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_recognizers + ## + # RPC-specific configuration for `get_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :get_recognizer + ## + # RPC-specific configuration for `update_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :update_recognizer + ## + # RPC-specific configuration for `delete_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_recognizer + ## + # RPC-specific configuration for `undelete_recognizer` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_recognizer + ## + # RPC-specific configuration for `recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :recognize + ## + # RPC-specific configuration for `batch_recognize` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_recognize + ## + # RPC-specific configuration for `get_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_config + ## + # RPC-specific configuration for `update_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_config + ## + # RPC-specific configuration for `create_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_class + ## + # RPC-specific configuration for `list_custom_classes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_classes + ## + # RPC-specific configuration for `get_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_class + ## + # RPC-specific configuration for `update_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :update_custom_class + ## + # RPC-specific configuration for `delete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_class + ## + # RPC-specific configuration for `undelete_custom_class` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_custom_class + ## + # RPC-specific configuration for `create_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_phrase_set + ## + # RPC-specific configuration for `list_phrase_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_phrase_sets + ## + # RPC-specific configuration for `get_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_phrase_set + ## + # RPC-specific configuration for `update_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_phrase_set + ## + # RPC-specific configuration for `delete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_phrase_set + ## + # RPC-specific configuration for `undelete_phrase_set` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_phrase_set + + # @private + def initialize parent_rpcs = nil + create_recognizer_config = parent_rpcs.create_recognizer if parent_rpcs.respond_to? :create_recognizer + @create_recognizer = ::Gapic::Config::Method.new create_recognizer_config + list_recognizers_config = parent_rpcs.list_recognizers if parent_rpcs.respond_to? :list_recognizers + @list_recognizers = ::Gapic::Config::Method.new list_recognizers_config + get_recognizer_config = parent_rpcs.get_recognizer if parent_rpcs.respond_to? :get_recognizer + @get_recognizer = ::Gapic::Config::Method.new get_recognizer_config + update_recognizer_config = parent_rpcs.update_recognizer if parent_rpcs.respond_to? :update_recognizer + @update_recognizer = ::Gapic::Config::Method.new update_recognizer_config + delete_recognizer_config = parent_rpcs.delete_recognizer if parent_rpcs.respond_to? :delete_recognizer + @delete_recognizer = ::Gapic::Config::Method.new delete_recognizer_config + undelete_recognizer_config = parent_rpcs.undelete_recognizer if parent_rpcs.respond_to? :undelete_recognizer + @undelete_recognizer = ::Gapic::Config::Method.new undelete_recognizer_config + recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize + @recognize = ::Gapic::Config::Method.new recognize_config + batch_recognize_config = parent_rpcs.batch_recognize if parent_rpcs.respond_to? :batch_recognize + @batch_recognize = ::Gapic::Config::Method.new batch_recognize_config + get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config + @get_config = ::Gapic::Config::Method.new get_config_config + update_config_config = parent_rpcs.update_config if parent_rpcs.respond_to? :update_config + @update_config = ::Gapic::Config::Method.new update_config_config + create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class + @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config + list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes + @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config + get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class + @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config + update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class + @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config + delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class + @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config + undelete_custom_class_config = parent_rpcs.undelete_custom_class if parent_rpcs.respond_to? :undelete_custom_class + @undelete_custom_class = ::Gapic::Config::Method.new undelete_custom_class_config + create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set + @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config + list_phrase_sets_config = parent_rpcs.list_phrase_sets if parent_rpcs.respond_to? :list_phrase_sets + @list_phrase_sets = ::Gapic::Config::Method.new list_phrase_sets_config + get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set + @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config + update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set + @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config + delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set + @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config + undelete_phrase_set_config = parent_rpcs.undelete_phrase_set if parent_rpcs.respond_to? :undelete_phrase_set + @undelete_phrase_set = ::Gapic::Config::Method.new undelete_phrase_set_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb new file mode 100644 index 000000000000..f2d7c9d11500 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/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 Speech + module V2 + module Speech + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Speech 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 Speech 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::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "speech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^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: "/v2/{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-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb new file mode 100644 index 000000000000..643afd7c54c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb @@ -0,0 +1,1435 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/speech/v2/cloud_speech_pb" + +module Google + module Cloud + module Speech + module V2 + module Speech + module Rest + ## + # REST service stub for the Speech 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_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreateRecognizerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_recognizer_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_recognizer", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_recognizers REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListRecognizersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::ListRecognizersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::ListRecognizersResponse] + # A result object deserialized from the server's reply + def list_recognizers request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_recognizers_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_recognizers", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::ListRecognizersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetRecognizerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::Recognizer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Recognizer] + # A result object deserialized from the server's reply + def get_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_recognizer_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_recognizer", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::Recognizer.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_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_recognizer_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_recognizer", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_recognizer_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_recognizer", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the undelete_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def undelete_recognizer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_recognizer_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "undelete_recognizer", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::RecognizeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::RecognizeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::RecognizeResponse] + # A result object deserialized from the server's reply + def recognize request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_recognize_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "recognize", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::RecognizeResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::BatchRecognizeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_recognize request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_recognize_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_recognize", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_config REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # A result object deserialized from the server's reply + def get_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_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_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::Config.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_config REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::Config] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::Config] + # A result object deserialized from the server's reply + def update_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_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_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::Config.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_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreateCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_custom_classes REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListCustomClassesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::ListCustomClassesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::ListCustomClassesResponse] + # A result object deserialized from the server's reply + def list_custom_classes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_classes_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_custom_classes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::CustomClass] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::CustomClass] + # A result object deserialized from the server's reply + def get_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::CustomClass.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_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the undelete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def undelete_custom_class request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_custom_class_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "undelete_custom_class", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_phrase_sets REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListPhraseSetsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::ListPhraseSetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::ListPhraseSetsResponse] + # A result object deserialized from the server's reply + def list_phrase_sets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_phrase_sets_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_phrase_sets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetPhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Speech::V2::PhraseSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # A result object deserialized from the server's reply + def get_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Speech::V2::PhraseSet.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_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the undelete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def undelete_phrase_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_phrase_set_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "undelete_phrase_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreateRecognizerRequest] + # 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_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/recognizers", + body: "recognizer", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_recognizers REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListRecognizersRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_recognizers_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/recognizers", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetRecognizerRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] + # 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_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{recognizer.name}", + body: "recognizer", + matches: [ + ["recognizer.name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_recognizer REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_recognizer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::RecognizeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_recognize_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{recognizer}:recognize", + body: "*", + matches: [ + ["recognizer", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_recognize REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::BatchRecognizeRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_recognize_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{recognizer}:batchRecognize", + body: "*", + matches: [ + ["recognizer", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_config REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/config/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_config REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateConfigRequest] + # 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_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{config.name}", + body: "config", + matches: [ + ["config.name", %r{^projects/[^/]+/locations/[^/]+/config/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreateCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/customClasses", + body: "custom_class", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_custom_classes REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListCustomClassesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_custom_classes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/customClasses", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetCustomClassRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] + # 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_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{custom_class.name}", + body: "custom_class", + matches: [ + ["custom_class.name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_custom_class REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_custom_class_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/phraseSets", + body: "phrase_set", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_phrase_sets REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::ListPhraseSetsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_phrase_sets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/phraseSets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::GetPhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] + # 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_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{phrase_set.name}", + body: "phrase_set", + matches: [ + ["phrase_set.name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_phrase_set REST call + # + # @param request_pb [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_phrase_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb new file mode 100644 index 000000000000..b3aeb607f80f --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/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 Speech + module V2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md new file mode 100644 index 000000000000..97cb89a70a74 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Speech-to-Text 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-speech-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/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-speech-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb new file mode 100644 index 000000000000..727666e1d47d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb @@ -0,0 +1,2086 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Speech + module V2 + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#create_recognizer CreateRecognizer} method. + # @!attribute [rw] recognizer + # @return [::Google::Cloud::Speech::V2::Recognizer] + # Required. The Recognizer to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the Recognizer, but do not + # actually create it. + # @!attribute [rw] recognizer_id + # @return [::String] + # The ID to use for the Recognizer, which will become the final component of + # the Recognizer's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location where this Recognizer will be created. + # The expected format is `projects/{project}/locations/{location}`. + class CreateRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of a long-running operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation was created. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation was last updated. + # @!attribute [rw] resource + # @return [::String] + # The resource path for the target of the operation. + # @!attribute [rw] method + # @return [::String] + # The method that triggered the operation. + # @!attribute [rw] kms_key_name + # @return [::String] + # The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the content of the Operation is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [rw] kms_key_version_name + # @return [::String] + # The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which content of the Operation is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + # @!attribute [rw] batch_recognize_request + # @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest] + # The BatchRecognizeRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] create_recognizer_request + # @return [::Google::Cloud::Speech::V2::CreateRecognizerRequest] + # The CreateRecognizerRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `create_recognizer_request`, `batch_recognize_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_recognizer_request + # @return [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] + # The UpdateRecognizerRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `update_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_recognizer_request + # @return [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] + # The DeleteRecognizerRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `delete_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] undelete_recognizer_request + # @return [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] + # The UndeleteRecognizerRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `undelete_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] create_custom_class_request + # @return [::Google::Cloud::Speech::V2::CreateCustomClassRequest] + # The CreateCustomClassRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `create_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_custom_class_request + # @return [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] + # The UpdateCustomClassRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `update_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_custom_class_request + # @return [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] + # The DeleteCustomClassRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `delete_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] undelete_custom_class_request + # @return [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] + # The UndeleteCustomClassRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `undelete_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] create_phrase_set_request + # @return [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] + # The CreatePhraseSetRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `create_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_phrase_set_request + # @return [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] + # The UpdatePhraseSetRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `update_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_phrase_set_request + # @return [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] + # The DeletePhraseSetRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `delete_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] undelete_phrase_set_request + # @return [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] + # The UndeletePhraseSetRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `undelete_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_config_request + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Speech::V2::UpdateConfigRequest] + # The UpdateConfigRequest that spawned the Operation. + # + # Note: The following fields are mutually exclusive: `update_config_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] progress_percent + # @return [::Integer] + # The percent progress of the Operation. Values can range from 0-100. If the + # value is 100, then the operation is finished. + # @!attribute [rw] batch_recognize_metadata + # @return [::Google::Cloud::Speech::V2::BatchRecognizeMetadata] + # Metadata specific to the BatchRecognize method. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location of Recognizers to list. The expected + # format is `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Recognizers to return. The service may return fewer + # than this value. If unspecified, at most 5 Recognizers will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} must match + # the call that provided the page token. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Whether, or not, to show resources that have been deleted. + class ListRecognizersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method. + # @!attribute [rw] recognizers + # @return [::Array<::Google::Cloud::Speech::V2::Recognizer>] + # The list of requested Recognizers. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::Speech::V2::ListRecognizersRequest#page_token page_token} to + # retrieve the next page. If this field is omitted, there are no subsequent + # pages. This token expires after 72 hours. + class ListRecognizersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#get_recognizer GetRecognizer} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Recognizer to retrieve. The expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. + class GetRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#update_recognizer UpdateRecognizer} method. + # @!attribute [rw] recognizer + # @return [::Google::Cloud::Speech::V2::Recognizer] + # Required. The Recognizer to update. + # + # The Recognizer's `name` field is used to identify the Recognizer to update. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire Recognizer resource. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the updated Recognizer, but do not + # actually update it. + class UpdateRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#delete_recognizer DeleteRecognizer} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Recognizer to delete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the deleted Recognizer, but do not + # actually delete it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the Recognizer is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class DeleteRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer UndeleteRecognizer} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Recognizer to undelete. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the undeleted Recognizer, but do + # not actually undelete it. + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class UndeleteRecognizerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Recognizer message. Stores recognition configuration and metadata. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the Recognizer. + # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. + # @!attribute [r] uid + # @return [::String] + # Output only. System-assigned unique identifier for the Recognizer. + # @!attribute [rw] display_name + # @return [::String] + # User-settable, human-readable name for the Recognizer. Must be 63 + # characters or less. + # @!attribute [rw] model + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. This field is now deprecated. Prefer the + # {::Google::Cloud::Speech::V2::RecognitionConfig#model `model`} field in the + # {::Google::Cloud::Speech::V2::RecognitionConfig `RecognitionConfig`} message. + # + # Which model to use for recognition requests. Select the model best suited + # to your domain to get best results. + # + # Guidance for choosing which model to use can be found in the [Transcription + # Models + # Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) + # and the models supported in each region can be found in the [Table Of + # Supported + # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + # @!attribute [rw] language_codes + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # Optional. This field is now deprecated. Prefer the + # {::Google::Cloud::Speech::V2::RecognitionConfig#language_codes `language_codes`} + # field in the + # {::Google::Cloud::Speech::V2::RecognitionConfig `RecognitionConfig`} message. + # + # The language of the supplied audio as a + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # + # Supported languages for each model are listed in the [Table of Supported + # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + # + # If additional languages are provided, recognition result will contain + # recognition in the most likely language detected. The recognition result + # will include the language tag of the language detected in the audio. + # When you create or update a Recognizer, these values are + # stored in normalized BCP-47 form. For example, "en-us" is stored as + # "en-US". + # @!attribute [rw] default_recognition_config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Default configuration to use for requests with this Recognizer. + # This can be overwritten by inline configuration in the + # {::Google::Cloud::Speech::V2::RecognizeRequest#config RecognizeRequest.config} + # field. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Allows users to store small amounts of arbitrary data. + # Both the key and the value must be 63 characters or less each. + # At most 100 annotations. + # @!attribute [r] state + # @return [::Google::Cloud::Speech::V2::Recognizer::State] + # Output only. The Recognizer lifecycle state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this Recognizer was modified. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this Recognizer was requested for deletion. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this Recognizer will be purged. + # @!attribute [r] etag + # @return [::String] + # Output only. This checksum is computed by the server based on the value of + # other fields. This may be sent on update, undelete, and delete requests to + # ensure the client has an up-to-date value before proceeding. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Whether or not this Recognizer is in the process of being + # updated. + # @!attribute [r] kms_key_name + # @return [::String] + # Output only. The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the Recognizer is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] kms_key_version_name + # @return [::String] + # Output only. The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which the Recognizer is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + class Recognizer + 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 + + # Set of states that define the lifecycle of a Recognizer. + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # The Recognizer is active and ready for use. + ACTIVE = 2 + + # This Recognizer has been deleted. + DELETED = 4 + end + end + + # Automatically detected decoding parameters. + # Supported for the following encodings: + # + # * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container. + # + # * WAV_MULAW: 8-bit companded mulaw samples in a WAV container. + # + # * WAV_ALAW: 8-bit companded alaw samples in a WAV container. + # + # * RFC4867_5_AMR: AMR frames with an rfc4867.5 header. + # + # * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header. + # + # * FLAC: FLAC frames in the "native FLAC" container format. + # + # * MP3: MPEG audio frames with optional (ignored) ID3 metadata. + # + # * OGG_OPUS: Opus audio frames in an Ogg container. + # + # * WEBM_OPUS: Opus audio frames in a WebM container. + # + # * MP4_AAC: AAC audio frames in an MP4 container. + # + # * M4A_AAC: AAC audio frames in an M4A container. + # + # * MOV_AAC: AAC audio frames in an MOV container. + class AutoDetectDecodingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Explicitly specified decoding parameters. + # @!attribute [rw] encoding + # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig::AudioEncoding] + # Required. Encoding of the audio data sent for recognition. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Optional. Sample rate in Hertz of the audio data sent for recognition. + # Valid values are: 8000-48000, and 16000 is optimal. For best results, set + # the sampling rate of the audio source to 16000 Hz. If that's not possible, + # use the native sample rate of the audio source (instead of resampling). + # Note that this field is marked as OPTIONAL for backward compatibility + # reasons. It is (and has always been) effectively REQUIRED. + # @!attribute [rw] audio_channel_count + # @return [::Integer] + # Optional. Number of channels present in the audio data sent for + # recognition. Note that this field is marked as OPTIONAL for backward + # compatibility reasons. It is (and has always been) effectively REQUIRED. + # + # The maximum allowed value is 8. + class ExplicitDecodingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Supported audio data encodings. + module AudioEncoding + # Default value. This value is unused. + AUDIO_ENCODING_UNSPECIFIED = 0 + + # Headerless 16-bit signed little-endian PCM samples. + LINEAR16 = 1 + + # Headerless 8-bit companded mulaw samples. + MULAW = 2 + + # Headerless 8-bit companded alaw samples. + ALAW = 3 + + # AMR frames with an rfc4867.5 header. + AMR = 4 + + # AMR-WB frames with an rfc4867.5 header. + AMR_WB = 5 + + # FLAC frames in the "native FLAC" container format. + FLAC = 6 + + # MPEG audio frames with optional (ignored) ID3 metadata. + MP3 = 7 + + # Opus audio frames in an Ogg container. + OGG_OPUS = 8 + + # Opus audio frames in a WebM container. + WEBM_OPUS = 9 + + # AAC audio frames in an MP4 container. + MP4_AAC = 10 + + # AAC audio frames in an M4A container. + M4A_AAC = 11 + + # AAC audio frames in an MOV container. + MOV_AAC = 12 + end + end + + # Configuration to enable speaker diarization. + # @!attribute [rw] min_speaker_count + # @return [::Integer] + # Optional. The system automatically determines the number of speakers. This + # value is not currently used. + # @!attribute [rw] max_speaker_count + # @return [::Integer] + # Optional. The system automatically determines the number of speakers. This + # value is not currently used. + class SpeakerDiarizationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration to enable custom prompt in chirp3. + # @!attribute [rw] custom_prompt + # @return [::String] + # Optional. The custom instructions to override the existing instructions for + # chirp3. + class CustomPromptConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Available recognition features. + # @!attribute [rw] profanity_filter + # @return [::Boolean] + # If set to `true`, the server will attempt to filter out profanities, + # replacing all but the initial character in each filtered word with + # asterisks, for instance, "f***". If set to `false` or omitted, profanities + # won't be filtered out. + # @!attribute [rw] enable_word_time_offsets + # @return [::Boolean] + # If `true`, the top result includes a list of words and the start and end + # time offsets (timestamps) for those words. If `false`, no word-level time + # offset information is returned. The default is `false`. + # @!attribute [rw] enable_word_confidence + # @return [::Boolean] + # If `true`, the top result includes a list of words and the confidence for + # those words. If `false`, no word-level confidence information is returned. + # The default is `false`. + # @!attribute [rw] enable_automatic_punctuation + # @return [::Boolean] + # If `true`, adds punctuation to recognition result hypotheses. This feature + # is only available in select languages. The default `false` value does not + # add punctuation to result hypotheses. + # @!attribute [rw] enable_spoken_punctuation + # @return [::Boolean] + # The spoken punctuation behavior for the call. If `true`, replaces spoken + # punctuation with the corresponding symbols in the request. For example, + # "how are you question mark" becomes "how are you?". See + # https://cloud.google.com/speech-to-text/docs/spoken-punctuation for + # support. If `false`, spoken punctuation is not replaced. + # @!attribute [rw] enable_spoken_emojis + # @return [::Boolean] + # The spoken emoji behavior for the call. If `true`, adds spoken emoji + # formatting for the request. This will replace spoken emojis with the + # corresponding Unicode symbols in the final transcript. If `false`, spoken + # emojis are not replaced. + # @!attribute [rw] multi_channel_mode + # @return [::Google::Cloud::Speech::V2::RecognitionFeatures::MultiChannelMode] + # Mode for recognizing multi-channel audio. + # @!attribute [rw] diarization_config + # @return [::Google::Cloud::Speech::V2::SpeakerDiarizationConfig] + # Configuration to enable speaker diarization. To enable diarization, set + # this field to an empty SpeakerDiarizationConfig message. + # @!attribute [rw] max_alternatives + # @return [::Integer] + # Maximum number of recognition hypotheses to be returned. + # The server may return fewer than `max_alternatives`. + # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + # one. If omitted, will return a maximum of one. + # @!attribute [rw] custom_prompt_config + # @return [::Google::Cloud::Speech::V2::CustomPromptConfig] + # Optional. Configuration to enable custom prompt for chirp3. + class RecognitionFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Options for how to recognize multi-channel audio. + module MultiChannelMode + # Default value for the multi-channel mode. If the audio contains + # multiple channels, only the first channel will be transcribed; other + # channels will be ignored. + MULTI_CHANNEL_MODE_UNSPECIFIED = 0 + + # If selected, each channel in the provided audio is transcribed + # independently. This cannot be selected if the selected + # {::Google::Cloud::Speech::V2::Recognizer#model model} is `latest_short`. + SEPARATE_RECOGNITION_PER_CHANNEL = 1 + end + end + + # Transcription normalization configuration. Use transcription normalization + # to automatically replace parts of the transcript with phrases of your + # choosing. For StreamingRecognize, this normalization only applies to stable + # partial transcripts (stability > 0.8) and final transcripts. + # @!attribute [rw] entries + # @return [::Array<::Google::Cloud::Speech::V2::TranscriptNormalization::Entry>] + # A list of replacement entries. We will perform replacement with one entry + # at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + # => "mountain dog"] will never be applied because we will always process the + # first entry before it. At most 100 entries. + class TranscriptNormalization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single replacement configuration. + # @!attribute [rw] search + # @return [::String] + # What to replace. Max length is 100 characters. + # @!attribute [rw] replace + # @return [::String] + # What to replace with. Max length is 100 characters. + # @!attribute [rw] case_sensitive + # @return [::Boolean] + # Whether the search is case sensitive. + class Entry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Translation configuration. Use to translate the given audio into text for the + # desired language. + # @!attribute [rw] target_language + # @return [::String] + # Required. The language code to translate to. + class TranslationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides "hints" to the speech recognizer to favor specific words and phrases + # in the results. PhraseSets can be specified as an inline resource, or a + # reference to an existing PhraseSet resource. + # @!attribute [rw] phrase_sets + # @return [::Array<::Google::Cloud::Speech::V2::SpeechAdaptation::AdaptationPhraseSet>] + # A list of inline or referenced PhraseSets. + # @!attribute [rw] custom_classes + # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>] + # A list of inline CustomClasses. Existing CustomClass resources can be + # referenced directly in a PhraseSet. + class SpeechAdaptation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A biasing PhraseSet, which can be either a string referencing the name of + # an existing PhraseSets resource, or an inline definition of a PhraseSet. + # @!attribute [rw] phrase_set + # @return [::String] + # The name of an existing PhraseSet resource. The user must have read + # access to the resource and it must not be deleted. + # + # Note: The following fields are mutually exclusive: `phrase_set`, `inline_phrase_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] inline_phrase_set + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # An inline defined PhraseSet. + # + # Note: The following fields are mutually exclusive: `inline_phrase_set`, `phrase_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AdaptationPhraseSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Denoiser config. May not be supported for all models and may + # have no effect. + # @!attribute [rw] denoise_audio + # @return [::Boolean] + # Denoise audio before sending to the transcription model. + # @!attribute [rw] snr_threshold + # @return [::Float] + # Signal-to-Noise Ratio (SNR) threshold for the denoiser. Here SNR means the + # loudness of the speech signal. Audio with an SNR below this threshold, + # meaning the speech is too quiet, will be prevented from being sent to the + # transcription model. + # + # If snr_threshold=0, no filtering will be applied. + class DenoiserConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides information to the Recognizer that specifies how to process the + # recognition request. + # @!attribute [rw] auto_decoding_config + # @return [::Google::Cloud::Speech::V2::AutoDetectDecodingConfig] + # Automatically detect decoding parameters. + # Preferred for supported formats. + # + # Note: The following fields are mutually exclusive: `auto_decoding_config`, `explicit_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] explicit_decoding_config + # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig] + # Explicitly specified decoding parameters. + # Required if using headerless PCM audio (linear16, mulaw, alaw). + # + # Note: The following fields are mutually exclusive: `explicit_decoding_config`, `auto_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] model + # @return [::String] + # Optional. Which model to use for recognition requests. Select the model + # best suited to your domain to get best results. + # + # Guidance for choosing which model to use can be found in the [Transcription + # Models + # Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) + # and the models supported in each region can be found in the [Table Of + # Supported + # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # Optional. The language of the supplied audio as a + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # Language tags are normalized to BCP-47 before they are used eg "en-us" + # becomes "en-US". + # + # Supported languages for each model are listed in the [Table of Supported + # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). + # + # If additional languages are provided, recognition result will contain + # recognition in the most likely language detected. The recognition result + # will include the language tag of the language detected in the audio. + # @!attribute [rw] features + # @return [::Google::Cloud::Speech::V2::RecognitionFeatures] + # Speech recognition features to enable. + # @!attribute [rw] adaptation + # @return [::Google::Cloud::Speech::V2::SpeechAdaptation] + # Speech adaptation context that weights recognizer predictions for specific + # words and phrases. + # @!attribute [rw] transcript_normalization + # @return [::Google::Cloud::Speech::V2::TranscriptNormalization] + # Optional. Use transcription normalization to automatically replace parts of + # the transcript with phrases of your choosing. For StreamingRecognize, this + # normalization only applies to stable partial transcripts (stability > 0.8) + # and final transcripts. + # @!attribute [rw] translation_config + # @return [::Google::Cloud::Speech::V2::TranslationConfig] + # Optional. Optional configuration used to automatically run translation on + # the given audio to the desired language for supported models. + # @!attribute [rw] denoiser_config + # @return [::Google::Cloud::Speech::V2::DenoiserConfig] + # Optional. Optional denoiser config. May not be supported for all models + # and may have no effect. + class RecognitionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method. Either + # `content` or `uri` must be supplied. Supplying both or neither returns + # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See [content + # limits](https://cloud.google.com/speech-to-text/quotas#content). + # @!attribute [rw] recognizer + # @return [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field + # can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @!attribute [rw] config_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the + # values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @!attribute [rw] content + # @return [::String] + # The audio data bytes encoded as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As + # with all bytes fields, proto buffers use a pure binary representation, + # whereas JSON representations use base64. + # + # Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uri + # @return [::String] + # URI that points to a file that contains audio data bytes as specified in + # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file + # must not be compressed (for example, gzip). Currently, only Google Cloud + # Storage URIs are supported, which must be specified in the following + # format: `gs://bucket_name/object_name` (other URI formats return + # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more + # information, see [Request + # URIs](https://cloud.google.com/storage/docs/reference-uris). + # + # Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class RecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about the recognition request and response. + # @!attribute [rw] request_id + # @return [::String] + # Global request identifier auto-generated by the API. + # @!attribute [rw] total_billed_duration + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the corresponding request. + # @!attribute [r] prompt + # @return [::String] + # Optional. Output only. Provides the prompt used for the recognition + # request. + class RecognitionResponseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Alternative hypotheses (a.k.a. n-best list). + # @!attribute [rw] transcript + # @return [::String] + # Transcript text representing the words that the user spoke. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence estimate between 0.0 and 1.0. A higher number + # indicates an estimated greater likelihood that the recognized words are + # correct. This field is set only for the top alternative of a non-streaming + # result or, of a streaming result where + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is + # set to `true`. This field is not guaranteed to be accurate and users should + # not rely on it to be always provided. The default of 0.0 is a sentinel + # value indicating `confidence` was not set. + # @!attribute [rw] words + # @return [::Array<::Google::Cloud::Speech::V2::WordInfo>] + # A list of word-specific information for each recognized word. + # When the + # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig} + # is set, you will see all the words from the beginning of the audio. + class SpeechRecognitionAlternative + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Word-specific information for recognized words. + # @!attribute [rw] start_offset + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio, + # and corresponding to the start of the spoken word. + # This field is only set if + # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets} + # is `true` and only in the top hypothesis. This is an experimental feature + # and the accuracy of the time offset can vary. + # @!attribute [rw] end_offset + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio, + # and corresponding to the end of the spoken word. + # This field is only set if + # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets} + # is `true` and only in the top hypothesis. This is an experimental feature + # and the accuracy of the time offset can vary. + # @!attribute [rw] word + # @return [::String] + # The word corresponding to this set of information. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence estimate between 0.0 and 1.0. A higher number + # indicates an estimated greater likelihood that the recognized words are + # correct. This field is set only for the top alternative of a non-streaming + # result or, of a streaming result where + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is + # set to `true`. This field is not guaranteed to be accurate and users should + # not rely on it to be always provided. The default of 0.0 is a sentinel + # value indicating `confidence` was not set. + # @!attribute [rw] speaker_label + # @return [::String] + # A distinct label is assigned for every speaker within the audio. This field + # specifies which one of those speakers was detected to have spoken this + # word. `speaker_label` is set if + # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig} + # is given and only in the top alternative. + class WordInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A speech recognition result corresponding to a portion of the audio. + # @!attribute [rw] alternatives + # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>] + # May contain one or more recognition hypotheses. These alternatives are + # ordered in terms of accuracy, with the top (first) alternative being the + # most probable, as ranked by the recognizer. + # @!attribute [rw] channel_tag + # @return [::Integer] + # For multi-channel audio, this is the channel number corresponding to the + # recognized result for the audio from that channel. + # For `audio_channel_count` = `N`, its output values can range from `1` to + # `N`. + # @!attribute [rw] result_end_offset + # @return [::Google::Protobuf::Duration] + # Time offset of the end of this result relative to the beginning of the + # audio. + # @!attribute [r] language_code + # @return [::String] + # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag of the language in this result. This language code was + # detected to have the most likelihood of being spoken in the audio. + class SpeechRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>] + # Sequential list of transcription results corresponding to sequential + # portions of audio. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] + # Metadata about the recognition. + class RecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Available recognition features specific to streaming recognition requests. + # @!attribute [rw] enable_voice_activity_events + # @return [::Boolean] + # If `true`, responses with voice activity speech events will be returned as + # they are detected. + # @!attribute [rw] interim_results + # @return [::Boolean] + # Whether or not to stream interim results to the client. If set to true, + # interim results will be streamed to the client. Otherwise, only the final + # response will be streamed back. + # @!attribute [rw] voice_activity_timeout + # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::VoiceActivityTimeout] + # If set, the server will automatically close the stream after the specified + # duration has elapsed after the last VOICE_ACTIVITY speech event has been + # sent. The field `voice_activity_events` must also be set to true. + # @!attribute [rw] endpointing_sensitivity + # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::EndpointingSensitivity] + # Optional. Endpointing sensitivity for this stream. + class StreamingRecognitionFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Events that a timeout can be set on for voice activity. + # @!attribute [rw] speech_start_timeout + # @return [::Google::Protobuf::Duration] + # Duration to timeout the stream if no speech begins. If this is set and + # no speech is detected in this duration at the start of the stream, the + # server will close the stream. + # @!attribute [rw] speech_end_timeout + # @return [::Google::Protobuf::Duration] + # Duration to timeout the stream after speech ends. If this is set and no + # speech is detected in this duration after speech was detected, the server + # will close the stream. + class VoiceActivityTimeout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Endpointing sensitivity is intended for applications that want to minimize + # result latency, possibly at the expense of quality. Some utterances may be + # broken up into multiple fragments. + module EndpointingSensitivity + # If no value is specified, the values for + # ENDPOINTING_SENSITIVITY_STANDARD will be used. + ENDPOINTING_SENSITIVITY_UNSPECIFIED = 0 + + # Standard sensitivity, no optimization for latency. + ENDPOINTING_SENSITIVITY_STANDARD = 1 + + # Super short sensitivity, optimized for super short utterances like single + # words ("Yes", "No", "Hello", etc.) or a single phrase, command or short + # query (e.g. "check balance", "five dollars", "call Mom"). + ENDPOINTING_SENSITIVITY_SUPERSHORT = 2 + + # Short sensitivity, optimized for short utterances like single sentences. + # (e.g. "Remind me to call the dentist tomorrow morning at nine", + # "Navigate to the nearest coffee shop that is currently open") + ENDPOINTING_SENSITIVITY_SHORT = 3 + end + end + + # Provides configuration information for the StreamingRecognize request. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Required. Features and audio metadata to use for the Automatic Speech + # Recognition. This field in combination with the + # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @!attribute [rw] config_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields in + # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} that + # override the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} override + # the values in the Recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # Recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} + # completely overrides and replaces the config in the recognizer for this + # recognition request. + # @!attribute [rw] streaming_features + # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures] + # Speech recognition features to enable specific to streaming audio + # recognition requests. + class StreamingRecognitionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#streaming_recognize StreamingRecognize} + # method. Multiple + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest StreamingRecognizeRequest} + # messages are sent in one call. + # + # If the {::Google::Cloud::Speech::V2::Recognizer Recognizer} referenced by + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer recognizer} + # contains a fully specified request configuration then the stream may only + # contain messages with only + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio} set. + # + # Otherwise the first message must contain a + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer recognizer} and + # a + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#streaming_config streaming_config} + # message that together fully specify the request configuration and must not + # contain {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio}. All + # subsequent messages must only have + # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio} set. + # @!attribute [rw] recognizer + # @return [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @!attribute [rw] streaming_config + # @return [::Google::Cloud::Speech::V2::StreamingRecognitionConfig] + # StreamingRecognitionConfig to be used in this recognition attempt. + # If provided, it will override the default RecognitionConfig stored in the + # Recognizer. + # + # Note: The following fields are mutually exclusive: `streaming_config`, `audio`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] audio + # @return [::String] + # Inline audio bytes to be Recognized. + # Maximum size for this field is 15 KB per request. + # + # Note: The following fields are mutually exclusive: `audio`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class StreamingRecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} + # method. + # @!attribute [rw] recognizer + # @return [::String] + # Required. The name of the Recognizer to use during recognition. The + # expected format is + # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The + # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource. + # @!attribute [rw] config_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override + # the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all given fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the + # values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely + # overrides and replaces the config in the recognizer for this recognition + # request. + # @!attribute [rw] files + # @return [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata>] + # Audio files with file metadata for ASR. + # The maximum number of files allowed to be specified is 15. + # @!attribute [rw] recognition_output_config + # @return [::Google::Cloud::Speech::V2::RecognitionOutputConfig] + # Configuration options for where to output the transcripts of each file. + # @!attribute [rw] processing_strategy + # @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] + # Processing strategy to use for this request. + class BatchRecognizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible processing strategies for batch requests. + module ProcessingStrategy + # Default value for the processing strategy. The request is processed as + # soon as its received. + PROCESSING_STRATEGY_UNSPECIFIED = 0 + + # If selected, processes the request during lower utilization periods for a + # price discount. The request is fulfilled within 24 hours. + DYNAMIC_BATCHING = 1 + end + end + + # Output configurations for Cloud Storage. + # @!attribute [rw] uri + # @return [::String] + # The Cloud Storage URI prefix with which recognition results will be + # written. + class GcsOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configurations for inline response. + class InlineOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configurations for serialized `BatchRecognizeResults` protos. + class NativeOutputFileFormatConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configurations for [WebVTT](https://www.w3.org/TR/webvtt1/) formatted + # subtitle file. + class VttOutputFileFormatConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configurations [SubRip + # Text](https://www.matroska.org/technical/subtitles.html#srt-subtitles) + # formatted subtitle file. + class SrtOutputFileFormatConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for the format of the results stored to `output`. + # @!attribute [rw] native + # @return [::Google::Cloud::Speech::V2::NativeOutputFileFormatConfig] + # Configuration for the native output format. If this field is set or if no + # other output format field is set, then transcripts will be written to the + # sink in the native format. + # @!attribute [rw] vtt + # @return [::Google::Cloud::Speech::V2::VttOutputFileFormatConfig] + # Configuration for the VTT output format. If this field is set, then + # transcripts will be written to the sink in the VTT format. + # @!attribute [rw] srt + # @return [::Google::Cloud::Speech::V2::SrtOutputFileFormatConfig] + # Configuration for the SRT output format. If this field is set, then + # transcripts will be written to the sink in the SRT format. + class OutputFormatConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration options for the output(s) of recognition. + # @!attribute [rw] gcs_output_config + # @return [::Google::Cloud::Speech::V2::GcsOutputConfig] + # If this message is populated, recognition results are written to the + # provided Google Cloud Storage URI. + # + # Note: The following fields are mutually exclusive: `gcs_output_config`, `inline_response_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] inline_response_config + # @return [::Google::Cloud::Speech::V2::InlineOutputConfig] + # If this message is populated, recognition results are provided in the + # {::Google::Cloud::Speech::V2::BatchRecognizeResponse BatchRecognizeResponse} + # message of the Operation when completed. This is only supported when + # calling {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} + # with just one audio file. + # + # Note: The following fields are mutually exclusive: `inline_response_config`, `gcs_output_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] output_format_config + # @return [::Google::Cloud::Speech::V2::OutputFormatConfig] + # Optional. Configuration for the format of the results stored to `output`. + # If unspecified transcripts will be written in the `NATIVE` format only. + class RecognitionOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} that is + # packaged into a longrunning {::Google::Longrunning::Operation Operation}. + # @!attribute [rw] results + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeFileResult}] + # Map from filename to the final result for that file. + # @!attribute [rw] total_billed_duration + # @return [::Google::Protobuf::Duration] + # When available, billed audio seconds for the corresponding request. + class BatchRecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Speech::V2::BatchRecognizeFileResult] + class ResultsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Output type for Cloud Storage of BatchRecognize transcripts. Though this + # proto isn't returned in this API anywhere, the Cloud Storage transcripts will + # be this proto serialized and should be parsed as such. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>] + # Sequential list of transcription results corresponding to sequential + # portions of audio. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] + # Metadata about the recognition. + class BatchRecognizeResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Final results written to Cloud Storage. + # @!attribute [rw] uri + # @return [::String] + # The Cloud Storage URI to which recognition results were written. + # @!attribute [rw] vtt_format_uri + # @return [::String] + # The Cloud Storage URI to which recognition results were written as VTT + # formatted captions. This is populated only when `VTT` output is requested. + # @!attribute [rw] srt_format_uri + # @return [::String] + # The Cloud Storage URI to which recognition results were written as SRT + # formatted captions. This is populated only when `SRT` output is requested. + class CloudStorageResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Final results returned inline in the recognition response. + # @!attribute [rw] transcript + # @return [::Google::Cloud::Speech::V2::BatchRecognizeResults] + # The transcript for the audio file. + # @!attribute [rw] vtt_captions + # @return [::String] + # The transcript for the audio file as VTT formatted captions. This is + # populated only when `VTT` output is requested. + # @!attribute [rw] srt_captions + # @return [::String] + # The transcript for the audio file as SRT formatted captions. This is + # populated only when `SRT` output is requested. + class InlineResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Final results for a single file. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Error if one was encountered. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] + # @!attribute [rw] cloud_storage_result + # @return [::Google::Cloud::Speech::V2::CloudStorageResult] + # Recognition results written to Cloud Storage. This is + # populated only when + # {::Google::Cloud::Speech::V2::GcsOutputConfig GcsOutputConfig} is set in + # the + # [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. + # + # Note: The following fields are mutually exclusive: `cloud_storage_result`, `inline_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] inline_result + # @return [::Google::Cloud::Speech::V2::InlineResult] + # Recognition results. This is populated only when + # {::Google::Cloud::Speech::V2::InlineOutputConfig InlineOutputConfig} is set in + # the + # [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. + # + # Note: The following fields are mutually exclusive: `inline_result`, `cloud_storage_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Deprecated. Use `cloud_storage_result.native_format_uri` instead. + # @!attribute [rw] transcript + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Speech::V2::BatchRecognizeResults] + # Deprecated. Use `inline_result.transcript` instead. + class BatchRecognizeFileResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about transcription for a single file (for example, progress + # percent). + # @!attribute [rw] progress_percent + # @return [::Integer] + # How much of the file has been transcribed so far. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Error if one was encountered. + # @!attribute [rw] uri + # @return [::String] + # The Cloud Storage URI to which recognition results will be written. + class BatchRecognizeTranscriptionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Operation metadata for + # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize}. + # @!attribute [rw] transcription_metadata + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata}] + # Map from provided filename to the transcription metadata for that file. + class BatchRecognizeMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata] + class TranscriptionMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata about a single file in a batch for BatchRecognize. + # @!attribute [rw] uri + # @return [::String] + # Cloud Storage URI for the audio file. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::RecognitionConfig] + # Features and audio metadata to use for the Automatic Speech Recognition. + # This field in combination with the + # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config_mask config_mask} + # field can be used to override parts of the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the Recognizer resource as well as the + # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} at the + # request level. + # @!attribute [rw] config_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} that + # override the values in the + # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} + # of the recognizer during this recognition request. If no mask is provided, + # all non-default valued fields in + # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} override + # the values in the recognizer for this recognition request. If a mask is + # provided, only the fields listed in the mask override the config in the + # recognizer for this recognition request. If a wildcard (`*`) is provided, + # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} + # completely overrides and replaces the config in the recognizer for this + # recognition request. + class BatchRecognizeFileMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A streaming speech recognition result corresponding to a portion of the audio + # that is currently being processed. + # @!attribute [rw] alternatives + # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>] + # May contain one or more recognition hypotheses. These alternatives are + # ordered in terms of accuracy, with the top (first) alternative being the + # most probable, as ranked by the recognizer. + # @!attribute [rw] is_final + # @return [::Boolean] + # If `false`, this + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult} + # represents an interim result that may change. If `true`, this is the final + # time the speech service will return this particular + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult}, + # the recognizer will not return any further hypotheses for this portion of + # the transcript and corresponding audio. + # @!attribute [rw] stability + # @return [::Float] + # An estimate of the likelihood that the recognizer will not change its guess + # about this interim result. Values range from 0.0 (completely unstable) + # to 1.0 (completely stable). This field is only provided for interim results + # ({::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false`). + # The default of 0.0 is a sentinel value indicating `stability` was not set. + # @!attribute [rw] result_end_offset + # @return [::Google::Protobuf::Duration] + # Time offset of the end of this result relative to the beginning of the + # audio. + # @!attribute [rw] channel_tag + # @return [::Integer] + # For multi-channel audio, this is the channel number corresponding to the + # recognized result for the audio from that channel. + # For + # `audio_channel_count` = `N`, its output values can range from `1` to `N`. + # @!attribute [r] language_code + # @return [::String] + # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag of the language in this result. This language code was + # detected to have the most likelihood of being spoken in the audio. + class StreamingRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `StreamingRecognizeResponse` is the only message returned to the client by + # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` + # messages are streamed back to the client. If there is no recognizable + # audio then no messages are streamed back to the client. + # + # Here are some examples of `StreamingRecognizeResponse`s that might + # be returned while processing audio: + # + # 1. results { alternatives { transcript: "tube" } stability: 0.01 } + # + # 2. results { alternatives { transcript: "to be a" } stability: 0.01 } + # + # 3. results { alternatives { transcript: "to be" } stability: 0.9 } + # results { alternatives { transcript: " or not to be" } stability: 0.01 } + # + # 4. results { alternatives { transcript: "to be or not to be" + # confidence: 0.92 } + # alternatives { transcript: "to bee or not to bee" } + # is_final: true } + # + # 5. results { alternatives { transcript: " that's" } stability: 0.01 } + # + # 6. results { alternatives { transcript: " that is" } stability: 0.9 } + # results { alternatives { transcript: " the question" } stability: 0.01 } + # + # 7. results { alternatives { transcript: " that is the question" + # confidence: 0.98 } + # alternatives { transcript: " that was the question" } + # is_final: true } + # + # Notes: + # + # - Only two of the above responses #4 and #7 contain final results; they are + # indicated by `is_final: true`. Concatenating these together generates the + # full transcript: "to be or not to be that is the question". + # + # - The others contain interim `results`. #3 and #6 contain two interim + # `results`: the first portion has a high stability and is less likely to + # change; the second portion has a low stability and is very likely to + # change. A UI designer might choose to show only high stability `results`. + # + # - The specific `stability` and `confidence` values shown above are only for + # illustrative purposes. Actual values may vary. + # + # - In each response, only one of these fields will be set: + # `error`, + # `speech_event_type`, or + # one or more (repeated) `results`. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Speech::V2::StreamingRecognitionResult>] + # This repeated list contains zero or more results that + # correspond to consecutive portions of the audio currently being processed. + # It contains zero or one + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`true` + # result (the newly settled portion), followed by zero or more + # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false` + # results (the interim results). + # @!attribute [rw] speech_event_type + # @return [::Google::Cloud::Speech::V2::StreamingRecognizeResponse::SpeechEventType] + # Indicates the type of speech event. + # @!attribute [rw] speech_event_offset + # @return [::Google::Protobuf::Duration] + # Time offset between the beginning of the audio and event emission. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] + # Metadata about the recognition. + class StreamingRecognizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates the type of speech event. + module SpeechEventType + # No speech event specified. + SPEECH_EVENT_TYPE_UNSPECIFIED = 0 + + # This event indicates that the server has detected the end of the user's + # speech utterance and expects no additional speech. Therefore, the server + # will not process additional audio and will close the gRPC bidirectional + # stream. This event is only sent if there was a force cutoff due to + # silence being detected early. This event is only available through the + # `latest_short` {::Google::Cloud::Speech::V2::Recognizer#model model}. + END_OF_SINGLE_UTTERANCE = 1 + + # This event indicates that the server has detected the beginning of human + # voice activity in the stream. This event can be returned multiple times + # if speech starts and stops repeatedly throughout the stream. This event + # is only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_BEGIN = 2 + + # This event indicates that the server has detected the end of human voice + # activity in the stream. This event can be returned multiple times if + # speech starts and stops repeatedly throughout the stream. This event is + # only sent if `voice_activity_events` is set to true. + SPEECH_ACTIVITY_END = 3 + end + end + + # Message representing the config for the Speech-to-Text API. This includes an + # optional [KMS key](https://cloud.google.com/kms/docs/resource-hierarchy#keys) + # with which incoming data will be encrypted. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The name of the config resource. There is exactly + # one config resource per project per location. The expected format is + # `projects/{project}/locations/{location}/config`. + # @!attribute [rw] kms_key_name + # @return [::String] + # Optional. An optional [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if + # present, will be used to encrypt Speech-to-Text resources at-rest. Updating + # this key will not encrypt existing resources using this key; only new + # resources will be encrypted using this key. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this resource was modified. + class Config + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#get_config GetConfig} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the config to retrieve. There is exactly one config + # resource per project per location. The expected format is + # `projects/{project}/locations/{location}/config`. + class GetConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#update_config UpdateConfig} method. + # @!attribute [rw] config + # @return [::Google::Cloud::Speech::V2::Config] + # Required. The config to update. + # + # The config's `name` field is used to identify the config to be updated. + # The expected format is `projects/{project}/locations/{location}/config`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CustomClass for biasing in speech recognition. Used to define a set of words + # or phrases that represents a common concept or theme likely to appear in your + # audio, for example a list of passenger ship names. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the CustomClass. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @!attribute [r] uid + # @return [::String] + # Output only. System-assigned unique identifier for the CustomClass. + # @!attribute [rw] display_name + # @return [::String] + # Optional. User-settable, human-readable name for the CustomClass. Must be + # 63 characters or less. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::Speech::V2::CustomClass::ClassItem>] + # A collection of class items. + # @!attribute [r] state + # @return [::Google::Cloud::Speech::V2::CustomClass::State] + # Output only. The CustomClass lifecycle state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this resource was modified. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource was requested for deletion. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource will be purged. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Allows users to store small amounts of arbitrary data. + # Both the key and the value must be 63 characters or less each. + # At most 100 annotations. + # @!attribute [r] etag + # @return [::String] + # Output only. This checksum is computed by the server based on the value of + # other fields. This may be sent on update, undelete, and delete requests to + # ensure the client has an up-to-date value before proceeding. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Whether or not this CustomClass is in the process of being + # updated. + # @!attribute [r] kms_key_name + # @return [::String] + # Output only. The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the CustomClass is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] kms_key_version_name + # @return [::String] + # Output only. The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which the CustomClass is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + class CustomClass + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An item of the class. + # @!attribute [rw] value + # @return [::String] + # The class item's value. + class ClassItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of states that define the lifecycle of a CustomClass. + module State + # Unspecified state. This is only used/useful for distinguishing + # unset values. + STATE_UNSPECIFIED = 0 + + # The normal and active state. + ACTIVE = 2 + + # This CustomClass has been deleted. + DELETED = 4 + end + end + + # PhraseSet for biasing in speech recognition. A PhraseSet is used to provide + # "hints" to the speech recognizer to favor specific words and phrases in the + # results. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the PhraseSet. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @!attribute [r] uid + # @return [::String] + # Output only. System-assigned unique identifier for the PhraseSet. + # @!attribute [rw] phrases + # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet::Phrase>] + # A list of word and phrases. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Positive value will increase the probability that a specific + # phrase will be recognized over other similar sounding phrases. The higher + # the boost, the higher the chance of false positive recognition as well. + # Valid `boost` values are between 0 (exclusive) and 20. We recommend using a + # binary search approach to finding the optimal value for your use case as + # well as adding phrases both with and without boost to your requests. + # @!attribute [rw] display_name + # @return [::String] + # User-settable, human-readable name for the PhraseSet. Must be 63 + # characters or less. + # @!attribute [r] state + # @return [::Google::Cloud::Speech::V2::PhraseSet::State] + # Output only. The PhraseSet lifecycle state. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time this resource was modified. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource was requested for deletion. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this resource will be purged. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Allows users to store small amounts of arbitrary data. + # Both the key and the value must be 63 characters or less each. + # At most 100 annotations. + # @!attribute [r] etag + # @return [::String] + # Output only. This checksum is computed by the server based on the value of + # other fields. This may be sent on update, undelete, and delete requests to + # ensure the client has an up-to-date value before proceeding. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Whether or not this PhraseSet is in the process of being + # updated. + # @!attribute [r] kms_key_name + # @return [::String] + # Output only. The [KMS key + # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which + # the PhraseSet is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + # @!attribute [r] kms_key_version_name + # @return [::String] + # Output only. The [KMS key version + # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) + # with which the PhraseSet is encrypted. The expected format is + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. + class PhraseSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A Phrase contains words and phrase "hints" so that the speech recognition + # is more likely to recognize them. This can be used to improve the accuracy + # for specific words and phrases, for example, if specific commands are + # typically spoken by the user. This can also be used to add additional words + # to the vocabulary of the recognizer. + # + # List items can also include CustomClass references containing groups of + # words that represent common concepts that occur in natural language. + # @!attribute [rw] value + # @return [::String] + # The phrase itself. + # @!attribute [rw] boost + # @return [::Float] + # Hint Boost. Overrides the boost set at the phrase set level. + # Positive value will increase the probability that a specific phrase will + # be recognized over other similar sounding phrases. The higher the boost, + # the higher the chance of false positive recognition as well. Negative + # boost values would correspond to anti-biasing. Anti-biasing is not + # enabled, so negative boost values will return an error. Boost values must + # be between 0 and 20. Any values outside that range will return an error. + # We recommend using a binary search approach to finding the optimal value + # for your use case as well as adding phrases both with and without boost + # to your requests. + class Phrase + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of states that define the lifecycle of a PhraseSet. + module State + # Unspecified state. This is only used/useful for distinguishing + # unset values. + STATE_UNSPECIFIED = 0 + + # The normal and active state. + ACTIVE = 2 + + # This PhraseSet has been deleted. + DELETED = 4 + end + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#create_custom_class CreateCustomClass} method. + # @!attribute [rw] custom_class + # @return [::Google::Cloud::Speech::V2::CustomClass] + # Required. The CustomClass to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the CustomClass, but do not + # actually create it. + # @!attribute [rw] custom_class_id + # @return [::String] + # The ID to use for the CustomClass, which will become the final component of + # the CustomClass's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location where this CustomClass will be created. + # The expected format is `projects/{project}/locations/{location}`. + class CreateCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location of CustomClass resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Number of results per requests. A valid page_size ranges from 0 to 100 + # inclusive. If the page_size is zero or unspecified, a page size of 5 will + # be chosen. If the page size exceeds 100, it will be coerced down to 100. + # Note that a call might return fewer results than the requested page size. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} must + # match the call that provided the page token. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Whether, or not, to show resources that have been deleted. + class ListCustomClassesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method. + # @!attribute [rw] custom_classes + # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>] + # The list of requested CustomClasses. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::Speech::V2::ListCustomClassesRequest#page_token page_token} to + # retrieve the next page. If this field is omitted, there are no subsequent + # pages. This token expires after 72 hours. + class ListCustomClassesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#get_custom_class GetCustomClass} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CustomClass to retrieve. The expected format is + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + class GetCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#update_custom_class UpdateCustomClass} method. + # @!attribute [rw] custom_class + # @return [::Google::Cloud::Speech::V2::CustomClass] + # Required. The CustomClass to update. + # + # The CustomClass's `name` field is used to identify the CustomClass to + # update. Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. If empty, all fields are considered for + # update. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the updated CustomClass, but do + # not actually update it. + class UpdateCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#delete_custom_class DeleteCustomClass} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CustomClass to delete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the deleted CustomClass, but do + # not actually delete it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the CustomClass is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class DeleteCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class UndeleteCustomClass} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CustomClass to undelete. + # Format: + # `projects/{project}/locations/{location}/customClasses/{custom_class}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the undeleted CustomClass, but do + # not actually undelete it. + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class UndeleteCustomClassRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#create_phrase_set CreatePhraseSet} method. + # @!attribute [rw] phrase_set + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # Required. The PhraseSet to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the PhraseSet, but do not + # actually create it. + # @!attribute [rw] phrase_set_id + # @return [::String] + # The ID to use for the PhraseSet, which will become the final component of + # the PhraseSet's resource name. + # + # This value should be 4-63 characters, and valid characters + # are /[a-z][0-9]-/. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location where this PhraseSet will be created. + # The expected format is `projects/{project}/locations/{location}`. + class CreatePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location of PhraseSet resources to list. The + # expected format is `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of PhraseSets to return. The service may return fewer + # than this value. If unspecified, at most 5 PhraseSets will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} must match + # the call that provided the page token. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Whether, or not, to show resources that have been deleted. + class ListPhraseSetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the + # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method. + # @!attribute [rw] phrase_sets + # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet>] + # The list of requested PhraseSets. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest#page_token page_token} to + # retrieve the next page. If this field is omitted, there are no subsequent + # pages. This token expires after 72 hours. + class ListPhraseSetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#get_phrase_set GetPhraseSet} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PhraseSet to retrieve. The expected format is + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + class GetPhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#update_phrase_set UpdatePhraseSet} method. + # @!attribute [rw] phrase_set + # @return [::Google::Cloud::Speech::V2::PhraseSet] + # Required. The PhraseSet to update. + # + # The PhraseSet's `name` field is used to identify the PhraseSet to update. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to update. If empty, all non-default valued fields are + # considered for update. Use `*` to update the entire PhraseSet resource. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the updated PhraseSet, but do not + # actually update it. + class UpdatePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set DeletePhraseSet} method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PhraseSet to delete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the deleted PhraseSet, but do not + # actually delete it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the PhraseSet is not found, the request will succeed + # and be a no-op (no Operation is recorded in this case). + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class DeletePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the + # {::Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set UndeletePhraseSet} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the PhraseSet to undelete. + # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the undeleted PhraseSet, but do + # not actually undelete it. + # @!attribute [rw] etag + # @return [::String] + # This checksum is computed by the server based on the value of other + # fields. This may be sent on update, undelete, and delete requests to ensure + # the client has an up-to-date value before proceeding. + class UndeletePhraseSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb new file mode 100644 index 000000000000..84cc8a10dfcd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Speech + module V2 + # Represents a singular feature of a model. If the feature is `recognizer`, + # the release_state of the feature represents the release_state of the model + # @!attribute [rw] feature + # @return [::String] + # The name of the feature (Note: the feature can be `recognizer`) + # @!attribute [rw] release_state + # @return [::String] + # The release state of the feature + class ModelFeature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the collection of features belonging to a model + # @!attribute [rw] model_feature + # @return [::Array<::Google::Cloud::Speech::V2::ModelFeature>] + # Repeated field that contains all features of the model + class ModelFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metadata about the models in a given region for a specific locale. + # Currently this is just the features of the model + # @!attribute [rw] model_features + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::ModelFeatures}] + # Map of the model name -> features of that model + class ModelMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Speech::V2::ModelFeatures] + class ModelFeaturesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The metadata about locales available in a given region. Currently this is + # just the models that are available for each locale + # @!attribute [rw] models + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::ModelMetadata}] + # Map of locale (language code) -> models + class LanguageMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Speech::V2::ModelMetadata] + class ModelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The access metadata for a particular region. This can be applied if the org + # policy for the given project disallows a particular region. + # @!attribute [rw] constraint_type + # @return [::Google::Cloud::Speech::V2::AccessMetadata::ConstraintType] + # Describes the different types of constraints that are applied. + class AccessMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the different types of constraints that can be applied on a + # region. + module ConstraintType + # Unspecified constraint applied. + CONSTRAINT_TYPE_UNSPECIFIED = 0 + + # The project's org policy disallows the given region. + RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT = 1 + end + end + + # Main metadata for the Locations API for STT V2. Currently this is just the + # metadata about locales, models, and features + # @!attribute [rw] languages + # @return [::Google::Cloud::Speech::V2::LanguageMetadata] + # Information about available locales, models, and features represented in + # the hierarchical structure of locales -> models -> features + # @!attribute [rw] access_metadata + # @return [::Google::Cloud::Speech::V2::AccessMetadata] + # Information about access metadata for the region and given project. + class LocationsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile new file mode 100644 index 000000000000..9099ccea67fd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-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-speech-v2", path: "../" +else + gem "google-cloud-speech-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-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json b/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json new file mode 100644 index 000000000000..5c30e3c81908 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json @@ -0,0 +1,935 @@ +{ + "client_library": { + "name": "google-cloud-speech-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.speech.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "speech_v2_generated_Speech_CreateRecognizer_sync", + "title": "Snippet for the create_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_recognizer.", + "file": "speech/create_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::CreateRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "CreateRecognizer", + "full_name": "google.cloud.speech.v2.Speech.CreateRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_ListRecognizers_sync", + "title": "Snippet for the list_recognizers call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_recognizers.", + "file": "speech/list_recognizers.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_recognizers", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_recognizers", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::ListRecognizersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::ListRecognizersResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "ListRecognizers", + "full_name": "google.cloud.speech.v2.Speech.ListRecognizers", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_GetRecognizer_sync", + "title": "Snippet for the get_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_recognizer.", + "file": "speech/get_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::GetRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::Recognizer", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "GetRecognizer", + "full_name": "google.cloud.speech.v2.Speech.GetRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UpdateRecognizer_sync", + "title": "Snippet for the update_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_recognizer.", + "file": "speech/update_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UpdateRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UpdateRecognizer", + "full_name": "google.cloud.speech.v2.Speech.UpdateRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_DeleteRecognizer_sync", + "title": "Snippet for the delete_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_recognizer.", + "file": "speech/delete_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::DeleteRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "DeleteRecognizer", + "full_name": "google.cloud.speech.v2.Speech.DeleteRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UndeleteRecognizer_sync", + "title": "Snippet for the undelete_recognizer call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer.", + "file": "speech/undelete_recognizer.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_recognizer", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UndeleteRecognizerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UndeleteRecognizer", + "full_name": "google.cloud.speech.v2.Speech.UndeleteRecognizer", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_Recognize_sync", + "title": "Snippet for the recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#recognize.", + "file": "speech/recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "recognize", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::RecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::RecognizeResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "Recognize", + "full_name": "google.cloud.speech.v2.Speech.Recognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_StreamingRecognize_sync", + "title": "Snippet for the streaming_recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#streaming_recognize.", + "file": "speech/streaming_recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_recognize", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#streaming_recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::StreamingRecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::StreamingRecognizeResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "StreamingRecognize", + "full_name": "google.cloud.speech.v2.Speech.StreamingRecognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_BatchRecognize_sync", + "title": "Snippet for the batch_recognize call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#batch_recognize.", + "file": "speech/batch_recognize.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_recognize", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#batch_recognize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::BatchRecognizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "BatchRecognize", + "full_name": "google.cloud.speech.v2.Speech.BatchRecognize", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_GetConfig_sync", + "title": "Snippet for the get_config call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_config.", + "file": "speech/get_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_config", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::GetConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::Config", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "GetConfig", + "full_name": "google.cloud.speech.v2.Speech.GetConfig", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UpdateConfig_sync", + "title": "Snippet for the update_config call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_config.", + "file": "speech/update_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_config", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UpdateConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::Config", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UpdateConfig", + "full_name": "google.cloud.speech.v2.Speech.UpdateConfig", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_CreateCustomClass_sync", + "title": "Snippet for the create_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_custom_class.", + "file": "speech/create_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::CreateCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "CreateCustomClass", + "full_name": "google.cloud.speech.v2.Speech.CreateCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_ListCustomClasses_sync", + "title": "Snippet for the list_custom_classes call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_custom_classes.", + "file": "speech/list_custom_classes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_custom_classes", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::ListCustomClassesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::ListCustomClassesResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "ListCustomClasses", + "full_name": "google.cloud.speech.v2.Speech.ListCustomClasses", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_GetCustomClass_sync", + "title": "Snippet for the get_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_custom_class.", + "file": "speech/get_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::GetCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::CustomClass", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "GetCustomClass", + "full_name": "google.cloud.speech.v2.Speech.GetCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UpdateCustomClass_sync", + "title": "Snippet for the update_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_custom_class.", + "file": "speech/update_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UpdateCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UpdateCustomClass", + "full_name": "google.cloud.speech.v2.Speech.UpdateCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_DeleteCustomClass_sync", + "title": "Snippet for the delete_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_custom_class.", + "file": "speech/delete_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::DeleteCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "DeleteCustomClass", + "full_name": "google.cloud.speech.v2.Speech.DeleteCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UndeleteCustomClass_sync", + "title": "Snippet for the undelete_custom_class call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class.", + "file": "speech/undelete_custom_class.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_custom_class", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UndeleteCustomClassRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UndeleteCustomClass", + "full_name": "google.cloud.speech.v2.Speech.UndeleteCustomClass", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_CreatePhraseSet_sync", + "title": "Snippet for the create_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_phrase_set.", + "file": "speech/create_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::CreatePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "CreatePhraseSet", + "full_name": "google.cloud.speech.v2.Speech.CreatePhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_ListPhraseSets_sync", + "title": "Snippet for the list_phrase_sets call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets.", + "file": "speech/list_phrase_sets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_phrase_sets", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::ListPhraseSetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::ListPhraseSetsResponse", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "ListPhraseSets", + "full_name": "google.cloud.speech.v2.Speech.ListPhraseSets", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_GetPhraseSet_sync", + "title": "Snippet for the get_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_phrase_set.", + "file": "speech/get_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::GetPhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Speech::V2::PhraseSet", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "GetPhraseSet", + "full_name": "google.cloud.speech.v2.Speech.GetPhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UpdatePhraseSet_sync", + "title": "Snippet for the update_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_phrase_set.", + "file": "speech/update_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UpdatePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UpdatePhraseSet", + "full_name": "google.cloud.speech.v2.Speech.UpdatePhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_DeletePhraseSet_sync", + "title": "Snippet for the delete_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set.", + "file": "speech/delete_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::DeletePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "DeletePhraseSet", + "full_name": "google.cloud.speech.v2.Speech.DeletePhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "speech_v2_generated_Speech_UndeletePhraseSet_sync", + "title": "Snippet for the undelete_phrase_set call in the Speech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set.", + "file": "speech/undelete_phrase_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_phrase_set", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Speech::V2::UndeletePhraseSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Speech::Client", + "full_name": "::Google::Cloud::Speech::V2::Speech::Client" + }, + "method": { + "short_name": "UndeletePhraseSet", + "full_name": "google.cloud.speech.v2.Speech.UndeletePhraseSet", + "service": { + "short_name": "Speech", + "full_name": "google.cloud.speech.v2.Speech" + } + } + }, + "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-speech-v2/snippets/speech/batch_recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb new file mode 100644 index 000000000000..4f957e4b6175 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_BatchRecognize_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the batch_recognize call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#batch_recognize. +# +def batch_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new + + # Call the batch_recognize method. + result = client.batch_recognize request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_BatchRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb new file mode 100644 index 000000000000..b68ec04f2ee7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_CreateCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the create_custom_class call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#create_custom_class. +# +def create_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new + + # Call the create_custom_class method. + result = client.create_custom_class request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_CreateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb new file mode 100644 index 000000000000..eba29d95b333 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_CreatePhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the create_phrase_set call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#create_phrase_set. +# +def create_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new + + # Call the create_phrase_set method. + result = client.create_phrase_set request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_CreatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb new file mode 100644 index 000000000000..75242ecadf32 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_CreateRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the create_recognizer call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#create_recognizer. +# +def create_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new + + # Call the create_recognizer method. + result = client.create_recognizer request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_CreateRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb new file mode 100644 index 000000000000..e8ddd07289dd --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_DeleteCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the delete_custom_class call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#delete_custom_class. +# +def delete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new + + # Call the delete_custom_class method. + result = client.delete_custom_class request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_DeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb new file mode 100644 index 000000000000..ed0f5b5e30c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_DeletePhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the delete_phrase_set call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set. +# +def delete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new + + # Call the delete_phrase_set method. + result = client.delete_phrase_set request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_DeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb new file mode 100644 index 000000000000..0884f27f9d8e --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_DeleteRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the delete_recognizer call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#delete_recognizer. +# +def delete_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new + + # Call the delete_recognizer method. + result = client.delete_recognizer request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_DeleteRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb new file mode 100644 index 000000000000..3fc3f9e7fcd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_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 speech_v2_generated_Speech_GetConfig_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the get_config call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#get_config. +# +def get_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetConfigRequest.new + + # Call the get_config method. + result = client.get_config request + + # The returned object is of type Google::Cloud::Speech::V2::Config. + p result +end +# [END speech_v2_generated_Speech_GetConfig_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb new file mode 100644 index 000000000000..784ffc18c23d --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_GetCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the get_custom_class call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#get_custom_class. +# +def get_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetCustomClassRequest.new + + # Call the get_custom_class method. + result = client.get_custom_class request + + # The returned object is of type Google::Cloud::Speech::V2::CustomClass. + p result +end +# [END speech_v2_generated_Speech_GetCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb new file mode 100644 index 000000000000..9708b47cf3e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_GetPhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the get_phrase_set call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#get_phrase_set. +# +def get_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new + + # Call the get_phrase_set method. + result = client.get_phrase_set request + + # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. + p result +end +# [END speech_v2_generated_Speech_GetPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb new file mode 100644 index 000000000000..3aaa1b269594 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_GetRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the get_recognizer call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#get_recognizer. +# +def get_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetRecognizerRequest.new + + # Call the get_recognizer method. + result = client.get_recognizer request + + # The returned object is of type Google::Cloud::Speech::V2::Recognizer. + p result +end +# [END speech_v2_generated_Speech_GetRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb new file mode 100644 index 000000000000..a9e5534d5b7b --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.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 speech_v2_generated_Speech_ListCustomClasses_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the list_custom_classes call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#list_custom_classes. +# +def list_custom_classes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new + + # Call the list_custom_classes method. + result = client.list_custom_classes request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Speech::V2::CustomClass. + p item + end +end +# [END speech_v2_generated_Speech_ListCustomClasses_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb new file mode 100644 index 000000000000..438c90e974fe --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.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 speech_v2_generated_Speech_ListPhraseSets_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the list_phrase_sets call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets. +# +def list_phrase_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new + + # Call the list_phrase_sets method. + result = client.list_phrase_sets request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet. + p item + end +end +# [END speech_v2_generated_Speech_ListPhraseSets_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb new file mode 100644 index 000000000000..5ca1e1af20ed --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.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 speech_v2_generated_Speech_ListRecognizers_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the list_recognizers call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#list_recognizers. +# +def list_recognizers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::ListRecognizersRequest.new + + # Call the list_recognizers method. + result = client.list_recognizers request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Speech::V2::Recognizer. + p item + end +end +# [END speech_v2_generated_Speech_ListRecognizers_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb new file mode 100644 index 000000000000..194e4add7771 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_Recognize_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the recognize call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#recognize. +# +def recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::RecognizeRequest.new + + # Call the recognize method. + result = client.recognize request + + # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. + p result +end +# [END speech_v2_generated_Speech_Recognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb new file mode 100644 index 000000000000..a09a15c0f87a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.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! + +# [START speech_v2_generated_Speech_StreamingRecognize_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the streaming_recognize call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#streaming_recognize. +# +def streaming_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the streaming_recognize method to start streaming. + output = client.streaming_recognize input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse + output.each do |current_response| + p current_response + end +end +# [END speech_v2_generated_Speech_StreamingRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb new file mode 100644 index 000000000000..c674fe781687 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_UndeleteCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the undelete_custom_class call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class. +# +def undelete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new + + # Call the undelete_custom_class method. + result = client.undelete_custom_class request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_UndeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb new file mode 100644 index 000000000000..13f47439e6f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_UndeletePhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the undelete_phrase_set call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set. +# +def undelete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new + + # Call the undelete_phrase_set method. + result = client.undelete_phrase_set request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_UndeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb new file mode 100644 index 000000000000..9e9efaa6f2f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_UndeleteRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the undelete_recognizer call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer. +# +def undelete_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new + + # Call the undelete_recognizer method. + result = client.undelete_recognizer request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_UndeleteRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb new file mode 100644 index 000000000000..f0e6f043b9b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_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 speech_v2_generated_Speech_UpdateConfig_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the update_config call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#update_config. +# +def update_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdateConfigRequest.new + + # Call the update_config method. + result = client.update_config request + + # The returned object is of type Google::Cloud::Speech::V2::Config. + p result +end +# [END speech_v2_generated_Speech_UpdateConfig_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb new file mode 100644 index 000000000000..41f39d156939 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_UpdateCustomClass_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the update_custom_class call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#update_custom_class. +# +def update_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new + + # Call the update_custom_class method. + result = client.update_custom_class request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_UpdateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb new file mode 100644 index 000000000000..c35958f5d92a --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_UpdatePhraseSet_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the update_phrase_set call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#update_phrase_set. +# +def update_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new + + # Call the update_phrase_set method. + result = client.update_phrase_set request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_UpdatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb new file mode 100644 index 000000000000..6eba5f9d7d62 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START speech_v2_generated_Speech_UpdateRecognizer_sync] +require "google/cloud/speech/v2" + +## +# Snippet for the update_recognizer call in the Speech service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#update_recognizer. +# +def update_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new + + # Call the update_recognizer method. + result = client.update_recognizer request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END speech_v2_generated_Speech_UpdateRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb new file mode 100644 index 000000000000..f6538455ac47 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_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/speech/v2/cloud_speech_pb" +require "google/cloud/speech/v2/cloud_speech_services_pb" +require "google/cloud/speech/v2/speech" + +class ::Google::Cloud::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb new file mode 100644 index 000000000000..d704a59e482c --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_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 "gapic/grpc/service_stub" + +require "google/cloud/speech/v2/speech" + +class ::Google::Cloud::Speech::V2::Speech::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_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::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.config_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/config", 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::Speech::V2::Speech::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::Speech::V2::Speech::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_custom_class_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" + assert_equal "projects/value0/locations/value1/customClasses/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::Speech::V2::Speech::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_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", path + end + end + + def test_recognizer_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.recognizer_path project: "value0", location: "value1", recognizer: "value2" + assert_equal "projects/value0/locations/value1/recognizers/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb new file mode 100644 index 000000000000..30ed3613ce74 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb @@ -0,0 +1,1335 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/speech/v2/cloud_speech_pb" +require "google/cloud/speech/v2/speech/rest" + + +class ::Google::Cloud::Speech::V2::Speech::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_recognizer + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + recognizer = {} + validate_only = true + recognizer_id = "hello world" + parent = "hello world" + + create_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_recognizer recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_recognizer ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_recognizer(::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_recognizer_client_stub.call_count + end + end + end + + def test_list_recognizers + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::ListRecognizersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_recognizers_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_recognizers_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_recognizers_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_recognizers parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_recognizers ::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_recognizers(::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_recognizers_client_stub.call_count + end + end + end + + def test_get_recognizer + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::Recognizer.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_recognizer({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_recognizer name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_recognizer ::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_recognizer({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_recognizer(::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_recognizer_client_stub.call_count + end + end + end + + def test_update_recognizer + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + recognizer = {} + update_mask = {} + validate_only = true + + update_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_recognizer recognizer: recognizer, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_recognizer ::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, 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_recognizer({ recognizer: recognizer, 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_recognizer(::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, 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_recognizer_client_stub.call_count + end + end + end + + def test_delete_recognizer + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_recognizer name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_recognizer ::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_recognizer(::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_recognizer_client_stub.call_count + end + end + end + + def test_undelete_recognizer + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + etag = "hello world" + + undelete_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_recognizer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_recognizer name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_recognizer ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_recognizer(::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_recognizer_client_stub.call_count + end + end + end + + def test_recognize + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::RecognizeResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + recognizer = "hello world" + config = {} + config_mask = {} + content = "hello world" + + recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_recognize_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.recognize recognizer: recognizer, config: config, config_mask: config_mask, content: content do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.recognize ::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.recognize(::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, recognize_client_stub.call_count + end + end + end + + def test_batch_recognize + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + recognizer = "hello world" + config = {} + config_mask = {} + files = [{}] + recognition_output_config = {} + processing_strategy = :PROCESSING_STRATEGY_UNSPECIFIED + + batch_recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_batch_recognize_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_recognize recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_recognize ::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_recognize(::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_recognize_client_stub.call_count + end + end + end + + def test_get_config + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::Config.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_config_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_config ::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_config(::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_config_client_stub.call_count + end + end + end + + def test_update_config + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::Config.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + config = {} + update_mask = {} + + update_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_config_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_config({ config: config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_config config: config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_config ::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_config({ config: config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_config(::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_config_client_stub.call_count + end + end + end + + def test_create_custom_class + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + custom_class = {} + validate_only = true + custom_class_id = "hello world" + parent = "hello world" + + create_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_custom_class custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_custom_class ::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_custom_class(::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_custom_class_client_stub.call_count + end + end + end + + def test_list_custom_classes + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_custom_classes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_custom_classes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_custom_classes_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_custom_classes parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_custom_classes ::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_custom_classes(::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_custom_classes_client_stub.call_count + end + end + end + + def test_get_custom_class + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::CustomClass.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_custom_class({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_custom_class name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_custom_class ::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_custom_class({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_custom_class(::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_custom_class_client_stub.call_count + end + end + end + + def test_update_custom_class + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + custom_class = {} + update_mask = {} + validate_only = true + + update_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_custom_class custom_class: custom_class, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_custom_class ::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class({ custom_class: custom_class, 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_custom_class(::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class_client_stub.call_count + end + end + end + + def test_delete_custom_class + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_custom_class name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_custom_class ::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_custom_class(::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_custom_class_client_stub.call_count + end + end + end + + def test_undelete_custom_class + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + etag = "hello world" + + undelete_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_custom_class_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_custom_class name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_custom_class ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_custom_class(::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_custom_class_client_stub.call_count + end + end + end + + def test_create_phrase_set + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + phrase_set = {} + validate_only = true + phrase_set_id = "hello world" + parent = "hello world" + + create_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_phrase_set phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_phrase_set ::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_phrase_set(::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_phrase_set_client_stub.call_count + end + end + end + + def test_list_phrase_sets + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_phrase_sets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_phrase_sets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_phrase_sets_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_phrase_sets parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_phrase_sets ::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_phrase_sets(::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_phrase_sets_client_stub.call_count + end + end + end + + def test_get_phrase_set + # Create test objects. + client_result = ::Google::Cloud::Speech::V2::PhraseSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_phrase_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_phrase_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_phrase_set ::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_phrase_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_phrase_set(::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_phrase_set_client_stub.call_count + end + end + end + + def test_update_phrase_set + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + phrase_set = {} + update_mask = {} + validate_only = true + + update_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_phrase_set ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set({ phrase_set: phrase_set, 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_phrase_set(::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set_client_stub.call_count + end + end + end + + def test_delete_phrase_set + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_phrase_set name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_phrase_set ::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_phrase_set(::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_phrase_set_client_stub.call_count + end + end + end + + def test_undelete_phrase_set + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + etag = "hello world" + + undelete_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_phrase_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_phrase_set name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_phrase_set ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_phrase_set(::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_phrase_set_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::Speech::V2::Speech::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::Speech::V2::Speech::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb new file mode 100644 index 000000000000..9e7fc7fc7014 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb @@ -0,0 +1,1662 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/speech/v2/cloud_speech_pb" +require "google/cloud/speech/v2/speech" + +class ::Google::Cloud::Speech::V2::Speech::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_recognizer + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + recognizer = {} + validate_only = true + recognizer_id = "hello world" + parent = "hello world" + + create_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::CreateRecognizerRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Recognizer), request["recognizer"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["recognizer_id"] + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_recognizer recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_recognizer ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_recognizer(::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_recognizer_client_stub.call_rpc_count + end + end + + def test_list_recognizers + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::ListRecognizersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_recognizers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_recognizers, name + assert_kind_of ::Google::Cloud::Speech::V2::ListRecognizersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_recognizers_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_recognizers parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_recognizers ::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_recognizers(::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_recognizers_client_stub.call_rpc_count + end + end + + def test_get_recognizer + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::Recognizer.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::GetRecognizerRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_recognizer({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_recognizer name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_recognizer ::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_recognizer({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_recognizer(::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_recognizer_client_stub.call_rpc_count + end + end + + def test_update_recognizer + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + recognizer = {} + update_mask = {} + validate_only = true + + update_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::UpdateRecognizerRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Recognizer), request["recognizer"] + 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_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_recognizer recognizer: recognizer, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_recognizer ::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_recognizer(::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_recognizer_client_stub.call_rpc_count + end + end + + def test_delete_recognizer + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::DeleteRecognizerRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_recognizer name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_recognizer ::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_recognizer(::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_recognizer_client_stub.call_rpc_count + end + end + + def test_undelete_recognizer + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + etag = "hello world" + + undelete_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_recognizer, name + assert_kind_of ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_recognizer_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undelete_recognizer name: name, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undelete_recognizer ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undelete_recognizer(::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, undelete_recognizer_client_stub.call_rpc_count + end + end + + def test_recognize + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::RecognizeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + recognizer = "hello world" + config = {} + config_mask = {} + content = "hello world" + + recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :recognize, name + assert_kind_of ::Google::Cloud::Speech::V2::RecognizeRequest, request + assert_equal "hello world", request["recognizer"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionConfig), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["config_mask"] + assert_equal "hello world", request["content"] + assert_equal :content, request.audio_source + refute_nil options + end + + Gapic::ServiceStub.stub :new, recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.recognize recognizer: recognizer, config: config, config_mask: config_mask, content: content do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.recognize ::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.recognize(::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, recognize_client_stub.call_rpc_count + end + end + + def test_streaming_recognize + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::StreamingRecognizeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a bidi streaming method. + recognizer = "hello world" + streaming_config = {} + + streaming_recognize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_recognize, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { recognizer: recognizer, streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_recognize enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { recognizer: recognizer, streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_recognize stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { recognizer: recognizer, streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_recognize enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { recognizer: recognizer, streaming_config: streaming_config } + request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_recognize stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, streaming_recognize_client_stub.call_rpc_count + streaming_recognize_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeRequest, r + assert_equal "hello world", r["recognizer"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::StreamingRecognitionConfig), r["streaming_config"] + assert_equal :streaming_config, r.streaming_request + end + end + end + end + + def test_batch_recognize + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + recognizer = "hello world" + config = {} + config_mask = {} + files = [{}] + recognition_output_config = {} + processing_strategy = :PROCESSING_STRATEGY_UNSPECIFIED + + batch_recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_recognize, name + assert_kind_of ::Google::Cloud::Speech::V2::BatchRecognizeRequest, request + assert_equal "hello world", request["recognizer"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionConfig), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["config_mask"] + assert_kind_of ::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, request["files"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionOutputConfig), request["recognition_output_config"] + assert_equal :PROCESSING_STRATEGY_UNSPECIFIED, request["processing_strategy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_recognize_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_recognize recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_recognize ::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_recognize(::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_recognize_client_stub.call_rpc_count + end + end + + def test_get_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::Config.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_config, name + assert_kind_of ::Google::Cloud::Speech::V2::GetConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_config_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_config ::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_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_config(::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_config_client_stub.call_rpc_count + end + end + + def test_update_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::Config.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + config = {} + update_mask = {} + + update_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_config, name + assert_kind_of ::Google::Cloud::Speech::V2::UpdateConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Config), request["config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_config_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_config({ config: config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_config config: config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_config ::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_config({ config: config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_config(::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_config_client_stub.call_rpc_count + end + end + + def test_create_custom_class + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + custom_class = {} + validate_only = true + custom_class_id = "hello world" + parent = "hello world" + + create_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::CreateCustomClassRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::CustomClass), request["custom_class"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["custom_class_id"] + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_custom_class custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_custom_class ::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_custom_class(::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_custom_class_client_stub.call_rpc_count + end + end + + def test_list_custom_classes + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_custom_classes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_custom_classes, name + assert_kind_of ::Google::Cloud::Speech::V2::ListCustomClassesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_custom_classes_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_custom_classes parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_custom_classes ::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_custom_classes(::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_custom_classes_client_stub.call_rpc_count + end + end + + def test_get_custom_class + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::CustomClass.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::GetCustomClassRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_custom_class({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_custom_class name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_custom_class ::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_custom_class({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_custom_class(::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_custom_class_client_stub.call_rpc_count + end + end + + def test_update_custom_class + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + custom_class = {} + update_mask = {} + validate_only = true + + update_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::UpdateCustomClassRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::CustomClass), request["custom_class"] + 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_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_custom_class custom_class: custom_class, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_custom_class ::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_custom_class(::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_custom_class_client_stub.call_rpc_count + end + end + + def test_delete_custom_class + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::DeleteCustomClassRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_custom_class name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_custom_class ::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_custom_class(::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_custom_class_client_stub.call_rpc_count + end + end + + def test_undelete_custom_class + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + etag = "hello world" + + undelete_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_custom_class, name + assert_kind_of ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_custom_class_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undelete_custom_class name: name, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undelete_custom_class ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undelete_custom_class(::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, undelete_custom_class_client_stub.call_rpc_count + end + end + + def test_create_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + phrase_set = {} + validate_only = true + phrase_set_id = "hello world" + parent = "hello world" + + create_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::CreatePhraseSetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::PhraseSet), request["phrase_set"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["phrase_set_id"] + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_phrase_set phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_phrase_set ::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_phrase_set(::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_phrase_set_client_stub.call_rpc_count + end + end + + def test_list_phrase_sets + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_phrase_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_phrase_sets, name + assert_kind_of ::Google::Cloud::Speech::V2::ListPhraseSetsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_phrase_sets_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_phrase_sets parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_phrase_sets ::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_phrase_sets(::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_phrase_sets_client_stub.call_rpc_count + end + end + + def test_get_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Speech::V2::PhraseSet.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::GetPhraseSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_phrase_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_phrase_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_phrase_set ::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_phrase_set({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_phrase_set(::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_phrase_set_client_stub.call_rpc_count + end + end + + def test_update_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + phrase_set = {} + update_mask = {} + validate_only = true + + update_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::PhraseSet), request["phrase_set"] + 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_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_phrase_set ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_phrase_set(::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_phrase_set_client_stub.call_rpc_count + end + end + + def test_delete_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + allow_missing = true + etag = "hello world" + + delete_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::DeletePhraseSetRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_phrase_set name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_phrase_set ::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_phrase_set(::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_phrase_set_client_stub.call_rpc_count + end + end + + def test_undelete_phrase_set + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + etag = "hello world" + + undelete_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_phrase_set, name + assert_kind_of ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_phrase_set_client_stub do + # Create client + client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.undelete_phrase_set name: name, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.undelete_phrase_set ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.undelete_phrase_set(::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, undelete_phrase_set_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Speech::V2::Speech::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::Speech::V2::Speech::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Speech::V2::Speech::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/helper.rb b/owl-bot-staging/google-cloud-speech-v2/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-speech-v2/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.gitignore b/owl-bot-staging/google-cloud-storage-control-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json new file mode 100644 index 000000000000..9dc1067e6b4b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "storage.googleapis.com", + "api_shortname": "storage", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage-control-v2/latest", + "distribution_name": "google-cloud-storage-control-v2", + "is_cloud": true, + "language": "ruby", + "name": "storage", + "name_pretty": "Storage Control V2 API", + "product_documentation": "https://cloud.google.com/storage/docs/overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. Note that google-cloud-storage-control-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage-control instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/storage/docs/overview", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml b/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml new file mode 100644 index 000000000000..c9354c029feb --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-storage-control-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-storage-control-v2.rb" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb b/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/.yardopts b/owl-bot-staging/google-cloud-storage-control-v2/.yardopts new file mode 100644 index 000000000000..e4425bd31ee0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Storage Control 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-storage-control-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..9672b7b75ce0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-storage-control-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-storage-control-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/storage/control/v2" + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/storage/control/v2" + +::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-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/storage/control/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-storage-control-v2/Gemfile b/owl-bot-staging/google-cloud-storage-control-v2/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md b/owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/README.md b/owl-bot-staging/google-cloud-storage-control-v2/README.md new file mode 100644 index 000000000000..ba465335ff4a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Storage Control V2 API + +The Storage Control API lets you perform metadata-specific, control plane, and long-running operations. The Storage Control API creates one space to perform metadata-specific, control plane, and long-running operations apart from the Storage API. Separating these operations from the Storage API improves API standardization and lets you run faster releases. + +The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Storage Control V2 API. Most users should consider using +the main client gem, +[google-cloud-storage-control](https://rubygems.org/gems/google-cloud-storage-control). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-storage-control-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/storage.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/storage/control/v2" + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new +request = ::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new # (request fields as keyword arguments...) +response = client.create_folder request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage-control-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/storage/docs/overview) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/storage/control/v2" +require "logger" + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-storage-control-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-storage-control`. +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-storage-control-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-storage-control-v2/Rakefile b/owl-bot-staging/google-cloud-storage-control-v2/Rakefile new file mode 100644 index 000000000000..c1ef5dea7f73 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2 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/storage/control/v2/storage_control/credentials" + ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-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-storage-control-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-storage-control-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-storage-control-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-storage-control-v2" + header "google-cloud-storage-control-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-storage-control-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-storage-control-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-storage-control-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-storage-control-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-storage-control-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json new file mode 100644 index 000000000000..c36e20575fbc --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json @@ -0,0 +1,153 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.storage.control.v2", + "libraryPackage": "::Google::Cloud::Storage::Control::V2", + "services": { + "StorageControl": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Storage::Control::V2::StorageControl::Client", + "rpcs": { + "CreateFolder": { + "methods": [ + "create_folder" + ] + }, + "DeleteFolder": { + "methods": [ + "delete_folder" + ] + }, + "GetFolder": { + "methods": [ + "get_folder" + ] + }, + "ListFolders": { + "methods": [ + "list_folders" + ] + }, + "RenameFolder": { + "methods": [ + "rename_folder" + ] + }, + "DeleteFolderRecursive": { + "methods": [ + "delete_folder_recursive" + ] + }, + "GetStorageLayout": { + "methods": [ + "get_storage_layout" + ] + }, + "CreateManagedFolder": { + "methods": [ + "create_managed_folder" + ] + }, + "DeleteManagedFolder": { + "methods": [ + "delete_managed_folder" + ] + }, + "GetManagedFolder": { + "methods": [ + "get_managed_folder" + ] + }, + "ListManagedFolders": { + "methods": [ + "list_managed_folders" + ] + }, + "CreateAnywhereCache": { + "methods": [ + "create_anywhere_cache" + ] + }, + "UpdateAnywhereCache": { + "methods": [ + "update_anywhere_cache" + ] + }, + "DisableAnywhereCache": { + "methods": [ + "disable_anywhere_cache" + ] + }, + "PauseAnywhereCache": { + "methods": [ + "pause_anywhere_cache" + ] + }, + "ResumeAnywhereCache": { + "methods": [ + "resume_anywhere_cache" + ] + }, + "GetAnywhereCache": { + "methods": [ + "get_anywhere_cache" + ] + }, + "ListAnywhereCaches": { + "methods": [ + "list_anywhere_caches" + ] + }, + "GetProjectIntelligenceConfig": { + "methods": [ + "get_project_intelligence_config" + ] + }, + "UpdateProjectIntelligenceConfig": { + "methods": [ + "update_project_intelligence_config" + ] + }, + "GetFolderIntelligenceConfig": { + "methods": [ + "get_folder_intelligence_config" + ] + }, + "UpdateFolderIntelligenceConfig": { + "methods": [ + "update_folder_intelligence_config" + ] + }, + "GetOrganizationIntelligenceConfig": { + "methods": [ + "get_organization_intelligence_config" + ] + }, + "UpdateOrganizationIntelligenceConfig": { + "methods": [ + "update_organization_intelligence_config" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec b/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec new file mode 100644 index 000000000000..995035118c6a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/storage/control/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-storage-control-v2" + gem.version = Google::Cloud::Storage::Control::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. Note that google-cloud-storage-control-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage-control instead. See the readme for more details." + gem.summary = "The Storage Control API lets you perform metadata-specific, control plane, and long-running operations. The Storage Control API creates one space to perform metadata-specific, control plane, and long-running operations apart from the Storage API. Separating these operations from the Storage API improves API standardization and lets you run faster releases." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb new file mode 100644 index 000000000000..c8a5475de0b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-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/storage/control/v2" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb new file mode 100644 index 000000000000..b529c031a2e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/storage/control/v2/storage_control" +require "google/cloud/storage/control/v2/version" + +module Google + module Cloud + module Storage + module Control + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/storage/control/v2" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/storage/control/v2" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + module V2 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/storage/control/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb new file mode 100644 index 000000000000..8e031b6fa014 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/storage/control/v2/storage_control/rest" +require "google/cloud/storage/control/v2/version" + +module Google + module Cloud + module Storage + module Control + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/storage/control/v2/rest" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + module V2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb new file mode 100644 index 000000000000..4cfe356728f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.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/storage/control/v2/version" + +require "google/cloud/storage/control/v2/storage_control/credentials" +require "google/cloud/storage/control/v2/storage_control/paths" +require "google/cloud/storage/control/v2/storage_control/operations" +require "google/cloud/storage/control/v2/storage_control/client" +require "google/cloud/storage/control/v2/storage_control/rest" + +module Google + module Cloud + module Storage + module Control + module V2 + ## + # StorageControl service includes selected control plane operations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/storage/control/v2/storage_control" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/storage/control/v2/storage_control/rest" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + module StorageControl + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "storage_control", "helpers.rb" +require "google/cloud/storage/control/v2/storage_control/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb new file mode 100644 index 000000000000..4a311841cf98 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb @@ -0,0 +1,3379 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/storage/control/v2/storage_control_pb" + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + ## + # Client for the StorageControl service. + # + # StorageControl service includes selected control plane operations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_control_stub + + ## + # Configure the StorageControl Client class. + # + # See {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageControl clients + # ::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Storage", "Control", "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.rpcs.create_folder.timeout = 60.0 + default_config.rpcs.create_folder.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_folder.timeout = 60.0 + default_config.rpcs.get_folder.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.list_folders.timeout = 60.0 + default_config.rpcs.list_folders.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.rename_folder.timeout = 60.0 + default_config.rpcs.rename_folder.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.delete_folder_recursive.timeout = 60.0 + default_config.rpcs.delete_folder_recursive.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_storage_layout.timeout = 60.0 + default_config.rpcs.get_storage_layout.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_managed_folder.timeout = 60.0 + default_config.rpcs.get_managed_folder.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.list_managed_folders.timeout = 60.0 + default_config.rpcs.list_managed_folders.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.create_anywhere_cache.timeout = 60.0 + default_config.rpcs.create_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_anywhere_cache.timeout = 60.0 + default_config.rpcs.update_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.disable_anywhere_cache.timeout = 60.0 + default_config.rpcs.disable_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.pause_anywhere_cache.timeout = 60.0 + default_config.rpcs.pause_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.resume_anywhere_cache.timeout = 60.0 + default_config.rpcs.resume_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_anywhere_cache.timeout = 60.0 + default_config.rpcs.get_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.list_anywhere_caches.timeout = 60.0 + default_config.rpcs.list_anywhere_caches.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_project_intelligence_config.timeout = 60.0 + default_config.rpcs.get_project_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_project_intelligence_config.timeout = 60.0 + default_config.rpcs.update_project_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_folder_intelligence_config.timeout = 60.0 + default_config.rpcs.get_folder_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_folder_intelligence_config.timeout = 60.0 + default_config.rpcs.update_folder_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_organization_intelligence_config.timeout = 60.0 + default_config.rpcs.get_organization_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_organization_intelligence_config.timeout = 60.0 + default_config.rpcs.update_organization_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageControl Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @storage_control_stub.universe_domain + end + + ## + # Create a new StorageControl client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageControl 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/storage/control/v2/storage_control_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 + + @storage_control_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Storage::Control::V2::StorageControl::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 + ) + + @storage_control_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::Storage::Control::V2::StorageControl::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @storage_control_stub.logger + end + + # Service calls + + ## + # Creates a new folder. This operation is only applicable to a hierarchical + # namespace enabled bucket. + # + # @overload create_folder(request, options = nil) + # Pass arguments to `create_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::CreateFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::CreateFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_folder(parent: nil, folder: nil, folder_id: nil, recursive: nil, request_id: nil) + # Pass arguments to `create_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the bucket in which the folder will reside. The bucket + # must be a hierarchical namespace enabled bucket. + # @param folder [::Google::Cloud::Storage::Control::V2::Folder, ::Hash] + # Required. Properties of the new folder being created. + # The bucket and name of the folder are specified in the parent and folder_id + # fields, respectively. Populating those fields in `folder` will result in an + # error. + # @param folder_id [::String] + # Required. The full name of a folder, including all its parent folders. + # Folders use single '/' characters as a delimiter. + # The folder_id must end with a slash. + # For example, the folder_id of "books/biographies/" would create a new + # "biographies/" folder under the "books/" folder. + # @param recursive [::Boolean] + # Optional. If true, parent folder doesn't have to be present and all missing + # ancestor folders will be created atomically. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::Folder] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::Folder] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::CreateFolderRequest.new + # + # # Call the create_folder method. + # result = client.create_folder request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. + # p result + # + def create_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :create_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes an empty folder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # + # @overload delete_folder(request, options = nil) + # Pass arguments to `delete_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::DeleteFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `delete_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @param if_metageneration_match [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration matches the given value. + # @param if_metageneration_not_match [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration does not match the given value. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new + # + # # Call the delete_folder method. + # result = client.delete_folder request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :delete_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for the specified folder. This operation is only + # applicable to a hierarchical namespace enabled bucket. + # + # @overload get_folder(request, options = nil) + # Pass arguments to `get_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `get_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @param if_metageneration_match [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration matches the given value. + # @param if_metageneration_not_match [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration does not match the given value. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::Folder] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::Folder] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetFolderRequest.new + # + # # Call the get_folder method. + # result = client.get_folder request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. + # p result + # + def get_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a list of folders. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # + # @overload list_folders(request, options = nil) + # Pass arguments to `list_folders` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::ListFoldersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::ListFoldersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, delimiter: nil, lexicographic_start: nil, lexicographic_end: nil, request_id: nil) + # Pass arguments to `list_folders` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the bucket in which to look for folders. The bucket must + # be a hierarchical namespace enabled bucket. + # @param page_size [::Integer] + # Optional. Maximum number of folders to return in a single response. The + # service will use this parameter or 1,000 items, whichever is smaller. + # @param page_token [::String] + # Optional. A previously-returned page token representing part of the larger + # set of results to view. + # @param prefix [::String] + # Optional. Filter results to folders whose names begin with this prefix. + # If set, the value must either be an empty string or end with a '/'. + # @param delimiter [::String] + # Optional. If set, returns results in a directory-like mode. The results + # will only include folders that either exactly match the above prefix, or + # are one level below the prefix. The only supported value is '/'. + # @param lexicographic_start [::String] + # Optional. Filter results to folders whose names are lexicographically equal + # to or after lexicographic_start. If lexicographic_end is also set, the + # folders listed have names between lexicographic_start (inclusive) and + # lexicographic_end (exclusive). + # @param lexicographic_end [::String] + # Optional. Filter results to folders whose names are lexicographically + # before lexicographic_end. If lexicographic_start is also set, the folders + # listed have names between lexicographic_start (inclusive) and + # lexicographic_end (exclusive). + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::ListFoldersRequest.new + # + # # Call the list_folders method. + # result = client.list_folders request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Storage::Control::V2::Folder. + # p item + # end + # + def list_folders request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListFoldersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_folders.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_folders.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_folders.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :list_folders, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_folders, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Renames a source folder to a destination folder. This operation is only + # applicable to a hierarchical namespace enabled bucket. During a rename, the + # source and destination folders are locked until the long running operation + # completes. + # + # @overload rename_folder(request, options = nil) + # Pass arguments to `rename_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::RenameFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload rename_folder(name: nil, destination_folder_id: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `rename_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the source folder being renamed. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @param destination_folder_id [::String] + # Required. The destination folder ID, e.g. `foo/bar/`. + # @param if_metageneration_match [::Integer] + # Makes the operation only succeed conditional on whether the source + # folder's current metageneration matches the given value. + # @param if_metageneration_not_match [::Integer] + # Makes the operation only succeed conditional on whether the source + # folder's current metageneration does not match the given value. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::RenameFolderRequest.new + # + # # Call the rename_folder method. + # result = client.rename_folder request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def rename_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::RenameFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.rename_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rename_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rename_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :rename_folder, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a folder recursively. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # + # @overload delete_folder_recursive(request, options = nil) + # Pass arguments to `delete_folder_recursive` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_folder_recursive(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `delete_folder_recursive` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the folder being deleted, however all of its contents + # will be deleted too. Format: + # `projects/{project}/buckets/{bucket}/folders/{folder}` + # @param if_metageneration_match [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration matches the given value. + # @param if_metageneration_not_match [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration does not match the given value. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new + # + # # Call the delete_folder_recursive method. + # result = client.delete_folder_recursive request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_folder_recursive request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_folder_recursive.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_folder_recursive.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_folder_recursive.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :delete_folder_recursive, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the storage layout configuration for a given bucket. + # + # @overload get_storage_layout(request, options = nil) + # Pass arguments to `get_storage_layout` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_storage_layout(name: nil, prefix: nil, request_id: nil) + # Pass arguments to `get_storage_layout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 StorageLayout resource. + # Format: `projects/{project}/buckets/{bucket}/storageLayout` + # @param prefix [::String] + # An optional prefix used for permission check. It is useful when the caller + # only has limited permissions under a specific prefix. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::StorageLayout] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::StorageLayout] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new + # + # # Call the get_storage_layout method. + # result = client.get_storage_layout request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::StorageLayout. + # p result + # + def get_storage_layout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_storage_layout.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_storage_layout.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_storage_layout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_storage_layout, request, 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 managed folder. + # + # @overload create_managed_folder(request, options = nil) + # Pass arguments to `create_managed_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_managed_folder(parent: nil, managed_folder: nil, managed_folder_id: nil, request_id: nil) + # Pass arguments to `create_managed_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the bucket this managed folder belongs to. + # @param managed_folder [::Google::Cloud::Storage::Control::V2::ManagedFolder, ::Hash] + # Required. Properties of the managed folder being created. + # The bucket and managed folder names are specified in the `parent` and + # `managed_folder_id` fields. Populating these fields in `managed_folder` + # will result in an error. + # @param managed_folder_id [::String] + # Required. The name of the managed folder. It uses a single `/` as delimiter + # and leading and trailing `/` are allowed. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new + # + # # Call the create_managed_folder method. + # result = client.create_managed_folder request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. + # p result + # + def create_managed_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest + + # Converts hash and nil to 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_managed_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_managed_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_managed_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :create_managed_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes an empty managed folder. + # + # @overload delete_managed_folder(request, options = nil) + # Pass arguments to `delete_managed_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_managed_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, allow_non_empty: nil, request_id: nil) + # Pass arguments to `delete_managed_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @param if_metageneration_match [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration matching the value here specified. + # @param if_metageneration_not_match [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration NOT matching the value here specified. + # @param allow_non_empty [::Boolean] + # Allows deletion of a managed folder even if it is not empty. + # A managed folder is empty if it manages no child managed folders or + # objects. Caller must have permission for + # storage.managedFolders.setIamPolicy. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new + # + # # Call the delete_managed_folder method. + # result = client.delete_managed_folder request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_managed_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_managed_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_managed_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_managed_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :delete_managed_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for the specified managed folder. + # + # @overload get_managed_folder(request, options = nil) + # Pass arguments to `get_managed_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_managed_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `get_managed_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @param if_metageneration_match [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration matching the value here specified. + # @param if_metageneration_not_match [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration NOT matching the value here specified. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new + # + # # Call the get_managed_folder method. + # result = client.get_managed_folder request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. + # p result + # + def get_managed_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_managed_folder.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_managed_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_managed_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_managed_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a list of managed folders for a given bucket. + # + # @overload list_managed_folders(request, options = nil) + # Pass arguments to `list_managed_folders` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_managed_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, request_id: nil) + # Pass arguments to `list_managed_folders` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the bucket this managed folder belongs to. + # @param page_size [::Integer] + # Optional. Maximum number of managed folders to return in a single response. + # The service will use this parameter or 1,000 items, whichever is smaller. + # @param page_token [::String] + # Optional. A previously-returned page token representing part of the larger + # set of results to view. + # @param prefix [::String] + # Optional. Filter results to match managed folders with name starting with + # this prefix. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::ManagedFolder>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::ManagedFolder>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new + # + # # Call the list_managed_folders method. + # result = client.list_managed_folders request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Storage::Control::V2::ManagedFolder. + # p item + # end + # + def list_managed_folders request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_managed_folders.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_managed_folders.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_managed_folders.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :list_managed_folders, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_managed_folders, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an Anywhere Cache instance. + # + # @overload create_anywhere_cache(request, options = nil) + # Pass arguments to `create_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_anywhere_cache(parent: nil, anywhere_cache: nil, request_id: nil) + # Pass arguments to `create_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The bucket to which this cache belongs. + # Format: `projects/{project}/buckets/{bucket}` + # @param anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash] + # Required. Properties of the Anywhere Cache instance being created. + # The parent bucket name is specified in the `parent` field. Server uses the + # default value of `ttl` or `admission_policy` if not specified in + # request. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new + # + # # Call the create_anywhere_cache method. + # result = client.create_anywhere_cache request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest + + # Converts hash and nil to 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_anywhere_cache.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :create_anywhere_cache, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 an Anywhere Cache instance. Mutable fields include `ttl` and + # `admission_policy`. + # + # @overload update_anywhere_cache(request, options = nil) + # Pass arguments to `update_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_anywhere_cache(anywhere_cache: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash] + # Required. The Anywhere Cache instance to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated. Mutable fields of AnywhereCache + # include `ttl` and `admission_policy`. + # + # To specify ALL fields, specify a single field with the value `*`. Note: We + # recommend against doing this. If a new field is introduced at a later time, + # an older client updating with the `*` may accidentally reset the new + # field's value. + # + # Not specifying any fields is an error. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new + # + # # Call the update_anywhere_cache method. + # result = client.update_anywhere_cache request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest + + # Converts hash and nil to 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_anywhere_cache.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.anywhere_cache&.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.anywhere_cache.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :update_anywhere_cache, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables an Anywhere Cache instance. A disabled instance is read-only. The + # disablement could be revoked by calling ResumeAnywhereCache. The cache + # instance will be deleted automatically if it remains in the disabled state + # for at least one hour. + # + # @overload disable_anywhere_cache(request, options = nil) + # Pass arguments to `disable_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_anywhere_cache(name: nil, request_id: nil) + # Pass arguments to `disable_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new + # + # # Call the disable_anywhere_cache method. + # result = client.disable_anywhere_cache request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + # p result + # + def disable_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_anywhere_cache.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :disable_anywhere_cache, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses an Anywhere Cache instance. + # + # @overload pause_anywhere_cache(request, options = nil) + # Pass arguments to `pause_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_anywhere_cache(name: nil, request_id: nil) + # Pass arguments to `pause_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new + # + # # Call the pause_anywhere_cache method. + # result = client.pause_anywhere_cache request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + # p result + # + def pause_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest + + # Converts hash and nil to 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_anywhere_cache.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.pause_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :pause_anywhere_cache, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resumes a disabled or paused Anywhere Cache instance. + # + # @overload resume_anywhere_cache(request, options = nil) + # Pass arguments to `resume_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_anywhere_cache(name: nil, request_id: nil) + # Pass arguments to `resume_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new + # + # # Call the resume_anywhere_cache method. + # result = client.resume_anywhere_cache request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + # p result + # + def resume_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest + + # Converts hash and nil to 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_anywhere_cache.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.resume_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :resume_anywhere_cache, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an Anywhere Cache instance. + # + # @overload get_anywhere_cache(request, options = nil) + # Pass arguments to `get_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_anywhere_cache(name: nil, request_id: nil) + # Pass arguments to `get_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new + # + # # Call the get_anywhere_cache method. + # result = client.get_anywhere_cache request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + # p result + # + def get_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_anywhere_cache.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_anywhere_cache, request, 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 Anywhere Cache instances for a given bucket. + # + # @overload list_anywhere_caches(request, options = nil) + # Pass arguments to `list_anywhere_caches` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_anywhere_caches(parent: nil, page_size: nil, page_token: nil, request_id: nil) + # Pass arguments to `list_anywhere_caches` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The bucket to which this cache belongs. + # @param page_size [::Integer] + # Maximum number of caches to return in a single response. + # The service will use this parameter or 1,000 items, whichever is smaller. + # @param page_token [::String] + # A previously-returned page token representing part of the larger set of + # results to view. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new + # + # # Call the list_anywhere_caches method. + # result = client.list_anywhere_caches request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Storage::Control::V2::AnywhereCache. + # p item + # end + # + def list_anywhere_caches request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_anywhere_caches.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_anywhere_caches.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_anywhere_caches.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :list_anywhere_caches, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_anywhere_caches, request, response, 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 Project scoped singleton IntelligenceConfig resource. + # + # @overload get_project_intelligence_config(request, options = nil) + # Pass arguments to `get_project_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_project_intelligence_config(name: nil) + # Pass arguments to `get_project_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your project. + # + # Format: `projects/{id}/locations/global/intelligenceConfig` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new + # + # # Call the get_project_intelligence_config method. + # result = client.get_project_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_project_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_project_intelligence_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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_project_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_project_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_project_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Project scoped singleton IntelligenceConfig resource. + # + # @overload update_project_intelligence_config(request, options = nil) + # Pass arguments to `update_project_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_project_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new + # + # # Call the update_project_intelligence_config method. + # result = client.update_project_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_project_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_project_intelligence_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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.intelligence_config&.name + header_params["intelligence_config.name"] = request.intelligence_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_project_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_project_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :update_project_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the Folder scoped singleton IntelligenceConfig resource. + # + # @overload get_folder_intelligence_config(request, options = nil) + # Pass arguments to `get_folder_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_folder_intelligence_config(name: nil) + # Pass arguments to `get_folder_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your folder. + # + # Format: `folders/{id}/locations/global/intelligenceConfig` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new + # + # # Call the get_folder_intelligence_config method. + # result = client.get_folder_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_folder_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_folder_intelligence_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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_folder_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_folder_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_folder_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Folder scoped singleton IntelligenceConfig resource. + # + # @overload update_folder_intelligence_config(request, options = nil) + # Pass arguments to `update_folder_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_folder_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new + # + # # Call the update_folder_intelligence_config method. + # result = client.update_folder_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_folder_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_folder_intelligence_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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.intelligence_config&.name + header_params["intelligence_config.name"] = request.intelligence_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_folder_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_folder_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :update_folder_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the Organization scoped singleton IntelligenceConfig resource. + # + # @overload get_organization_intelligence_config(request, options = nil) + # Pass arguments to `get_organization_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_organization_intelligence_config(name: nil) + # Pass arguments to `get_organization_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your organization. + # + # Format: `organizations/{org_id}/locations/global/intelligenceConfig` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new + # + # # Call the get_organization_intelligence_config method. + # result = client.get_organization_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_organization_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_organization_intelligence_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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_organization_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_organization_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_organization_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Organization scoped singleton IntelligenceConfig resource. + # + # @overload update_organization_intelligence_config(request, options = nil) + # Pass arguments to `update_organization_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_organization_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new + # + # # Call the update_organization_intelligence_config method. + # result = client.update_organization_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_organization_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_organization_intelligence_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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.intelligence_config&.name + header_params["intelligence_config.name"] = request.intelligence_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_organization_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_organization_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :update_organization_intelligence_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 IAM policy for a specified bucket. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-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 && !request.resource.empty? + header_params["bucket"] = request.resource + end + if request.resource + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.resource + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an IAM policy for the specified bucket. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-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 && !request.resource.empty? + header_params["bucket"] = request.resource + end + if request.resource + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.resource + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Tests a set of permissions on the given bucket, object, or managed folder + # to see which, if any, are held by the caller. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, + # `projects/_/buckets/{bucket}/objects/{object}` for an object, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION + metadata[:"x-goog-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 && !request.resource.empty? + header_params["bucket"] = request.resource + end + if request.resource + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)/objects(?:/.*)?$}.match request.resource + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + if request.resource + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)/managedFolders(?:/.*)?$}.match request.resource + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the StorageControl API. + # + # This class represents the configuration for StorageControl, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_folder to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_folder.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_folder.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the StorageControl API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :create_folder + ## + # RPC-specific configuration for `delete_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_folder + ## + # RPC-specific configuration for `get_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :get_folder + ## + # RPC-specific configuration for `list_folders` + # @return [::Gapic::Config::Method] + # + attr_reader :list_folders + ## + # RPC-specific configuration for `rename_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :rename_folder + ## + # RPC-specific configuration for `delete_folder_recursive` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_folder_recursive + ## + # RPC-specific configuration for `get_storage_layout` + # @return [::Gapic::Config::Method] + # + attr_reader :get_storage_layout + ## + # RPC-specific configuration for `create_managed_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :create_managed_folder + ## + # RPC-specific configuration for `delete_managed_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_managed_folder + ## + # RPC-specific configuration for `get_managed_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :get_managed_folder + ## + # RPC-specific configuration for `list_managed_folders` + # @return [::Gapic::Config::Method] + # + attr_reader :list_managed_folders + ## + # RPC-specific configuration for `create_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :create_anywhere_cache + ## + # RPC-specific configuration for `update_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :update_anywhere_cache + ## + # RPC-specific configuration for `disable_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_anywhere_cache + ## + # RPC-specific configuration for `pause_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_anywhere_cache + ## + # RPC-specific configuration for `resume_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_anywhere_cache + ## + # RPC-specific configuration for `get_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :get_anywhere_cache + ## + # RPC-specific configuration for `list_anywhere_caches` + # @return [::Gapic::Config::Method] + # + attr_reader :list_anywhere_caches + ## + # RPC-specific configuration for `get_project_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_project_intelligence_config + ## + # RPC-specific configuration for `update_project_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_project_intelligence_config + ## + # RPC-specific configuration for `get_folder_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_folder_intelligence_config + ## + # RPC-specific configuration for `update_folder_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_folder_intelligence_config + ## + # RPC-specific configuration for `get_organization_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_intelligence_config + ## + # RPC-specific configuration for `update_organization_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_organization_intelligence_config + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + create_folder_config = parent_rpcs.create_folder if parent_rpcs.respond_to? :create_folder + @create_folder = ::Gapic::Config::Method.new create_folder_config + delete_folder_config = parent_rpcs.delete_folder if parent_rpcs.respond_to? :delete_folder + @delete_folder = ::Gapic::Config::Method.new delete_folder_config + get_folder_config = parent_rpcs.get_folder if parent_rpcs.respond_to? :get_folder + @get_folder = ::Gapic::Config::Method.new get_folder_config + list_folders_config = parent_rpcs.list_folders if parent_rpcs.respond_to? :list_folders + @list_folders = ::Gapic::Config::Method.new list_folders_config + rename_folder_config = parent_rpcs.rename_folder if parent_rpcs.respond_to? :rename_folder + @rename_folder = ::Gapic::Config::Method.new rename_folder_config + delete_folder_recursive_config = parent_rpcs.delete_folder_recursive if parent_rpcs.respond_to? :delete_folder_recursive + @delete_folder_recursive = ::Gapic::Config::Method.new delete_folder_recursive_config + get_storage_layout_config = parent_rpcs.get_storage_layout if parent_rpcs.respond_to? :get_storage_layout + @get_storage_layout = ::Gapic::Config::Method.new get_storage_layout_config + create_managed_folder_config = parent_rpcs.create_managed_folder if parent_rpcs.respond_to? :create_managed_folder + @create_managed_folder = ::Gapic::Config::Method.new create_managed_folder_config + delete_managed_folder_config = parent_rpcs.delete_managed_folder if parent_rpcs.respond_to? :delete_managed_folder + @delete_managed_folder = ::Gapic::Config::Method.new delete_managed_folder_config + get_managed_folder_config = parent_rpcs.get_managed_folder if parent_rpcs.respond_to? :get_managed_folder + @get_managed_folder = ::Gapic::Config::Method.new get_managed_folder_config + list_managed_folders_config = parent_rpcs.list_managed_folders if parent_rpcs.respond_to? :list_managed_folders + @list_managed_folders = ::Gapic::Config::Method.new list_managed_folders_config + create_anywhere_cache_config = parent_rpcs.create_anywhere_cache if parent_rpcs.respond_to? :create_anywhere_cache + @create_anywhere_cache = ::Gapic::Config::Method.new create_anywhere_cache_config + update_anywhere_cache_config = parent_rpcs.update_anywhere_cache if parent_rpcs.respond_to? :update_anywhere_cache + @update_anywhere_cache = ::Gapic::Config::Method.new update_anywhere_cache_config + disable_anywhere_cache_config = parent_rpcs.disable_anywhere_cache if parent_rpcs.respond_to? :disable_anywhere_cache + @disable_anywhere_cache = ::Gapic::Config::Method.new disable_anywhere_cache_config + pause_anywhere_cache_config = parent_rpcs.pause_anywhere_cache if parent_rpcs.respond_to? :pause_anywhere_cache + @pause_anywhere_cache = ::Gapic::Config::Method.new pause_anywhere_cache_config + resume_anywhere_cache_config = parent_rpcs.resume_anywhere_cache if parent_rpcs.respond_to? :resume_anywhere_cache + @resume_anywhere_cache = ::Gapic::Config::Method.new resume_anywhere_cache_config + get_anywhere_cache_config = parent_rpcs.get_anywhere_cache if parent_rpcs.respond_to? :get_anywhere_cache + @get_anywhere_cache = ::Gapic::Config::Method.new get_anywhere_cache_config + list_anywhere_caches_config = parent_rpcs.list_anywhere_caches if parent_rpcs.respond_to? :list_anywhere_caches + @list_anywhere_caches = ::Gapic::Config::Method.new list_anywhere_caches_config + get_project_intelligence_config_config = parent_rpcs.get_project_intelligence_config if parent_rpcs.respond_to? :get_project_intelligence_config + @get_project_intelligence_config = ::Gapic::Config::Method.new get_project_intelligence_config_config + update_project_intelligence_config_config = parent_rpcs.update_project_intelligence_config if parent_rpcs.respond_to? :update_project_intelligence_config + @update_project_intelligence_config = ::Gapic::Config::Method.new update_project_intelligence_config_config + get_folder_intelligence_config_config = parent_rpcs.get_folder_intelligence_config if parent_rpcs.respond_to? :get_folder_intelligence_config + @get_folder_intelligence_config = ::Gapic::Config::Method.new get_folder_intelligence_config_config + update_folder_intelligence_config_config = parent_rpcs.update_folder_intelligence_config if parent_rpcs.respond_to? :update_folder_intelligence_config + @update_folder_intelligence_config = ::Gapic::Config::Method.new update_folder_intelligence_config_config + get_organization_intelligence_config_config = parent_rpcs.get_organization_intelligence_config if parent_rpcs.respond_to? :get_organization_intelligence_config + @get_organization_intelligence_config = ::Gapic::Config::Method.new get_organization_intelligence_config_config + update_organization_intelligence_config_config = parent_rpcs.update_organization_intelligence_config if parent_rpcs.respond_to? :update_organization_intelligence_config + @update_organization_intelligence_config = ::Gapic::Config::Method.new update_organization_intelligence_config_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb new file mode 100644 index 000000000000..c65981e2f69b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/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 Storage + module Control + module V2 + module StorageControl + # Credentials for the StorageControl API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + 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-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb new file mode 100644 index 000000000000..3ba9c91b393a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/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 Storage + module Control + module V2 + module StorageControl + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StorageControl 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 StorageControl 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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Storage::Control::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::Storage::Control::V2::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 = "storage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb new file mode 100644 index 000000000000..669b90f12a51 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + # Path helper methods for the StorageControl API. + module Paths + ## + # Create a fully-qualified AnywhereCache resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # + # @param project [String] + # @param bucket [String] + # @param anywhere_cache [String] + # + # @return [::String] + def anywhere_cache_path project:, bucket:, anywhere_cache: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}/anywhereCaches/#{anywhere_cache}" + end + + ## + # Create a fully-qualified Bucket resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}` + # + # @param project [String] + # @param bucket [String] + # + # @return [::String] + def bucket_path project:, bucket: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}" + end + + ## + # Create a fully-qualified Folder resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}/folders/{folder=**}` + # + # @param project [String] + # @param bucket [String] + # @param folder [String] + # + # @return [::String] + def folder_path project:, bucket:, folder: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}/folders/#{folder}" + end + + ## + # Create a fully-qualified IntelligenceConfig resource string. + # + # @overload intelligence_config_path(folder:, location:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/intelligenceConfig` + # + # @param folder [String] + # @param location [String] + # + # @overload intelligence_config_path(org:, location:) + # The resource will be in the following format: + # + # `organizations/{org}/locations/{location}/intelligenceConfig` + # + # @param org [String] + # @param location [String] + # + # @overload intelligence_config_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/intelligenceConfig` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def intelligence_config_path **args + resources = { + "folder:location" => (proc do |folder:, location:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/intelligenceConfig" + end), + "location:org" => (proc do |org:, location:| + raise ::ArgumentError, "org cannot contain /" if org.to_s.include? "/" + + "organizations/#{org}/locations/#{location}/intelligenceConfig" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/intelligenceConfig" + 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 ManagedFolder resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}` + # + # @param project [String] + # @param bucket [String] + # @param managed_folder [String] + # + # @return [::String] + def managed_folder_path project:, bucket:, managed_folder: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}/managedFolders/#{managed_folder}" + end + + ## + # Create a fully-qualified StorageLayout resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}/storageLayout` + # + # @param project [String] + # @param bucket [String] + # + # @return [::String] + def storage_layout_path project:, bucket: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}/storageLayout" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb new file mode 100644 index 000000000000..afbdecc7fabf --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/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/storage/control/v2/version" + +require "google/cloud/storage/control/v2/storage_control/credentials" +require "google/cloud/storage/control/v2/storage_control/paths" +require "google/cloud/storage/control/v2/storage_control/rest/client" + +module Google + module Cloud + module Storage + module Control + module V2 + ## + # StorageControl service includes selected control plane operations. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/storage/control/v2/storage_control/rest" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + module StorageControl + # 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/storage/control/v2/storage_control/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb new file mode 100644 index 000000000000..b1c5439c8bfa --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb @@ -0,0 +1,913 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/storage/control/v2/storage_control_pb" +require "google/cloud/storage/control/v2/storage_control/rest/service_stub" + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + module Rest + ## + # REST client for the StorageControl service. + # + # StorageControl service includes selected control plane operations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_control_stub + + ## + # Configure the StorageControl Client class. + # + # See {::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageControl clients + # ::Google::Cloud::Storage::Control::V2::StorageControl::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", "Storage", "Control", "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.rpcs.get_project_intelligence_config.timeout = 60.0 + default_config.rpcs.get_project_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_project_intelligence_config.timeout = 60.0 + default_config.rpcs.update_project_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_folder_intelligence_config.timeout = 60.0 + default_config.rpcs.get_folder_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_folder_intelligence_config.timeout = 60.0 + default_config.rpcs.update_folder_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_organization_intelligence_config.timeout = 60.0 + default_config.rpcs.get_organization_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_organization_intelligence_config.timeout = 60.0 + default_config.rpcs.update_organization_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageControl Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Storage::Control::V2::StorageControl::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 + @storage_control_stub.universe_domain + end + + ## + # Create a new StorageControl REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageControl 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 + + @storage_control_stub = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @storage_control_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 + @storage_control_stub.logger + end + + # Service calls + + ## + # Returns the Project scoped singleton IntelligenceConfig resource. + # + # @overload get_project_intelligence_config(request, options = nil) + # Pass arguments to `get_project_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_project_intelligence_config(name: nil) + # Pass arguments to `get_project_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your project. + # + # Format: `projects/{id}/locations/global/intelligenceConfig` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new + # + # # Call the get_project_intelligence_config method. + # result = client.get_project_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_project_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_project_intelligence_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::Storage::Control::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_project_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_project_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.get_project_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Project scoped singleton IntelligenceConfig resource. + # + # @overload update_project_intelligence_config(request, options = nil) + # Pass arguments to `update_project_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_project_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new + # + # # Call the update_project_intelligence_config method. + # result = client.update_project_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_project_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_project_intelligence_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::Storage::Control::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_project_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_project_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.update_project_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the Folder scoped singleton IntelligenceConfig resource. + # + # @overload get_folder_intelligence_config(request, options = nil) + # Pass arguments to `get_folder_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_folder_intelligence_config(name: nil) + # Pass arguments to `get_folder_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your folder. + # + # Format: `folders/{id}/locations/global/intelligenceConfig` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new + # + # # Call the get_folder_intelligence_config method. + # result = client.get_folder_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_folder_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_folder_intelligence_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::Storage::Control::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_folder_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_folder_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.get_folder_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Folder scoped singleton IntelligenceConfig resource. + # + # @overload update_folder_intelligence_config(request, options = nil) + # Pass arguments to `update_folder_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_folder_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new + # + # # Call the update_folder_intelligence_config method. + # result = client.update_folder_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_folder_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_folder_intelligence_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::Storage::Control::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_folder_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_folder_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.update_folder_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the Organization scoped singleton IntelligenceConfig resource. + # + # @overload get_organization_intelligence_config(request, options = nil) + # Pass arguments to `get_organization_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_organization_intelligence_config(name: nil) + # Pass arguments to `get_organization_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your organization. + # + # Format: `organizations/{org_id}/locations/global/intelligenceConfig` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new + # + # # Call the get_organization_intelligence_config method. + # result = client.get_organization_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_organization_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_organization_intelligence_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::Storage::Control::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_organization_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_organization_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.get_organization_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Organization scoped singleton IntelligenceConfig resource. + # + # @overload update_organization_intelligence_config(request, options = nil) + # Pass arguments to `update_organization_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_organization_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new + # + # # Call the update_organization_intelligence_config method. + # result = client.update_organization_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_organization_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_organization_intelligence_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::Storage::Control::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_organization_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_organization_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.update_organization_intelligence_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 StorageControl REST API. + # + # This class represents the configuration for StorageControl REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_project_intelligence_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_project_intelligence_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_project_intelligence_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the StorageControl API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_project_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_project_intelligence_config + ## + # RPC-specific configuration for `update_project_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_project_intelligence_config + ## + # RPC-specific configuration for `get_folder_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_folder_intelligence_config + ## + # RPC-specific configuration for `update_folder_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_folder_intelligence_config + ## + # RPC-specific configuration for `get_organization_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_intelligence_config + ## + # RPC-specific configuration for `update_organization_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_organization_intelligence_config + + # @private + def initialize parent_rpcs = nil + get_project_intelligence_config_config = parent_rpcs.get_project_intelligence_config if parent_rpcs.respond_to? :get_project_intelligence_config + @get_project_intelligence_config = ::Gapic::Config::Method.new get_project_intelligence_config_config + update_project_intelligence_config_config = parent_rpcs.update_project_intelligence_config if parent_rpcs.respond_to? :update_project_intelligence_config + @update_project_intelligence_config = ::Gapic::Config::Method.new update_project_intelligence_config_config + get_folder_intelligence_config_config = parent_rpcs.get_folder_intelligence_config if parent_rpcs.respond_to? :get_folder_intelligence_config + @get_folder_intelligence_config = ::Gapic::Config::Method.new get_folder_intelligence_config_config + update_folder_intelligence_config_config = parent_rpcs.update_folder_intelligence_config if parent_rpcs.respond_to? :update_folder_intelligence_config + @update_folder_intelligence_config = ::Gapic::Config::Method.new update_folder_intelligence_config_config + get_organization_intelligence_config_config = parent_rpcs.get_organization_intelligence_config if parent_rpcs.respond_to? :get_organization_intelligence_config + @get_organization_intelligence_config = ::Gapic::Config::Method.new get_organization_intelligence_config_config + update_organization_intelligence_config_config = parent_rpcs.update_organization_intelligence_config if parent_rpcs.respond_to? :update_organization_intelligence_config + @update_organization_intelligence_config = ::Gapic::Config::Method.new update_organization_intelligence_config_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-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb new file mode 100644 index 000000000000..5c5d5c81ed57 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb @@ -0,0 +1,452 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/storage/control/v2/storage_control_pb" + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + module Rest + ## + # REST service stub for the StorageControl service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_project_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def get_project_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_project_intelligence_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_project_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_project_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def update_project_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_project_intelligence_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_project_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_folder_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def get_folder_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_folder_intelligence_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_folder_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_folder_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def update_folder_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_folder_intelligence_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_folder_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_organization_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def get_organization_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_intelligence_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_organization_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_organization_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def update_organization_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_organization_intelligence_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_organization_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_project_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_project_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_project_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_project_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{intelligence_config.name}", + body: "intelligence_config", + matches: [ + ["intelligence_config.name", %r{^projects/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_folder_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_folder_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_folder_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_folder_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{intelligence_config.name}", + body: "intelligence_config", + matches: [ + ["intelligence_config.name", %r{^folders/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_organization_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_organization_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_organization_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_organization_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{intelligence_config.name}", + body: "intelligence_config", + matches: [ + ["intelligence_config.name", %r{^organizations/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb new file mode 100644 index 000000000000..41fdc28eedf0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/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 Storage + module Control + module V2 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb new file mode 100644 index 000000000000..c7b1ce8e75b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/storage/control/v2/storage_control.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/api/routing_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/storage/control/v2/storage_control.proto\x12\x19google.storage.control.v2\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\x18google/api/routing.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"+\n\x11PendingRenameInfo\x12\x16\n\toperation\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xe2\x02\n\x06\x46older\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\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\x12N\n\x13pending_rename_info\x18\x07 \x01(\x0b\x32,.google.storage.control.v2.PendingRenameInfoB\x03\xe0\x41\x03:l\xea\x41i\n\x1dstorage.googleapis.com/Folder\x12\x37projects/{project}/buckets/{bucket}/folders/{folder=**}*\x07\x66olders2\x06\x66older\"\xf4\x01\n\x10GetFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xd5\x01\n\x13\x43reateFolderRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x36\n\x06\x66older\x18\x02 \x01(\x0b\x32!.google.storage.control.v2.FolderB\x03\xe0\x41\x02\x12\x16\n\tfolder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\trecursive\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xf7\x01\n\x13\x44\x65leteFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8c\x02\n\x12ListFoldersRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\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\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdelimiter\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13lexicographic_start\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11lexicographic_end\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\t \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"b\n\x13ListFoldersResponse\x12\x32\n\x07\x66olders\x18\x01 \x03(\x0b\x32!.google.storage.control.v2.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9b\x02\n\x13RenameFolderRequest\x12\x33\n\x04name\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12\"\n\x15\x64\x65stination_folder_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12$\n\x17if_metageneration_match\x18\x04 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x05 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8a\x02\n\x1c\x44\x65leteFolderRecursiveRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12)\n\x17if_metageneration_match\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12-\n\x1bif_metageneration_not_match\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x9a\x02\n\"CommonLongRunningOperationMetadata\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\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1d\n\x10progress_percent\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\"\xa7\x01\n\x14RenameFolderMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x18\n\x10source_folder_id\x18\x02 \x01(\t\x12\x1d\n\x15\x64\x65stination_folder_id\x18\x03 \x01(\t\"\x8a\x01\n\x1d\x44\x65leteFolderRecursiveMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x11\n\tfolder_id\x18\x02 \x01(\t\"\xf8\x03\n\rStorageLayout\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08location\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rlocation_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x64\n\x17\x63ustom_placement_config\x18\x04 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.CustomPlacementConfigB\x03\xe0\x41\x03\x12\x63\n\x16hierarchical_namespace\x18\x05 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.HierarchicalNamespaceB\x03\xe0\x41\x03\x1a/\n\x15\x43ustomPlacementConfig\x12\x16\n\x0e\x64\x61ta_locations\x18\x01 \x03(\t\x1a(\n\x15HierarchicalNamespace\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08:{\xea\x41x\n$storage.googleapis.com/StorageLayout\x12\x31projects/{project}/buckets/{bucket}/storageLayout*\x0estorageLayouts2\rstorageLayout\"\x86\x01\n\x17GetStorageLayoutRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/StorageLayout\x12\x0e\n\x06prefix\x18\x02 \x01(\t\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xbf\x02\n\rManagedFolder\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\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:\x91\x01\xea\x41\x8d\x01\n$storage.googleapis.com/ManagedFolder\x12\x46projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}*\x0emanagedFolders2\rmanagedFolder\"\x82\x02\n\x17GetManagedFolderRequest\x12:\n\x04name\x18\x06 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xe2\x01\n\x1a\x43reateManagedFolderRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x45\n\x0emanaged_folder\x18\x02 \x01(\x0b\x32(.google.storage.control.v2.ManagedFolderB\x03\xe0\x41\x02\x12\x1e\n\x11managed_folder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x9e\x02\n\x1a\x44\x65leteManagedFolderRequest\x12:\n\x04name\x18\x07 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x17\n\x0f\x61llow_non_empty\x18\x05 \x01(\x08\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xc0\x01\n\x19ListManagedFoldersRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\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\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListManagedFoldersResponse\x12\x41\n\x0fmanaged_folders\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.ManagedFolder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x02\n\x1b\x43reateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x06 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x05 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xb0\x02\n\x1bUpdateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x05 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xa5\x03\n\rAnywhereCache\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\x04zone\x18\n \x01(\tB\x03\xe0\x41\x05\x12&\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10\x61\x64mission_policy\x18\t \x01(\t\x12\x12\n\x05state\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0epending_update\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03:\x8e\x01\xea\x41\x8a\x01\n$storage.googleapis.com/AnywhereCache\x12\x43projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}*\x0e\x61nywhereCaches2\ranywhereCache\"\xc2\x01\n\x1a\x43reateAnywhereCacheRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x45\n\x0e\x61nywhere_cache\x18\x03 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xba\x01\n\x1aUpdateAnywhereCacheRequest\x12\x45\n\x0e\x61nywhere_cache\x18\x01 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"z\n\x1b\x44isableAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x19PauseAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"y\n\x1aResumeAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"v\n\x17GetAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xa1\x01\n\x19ListAnywhereCachesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListAnywhereCachesResponse\x12\x41\n\x0f\x61nywhere_caches\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.AnywhereCache\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8e\x0e\n\x12IntelligenceConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12X\n\x0e\x65\x64ition_config\x18\x02 \x01(\x0e\x32;.google.storage.control.v2.IntelligenceConfig.EditionConfigB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x34.google.storage.control.v2.IntelligenceConfig.FilterB\x03\xe0\x41\x01\x12u\n\x1d\x65\x66\x66\x65\x63tive_intelligence_config\x18\x05 \x01(\x0b\x32I.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfigB\x03\xe0\x41\x03\x12O\n\x0ctrial_config\x18\x07 \x01(\x0b\x32\x39.google.storage.control.v2.IntelligenceConfig.TrialConfig\x1a\xfc\x04\n\x06\x46ilter\x12v\n included_cloud_storage_locations\x18\x01 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12v\n excluded_cloud_storage_locations\x18\x02 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12r\n\x1eincluded_cloud_storage_buckets\x18\x03 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x12r\n\x1e\x65xcluded_cloud_storage_buckets\x18\x04 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x1a/\n\x15\x43loudStorageLocations\x12\x16\n\tlocations\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a\x35\n\x13\x43loudStorageBuckets\x12\x1e\n\x11\x62ucket_id_regexes\x18\x01 \x03(\tB\x03\xe0\x41\x01\x42\x19\n\x17\x63loud_storage_locationsB\x17\n\x15\x63loud_storage_buckets\x1a\x8a\x02\n\x1b\x45\x66\x66\x65\x63tiveIntelligenceConfig\x12z\n\x11\x65\x66\x66\x65\x63tive_edition\x18\x01 \x01(\x0e\x32Z.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEditionB\x03\xe0\x41\x03\x12 \n\x13intelligence_config\x18\x02 \x01(\tB\x03\xe0\x41\x03\"M\n\x10\x45\x66\x66\x65\x63tiveEdition\x12!\n\x1d\x45\x46\x46\x45\x43TIVE_EDITION_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08STANDARD\x10\x02\x1a\x43\n\x0bTrialConfig\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\rEditionConfig\x12\x1e\n\x1a\x45\x44ITION_CONFIG_UNSPECIFIED\x10\x00\x12\x0b\n\x07INHERIT\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0c\n\x08STANDARD\x10\x03\x12\t\n\x05TRIAL\x10\x05:\x8b\x02\xea\x41\x87\x02\n)storage.googleapis.com/IntelligenceConfig\x12\x38\x66olders/{folder}/locations/{location}/intelligenceConfig\x12;organizations/{org}/locations/{location}/intelligenceConfig\x12:projects/{project}/locations/{location}/intelligenceConfig*\x13intelligenceConfigs2\x12intelligenceConfig\"\xd5\x01\n+UpdateOrganizationIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xcf\x01\n%UpdateFolderIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xd0\x01\n&UpdateProjectIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"k\n(GetOrganizationIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"e\n\"GetFolderIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"f\n#GetProjectIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig2\xd2,\n\x0eStorageControl\x12\x9a\x01\n\x0c\x43reateFolder\x12..google.storage.control.v2.CreateFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x17parent,folder,folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x8f\x01\n\x0c\x44\x65leteFolder\x12..google.storage.control.v2.DeleteFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\tGetFolder\x12+.google.storage.control.v2.GetFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\x0bListFolders\x12-.google.storage.control.v2.ListFoldersRequest\x1a..google.storage.control.v2.ListFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xcd\x01\n\x0cRenameFolder\x12..google.storage.control.v2.RenameFolderRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1e\n\x06\x46older\x12\x14RenameFolderMetadata\xda\x41\x1aname,destination_folder_id\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xe1\x01\n\x15\x44\x65leteFolderRecursive\x12\x37.google.storage.control.v2.DeleteFolderRecursiveRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x36\n\x15google.protobuf.Empty\x12\x1d\x44\x65leteFolderRecursiveMetadata\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetStorageLayout\x12\x32.google.storage.control.v2.GetStorageLayoutRequest\x1a(.google.storage.control.v2.StorageLayout\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xbf\x01\n\x13\x43reateManagedFolder\x12\x35.google.storage.control.v2.CreateManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"G\xda\x41\'parent,managed_folder,managed_folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x9d\x01\n\x13\x44\x65leteManagedFolder\x12\x35.google.storage.control.v2.DeleteManagedFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetManagedFolder\x12\x32.google.storage.control.v2.GetManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListManagedFolders\x12\x34.google.storage.control.v2.ListManagedFoldersRequest\x1a\x35.google.storage.control.v2.ListManagedFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd1\x01\n\x13\x43reateAnywhereCache\x12\x35.google.storage.control.v2.CreateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41,\n\rAnywhereCache\x12\x1b\x43reateAnywhereCacheMetadata\xda\x41\x15parent,anywhere_cache\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xf9\x01\n\x13UpdateAnywhereCache\x12\x35.google.storage.control.v2.UpdateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41,\n\rAnywhereCache\x12\x1bUpdateAnywhereCacheMetadata\xda\x41\x1a\x61nywhere_cache,update_mask\x8a\xd3\xe4\x93\x02\x39\x12\x37\n\x13\x61nywhere_cache.name\x12 {bucket=projects/*/buckets/*}/**\x12\xb1\x01\n\x14\x44isableAnywhereCache\x12\x36.google.storage.control.v2.DisableAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xad\x01\n\x12PauseAnywhereCache\x12\x34.google.storage.control.v2.PauseAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xaf\x01\n\x13ResumeAnywhereCache\x12\x35.google.storage.control.v2.ResumeAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetAnywhereCache\x12\x32.google.storage.control.v2.GetAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListAnywhereCaches\x12\x34.google.storage.control.v2.ListAnywhereCachesRequest\x1a\x35.google.storage.control.v2.ListAnywhereCachesResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd2\x01\n\x1cGetProjectIntelligenceConfig\x12>.google.storage.control.v2.GetProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v2/{name=projects/*/locations/*/intelligenceConfig}\x12\x9d\x02\n\x1fUpdateProjectIntelligenceConfig\x12\x41.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x87\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02_2H/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xcf\x01\n\x1bGetFolderIntelligenceConfig\x12=.google.storage.control.v2.GetFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v2/{name=folders/*/locations/*/intelligenceConfig}\x12\x9a\x02\n\x1eUpdateFolderIntelligenceConfig\x12@.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x86\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02^2G/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xe1\x01\n!GetOrganizationIntelligenceConfig\x12\x43.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v2/{name=organizations/*/locations/*/intelligenceConfig}\x12\xac\x02\n$UpdateOrganizationIntelligenceConfig\x12\x46.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x8c\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32M/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xa3\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\xda\x41\x08resource\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\xaa\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"_\xda\x41\x0fresource,policy\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\x96\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaa\x01\xda\x41\x14resource,permissions\x8a\xd3\xe4\x93\x02\x8c\x01\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12\x34\n\x08resource\x12({bucket=projects/*/buckets/*}/objects/**\x12;\n\x08resource\x12/{bucket=projects/*/buckets/*}/managedFolders/**\x1a\xa7\x02\xca\x41\x16storage.googleapis.com\xd2\x41\x8a\x02https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/devstorage.read_writeB\xa6\x02\n\x1d\x63om.google.storage.control.v2B\x13StorageControlProtoP\x01Z=cloud.google.com/go/storage/control/apiv2/controlpb;controlpb\xaa\x02\x1fGoogle.Cloud.Storage.Control.V2\xca\x02\x1fGoogle\\Cloud\\Storage\\Control\\V2\xea\x02#Google::Cloud::Storage::Control::V2\xea\x41\x44\n\x1dstorage.googleapis.com/Bucket\x12#projects/{project}/buckets/{bucket}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Storage + module Control + module V2 + PendingRenameInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.PendingRenameInfo").msgclass + Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.Folder").msgclass + GetFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetFolderRequest").msgclass + CreateFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateFolderRequest").msgclass + DeleteFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRequest").msgclass + ListFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersRequest").msgclass + ListFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersResponse").msgclass + RenameFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderRequest").msgclass + DeleteFolderRecursiveRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveRequest").msgclass + CommonLongRunningOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CommonLongRunningOperationMetadata").msgclass + RenameFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderMetadata").msgclass + DeleteFolderRecursiveMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveMetadata").msgclass + StorageLayout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout").msgclass + StorageLayout::CustomPlacementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.CustomPlacementConfig").msgclass + StorageLayout::HierarchicalNamespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.HierarchicalNamespace").msgclass + GetStorageLayoutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetStorageLayoutRequest").msgclass + ManagedFolder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ManagedFolder").msgclass + GetManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetManagedFolderRequest").msgclass + CreateManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateManagedFolderRequest").msgclass + DeleteManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteManagedFolderRequest").msgclass + ListManagedFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListManagedFoldersRequest").msgclass + ListManagedFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListManagedFoldersResponse").msgclass + CreateAnywhereCacheMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateAnywhereCacheMetadata").msgclass + UpdateAnywhereCacheMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateAnywhereCacheMetadata").msgclass + AnywhereCache = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.AnywhereCache").msgclass + CreateAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateAnywhereCacheRequest").msgclass + UpdateAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateAnywhereCacheRequest").msgclass + DisableAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DisableAnywhereCacheRequest").msgclass + PauseAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.PauseAnywhereCacheRequest").msgclass + ResumeAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ResumeAnywhereCacheRequest").msgclass + GetAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetAnywhereCacheRequest").msgclass + ListAnywhereCachesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListAnywhereCachesRequest").msgclass + ListAnywhereCachesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListAnywhereCachesResponse").msgclass + IntelligenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig").msgclass + IntelligenceConfig::Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter").msgclass + IntelligenceConfig::Filter::CloudStorageLocations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations").msgclass + IntelligenceConfig::Filter::CloudStorageBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets").msgclass + IntelligenceConfig::EffectiveIntelligenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig").msgclass + IntelligenceConfig::EffectiveIntelligenceConfig::EffectiveEdition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition").enummodule + IntelligenceConfig::TrialConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.TrialConfig").msgclass + IntelligenceConfig::EditionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EditionConfig").enummodule + UpdateOrganizationIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest").msgclass + UpdateFolderIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateFolderIntelligenceConfigRequest").msgclass + UpdateProjectIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateProjectIntelligenceConfigRequest").msgclass + GetOrganizationIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetOrganizationIntelligenceConfigRequest").msgclass + GetFolderIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetFolderIntelligenceConfigRequest").msgclass + GetProjectIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetProjectIntelligenceConfigRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb new file mode 100644 index 000000000000..e631a002bf14 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb @@ -0,0 +1,125 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/storage/control/v2/storage_control.proto for package 'Google.Cloud.Storage.Control.V2' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/storage/control/v2/storage_control_pb' + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + # StorageControl service includes selected control plane operations. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.storage.control.v2.StorageControl' + + # Creates a new folder. This operation is only applicable to a hierarchical + # namespace enabled bucket. + rpc :CreateFolder, ::Google::Cloud::Storage::Control::V2::CreateFolderRequest, ::Google::Cloud::Storage::Control::V2::Folder + # Permanently deletes an empty folder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + rpc :DeleteFolder, ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, ::Google::Protobuf::Empty + # Returns metadata for the specified folder. This operation is only + # applicable to a hierarchical namespace enabled bucket. + rpc :GetFolder, ::Google::Cloud::Storage::Control::V2::GetFolderRequest, ::Google::Cloud::Storage::Control::V2::Folder + # Retrieves a list of folders. This operation is only applicable to a + # hierarchical namespace enabled bucket. + rpc :ListFolders, ::Google::Cloud::Storage::Control::V2::ListFoldersRequest, ::Google::Cloud::Storage::Control::V2::ListFoldersResponse + # Renames a source folder to a destination folder. This operation is only + # applicable to a hierarchical namespace enabled bucket. During a rename, the + # source and destination folders are locked until the long running operation + # completes. + rpc :RenameFolder, ::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::Google::Longrunning::Operation + # Deletes a folder recursively. This operation is only applicable to a + # hierarchical namespace enabled bucket. + rpc :DeleteFolderRecursive, ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::Google::Longrunning::Operation + # Returns the storage layout configuration for a given bucket. + rpc :GetStorageLayout, ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::Google::Cloud::Storage::Control::V2::StorageLayout + # Creates a new managed folder. + rpc :CreateManagedFolder, ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, ::Google::Cloud::Storage::Control::V2::ManagedFolder + # Permanently deletes an empty managed folder. + rpc :DeleteManagedFolder, ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, ::Google::Protobuf::Empty + # Returns metadata for the specified managed folder. + rpc :GetManagedFolder, ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, ::Google::Cloud::Storage::Control::V2::ManagedFolder + # Retrieves a list of managed folders for a given bucket. + rpc :ListManagedFolders, ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, ::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse + # Creates an Anywhere Cache instance. + rpc :CreateAnywhereCache, ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, ::Google::Longrunning::Operation + # Updates an Anywhere Cache instance. Mutable fields include `ttl` and + # `admission_policy`. + rpc :UpdateAnywhereCache, ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, ::Google::Longrunning::Operation + # Disables an Anywhere Cache instance. A disabled instance is read-only. The + # disablement could be revoked by calling ResumeAnywhereCache. The cache + # instance will be deleted automatically if it remains in the disabled state + # for at least one hour. + rpc :DisableAnywhereCache, ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache + # Pauses an Anywhere Cache instance. + rpc :PauseAnywhereCache, ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache + # Resumes a disabled or paused Anywhere Cache instance. + rpc :ResumeAnywhereCache, ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache + # Gets an Anywhere Cache instance. + rpc :GetAnywhereCache, ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache + # Lists Anywhere Cache instances for a given bucket. + rpc :ListAnywhereCaches, ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse + # Returns the Project scoped singleton IntelligenceConfig resource. + rpc :GetProjectIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Updates the Project scoped singleton IntelligenceConfig resource. + rpc :UpdateProjectIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Returns the Folder scoped singleton IntelligenceConfig resource. + rpc :GetFolderIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Updates the Folder scoped singleton IntelligenceConfig resource. + rpc :UpdateFolderIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Returns the Organization scoped singleton IntelligenceConfig resource. + rpc :GetOrganizationIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Updates the Organization scoped singleton IntelligenceConfig resource. + rpc :UpdateOrganizationIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Gets the IAM policy for a specified bucket. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Updates an IAM policy for the specified bucket. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Tests a set of permissions on the given bucket, object, or managed folder + # to see which, if any, are held by the caller. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, + # `projects/_/buckets/{bucket}/objects/{object}` for an object, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md new file mode 100644 index 000000000000..1aefe1559ea2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Storage Control 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-storage-control-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/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-storage-control-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb new file mode 100644 index 000000000000..6d71a9430253 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb @@ -0,0 +1,463 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Specifies the routing information that should be sent along with the request + # in the form of routing header. + # **NOTE:** All service configuration rules follow the "last one wins" order. + # + # The examples below will apply to an RPC which has the following request type: + # + # Message Definition: + # + # message Request { + # // The name of the Table + # // Values can be of the following formats: + # // - `projects//tables/` + # // - `projects//instances//tables/
` + # // - `region//zones//tables/
` + # string table_name = 1; + # + # // This value specifies routing for replication. + # // It can be in the following formats: + # // - `profiles/` + # // - a legacy `profile_id` that can be any string + # string app_profile_id = 2; + # } + # + # Example message: + # + # { + # table_name: projects/proj_foo/instances/instance_bar/table/table_baz, + # app_profile_id: profiles/prof_qux + # } + # + # The routing header consists of one or multiple key-value pairs. The order of + # the key-value pairs is undefined, the order of the `routing_parameters` in + # the `RoutingRule` only matters for the evaluation order of the path + # templates when `field` is the same. See the examples below for more details. + # + # Every key and value in the routing header must be percent-encoded, + # and joined together in the following format: `key1=value1&key2=value2`. + # The examples below skip the percent-encoding for readability. + # + # Example 1 + # + # Extracting a field from the request to put into the routing header + # unchanged, with the key equal to the field name. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `app_profile_id`. + # routing_parameters { + # field: "app_profile_id" + # } + # }; + # + # result: + # + # x-goog-request-params: app_profile_id=profiles/prof_qux + # + # Example 2 + # + # Extracting a field from the request to put into the routing header + # unchanged, with the key different from the field name. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `app_profile_id`, but name it `routing_id` in the header. + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=profiles/prof_qux + # + # Example 3 + # + # Extracting a field from the request to put into the routing + # header, while matching a path template syntax on the field's value. + # + # NB: it is more useful to send nothing than to send garbage for the purpose + # of dynamic routing, since garbage pollutes cache. Thus the matching. + # + # Sub-example 3a + # + # The field matches the template. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed (with project-based + # // syntax). + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=projects/*/instances/*/**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_name=projects/proj_foo/instances/instance_bar/table/table_baz + # + # Sub-example 3b + # + # The field does not match the template. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed (with region-based + # // syntax). + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=regions/*/zones/*/**}" + # } + # }; + # + # result: + # + # + # + # Sub-example 3c + # + # Multiple alternative conflictingly named path templates are + # specified. The one that matches is used to construct the header. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed, whether + # // using the region- or projects-based syntax. + # + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=regions/*/zones/*/**}" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=projects/*/instances/*/**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_name=projects/proj_foo/instances/instance_bar/table/table_baz + # + # Example 4 + # + # Extracting a single routing header key-value pair by matching a + # template syntax on (a part of) a single request field. + # + # annotation: + # + # option (google.api.routing) = { + # // Take just the project id from the `table_name` field. + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=projects/proj_foo + # + # Example 5 + # + # Extracting a single routing header key-value pair by matching + # several conflictingly named path templates on (parts of) a single request + # field. The last template to match "wins" the conflict. + # + # annotation: + # + # option (google.api.routing) = { + # // If the `table_name` does not have instances information, + # // take just the project id for routing. + # // Otherwise take project + instance. + # + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*/instances/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: + # routing_id=projects/proj_foo/instances/instance_bar + # + # Example 6 + # + # Extracting multiple routing header key-value pairs by matching + # several non-conflicting path templates on (parts of) a single request field. + # + # Sub-example 6a + # + # Make the templates strict, so that if the `table_name` does not + # have an instance information, nothing is sent. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing code needs two keys instead of one composite + # // but works only for the tables with the "project-instance" name + # // syntax. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/instances/*/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{instance_id=instances/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: + # project_id=projects/proj_foo&instance_id=instances/instance_bar + # + # Sub-example 6b + # + # Make the templates loose, so that if the `table_name` does not + # have an instance information, just the project id part is sent. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing code wants two keys instead of one composite + # // but will work with just the `project_id` for tables without + # // an instance in the `table_name`. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{instance_id=instances/*}/**" + # } + # }; + # + # result (is the same as 6a for our example message because it has the instance + # information): + # + # x-goog-request-params: + # project_id=projects/proj_foo&instance_id=instances/instance_bar + # + # Example 7 + # + # Extracting multiple routing header key-value pairs by matching + # several path templates on multiple request fields. + # + # NB: note that here there is no way to specify sending nothing if one of the + # fields does not match its template. E.g. if the `table_name` is in the wrong + # format, the `project_id` will not be sent, but the `routing_id` will be. + # The backend routing code has to be aware of that and be prepared to not + # receive a full complement of keys if it expects multiple. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing needs both `project_id` and `routing_id` + # // (from the `app_profile_id` field) for routing. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # project_id=projects/proj_foo&routing_id=profiles/prof_qux + # + # Example 8 + # + # Extracting a single routing header key-value pair by matching + # several conflictingly named path templates on several request fields. The + # last template to match "wins" the conflict. + # + # annotation: + # + # option (google.api.routing) = { + # // The `routing_id` can be a project id or a region id depending on + # // the table name format, but only if the `app_profile_id` is not set. + # // If `app_profile_id` is set it should be used instead. + # + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=regions/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=profiles/prof_qux + # + # Example 9 + # + # Bringing it all together. + # + # annotation: + # + # option (google.api.routing) = { + # // For routing both `table_location` and a `routing_id` are needed. + # // + # // table_location can be either an instance id or a region+zone id. + # // + # // For `routing_id`, take the value of `app_profile_id` + # // - If it's in the format `profiles/`, send + # // just the `` part. + # // - If it's any other literal, send it as is. + # // If the `app_profile_id` is empty, and the `table_name` starts with + # // the project_id, send that instead. + # + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{table_location=instances/*}/tables/*" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{table_location=regions/*/zones/*}/tables/*" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "profiles/{routing_id=*}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_location=instances/instance_bar&routing_id=prof_qux + # @!attribute [rw] routing_parameters + # @return [::Array<::Google::Api::RoutingParameter>] + # A collection of Routing Parameter specifications. + # **NOTE:** If multiple Routing Parameters describe the same key + # (via the `path_template` field or via the `field` field when + # `path_template` is not provided), "last one wins" rule + # determines which Parameter gets used. + # See the examples for more details. + class RoutingRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A projection from an input message to the GRPC or REST header. + # @!attribute [rw] field + # @return [::String] + # A request field to extract the header key-value pair from. + # @!attribute [rw] path_template + # @return [::String] + # A pattern matching the key-value field. Optional. + # If not specified, the whole field specified in the `field` field will be + # taken as value, and its name used as key. If specified, it MUST contain + # exactly one named segment (along with any number of unnamed segments) The + # pattern will be matched over the field specified in the `field` field, then + # if the match is successful: + # - the name of the single named segment will be used as a header name, + # - the match value of the segment will be used as a header value; + # if the match is NOT successful, nothing will be sent. + # + # Example: + # + # -- This is a field in the request message + # | that the header value will be extracted from. + # | + # | -- This is the key name in the + # | | routing header. + # V | + # field: "table_name" v + # path_template: "projects/*/{table_location=instances/*}/tables/*" + # ^ ^ + # | | + # In the {} brackets is the pattern that -- | + # specifies what to extract from the | + # field as a value to be sent. | + # | + # The string in the field must match the whole pattern -- + # before brackets, inside brackets, after brackets. + # + # When looking at this specific example, we can see that: + # - A key-value pair with the key `table_location` + # and the value matching `instances/*` should be added + # to the x-goog-request-params routing header. + # - The value is extracted from the request message's `table_name` field + # if it matches the full pattern specified: + # `projects/*/instances/*/tables/*`. + # + # **NB:** If the `path_template` field is not provided, the key name is + # equal to the field name, and the whole field should be sent as a value. + # This makes the pattern for the field and the value functionally equivalent + # to `**`, and the configuration + # + # { + # field: "table_name" + # } + # + # is a functionally equivalent shorthand to: + # + # { + # field: "table_name" + # path_template: "{table_name=**}" + # } + # + # See Example 1 for more details. + class RoutingParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb new file mode 100644 index 000000000000..6ab7a9a20ea8 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb @@ -0,0 +1,1026 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Storage + module Control + module V2 + # Contains information about a pending rename operation. + # @!attribute [r] operation + # @return [::String] + # Output only. The name of the rename operation. + class PendingRenameInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A folder resource. This resource can only exist in a hierarchical namespace + # enabled bucket. + # @!attribute [rw] name + # @return [::String] + # Identifier. The name of this folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [r] metageneration + # @return [::Integer] + # Output only. The version of the metadata for this folder. Used for + # preconditions and for detecting changes in metadata. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time of the folder. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The modification time of the folder. + # @!attribute [r] pending_rename_info + # @return [::Google::Cloud::Storage::Control::V2::PendingRenameInfo] + # Output only. Only present if the folder is part of an ongoing RenameFolder + # operation. Contains information which can be used to query the operation + # status. The presence of this field also indicates all write operations are + # blocked for this folder, including folder, managed folder, and object + # operations. + class Folder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetFolder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration matches the given value. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration does not match the given value. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class GetFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateFolder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the bucket in which the folder will reside. The bucket + # must be a hierarchical namespace enabled bucket. + # @!attribute [rw] folder + # @return [::Google::Cloud::Storage::Control::V2::Folder] + # Required. Properties of the new folder being created. + # The bucket and name of the folder are specified in the parent and folder_id + # fields, respectively. Populating those fields in `folder` will result in an + # error. + # @!attribute [rw] folder_id + # @return [::String] + # Required. The full name of a folder, including all its parent folders. + # Folders use single '/' characters as a delimiter. + # The folder_id must end with a slash. + # For example, the folder_id of "books/biographies/" would create a new + # "biographies/" folder under the "books/" folder. + # @!attribute [rw] recursive + # @return [::Boolean] + # Optional. If true, parent folder doesn't have to be present and all missing + # ancestor folders will be created atomically. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class CreateFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteFolder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration matches the given value. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration does not match the given value. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class DeleteFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListFolders. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the bucket in which to look for folders. The bucket must + # be a hierarchical namespace enabled bucket. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of folders to return in a single response. The + # service will use this parameter or 1,000 items, whichever is smaller. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A previously-returned page token representing part of the larger + # set of results to view. + # @!attribute [rw] prefix + # @return [::String] + # Optional. Filter results to folders whose names begin with this prefix. + # If set, the value must either be an empty string or end with a '/'. + # @!attribute [rw] delimiter + # @return [::String] + # Optional. If set, returns results in a directory-like mode. The results + # will only include folders that either exactly match the above prefix, or + # are one level below the prefix. The only supported value is '/'. + # @!attribute [rw] lexicographic_start + # @return [::String] + # Optional. Filter results to folders whose names are lexicographically equal + # to or after lexicographic_start. If lexicographic_end is also set, the + # folders listed have names between lexicographic_start (inclusive) and + # lexicographic_end (exclusive). + # @!attribute [rw] lexicographic_end + # @return [::String] + # Optional. Filter results to folders whose names are lexicographically + # before lexicographic_end. If lexicographic_start is also set, the folders + # listed have names between lexicographic_start (inclusive) and + # lexicographic_end (exclusive). + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class ListFoldersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListFolders. + # @!attribute [rw] folders + # @return [::Array<::Google::Cloud::Storage::Control::V2::Folder>] + # The list of child folders + # @!attribute [rw] next_page_token + # @return [::String] + # The continuation token, used to page through large result sets. Provide + # this value in a subsequent request to return the next page of results. + class ListFoldersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for RenameFolder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the source folder being renamed. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [rw] destination_folder_id + # @return [::String] + # Required. The destination folder ID, e.g. `foo/bar/`. + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the source + # folder's current metageneration matches the given value. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the source + # folder's current metageneration does not match the given value. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class RenameFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteFolderRecursive. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the folder being deleted, however all of its contents + # will be deleted too. Format: + # `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration matches the given value. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration does not match the given value. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class DeleteFolderRecursiveRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message contains metadata that is common to all Storage Control + # long-running operations, present in its `google.longrunning.Operation` + # messages, and accessible via `metadata.common_metadata`. + # @!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] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was last modified. + # @!attribute [r] type + # @return [::String] + # Output only. The type of operation invoked. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation. + # @!attribute [r] progress_percent + # @return [::Integer] + # Output only. The estimated progress of the operation in percentage [0, + # 100]. The value -1 means the progress is unknown. + class CommonLongRunningOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned in the metadata field of the Operation resource for + # RenameFolder operations. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] + # Generic metadata for the long running operation. + # @!attribute [rw] source_folder_id + # @return [::String] + # The path of the source folder. + # @!attribute [rw] destination_folder_id + # @return [::String] + # The path of the destination folder. + class RenameFolderMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned in the metadata field of the Operation resource for + # DeleteFolderRecursive operations. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] + # Generic metadata for the long running operation. + # @!attribute [rw] folder_id + # @return [::String] + # The path of the folder recursively deleted. + class DeleteFolderRecursiveMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The storage layout configuration of a bucket. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the StorageLayout resource. + # Format: `projects/{project}/buckets/{bucket}/storageLayout` + # @!attribute [r] location + # @return [::String] + # Output only. The location of the bucket. + # @!attribute [r] location_type + # @return [::String] + # Output only. The location type of the bucket (region, dual-region, + # multi-region, etc). + # @!attribute [r] custom_placement_config + # @return [::Google::Cloud::Storage::Control::V2::StorageLayout::CustomPlacementConfig] + # Output only. The data placement configuration for custom dual region. If + # there is no configuration, this is not a custom dual region bucket. + # @!attribute [r] hierarchical_namespace + # @return [::Google::Cloud::Storage::Control::V2::StorageLayout::HierarchicalNamespace] + # Output only. The bucket's hierarchical namespace configuration. If there is + # no configuration, the hierarchical namespace is disabled. + class StorageLayout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for Custom Dual Regions. It should specify precisely two + # eligible regions within the same Multiregion. More information on regions + # may be found [here](https://cloud.google.com/storage/docs/locations). + # @!attribute [rw] data_locations + # @return [::Array<::String>] + # List of locations to use for data placement. + class CustomPlacementConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for a bucket's hierarchical namespace feature. + # @!attribute [rw] enabled + # @return [::Boolean] + # Enables the hierarchical namespace feature. + class HierarchicalNamespace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for GetStorageLayout. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the StorageLayout resource. + # Format: `projects/{project}/buckets/{bucket}/storageLayout` + # @!attribute [rw] prefix + # @return [::String] + # An optional prefix used for permission check. It is useful when the caller + # only has limited permissions under a specific prefix. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class GetStorageLayoutRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A managed folder. + # @!attribute [rw] name + # @return [::String] + # Identifier. The name of this managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @!attribute [r] metageneration + # @return [::Integer] + # Output only. The metadata version of this managed folder. It increases + # whenever the metadata is updated. Used for preconditions and for detecting + # changes in metadata. Managed folders don't have a generation number. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time of the managed folder. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The modification time of the managed folder. + class ManagedFolder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetManagedFolder. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration matching the value here specified. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration NOT matching the value here specified. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class GetManagedFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateManagedFolder. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the bucket this managed folder belongs to. + # @!attribute [rw] managed_folder + # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # Required. Properties of the managed folder being created. + # The bucket and managed folder names are specified in the `parent` and + # `managed_folder_id` fields. Populating these fields in `managed_folder` + # will result in an error. + # @!attribute [rw] managed_folder_id + # @return [::String] + # Required. The name of the managed folder. It uses a single `/` as delimiter + # and leading and trailing `/` are allowed. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class CreateManagedFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DeleteManagedFolder RPC request message. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration matching the value here specified. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration NOT matching the value here specified. + # @!attribute [rw] allow_non_empty + # @return [::Boolean] + # Allows deletion of a managed folder even if it is not empty. + # A managed folder is empty if it manages no child managed folders or + # objects. Caller must have permission for + # storage.managedFolders.setIamPolicy. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class DeleteManagedFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListManagedFolders. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the bucket this managed folder belongs to. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of managed folders to return in a single response. + # The service will use this parameter or 1,000 items, whichever is smaller. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A previously-returned page token representing part of the larger + # set of results to view. + # @!attribute [rw] prefix + # @return [::String] + # Optional. Filter results to match managed folders with name starting with + # this prefix. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class ListManagedFoldersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListManagedFolders. + # @!attribute [rw] managed_folders + # @return [::Array<::Google::Cloud::Storage::Control::V2::ManagedFolder>] + # The list of matching managed folders + # @!attribute [rw] next_page_token + # @return [::String] + # The continuation token, used to page through large result sets. Provide + # this value in a subsequent request to return the next page of results. + class ListManagedFoldersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned in the metadata field of the Operation resource for + # CreateAnywhereCache operations. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] + # Generic metadata for the long running operation. + # @!attribute [rw] anywhere_cache_id + # @return [::String] + # Anywhere Cache ID. + # @!attribute [rw] zone + # @return [::String] + # The zone in which the cache instance is running. For example, + # us-central1-a. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Anywhere Cache entry's TTL. A cache-level config that is applied to all new + # cache entries on admission. Default ttl value (24hrs) is applied if not + # specified in the create request. + # @!attribute [rw] admission_policy + # @return [::String] + # Anywhere Cache entry Admission Policy in kebab-case (e.g., + # "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is + # applied if not specified in the create request. + class CreateAnywhereCacheMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned in the metadata field of the Operation resource for + # UpdateAnywhereCache operation. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] + # Generic metadata for the long running operation. + # @!attribute [rw] anywhere_cache_id + # @return [::String] + # Anywhere Cache ID. + # @!attribute [rw] zone + # @return [::String] + # The zone in which the cache instance is running. For example, + # us-central1-a. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that + # is applied to all new cache entries on admission. If `ttl` is pending + # update, this field equals to the new value specified in the Update request. + # @!attribute [rw] admission_policy + # @return [::String] + # L4 Cache entry Admission Policy in kebab-case (e.g., + # "admit-on-first-miss"). If `admission_policy` is pending + # update, this field equals to the new value specified in the Update request. + class UpdateAnywhereCacheMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An Anywhere Cache Instance. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name of this AnywhereCache. + # Format: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] zone + # @return [::String] + # Immutable. The zone in which the cache instance is running. For example, + # us-central1-a. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Cache entry TTL (ranges between 1h to 7d). This is a cache-level config + # that defines how long a cache entry can live. Default ttl value (24hrs) + # is applied if not specified in the create request. TTL must be in whole + # seconds. + # @!attribute [rw] admission_policy + # @return [::String] + # Cache admission policy. Valid policies includes: + # `admit-on-first-miss` and `admit-on-second-miss`. Defaults to + # `admit-on-first-miss`. Default value is applied if not specified in the + # create request. + # @!attribute [r] state + # @return [::String] + # Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when Anywhere cache instance is allocated. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when Anywhere cache instance is last updated, including + # creation. + # @!attribute [r] pending_update + # @return [::Boolean] + # Output only. True if there is an active update operation against this cache + # instance. Subsequential update requests will be rejected if this field is + # true. Output only. + class AnywhereCache + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateAnywhereCache. + # @!attribute [rw] parent + # @return [::String] + # Required. The bucket to which this cache belongs. + # Format: `projects/{project}/buckets/{bucket}` + # @!attribute [rw] anywhere_cache + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # Required. Properties of the Anywhere Cache instance being created. + # The parent bucket name is specified in the `parent` field. Server uses the + # default value of `ttl` or `admission_policy` if not specified in + # request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class CreateAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateAnywhereCache. + # @!attribute [rw] anywhere_cache + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # Required. The Anywhere Cache instance to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated. Mutable fields of AnywhereCache + # include `ttl` and `admission_policy`. + # + # To specify ALL fields, specify a single field with the value `*`. Note: We + # recommend against doing this. If a new field is introduced at a later time, + # an older client updating with the `*` may accidentally reset the new + # field's value. + # + # Not specifying any fields is an error. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class UpdateAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DisableAnywhereCache. + # @!attribute [rw] name + # @return [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class DisableAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for PauseAnywhereCache. + # @!attribute [rw] name + # @return [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class PauseAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ResumeAnywhereCache. + # @!attribute [rw] name + # @return [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class ResumeAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetAnywhereCache. + # @!attribute [rw] name + # @return [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class GetAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListAnywhereCaches. + # @!attribute [rw] parent + # @return [::String] + # Required. The bucket to which this cache belongs. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of caches to return in a single response. + # The service will use this parameter or 1,000 items, whichever is smaller. + # @!attribute [rw] page_token + # @return [::String] + # A previously-returned page token representing part of the larger set of + # results to view. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class ListAnywhereCachesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListAnywhereCaches. + # @!attribute [rw] anywhere_caches + # @return [::Array<::Google::Cloud::Storage::Control::V2::AnywhereCache>] + # The list of items. + # @!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 ListAnywhereCachesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The `IntelligenceConfig` resource associated with your organization, folder, + # or project. + # @!attribute [rw] name + # @return [::String] + # Identifier. The name of the `IntelligenceConfig` resource associated with + # your organization, folder, or project. + # + # The name format varies based on the GCP resource hierarchy as follows: + # + # * For project: + # `projects/{project_number}/locations/global/intelligenceConfig` + # * For organization: + # `organizations/{org_id}/locations/global/intelligenceConfig` + # * For folder: `folders/{folder_id}/locations/global/intelligenceConfig` + # @!attribute [rw] edition_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EditionConfig] + # Optional. The edition configuration of the `IntelligenceConfig` resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the `IntelligenceConfig` resource is last + # updated. + # @!attribute [rw] filter + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter] + # Optional. Filter over location and bucket. + # @!attribute [r] effective_intelligence_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EffectiveIntelligenceConfig] + # Output only. The `IntelligenceConfig` resource that is applicable for the + # resource. + # @!attribute [rw] trial_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::TrialConfig] + # The trial configuration of the `IntelligenceConfig` resource. + class IntelligenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Filter over location and bucket using include or exclude semantics. + # Resources that match the include or exclude filter are exclusively included + # or excluded from the Storage Intelligence plan. + # @!attribute [rw] included_cloud_storage_locations + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageLocations] + # Bucket locations to include. + # + # Note: The following fields are mutually exclusive: `included_cloud_storage_locations`, `excluded_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] excluded_cloud_storage_locations + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageLocations] + # Bucket locations to exclude. + # + # Note: The following fields are mutually exclusive: `excluded_cloud_storage_locations`, `included_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] included_cloud_storage_buckets + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageBuckets] + # Buckets to include. + # + # Note: The following fields are mutually exclusive: `included_cloud_storage_buckets`, `excluded_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] excluded_cloud_storage_buckets + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageBuckets] + # Buckets to exclude. + # + # Note: The following fields are mutually exclusive: `excluded_cloud_storage_buckets`, `included_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Filter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Collection of bucket locations. + # @!attribute [rw] locations + # @return [::Array<::String>] + # Optional. Bucket locations. Location can be any of the Cloud Storage + # regions specified in lower case format. For example, `us-east1`, + # `us-west1`. + class CloudStorageLocations + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Collection of buckets. + # @!attribute [rw] bucket_id_regexes + # @return [::Array<::String>] + # Optional. A regex pattern for matching bucket names. Regex should + # follow the syntax specified in + # [google/re2](https://github.com/google/re2). For example, + # `^sample_.*` matches all buckets of the form + # `gs://sample_bucket-1`, `gs://sample_bucket-2`, + # `gs://sample_bucket-n` but not `gs://test_sample_bucket`. + # If you want to match a single bucket, say `gs://sample_bucket`, + # use `sample_bucket`. + class CloudStorageBuckets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The effective `IntelligenceConfig` for the resource. + # @!attribute [r] effective_edition + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EffectiveIntelligenceConfig::EffectiveEdition] + # Output only. The `IntelligenceConfig` edition that is applicable for the + # resource. + # @!attribute [r] intelligence_config + # @return [::String] + # Output only. The `IntelligenceConfig` resource that is applied for the + # target resource. Format: + # `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig` + class EffectiveIntelligenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The effective edition of the `IntelligenceConfig` resource. + module EffectiveEdition + # This is an unknown edition of the resource. + EFFECTIVE_EDITION_UNSPECIFIED = 0 + + # No edition. + NONE = 1 + + # The `IntelligenceConfig` resource is of STANDARD edition. + STANDARD = 2 + end + end + + # The trial configuration of the `IntelligenceConfig` resource. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the trial expires. + class TrialConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The edition configuration of the `IntelligenceConfig` resource. This + # signifies the edition used for configuring the `IntelligenceConfig` + # resource and can only take the following values: + # `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and + # `TRIAL`. + module EditionConfig + # This is an unknown edition of the resource. + EDITION_CONFIG_UNSPECIFIED = 0 + + # The inherited edition from the parent and filters. This is the default + # edition when there is no `IntelligenceConfig` setup for a GCP resource. + INHERIT = 1 + + # The edition configuration is disabled for the `IntelligenceConfig` + # resource and its children. Filters are not applicable. + DISABLED = 2 + + # The `IntelligenceConfig` resource is of STANDARD edition. + STANDARD = 3 + + # The `IntelligenceConfig` resource is available in `TRIAL` edition. During + # the trial period, Cloud Storage does not charge for Storage Intelligence + # usage. You can specify the buckets to include in the trial period by + # using filters. At the end of the trial period, the `IntelligenceConfig` + # resource is upgraded to `STANDARD` edition. + TRIAL = 5 + end + end + + # Request message to update the `IntelligenceConfig` resource associated with + # your organization. + # + # **IAM Permissions**: + # + # Requires `storage.intelligenceConfigs.update` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the organization. + # @!attribute [rw] intelligence_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # Required. The `IntelligenceConfig` resource to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + class UpdateOrganizationIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to update the `IntelligenceConfig` resource associated with + # your folder. + # + # **IAM Permissions**: + # + # Requires `storage.intelligenceConfigs.update` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the folder. + # @!attribute [rw] intelligence_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # Required. The `IntelligenceConfig` resource to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + class UpdateFolderIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to update the `IntelligenceConfig` resource associated with + # your project. + # + # **IAM Permissions**: + # + # Requires `storage.intelligenceConfigs.update` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the folder. + # @!attribute [rw] intelligence_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # Required. The `IntelligenceConfig` resource to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + class UpdateProjectIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get the `IntelligenceConfig` resource associated with your + # organization. + # + # **IAM Permissions** + # + # Requires `storage.intelligenceConfigs.get` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the organization. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your organization. + # + # Format: `organizations/{org_id}/locations/global/intelligenceConfig` + class GetOrganizationIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get the `IntelligenceConfig` resource associated with your + # folder. + # + # **IAM Permissions** + # + # Requires `storage.intelligenceConfigs.get` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the folder. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your folder. + # + # Format: `folders/{id}/locations/global/intelligenceConfig` + class GetFolderIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get the `IntelligenceConfig` resource associated with your + # project. + # + # **IAM Permissions**: + # + # Requires `storage.intelligenceConfigs.get` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission + # on the project. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your project. + # + # Format: `projects/{id}/locations/global/intelligenceConfig` + class GetProjectIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile new file mode 100644 index 000000000000..2d9a5aa92db0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2", path: "../" +else + gem "google-cloud-storage-control-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-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json b/owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json new file mode 100644 index 000000000000..79b7fb355379 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json @@ -0,0 +1,1095 @@ +{ + "client_library": { + "name": "google-cloud-storage-control-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.storage.control.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "storage_v2_generated_StorageControl_CreateFolder_sync", + "title": "Snippet for the create_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder.", + "file": "storage_control/create_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::CreateFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::Folder", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "CreateFolder", + "full_name": "google.storage.control.v2.StorageControl.CreateFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_DeleteFolder_sync", + "title": "Snippet for the delete_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder.", + "file": "storage_control/delete_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::DeleteFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "DeleteFolder", + "full_name": "google.storage.control.v2.StorageControl.DeleteFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetFolder_sync", + "title": "Snippet for the get_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder.", + "file": "storage_control/get_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::Folder", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetFolder", + "full_name": "google.storage.control.v2.StorageControl.GetFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_ListFolders_sync", + "title": "Snippet for the list_folders call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders.", + "file": "storage_control/list_folders.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_folders", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::ListFoldersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ListFoldersResponse", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "ListFolders", + "full_name": "google.storage.control.v2.StorageControl.ListFolders", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_RenameFolder_sync", + "title": "Snippet for the rename_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder.", + "file": "storage_control/rename_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "rename_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::RenameFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "RenameFolder", + "full_name": "google.storage.control.v2.StorageControl.RenameFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_DeleteFolderRecursive_sync", + "title": "Snippet for the delete_folder_recursive call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive.", + "file": "storage_control/delete_folder_recursive.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_folder_recursive", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "DeleteFolderRecursive", + "full_name": "google.storage.control.v2.StorageControl.DeleteFolderRecursive", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetStorageLayout_sync", + "title": "Snippet for the get_storage_layout call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout.", + "file": "storage_control/get_storage_layout.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_storage_layout", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::StorageLayout", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetStorageLayout", + "full_name": "google.storage.control.v2.StorageControl.GetStorageLayout", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_CreateManagedFolder_sync", + "title": "Snippet for the create_managed_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder.", + "file": "storage_control/create_managed_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_managed_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ManagedFolder", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "CreateManagedFolder", + "full_name": "google.storage.control.v2.StorageControl.CreateManagedFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_DeleteManagedFolder_sync", + "title": "Snippet for the delete_managed_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder.", + "file": "storage_control/delete_managed_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_managed_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "DeleteManagedFolder", + "full_name": "google.storage.control.v2.StorageControl.DeleteManagedFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetManagedFolder_sync", + "title": "Snippet for the get_managed_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder.", + "file": "storage_control/get_managed_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_managed_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ManagedFolder", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetManagedFolder", + "full_name": "google.storage.control.v2.StorageControl.GetManagedFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_ListManagedFolders_sync", + "title": "Snippet for the list_managed_folders call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders.", + "file": "storage_control/list_managed_folders.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_managed_folders", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "ListManagedFolders", + "full_name": "google.storage.control.v2.StorageControl.ListManagedFolders", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_CreateAnywhereCache_sync", + "title": "Snippet for the create_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache.", + "file": "storage_control/create_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "CreateAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.CreateAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_UpdateAnywhereCache_sync", + "title": "Snippet for the update_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache.", + "file": "storage_control/update_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "UpdateAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.UpdateAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_DisableAnywhereCache_sync", + "title": "Snippet for the disable_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache.", + "file": "storage_control/disable_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "DisableAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.DisableAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_PauseAnywhereCache_sync", + "title": "Snippet for the pause_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache.", + "file": "storage_control/pause_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "PauseAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.PauseAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_ResumeAnywhereCache_sync", + "title": "Snippet for the resume_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache.", + "file": "storage_control/resume_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "ResumeAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.ResumeAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetAnywhereCache_sync", + "title": "Snippet for the get_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache.", + "file": "storage_control/get_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.GetAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_ListAnywhereCaches_sync", + "title": "Snippet for the list_anywhere_caches call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches.", + "file": "storage_control/list_anywhere_caches.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_anywhere_caches", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "ListAnywhereCaches", + "full_name": "google.storage.control.v2.StorageControl.ListAnywhereCaches", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync", + "title": "Snippet for the get_project_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config.", + "file": "storage_control/get_project_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_project_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetProjectIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.GetProjectIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync", + "title": "Snippet for the update_project_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config.", + "file": "storage_control/update_project_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_project_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "UpdateProjectIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.UpdateProjectIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync", + "title": "Snippet for the get_folder_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config.", + "file": "storage_control/get_folder_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_folder_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetFolderIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.GetFolderIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync", + "title": "Snippet for the update_folder_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config.", + "file": "storage_control/update_folder_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_folder_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "UpdateFolderIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.UpdateFolderIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync", + "title": "Snippet for the get_organization_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config.", + "file": "storage_control/get_organization_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_organization_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetOrganizationIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.GetOrganizationIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync", + "title": "Snippet for the update_organization_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config.", + "file": "storage_control/update_organization_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_organization_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "UpdateOrganizationIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.UpdateOrganizationIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy.", + "file": "storage_control/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.storage.control.v2.StorageControl.GetIamPolicy", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy.", + "file": "storage_control/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.storage.control.v2.StorageControl.SetIamPolicy", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions.", + "file": "storage_control/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.storage.control.v2.StorageControl.TestIamPermissions", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "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-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb new file mode 100644 index 000000000000..bbd8060b1bd0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_CreateAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the create_anywhere_cache call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache. +# +def create_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new + + # Call the create_anywhere_cache method. + result = client.create_anywhere_cache request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storage_v2_generated_StorageControl_CreateAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb new file mode 100644 index 000000000000..dd92a948086e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_CreateFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the create_folder call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder. +# +def create_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::CreateFolderRequest.new + + # Call the create_folder method. + result = client.create_folder request + + # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. + p result +end +# [END storage_v2_generated_StorageControl_CreateFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb new file mode 100644 index 000000000000..e1fb93270c88 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_CreateManagedFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the create_managed_folder call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder. +# +def create_managed_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new + + # Call the create_managed_folder method. + result = client.create_managed_folder request + + # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. + p result +end +# [END storage_v2_generated_StorageControl_CreateManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb new file mode 100644 index 000000000000..6527be8b6351 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_DeleteFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the delete_folder call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder. +# +def delete_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new + + # Call the delete_folder method. + result = client.delete_folder request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storage_v2_generated_StorageControl_DeleteFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb new file mode 100644 index 000000000000..5e4a473b6602 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_DeleteFolderRecursive_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the delete_folder_recursive call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive. +# +def delete_folder_recursive + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new + + # Call the delete_folder_recursive method. + result = client.delete_folder_recursive request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storage_v2_generated_StorageControl_DeleteFolderRecursive_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb new file mode 100644 index 000000000000..cc6a608ab87f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_DeleteManagedFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the delete_managed_folder call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder. +# +def delete_managed_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new + + # Call the delete_managed_folder method. + result = client.delete_managed_folder request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storage_v2_generated_StorageControl_DeleteManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb new file mode 100644 index 000000000000..c2a2b8e4c3b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_DisableAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the disable_anywhere_cache call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache. +# +def disable_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new + + # Call the disable_anywhere_cache method. + result = client.disable_anywhere_cache request + + # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + p result +end +# [END storage_v2_generated_StorageControl_DisableAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb new file mode 100644 index 000000000000..e71ce4780d7a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_anywhere_cache call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache. +# +def get_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new + + # Call the get_anywhere_cache method. + result = client.get_anywhere_cache request + + # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + p result +end +# [END storage_v2_generated_StorageControl_GetAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb new file mode 100644 index 000000000000..a48c2019212e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_folder call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder. +# +def get_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetFolderRequest.new + + # Call the get_folder method. + result = client.get_folder request + + # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. + p result +end +# [END storage_v2_generated_StorageControl_GetFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb new file mode 100644 index 000000000000..dad8ed93e7ba --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_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 storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_folder_intelligence_config call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config. +# +def get_folder_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new + + # Call the get_folder_intelligence_config method. + result = client.get_folder_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb new file mode 100644 index 000000000000..349e334e7668 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetIamPolicy_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_iam_policy call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END storage_v2_generated_StorageControl_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb new file mode 100644 index 000000000000..4456c65ead42 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetManagedFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_managed_folder call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder. +# +def get_managed_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new + + # Call the get_managed_folder method. + result = client.get_managed_folder request + + # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. + p result +end +# [END storage_v2_generated_StorageControl_GetManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb new file mode 100644 index 000000000000..3843e092f909 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_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 storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_organization_intelligence_config call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config. +# +def get_organization_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new + + # Call the get_organization_intelligence_config method. + result = client.get_organization_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb new file mode 100644 index 000000000000..63b47d76f5ce --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_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 storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_project_intelligence_config call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config. +# +def get_project_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new + + # Call the get_project_intelligence_config method. + result = client.get_project_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb new file mode 100644 index 000000000000..b032cc0443a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetStorageLayout_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_storage_layout call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout. +# +def get_storage_layout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new + + # Call the get_storage_layout method. + result = client.get_storage_layout request + + # The returned object is of type Google::Cloud::Storage::Control::V2::StorageLayout. + p result +end +# [END storage_v2_generated_StorageControl_GetStorageLayout_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb new file mode 100644 index 000000000000..125771ab1c46 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.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 storage_v2_generated_StorageControl_ListAnywhereCaches_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the list_anywhere_caches call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches. +# +def list_anywhere_caches + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new + + # Call the list_anywhere_caches method. + result = client.list_anywhere_caches request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Storage::Control::V2::AnywhereCache. + p item + end +end +# [END storage_v2_generated_StorageControl_ListAnywhereCaches_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb new file mode 100644 index 000000000000..a14428976afa --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_ListFolders_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the list_folders call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders. +# +def list_folders + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::ListFoldersRequest.new + + # Call the list_folders method. + result = client.list_folders request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Storage::Control::V2::Folder. + p item + end +end +# [END storage_v2_generated_StorageControl_ListFolders_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb new file mode 100644 index 000000000000..199fdd2fb572 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_ListManagedFolders_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the list_managed_folders call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders. +# +def list_managed_folders + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new + + # Call the list_managed_folders method. + result = client.list_managed_folders request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Storage::Control::V2::ManagedFolder. + p item + end +end +# [END storage_v2_generated_StorageControl_ListManagedFolders_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb new file mode 100644 index 000000000000..ba92a11e170d --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_PauseAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the pause_anywhere_cache call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache. +# +def pause_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new + + # Call the pause_anywhere_cache method. + result = client.pause_anywhere_cache request + + # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + p result +end +# [END storage_v2_generated_StorageControl_PauseAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb new file mode 100644 index 000000000000..f44abdfe039b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_RenameFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the rename_folder call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder. +# +def rename_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::RenameFolderRequest.new + + # Call the rename_folder method. + result = client.rename_folder request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storage_v2_generated_StorageControl_RenameFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb new file mode 100644 index 000000000000..4302ff5de677 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_ResumeAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the resume_anywhere_cache call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache. +# +def resume_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new + + # Call the resume_anywhere_cache method. + result = client.resume_anywhere_cache request + + # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + p result +end +# [END storage_v2_generated_StorageControl_ResumeAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb new file mode 100644 index 000000000000..e73a4d5d1de2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_SetIamPolicy_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the set_iam_policy call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END storage_v2_generated_StorageControl_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb new file mode 100644 index 000000000000..485086025053 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_TestIamPermissions_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the test_iam_permissions call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END storage_v2_generated_StorageControl_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb new file mode 100644 index 000000000000..57d4f56505f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_UpdateAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the update_anywhere_cache call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache. +# +def update_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new + + # Call the update_anywhere_cache method. + result = client.update_anywhere_cache request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storage_v2_generated_StorageControl_UpdateAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb new file mode 100644 index 000000000000..c44d13080aa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_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 storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the update_folder_intelligence_config call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config. +# +def update_folder_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new + + # Call the update_folder_intelligence_config method. + result = client.update_folder_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb new file mode 100644 index 000000000000..150381470100 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_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 storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the update_organization_intelligence_config call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config. +# +def update_organization_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new + + # Call the update_organization_intelligence_config method. + result = client.update_organization_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb new file mode 100644 index 000000000000..56d206d78ff1 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_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 storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the update_project_intelligence_config call in the StorageControl service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config. +# +def update_project_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new + + # Call the update_project_intelligence_config method. + result = client.update_project_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb new file mode 100644 index 000000000000..39b7bd9a10d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_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/storage/control/v2/storage_control_pb" +require "google/storage/control/v2/storage_control_services_pb" +require "google/cloud/storage/control/v2/storage_control" + +class ::Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb new file mode 100644 index 000000000000..77eb67a52960 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/storage/control/v2/storage_control" + +class ::Google::Cloud::Storage::Control::V2::StorageControl::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_anywhere_cache_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.anywhere_cache_path project: "value0", bucket: "value1", anywhere_cache: "value2" + assert_equal "projects/value0/buckets/value1/anywhereCaches/value2", path + end + end + + def test_bucket_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.bucket_path project: "value0", bucket: "value1" + assert_equal "projects/value0/buckets/value1", path + end + end + + def test_folder_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.folder_path project: "value0", bucket: "value1", folder: "value2" + assert_equal "projects/value0/buckets/value1/folders/value2", path + end + end + + def test_intelligence_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::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intelligence_config_path folder: "value0", location: "value1" + assert_equal "folders/value0/locations/value1/intelligenceConfig", path + + path = client.intelligence_config_path org: "value0", location: "value1" + assert_equal "organizations/value0/locations/value1/intelligenceConfig", path + + path = client.intelligence_config_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/intelligenceConfig", path + end + end + + def test_managed_folder_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.managed_folder_path project: "value0", bucket: "value1", managed_folder: "value2" + assert_equal "projects/value0/buckets/value1/managedFolders/value2", path + end + end + + def test_storage_layout_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.storage_layout_path project: "value0", bucket: "value1" + assert_equal "projects/value0/buckets/value1/storageLayout", path + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb new file mode 100644 index 000000000000..e8890b18eec3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb @@ -0,0 +1,429 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/storage/control/v2/storage_control_pb" +require "google/cloud/storage/control/v2/storage_control/rest" + + +class ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_project_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_project_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_project_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_project_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_project_intelligence_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_project_intelligence_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_project_intelligence_config ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_project_intelligence_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_project_intelligence_config(::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_project_intelligence_config_client_stub.call_count + end + end + end + + def test_update_project_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_project_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_project_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_project_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_project_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_project_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_project_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_project_intelligence_config_client_stub.call_count + end + end + end + + def test_get_folder_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_folder_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_folder_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_folder_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_folder_intelligence_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_folder_intelligence_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_folder_intelligence_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_folder_intelligence_config_client_stub.call_count + end + end + end + + def test_update_folder_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_folder_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_folder_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_folder_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_folder_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_folder_intelligence_config_client_stub.call_count + end + end + end + + def test_get_organization_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_organization_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_organization_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_organization_intelligence_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_organization_intelligence_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_organization_intelligence_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_organization_intelligence_config_client_stub.call_count + end + end + end + + def test_update_organization_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_organization_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_organization_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_organization_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_organization_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_organization_intelligence_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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb new file mode 100644 index 000000000000..d85897291ac9 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb @@ -0,0 +1,1853 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/storage/control/v2/storage_control_pb" +require "google/cloud/storage/control/v2/storage_control" + +class ::Google::Cloud::Storage::Control::V2::StorageControl::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_folder + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::Folder.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + folder = {} + folder_id = "hello world" + recursive = true + request_id = "hello world" + + create_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateFolderRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::Folder), request["folder"] + assert_equal "hello world", request["folder_id"] + assert_equal true, request["recursive"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_folder({ parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_folder parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_folder ::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new(parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder({ parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder(::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new(parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder_client_stub.call_rpc_count + end + end + + def test_delete_folder + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + delete_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_folder ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_folder(::Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_folder_client_stub.call_rpc_count + end + end + + def test_get_folder + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::Folder.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + get_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_folder ::Google::Cloud::Storage::Control::V2::GetFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.get_folder(::Google::Cloud::Storage::Control::V2::GetFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, get_folder_client_stub.call_rpc_count + end + end + + def test_list_folders + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ListFoldersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + prefix = "hello world" + delimiter = "hello world" + lexicographic_start = "hello world" + lexicographic_end = "hello world" + request_id = "hello world" + + list_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_folders, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::ListFoldersRequest, 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["prefix"] + assert_equal "hello world", request["delimiter"] + assert_equal "hello world", request["lexicographic_start"] + assert_equal "hello world", request["lexicographic_end"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_folders_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_folders parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_folders ::Google::Cloud::Storage::Control::V2::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_folders(::Google::Cloud::Storage::Control::V2::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_folders_client_stub.call_rpc_count + end + end + + def test_rename_folder + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + destination_folder_id = "hello world" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + rename_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rename_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::RenameFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["destination_folder_id"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rename_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rename_folder({ name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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.rename_folder name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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.rename_folder ::Google::Cloud::Storage::Control::V2::RenameFolderRequest.new(name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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.rename_folder({ name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder(::Google::Cloud::Storage::Control::V2::RenameFolderRequest.new(name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, rename_folder_client_stub.call_rpc_count + end + end + + def test_delete_folder_recursive + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + delete_folder_recursive_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_folder_recursive, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_folder_recursive_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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_folder_recursive name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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_folder_recursive ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive(::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive_client_stub.call_rpc_count + end + end + + def test_get_storage_layout + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::StorageLayout.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + prefix = "hello world" + request_id = "hello world" + + get_storage_layout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_storage_layout, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["prefix"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_storage_layout_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_storage_layout({ name: name, prefix: prefix, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_storage_layout name: name, prefix: prefix, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_storage_layout ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new(name: name, prefix: prefix, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_storage_layout({ name: name, prefix: prefix, 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.get_storage_layout(::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new(name: name, prefix: prefix, 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, get_storage_layout_client_stub.call_rpc_count + end + end + + def test_create_managed_folder + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ManagedFolder.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + managed_folder = {} + managed_folder_id = "hello world" + request_id = "hello world" + + create_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_managed_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::ManagedFolder), request["managed_folder"] + assert_equal "hello world", request["managed_folder_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_managed_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_managed_folder({ parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_managed_folder parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_managed_folder ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new(parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder({ parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder(::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new(parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder_client_stub.call_rpc_count + end + end + + def test_delete_managed_folder + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + allow_non_empty = true + request_id = "hello world" + + delete_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_managed_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal true, request["allow_non_empty"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_managed_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_managed_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_managed_folder ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_managed_folder(::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_managed_folder_client_stub.call_rpc_count + end + end + + def test_get_managed_folder + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ManagedFolder.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + get_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_managed_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_managed_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_managed_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_managed_folder ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.get_managed_folder(::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, get_managed_folder_client_stub.call_rpc_count + end + end + + def test_list_managed_folders + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + prefix = "hello world" + request_id = "hello world" + + list_managed_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_managed_folders, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, 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["prefix"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_managed_folders_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_managed_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_managed_folders parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_managed_folders ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_managed_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_managed_folders(::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_managed_folders_client_stub.call_rpc_count + end + end + + def test_create_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + anywhere_cache = {} + request_id = "hello world" + + create_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::AnywhereCache), request["anywhere_cache"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_anywhere_cache({ parent: parent, anywhere_cache: anywhere_cache, request_id: request_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_anywhere_cache parent: parent, anywhere_cache: anywhere_cache, request_id: request_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_anywhere_cache ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new(parent: parent, anywhere_cache: anywhere_cache, request_id: request_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_anywhere_cache({ parent: parent, anywhere_cache: anywhere_cache, 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_anywhere_cache(::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new(parent: parent, anywhere_cache: anywhere_cache, 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_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_update_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + anywhere_cache = {} + update_mask = {} + request_id = "hello world" + + update_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::AnywhereCache), request["anywhere_cache"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_anywhere_cache({ anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_anywhere_cache anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_anywhere_cache ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new(anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_anywhere_cache({ anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_anywhere_cache(::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new(anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_disable_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + disable_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_anywhere_cache name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_anywhere_cache ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_anywhere_cache({ name: name, 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.disable_anywhere_cache(::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new(name: name, 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, disable_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_pause_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_anywhere_cache name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_anywhere_cache ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_anywhere_cache({ name: name, 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.pause_anywhere_cache(::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new(name: name, 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, pause_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_resume_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_anywhere_cache name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_anywhere_cache ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_anywhere_cache({ name: name, 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.resume_anywhere_cache(::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new(name: name, 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, resume_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_get_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + + get_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_anywhere_cache name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_anywhere_cache ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_anywhere_cache({ name: name, 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.get_anywhere_cache(::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new(name: name, 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, get_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_list_anywhere_caches + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + request_id = "hello world" + + list_anywhere_caches_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_anywhere_caches, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, 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["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_anywhere_caches_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_anywhere_caches({ parent: parent, page_size: page_size, page_token: page_token, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_anywhere_caches parent: parent, page_size: page_size, page_token: page_token, request_id: request_id do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_anywhere_caches ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new(parent: parent, page_size: page_size, page_token: page_token, request_id: request_id) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_anywhere_caches({ parent: parent, page_size: page_size, page_token: page_token, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_anywhere_caches(::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new(parent: parent, page_size: page_size, page_token: page_token, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_anywhere_caches_client_stub.call_rpc_count + end + end + + def test_get_project_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_project_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_project_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_project_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_project_intelligence_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_project_intelligence_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_project_intelligence_config ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_project_intelligence_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_project_intelligence_config(::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_project_intelligence_config_client_stub.call_rpc_count + end + end + + def test_update_project_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_project_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_project_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_project_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_project_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_project_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_project_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_project_intelligence_config_client_stub.call_rpc_count + end + end + + def test_get_folder_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_folder_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_folder_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_folder_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_folder_intelligence_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_folder_intelligence_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_folder_intelligence_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_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_folder_intelligence_config_client_stub.call_rpc_count + end + end + + def test_update_folder_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_folder_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_folder_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_folder_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_folder_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_folder_intelligence_config_client_stub.call_rpc_count + end + end + + def test_get_organization_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_organization_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_organization_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_organization_intelligence_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_organization_intelligence_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_organization_intelligence_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_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_organization_intelligence_config_client_stub.call_rpc_count + end + end + + def test_update_organization_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_organization_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_organization_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_organization_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_organization_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_organization_intelligence_config_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Storage::Control::V2::StorageControl::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/.gitignore b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.repo-metadata.json new file mode 100644 index 000000000000..9e3d08bb0247 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "storagebatchoperations.googleapis.com", + "api_shortname": "storagebatchoperations", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage_batch_operations-v1/latest", + "distribution_name": "google-cloud-storage_batch_operations-v1", + "is_cloud": true, + "language": "ruby", + "name": "storagebatchoperations", + "name_pretty": "Storage Batch Operations V1 API", + "product_documentation": "https://cloud.google.com/storage/docs/batch-operations/overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "google-cloud-storage_batch_operations-v1 is the official client library for the Storage Batch Operations V1 API. Note that google-cloud-storage_batch_operations-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_batch_operations instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/storage/docs/batch-operations/overview", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/.rubocop.yml b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.rubocop.yml new file mode 100644 index 000000000000..1c5b71367c84 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-storage_batch_operations-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-storage_batch_operations-v1.rb" diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/.toys.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/.yardopts b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.yardopts new file mode 100644 index 000000000000..01d2e25f2a19 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Storage Batch Operations 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-storage_batch_operations-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..00a2a8e025ed --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-storage_batch_operations-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-storage_batch_operations-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/storage_batch_operations/v1" + +client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/storage_batch_operations/v1" + +::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations-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/storage_batch_operations/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/Gemfile b/owl-bot-staging/google-cloud-storage_batch_operations-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/LICENSE.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/README.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/README.md new file mode 100644 index 000000000000..22c13bdba279 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Storage Batch Operations V1 API + +API Client library for the Storage Batch Operations V1 API + +google-cloud-storage_batch_operations-v1 is the official client library for the Storage Batch Operations V1 API. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Storage Batch Operations V1 API. Most users should consider using +the main client gem, +[google-cloud-storage_batch_operations](https://rubygems.org/gems/google-cloud-storage_batch_operations). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-storage_batch_operations-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/storagebatchoperations.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/storage_batch_operations/v1" + +client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new +request = ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new # (request fields as keyword arguments...) +response = client.list_jobs request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage_batch_operations-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/storage/docs/batch-operations/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/storage_batch_operations/v1" +require "logger" + +client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-storage_batch_operations-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-storage_batch_operations`. +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-storage_batch_operations-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-storage_batch_operations-v1/Rakefile b/owl-bot-staging/google-cloud-storage_batch_operations-v1/Rakefile new file mode 100644 index 000000000000..e412b629f993 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-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/storage_batch_operations/v1/storage_batch_operations/credentials" + ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations-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-storage_batch_operations-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-storage_batch_operations-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-storage_batch_operations-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-storage_batch_operations-v1" + header "google-cloud-storage_batch_operations-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-storage_batch_operations-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-storage_batch_operations-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-storage_batch_operations-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-storage_batch_operations-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-storage_batch_operations-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-storage_batch_operations-v1/gapic_metadata.json new file mode 100644 index 000000000000..d3fa69b3d746 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/gapic_metadata.json @@ -0,0 +1,53 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.storagebatchoperations.v1", + "libraryPackage": "::Google::Cloud::StorageBatchOperations::V1", + "services": { + "StorageBatchOperations": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client", + "rpcs": { + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "CreateJob": { + "methods": [ + "create_job" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + }, + "CancelJob": { + "methods": [ + "cancel_job" + ] + }, + "ListBucketOperations": { + "methods": [ + "list_bucket_operations" + ] + }, + "GetBucketOperation": { + "methods": [ + "get_bucket_operation" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/google-cloud-storage_batch_operations-v1.gemspec b/owl-bot-staging/google-cloud-storage_batch_operations-v1/google-cloud-storage_batch_operations-v1.gemspec new file mode 100644 index 000000000000..959a182d1abb --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/google-cloud-storage_batch_operations-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/storage_batch_operations/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-storage_batch_operations-v1" + gem.version = Google::Cloud::StorageBatchOperations::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "google-cloud-storage_batch_operations-v1 is the official client library for the Storage Batch Operations V1 API. Note that google-cloud-storage_batch_operations-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_batch_operations instead. See the readme for more details." + gem.summary = "API Client library for the Storage Batch Operations 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google-cloud-storage_batch_operations-v1.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google-cloud-storage_batch_operations-v1.rb new file mode 100644 index 000000000000..e43de71ce03a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google-cloud-storage_batch_operations-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/storage_batch_operations/v1" diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1.rb new file mode 100644 index 000000000000..b0fd4614ed1c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/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/storage_batch_operations/v1/storage_batch_operations" +require "google/cloud/storage_batch_operations/v1/version" + +module Google + module Cloud + module StorageBatchOperations + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/storage_batch_operations/v1" + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/storage_batch_operations/v1" + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/storage_batch_operations/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/bindings_override.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/bindings_override.rb new file mode 100644 index 000000000000..0ff63196918e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/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 StorageBatchOperations + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/storage_batch_operations/v1/rest" + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "StorageBatchOperations"] + parent_config = while namespace.any? + parent_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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/rest.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/rest.rb new file mode 100644 index 000000000000..040c0e686dbe --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/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/storage_batch_operations/v1/storage_batch_operations/rest" +require "google/cloud/storage_batch_operations/v1/bindings_override" +require "google/cloud/storage_batch_operations/v1/version" + +module Google + module Cloud + module StorageBatchOperations + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/storage_batch_operations/v1/rest" + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations.rb new file mode 100644 index 000000000000..f5ab32c6e727 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations.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/storage_batch_operations/v1/version" + +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/paths" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/operations" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/client" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest" + +module Google + module Cloud + module StorageBatchOperations + module V1 + ## + # Storage Batch Operations offers a managed experience to perform batch + # operations on millions of Cloud Storage objects in a serverless fashion. With + # this service, you can automate and simplify large scale API operations + # performed on Cloud Storage objects. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/storage_batch_operations/v1/storage_batch_operations" + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest" + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + module StorageBatchOperations + end + end + end + end +end + +helper_path = ::File.join __dir__, "storage_batch_operations", "helpers.rb" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/client.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/client.rb new file mode 100644 index 000000000000..cddd49a94cd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/client.rb @@ -0,0 +1,1150 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" +require "google/cloud/location" + +module Google + module Cloud + module StorageBatchOperations + module V1 + module StorageBatchOperations + ## + # Client for the StorageBatchOperations service. + # + # Storage Batch Operations offers a managed experience to perform batch + # operations on millions of Cloud Storage objects in a serverless fashion. With + # this service, you can automate and simplify large scale API operations + # performed on Cloud Storage objects. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storagebatchoperations.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_batch_operations_stub + + ## + # Configure the StorageBatchOperations Client class. + # + # See {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageBatchOperations clients + # ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "StorageBatchOperations", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_jobs.timeout = 60.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] + } + + default_config.rpcs.get_job.timeout = 60.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] + } + + default_config.rpcs.create_job.timeout = 60.0 + + default_config.rpcs.delete_job.timeout = 60.0 + + default_config.rpcs.cancel_job.timeout = 60.0 + default_config.rpcs.cancel_job.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageBatchOperations Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @storage_batch_operations_stub.universe_domain + end + + ## + # Create a new StorageBatchOperations client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageBatchOperations 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/storagebatchoperations/v1/storage_batch_operations_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 + + @storage_batch_operations_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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 + ) + + @storage_batch_operations_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 = @storage_batch_operations_stub.endpoint + config.universe_domain = @storage_batch_operations_stub.universe_domain + config.logger = @storage_batch_operations_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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 + @storage_batch_operations_stub.logger + end + + # Service calls + + ## + # Lists Jobs in a given project. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Format: projects/\\{project_id}/locations/global. + # @param filter [::String] + # Optional. Filters results as defined by https://google.aip.dev/160. + # @param page_size [::Integer] + # Optional. The list page size. default page size is 100. + # @param page_token [::String] + # Optional. The list page token. + # @param order_by [::String] + # Optional. Field to sort by. Supported fields are name, create_time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_batch_operations_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a batch job. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. `name` of the job to retrieve. + # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageBatchOperations::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a batch job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_job(parent: nil, job_id: nil, job: nil, request_id: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Value for parent. + # @param job_id [::String] + # Required. The optional `job_id` for this Job . If not + # specified, an id is generated. `job_id` should be no more than 128 + # characters and must include only characters available in DNS names, as + # defined by RFC-1123. + # @param job [::Google::Cloud::StorageBatchOperations::V1::Job, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID in case you need to retry your request. Requests with same + # `request_id` will be ignored for at least 60 minutes since the first + # request. 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/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.call_rpc :create_job, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 batch job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_job(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The `name` of the job to delete. + # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID in case you need to retry your request. Requests with same + # `request_id` will be ignored for at least 60 minutes since the first + # 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 bucket operations of the job will also + # be deleted. Highly recommended to be set to true by all clients. Users + # cannot mutate bucket operations directly, so only the jobs.delete + # permission is required to delete a job (and its child bucket operations). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.call_rpc :delete_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Cancels a batch job. + # + # @overload cancel_job(request, options = nil) + # Pass arguments to `cancel_job` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(name: nil, request_id: nil) + # Pass arguments to `cancel_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The `name` of the job to cancel. + # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID in case you need to retry your request. Requests with same + # `request_id` will be ignored for at least 60 minutes since the first + # request. 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::StorageBatchOperations::V1::CancelJobResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new + # + # # Call the cancel_job method. + # result = client.cancel_job request + # + # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::CancelJobResponse. + # p result + # + def cancel_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest + + # Converts hash and nil to 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_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.call_rpc :cancel_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BucketOperations in a given project and job. + # + # @overload list_bucket_operations(request, options = nil) + # Pass arguments to `list_bucket_operations` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_bucket_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_bucket_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. + # @param filter [::String] + # Optional. Filters results as defined by https://google.aip.dev/160. + # @param page_size [::Integer] + # Optional. The list page size. Default page size is 100. + # @param page_token [::String] + # Optional. The list page token. + # @param order_by [::String] + # Optional. Field to sort by. Supported fields are name, create_time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new + # + # # Call the list_bucket_operations method. + # result = client.list_bucket_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::BucketOperation. + # p item + # end + # + def list_bucket_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_bucket_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::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_bucket_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_bucket_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.call_rpc :list_bucket_operations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_batch_operations_stub, :list_bucket_operations, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a BucketOperation. + # + # @overload get_bucket_operation(request, options = nil) + # Pass arguments to `get_bucket_operation` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_bucket_operation(name: nil) + # Pass arguments to `get_bucket_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. `name` of the bucket operation to retrieve. + # Format: + # projects/\\{project_id}/locations/global/jobs/\\{job_id}/bucketOperations/\\{bucket_operation_id}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new + # + # # Call the get_bucket_operation method. + # result = client.get_bucket_operation request + # + # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::BucketOperation. + # p result + # + def get_bucket_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_bucket_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_bucket_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_bucket_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.call_rpc :get_bucket_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 + + ## + # Configuration class for the StorageBatchOperations API. + # + # This class represents the configuration for StorageBatchOperations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_jobs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storagebatchoperations.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the StorageBatchOperations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `cancel_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_job + ## + # RPC-specific configuration for `list_bucket_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_bucket_operations + ## + # RPC-specific configuration for `get_bucket_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_bucket_operation + + # @private + def initialize parent_rpcs = nil + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job + @cancel_job = ::Gapic::Config::Method.new cancel_job_config + list_bucket_operations_config = parent_rpcs.list_bucket_operations if parent_rpcs.respond_to? :list_bucket_operations + @list_bucket_operations = ::Gapic::Config::Method.new list_bucket_operations_config + get_bucket_operation_config = parent_rpcs.get_bucket_operation if parent_rpcs.respond_to? :get_bucket_operation + @get_bucket_operation = ::Gapic::Config::Method.new get_bucket_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials.rb new file mode 100644 index 000000000000..fd5b6b90611d --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/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 StorageBatchOperations + module V1 + module StorageBatchOperations + # Credentials for the StorageBatchOperations 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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/operations.rb new file mode 100644 index 000000000000..30ceae19e2a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/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 StorageBatchOperations + module V1 + module StorageBatchOperations + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storagebatchoperations.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StorageBatchOperations 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 StorageBatchOperations 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::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::StorageBatchOperations::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::StorageBatchOperations::V1::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 = "storagebatchoperations.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/paths.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/paths.rb new file mode 100644 index 000000000000..8f514eafbc0c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/paths.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module StorageBatchOperations + module V1 + module StorageBatchOperations + # Path helper methods for the StorageBatchOperations API. + module Paths + ## + # Create a fully-qualified BucketOperation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}/bucketOperations/{bucket_operation}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # @param bucket_operation [String] + # + # @return [::String] + def bucket_operation_path project:, location:, job:, bucket_operation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}/bucketOperations/#{bucket_operation}" + 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 Job resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # + # @return [::String] + def job_path project:, location:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest.rb new file mode 100644 index 000000000000..777784ab05be --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/storage_batch_operations/v1/version" +require "google/cloud/storage_batch_operations/v1/bindings_override" + +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/paths" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/operations" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client" + +module Google + module Cloud + module StorageBatchOperations + module V1 + ## + # Storage Batch Operations offers a managed experience to perform batch + # operations on millions of Cloud Storage objects in a serverless fashion. With + # this service, you can automate and simplify large scale API operations + # performed on Cloud Storage objects. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest" + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + module StorageBatchOperations + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client.rb new file mode 100644 index 000000000000..644478a3a8bd --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client.rb @@ -0,0 +1,1066 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module StorageBatchOperations + module V1 + module StorageBatchOperations + module Rest + ## + # REST client for the StorageBatchOperations service. + # + # Storage Batch Operations offers a managed experience to perform batch + # operations on millions of Cloud Storage objects in a serverless fashion. With + # this service, you can automate and simplify large scale API operations + # performed on Cloud Storage objects. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storagebatchoperations.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_batch_operations_stub + + ## + # Configure the StorageBatchOperations Client class. + # + # See {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageBatchOperations clients + # ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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", "StorageBatchOperations", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_jobs.timeout = 60.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] + } + + default_config.rpcs.get_job.timeout = 60.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] + } + + default_config.rpcs.create_job.timeout = 60.0 + + default_config.rpcs.delete_job.timeout = 60.0 + + default_config.rpcs.cancel_job.timeout = 60.0 + default_config.rpcs.cancel_job.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageBatchOperations Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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 + @storage_batch_operations_stub.universe_domain + end + + ## + # Create a new StorageBatchOperations REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageBatchOperations 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::StorageBatchOperations::V1::StorageBatchOperations::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 + + @storage_batch_operations_stub = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @storage_batch_operations_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 = @storage_batch_operations_stub.endpoint + config.universe_domain = @storage_batch_operations_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @storage_batch_operations_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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 + @storage_batch_operations_stub.logger + end + + # Service calls + + ## + # Lists Jobs in a given project. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Format: projects/\\{project_id}/locations/global. + # @param filter [::String] + # Optional. Filters results as defined by https://google.aip.dev/160. + # @param page_size [::Integer] + # Optional. The list page size. default page size is 100. + # @param page_token [::String] + # Optional. The list page token. + # @param order_by [::String] + # Optional. Field to sort by. Supported fields are name, create_time. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::Job>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::Job>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.list_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @storage_batch_operations_stub, :list_jobs, "jobs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a batch job. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. `name` of the job to retrieve. + # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.get_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a batch job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_job(parent: nil, job_id: nil, job: nil, request_id: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Value for parent. + # @param job_id [::String] + # Required. The optional `job_id` for this Job . If not + # specified, an id is generated. `job_id` should be no more than 128 + # characters and must include only characters available in DNS names, as + # defined by RFC-1123. + # @param job [::Google::Cloud::StorageBatchOperations::V1::Job, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID in case you need to retry your request. Requests with same + # `request_id` will be ignored for at least 60 minutes since the first + # request. 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/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.create_job request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 batch job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_job(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The `name` of the job to delete. + # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID in case you need to retry your request. Requests with same + # `request_id` will be ignored for at least 60 minutes since the first + # 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 bucket operations of the job will also + # be deleted. Highly recommended to be set to true by all clients. Users + # cannot mutate bucket operations directly, so only the jobs.delete + # permission is required to delete a job (and its child bucket operations). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.delete_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Cancels a batch job. + # + # @overload cancel_job(request, options = nil) + # Pass arguments to `cancel_job` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(name: nil, request_id: nil) + # Pass arguments to `cancel_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The `name` of the job to cancel. + # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID in case you need to retry your request. Requests with same + # `request_id` will be ignored for at least 60 minutes since the first + # request. 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::StorageBatchOperations::V1::CancelJobResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new + # + # # Call the cancel_job method. + # result = client.cancel_job request + # + # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::CancelJobResponse. + # p result + # + def cancel_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest + + # Converts hash and nil to an 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_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.cancel_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists BucketOperations in a given project and job. + # + # @overload list_bucket_operations(request, options = nil) + # Pass arguments to `list_bucket_operations` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_bucket_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) + # Pass arguments to `list_bucket_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. + # @param filter [::String] + # Optional. Filters results as defined by https://google.aip.dev/160. + # @param page_size [::Integer] + # Optional. The list page size. Default page size is 100. + # @param page_token [::String] + # Optional. The list page token. + # @param order_by [::String] + # Optional. Field to sort by. Supported fields are name, create_time. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new + # + # # Call the list_bucket_operations method. + # result = client.list_bucket_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::BucketOperation. + # p item + # end + # + def list_bucket_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_bucket_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::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_bucket_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_bucket_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.list_bucket_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @storage_batch_operations_stub, :list_bucket_operations, "bucket_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 a BucketOperation. + # + # @overload get_bucket_operation(request, options = nil) + # Pass arguments to `get_bucket_operation` via a request object, either of type + # {::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_bucket_operation(name: nil) + # Pass arguments to `get_bucket_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. `name` of the bucket operation to retrieve. + # Format: + # projects/\\{project_id}/locations/global/jobs/\\{job_id}/bucketOperations/\\{bucket_operation_id}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_batch_operations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new + # + # # Call the get_bucket_operation method. + # result = client.get_bucket_operation request + # + # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::BucketOperation. + # p result + # + def get_bucket_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_bucket_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_bucket_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_bucket_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_batch_operations_stub.get_bucket_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 StorageBatchOperations REST API. + # + # This class represents the configuration for StorageBatchOperations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_jobs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storagebatchoperations.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 StorageBatchOperations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `cancel_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_job + ## + # RPC-specific configuration for `list_bucket_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_bucket_operations + ## + # RPC-specific configuration for `get_bucket_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_bucket_operation + + # @private + def initialize parent_rpcs = nil + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job + @cancel_job = ::Gapic::Config::Method.new cancel_job_config + list_bucket_operations_config = parent_rpcs.list_bucket_operations if parent_rpcs.respond_to? :list_bucket_operations + @list_bucket_operations = ::Gapic::Config::Method.new list_bucket_operations_config + get_bucket_operation_config = parent_rpcs.get_bucket_operation if parent_rpcs.respond_to? :get_bucket_operation + @get_bucket_operation = ::Gapic::Config::Method.new get_bucket_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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/operations.rb new file mode 100644 index 000000000000..e714b68f17a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/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 StorageBatchOperations + module V1 + module StorageBatchOperations + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storagebatchoperations.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StorageBatchOperations 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 StorageBatchOperations 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::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageBatchOperations::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "storagebatchoperations.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub.rb new file mode 100644 index 000000000000..29756eab3e5e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub.rb @@ -0,0 +1,510 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" + +module Google + module Cloud + module StorageBatchOperations + module V1 + module StorageBatchOperations + module Rest + ## + # REST service stub for the StorageBatchOperations service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse] + # A result object deserialized from the server's reply + def list_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_job REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::Job] + # A result object deserialized from the server's reply + def get_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageBatchOperations::V1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_job REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_job REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_job REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse] + # A result object deserialized from the server's reply + def cancel_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse.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_bucket_operations REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse] + # A result object deserialized from the server's reply + def list_bucket_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_bucket_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_bucket_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_bucket_operation REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] + # A result object deserialized from the server's reply + def get_bucket_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_bucket_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_bucket_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageBatchOperations::V1::BucketOperation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/jobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_job REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_job REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/jobs", + body: "job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_job REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_job REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest] + # 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_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_bucket_operations REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_bucket_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/bucketOperations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_bucket_operation REST call + # + # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_bucket_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/bucketOperations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/version.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/version.rb new file mode 100644 index 000000000000..bcb427ab5428 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/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 StorageBatchOperations + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_pb.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_pb.rb new file mode 100644 index 000000000000..3171953bbff9 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_pb.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/storagebatchoperations/v1/storage_batch_operations.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\nEgoogle/cloud/storagebatchoperations/v1/storage_batch_operations.proto\x12&google.cloud.storagebatchoperations.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\x1aKgoogle/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb1\x01\n\x0fListJobsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)storagebatchoperations.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"{\n\x10ListJobsResponse\x12\x39\n\x04jobs\x18\x01 \x03(\x0b\x32+.google.cloud.storagebatchoperations.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"P\n\rGetJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storagebatchoperations.googleapis.com/Job\"\xca\x01\n\x10\x43reateJobRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)storagebatchoperations.googleapis.com/Job\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x03job\x18\x03 \x01(\x0b\x32+.google.cloud.storagebatchoperations.v1.JobB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"t\n\x10\x43\x61ncelJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storagebatchoperations.googleapis.com/Job\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x88\x01\n\x10\x44\x65leteJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storagebatchoperations.googleapis.com/Job\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x13\n\x11\x43\x61ncelJobResponse\"\xc9\x01\n\x1bListBucketOperationsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35storagebatchoperations.googleapis.com/BucketOperation\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x1cListBucketOperationsResponse\x12R\n\x11\x62ucket_operations\x18\x01 \x03(\x0b\x32\x37.google.cloud.storagebatchoperations.v1.BucketOperation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"h\n\x19GetBucketOperationRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5storagebatchoperations.googleapis.com/BucketOperation\"\x92\x02\n\x11OperationMetadata\x12\x16\n\toperation\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12=\n\x03job\x18\n \x01(\x0b\x32+.google.cloud.storagebatchoperations.v1.JobB\x03\xe0\x41\x03\x32\xd3\x0b\n\x16StorageBatchOperations\x12\xb8\x01\n\x08ListJobs\x12\x37.google.cloud.storagebatchoperations.v1.ListJobsRequest\x1a\x38.google.cloud.storagebatchoperations.v1.ListJobsResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\x12\xa5\x01\n\x06GetJob\x12\x35.google.cloud.storagebatchoperations.v1.GetJobRequest\x1a+.google.cloud.storagebatchoperations.v1.Job\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\x12\xca\x01\n\tCreateJob\x12\x38.google.cloud.storagebatchoperations.v1.CreateJobRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41\x18\n\x03Job\x12\x11OperationMetadata\xda\x41\x11parent,job,job_id\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\x12\x96\x01\n\tDeleteJob\x12\x38.google.cloud.storagebatchoperations.v1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\x12\xc3\x01\n\tCancelJob\x12\x38.google.cloud.storagebatchoperations.v1.CancelJobRequest\x1a\x39.google.cloud.storagebatchoperations.v1.CancelJobResponse\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/jobs/*}:cancel:\x01*\x12\xef\x01\n\x14ListBucketOperations\x12\x43.google.cloud.storagebatchoperations.v1.ListBucketOperationsRequest\x1a\x44.google.cloud.storagebatchoperations.v1.ListBucketOperationsResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1/{parent=projects/*/locations/*/jobs/*}/bucketOperations\x12\xdc\x01\n\x12GetBucketOperation\x12\x41.google.cloud.storagebatchoperations.v1.GetBucketOperationRequest\x1a\x37.google.cloud.storagebatchoperations.v1.BucketOperation\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1/{name=projects/*/locations/*/jobs/*/bucketOperations/*}\x1aY\xca\x41%storagebatchoperations.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xad\x02\n*com.google.cloud.storagebatchoperations.v1B\x1bStorageBatchOperationsProtoP\x01Zbcloud.google.com/go/storagebatchoperations/apiv1/storagebatchoperationspb;storagebatchoperationspb\xaa\x02&Google.Cloud.StorageBatchOperations.V1\xca\x02&Google\\Cloud\\StorageBatchOperations\\V1\xea\x02)Google::Cloud::StorageBatchOperations::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module StorageBatchOperations + module V1 + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ListJobsRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ListJobsResponse").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.GetJobRequest").msgclass + CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.CreateJobRequest").msgclass + CancelJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.CancelJobRequest").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.DeleteJobRequest").msgclass + CancelJobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.CancelJobResponse").msgclass + ListBucketOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ListBucketOperationsRequest").msgclass + ListBucketOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ListBucketOperationsResponse").msgclass + GetBucketOperationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.GetBucketOperationRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.OperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb.rb new file mode 100644 index 000000000000..b07d550e4557 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb.rb @@ -0,0 +1,60 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/storagebatchoperations/v1/storage_batch_operations.proto for package 'Google.Cloud.StorageBatchOperations.V1' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/storagebatchoperations/v1/storage_batch_operations_pb' + +module Google + module Cloud + module StorageBatchOperations + module V1 + module StorageBatchOperations + # Storage Batch Operations offers a managed experience to perform batch + # operations on millions of Cloud Storage objects in a serverless fashion. With + # this service, you can automate and simplify large scale API operations + # performed on Cloud Storage objects. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.storagebatchoperations.v1.StorageBatchOperations' + + # Lists Jobs in a given project. + rpc :ListJobs, ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest, ::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse + # Gets a batch job. + rpc :GetJob, ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest, ::Google::Cloud::StorageBatchOperations::V1::Job + # Creates a batch job. + rpc :CreateJob, ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest, ::Google::Longrunning::Operation + # Deletes a batch job. + rpc :DeleteJob, ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest, ::Google::Protobuf::Empty + # Cancels a batch job. + rpc :CancelJob, ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest, ::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse + # Lists BucketOperations in a given project and job. + rpc :ListBucketOperations, ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest, ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse + # Gets a BucketOperation. + rpc :GetBucketOperation, ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest, ::Google::Cloud::StorageBatchOperations::V1::BucketOperation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb.rb new file mode 100644 index 000000000000..294d3c88d373 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/code_pb' + + +descriptor_data = "\nKgoogle/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto\x12&google.cloud.storagebatchoperations.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15google/rpc/code.proto\"\xaa\n\n\x03Job\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\x12I\n\x0b\x62ucket_list\x18\x13 \x01(\x0b\x32\x32.google.cloud.storagebatchoperations.v1.BucketListH\x00\x12P\n\x0fput_object_hold\x18\x05 \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.PutObjectHoldH\x01\x12M\n\rdelete_object\x18\x06 \x01(\x0b\x32\x34.google.cloud.storagebatchoperations.v1.DeleteObjectH\x01\x12K\n\x0cput_metadata\x18\x08 \x01(\x0b\x32\x33.google.cloud.storagebatchoperations.v1.PutMetadataH\x01\x12O\n\x0erewrite_object\x18\x14 \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.RewriteObjectH\x01\x12i\n\x1cupdate_object_custom_context\x18\x17 \x01(\x0b\x32\x41.google.cloud.storagebatchoperations.v1.UpdateObjectCustomContextH\x01\x12R\n\x0elogging_config\x18\t \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.LoggingConfigB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rschedule_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rcomplete_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x08\x63ounters\x18\r \x01(\x0b\x32\x30.google.cloud.storagebatchoperations.v1.CountersB\x03\xe0\x41\x03\x12R\n\x0f\x65rror_summaries\x18\x0e \x03(\x0b\x32\x34.google.cloud.storagebatchoperations.v1.ErrorSummaryB\x03\xe0\x41\x03\x12\x45\n\x05state\x18\x0f \x01(\x0e\x32\x31.google.cloud.storagebatchoperations.v1.Job.StateB\x03\xe0\x41\x03\x12\x14\n\x07\x64ry_run\x18\x16 \x01(\x08\x42\x03\xe0\x41\x01\x12 \n\x13is_multi_bucket_job\x18\x18 \x01(\x08\x42\x03\xe0\x41\x03\"`\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\x0c\n\x08\x43\x41NCELED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\n\n\x06QUEUED\x10\x05:m\xea\x41j\n)storagebatchoperations.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}*\x04jobs2\x03jobB\x08\n\x06sourceB\x10\n\x0etransformation\"\xcc\n\n\x0f\x42ucketOperation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x13\n\x0b\x62ucket_name\x18\x02 \x01(\t\x12I\n\x0bprefix_list\x18\x03 \x01(\x0b\x32\x32.google.cloud.storagebatchoperations.v1.PrefixListH\x00\x12\x44\n\x08manifest\x18\x04 \x01(\x0b\x32\x30.google.cloud.storagebatchoperations.v1.ManifestH\x00\x12P\n\x0fput_object_hold\x18\x0b \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.PutObjectHoldH\x01\x12M\n\rdelete_object\x18\x0c \x01(\x0b\x32\x34.google.cloud.storagebatchoperations.v1.DeleteObjectH\x01\x12K\n\x0cput_metadata\x18\r \x01(\x0b\x32\x33.google.cloud.storagebatchoperations.v1.PutMetadataH\x01\x12O\n\x0erewrite_object\x18\x0e \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.RewriteObjectH\x01\x12i\n\x1cupdate_object_custom_context\x18\x0f \x01(\x0b\x32\x41.google.cloud.storagebatchoperations.v1.UpdateObjectCustomContextH\x01\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rcomplete_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x08\x63ounters\x18\x08 \x01(\x0b\x32\x30.google.cloud.storagebatchoperations.v1.CountersB\x03\xe0\x41\x03\x12R\n\x0f\x65rror_summaries\x18\t \x03(\x0b\x32\x34.google.cloud.storagebatchoperations.v1.ErrorSummaryB\x03\xe0\x41\x03\x12Q\n\x05state\x18\n \x01(\x0e\x32=.google.cloud.storagebatchoperations.v1.BucketOperation.StateB\x03\xe0\x41\x03\"`\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0c\n\x08\x43\x41NCELED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05:\xb6\x01\xea\x41\xb2\x01\n5storagebatchoperations.googleapis.com/BucketOperation\x12Vprojects/{project}/locations/{location}/jobs/{job}/bucketOperations/{bucket_operation}*\x10\x62ucketoperations2\x0f\x62ucketOperationB\x16\n\x14object_configurationB\x10\n\x0etransformation\"\xa6\x02\n\nBucketList\x12O\n\x07\x62uckets\x18\x01 \x03(\x0b\x32\x39.google.cloud.storagebatchoperations.v1.BucketList.BucketB\x03\xe0\x41\x02\x1a\xc6\x01\n\x06\x42ucket\x12\x13\n\x06\x62ucket\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12I\n\x0bprefix_list\x18\x02 \x01(\x0b\x32\x32.google.cloud.storagebatchoperations.v1.PrefixListH\x00\x12\x44\n\x08manifest\x18\x03 \x01(\x0b\x32\x30.google.cloud.storagebatchoperations.v1.ManifestH\x00\x42\x16\n\x14object_configuration\"*\n\x08Manifest\x12\x1e\n\x11manifest_location\x18\x02 \x01(\tB\x03\xe0\x41\x02\"3\n\nPrefixList\x12%\n\x18included_object_prefixes\x18\x02 \x03(\tB\x03\xe0\x41\x01\"\x8e\x02\n\rPutObjectHold\x12]\n\x0etemporary_hold\x18\x01 \x01(\x0e\x32@.google.cloud.storagebatchoperations.v1.PutObjectHold.HoldStatusB\x03\xe0\x41\x02\x12_\n\x10\x65vent_based_hold\x18\x02 \x01(\x0e\x32@.google.cloud.storagebatchoperations.v1.PutObjectHold.HoldStatusB\x03\xe0\x41\x02\"=\n\nHoldStatus\x12\x1b\n\x17HOLD_STATUS_UNSPECIFIED\x10\x00\x12\x07\n\x03SET\x10\x01\x12\t\n\x05UNSET\x10\x02\">\n\x0c\x44\x65leteObject\x12.\n!permanent_object_deletion_enabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\"\\\n\rRewriteObject\x12?\n\x07kms_key\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\x00\x88\x01\x01\x42\n\n\x08_kms_key\"\x93\x02\n\x0fObjectRetention\x12#\n\x11retain_until_time\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12g\n\x0eretention_mode\x18\x02 \x01(\x0e\x32\x45.google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionModeB\x03\xe0\x41\x02H\x01\x88\x01\x01\"I\n\rRetentionMode\x12\x1e\n\x1aRETENTION_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x0c\n\x08UNLOCKED\x10\x02\x42\x14\n\x12_retain_until_timeB\x11\n\x0f_retention_mode\"\xe1\x04\n\x0bPutMetadata\x12%\n\x13\x63ontent_disposition\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\"\n\x10\x63ontent_encoding\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\"\n\x10\x63ontent_language\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1e\n\x0c\x63ontent_type\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x1f\n\rcache_control\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x1d\n\x0b\x63ustom_time\x18\x06 \x01(\tB\x03\xe0\x41\x01H\x05\x88\x01\x01\x12\x65\n\x0f\x63ustom_metadata\x18\x07 \x03(\x0b\x32G.google.cloud.storagebatchoperations.v1.PutMetadata.CustomMetadataEntryB\x03\xe0\x41\x01\x12[\n\x10object_retention\x18\x08 \x01(\x0b\x32\x37.google.cloud.storagebatchoperations.v1.ObjectRetentionB\x03\xe0\x41\x01H\x06\x88\x01\x01\x1a\x35\n\x13\x43ustomMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14_content_dispositionB\x13\n\x11_content_encodingB\x13\n\x11_content_languageB\x0f\n\r_content_typeB\x10\n\x0e_cache_controlB\x0e\n\x0c_custom_timeB\x13\n\x11_object_retention\":\n\x1aObjectCustomContextPayload\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"\x87\x02\n\x14\x43ustomContextUpdates\x12_\n\x07updates\x18\x01 \x03(\x0b\x32I.google.cloud.storagebatchoperations.v1.CustomContextUpdates.UpdatesEntryB\x03\xe0\x41\x01\x12\x1a\n\rkeys_to_clear\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1ar\n\x0cUpdatesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12Q\n\x05value\x18\x02 \x01(\x0b\x32\x42.google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload:\x02\x38\x01\"\x9a\x01\n\x19UpdateObjectCustomContext\x12^\n\x16\x63ustom_context_updates\x18\x01 \x01(\x0b\x32<.google.cloud.storagebatchoperations.v1.CustomContextUpdatesH\x00\x12\x13\n\tclear_all\x18\x02 \x01(\x08H\x00\x42\x08\n\x06\x61\x63tion\"\xaa\x01\n\x0c\x45rrorSummary\x12)\n\nerror_code\x18\x01 \x01(\x0e\x32\x10.google.rpc.CodeB\x03\xe0\x41\x02\x12\x18\n\x0b\x65rror_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02\x12U\n\x11\x65rror_log_entries\x18\x03 \x03(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.ErrorLogEntryB\x03\xe0\x41\x02\"J\n\rErrorLogEntry\x12\x1a\n\nobject_uri\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x03\x12\x1d\n\rerror_details\x18\x03 \x03(\tB\x06\xe0\x41\x01\xe0\x41\x03\"\xad\x01\n\x08\x43ounters\x12\x1f\n\x12total_object_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12#\n\x16succeeded_object_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12 \n\x13\x66\x61iled_object_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12#\n\x11total_bytes_found\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x14\n\x12_total_bytes_found\"\xf5\x02\n\rLoggingConfig\x12^\n\x0blog_actions\x18\x01 \x03(\x0e\x32\x44.google.cloud.storagebatchoperations.v1.LoggingConfig.LoggableActionB\x03\xe0\x41\x02\x12i\n\x11log_action_states\x18\x02 \x03(\x0e\x32I.google.cloud.storagebatchoperations.v1.LoggingConfig.LoggableActionStateB\x03\xe0\x41\x02\"@\n\x0eLoggableAction\x12\x1f\n\x1bLOGGABLE_ACTION_UNSPECIFIED\x10\x00\x12\r\n\tTRANSFORM\x10\x06\"W\n\x13LoggableActionState\x12%\n!LOGGABLE_ACTION_STATE_UNSPECIFIED\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\xad\x03\n*com.google.cloud.storagebatchoperations.v1B StorageBatchOperationsTypesProtoP\x01Zbcloud.google.com/go/storagebatchoperations/apiv1/storagebatchoperationspb;storagebatchoperationspb\xaa\x02&Google.Cloud.StorageBatchOperations.V1\xca\x02&Google\\Cloud\\StorageBatchOperations\\V1\xea\x02)Google::Cloud::StorageBatchOperations::V1\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module StorageBatchOperations + module V1 + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.Job").msgclass + Job::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.Job.State").enummodule + BucketOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.BucketOperation").msgclass + BucketOperation::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.BucketOperation.State").enummodule + BucketList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.BucketList").msgclass + BucketList::Bucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.BucketList.Bucket").msgclass + Manifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.Manifest").msgclass + PrefixList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.PrefixList").msgclass + PutObjectHold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.PutObjectHold").msgclass + PutObjectHold::HoldStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.PutObjectHold.HoldStatus").enummodule + DeleteObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.DeleteObject").msgclass + RewriteObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.RewriteObject").msgclass + ObjectRetention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ObjectRetention").msgclass + ObjectRetention::RetentionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionMode").enummodule + PutMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.PutMetadata").msgclass + ObjectCustomContextPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload").msgclass + CustomContextUpdates = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.CustomContextUpdates").msgclass + UpdateObjectCustomContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.UpdateObjectCustomContext").msgclass + ErrorSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ErrorSummary").msgclass + ErrorLogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ErrorLogEntry").msgclass + Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.Counters").msgclass + LoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.LoggingConfig").msgclass + LoggingConfig::LoggableAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.LoggingConfig.LoggableAction").enummodule + LoggingConfig::LoggableActionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.LoggingConfig.LoggableActionState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/README.md new file mode 100644 index 000000000000..34ba034c9ae3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Storage Batch Operations 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-storage_batch_operations-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations.rb new file mode 100644 index 000000000000..d1886164a29b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations.rb @@ -0,0 +1,221 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module StorageBatchOperations + module V1 + # Message for request to list Jobs + # @!attribute [rw] parent + # @return [::String] + # Required. Format: projects/\\{project_id}/locations/global. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filters results as defined by https://google.aip.dev/160. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The list page size. default page size is 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The list page token. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Field to sort by. Supported fields are name, create_time. + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Jobs + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::Job>] + # A list of storage batch jobs. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Job + # @!attribute [rw] name + # @return [::String] + # Required. `name` of the job to retrieve. + # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Job + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] job_id + # @return [::String] + # Required. The optional `job_id` for this Job . If not + # specified, an id is generated. `job_id` should be no more than 128 + # characters and must include only characters available in DNS names, as + # defined by RFC-1123. + # @!attribute [rw] job + # @return [::Google::Cloud::StorageBatchOperations::V1::Job] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID in case you need to retry your request. Requests with same + # `request_id` will be ignored for at least 60 minutes since the first + # request. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + class CreateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for Job to Cancel + # @!attribute [rw] name + # @return [::String] + # Required. The `name` of the job to cancel. + # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID in case you need to retry your request. Requests with same + # `request_id` will be ignored for at least 60 minutes since the first + # request. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + class CancelJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Job + # @!attribute [rw] name + # @return [::String] + # Required. The `name` of the job to delete. + # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID in case you need to retry your request. Requests with same + # `request_id` will be ignored for at least 60 minutes since the first + # 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 bucket operations of the job will also + # be deleted. Highly recommended to be set to true by all clients. Users + # cannot mutate bucket operations directly, so only the jobs.delete + # permission is required to delete a job (and its child bucket operations). + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to cancel Job. + class CancelJobResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for request to list BucketOperations + # @!attribute [rw] parent + # @return [::String] + # Required. Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filters results as defined by https://google.aip.dev/160. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The list page size. Default page size is 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The list page token. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Field to sort by. Supported fields are name, create_time. + class ListBucketOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing BucketOperations + # @!attribute [rw] bucket_operations + # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] + # A list of storage batch bucket operations. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBucketOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a BucketOperation. + # @!attribute [rw] name + # @return [::String] + # Required. `name` of the bucket operation to retrieve. + # Format: + # projects/\\{project_id}/locations/global/jobs/\\{job_id}/bucketOperations/\\{bucket_operation_id}. + class GetBucketOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] operation + # @return [::String] + # Output only. The unique operation resource name. + # Format: projects/\\{project}/locations/global/operations/\\{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] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have been cancelled successfully + # have + # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to + # `[Code.CANCELLED][google.rpc.Code.CANCELLED]`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + # @!attribute [r] job + # @return [::Google::Cloud::StorageBatchOperations::V1::Job] + # Output only. The Job associated with 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-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations_types.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations_types.rb new file mode 100644 index 000000000000..a1664bfd40c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations_types.rb @@ -0,0 +1,564 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module StorageBatchOperations + module V1 + # The Storage Batch Operations Job description. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the Job. job_id is unique + # within the project, that is either set by the customer or + # defined by the service. Format: + # projects/\\{project}/locations/global/jobs/\\{job_id} . + # For example: "projects/123456/locations/global/jobs/job01". + # @!attribute [rw] description + # @return [::String] + # Optional. A description provided by the user for the job. Its max length is + # 1024 bytes when Unicode-encoded. + # @!attribute [rw] bucket_list + # @return [::Google::Cloud::StorageBatchOperations::V1::BucketList] + # Specifies a list of buckets and their objects to be transformed. + # @!attribute [rw] put_object_hold + # @return [::Google::Cloud::StorageBatchOperations::V1::PutObjectHold] + # Changes object hold status. + # + # Note: The following fields are mutually exclusive: `put_object_hold`, `delete_object`, `put_metadata`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_object + # @return [::Google::Cloud::StorageBatchOperations::V1::DeleteObject] + # Delete objects. + # + # Note: The following fields are mutually exclusive: `delete_object`, `put_object_hold`, `put_metadata`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] put_metadata + # @return [::Google::Cloud::StorageBatchOperations::V1::PutMetadata] + # Updates object metadata. Allows updating fixed-key and custom metadata + # and fixed-key metadata i.e. Cache-Control, Content-Disposition, + # Content-Encoding, Content-Language, Content-Type, Custom-Time. + # + # Note: The following fields are mutually exclusive: `put_metadata`, `put_object_hold`, `delete_object`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] rewrite_object + # @return [::Google::Cloud::StorageBatchOperations::V1::RewriteObject] + # Rewrite the object and updates metadata like KMS key. + # + # Note: The following fields are mutually exclusive: `rewrite_object`, `put_object_hold`, `delete_object`, `put_metadata`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_object_custom_context + # @return [::Google::Cloud::StorageBatchOperations::V1::UpdateObjectCustomContext] + # Update object custom context. + # + # Note: The following fields are mutually exclusive: `update_object_custom_context`, `put_object_hold`, `delete_object`, `put_metadata`, `rewrite_object`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::StorageBatchOperations::V1::LoggingConfig] + # Optional. Logging configuration. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the job was created. + # @!attribute [r] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the job was scheduled. + # @!attribute [r] complete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the job was completed. + # @!attribute [r] counters + # @return [::Google::Cloud::StorageBatchOperations::V1::Counters] + # Output only. Information about the progress of the job. + # @!attribute [r] error_summaries + # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::ErrorSummary>] + # Output only. Summarizes errors encountered with sample error log entries. + # @!attribute [r] state + # @return [::Google::Cloud::StorageBatchOperations::V1::Job::State] + # Output only. State of the job. + # @!attribute [rw] dry_run + # @return [::Boolean] + # Optional. If true, the job will run in dry run mode, returning the total + # object count and, if the object configuration is a prefix list, the bytes + # found from source. No transformations will be performed. + # @!attribute [r] is_multi_bucket_job + # @return [::Boolean] + # Output only. If true, this Job operates on multiple buckets. Multibucket + # jobs are subject to different quota limits than single-bucket jobs. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes state of a job. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # In progress. + RUNNING = 1 + + # Completed successfully. + SUCCEEDED = 2 + + # Cancelled by the user. + CANCELED = 3 + + # Terminated due to an unrecoverable failure. + FAILED = 4 + + # Queued but not yet started. + QUEUED = 5 + end + end + + # BucketOperation represents a bucket-level breakdown of a Job. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the BucketOperation. This is defined by + # the service. Format: + # projects/\\{project}/locations/global/jobs/\\{job_id}/bucketOperations/\\{bucket_operation}. + # @!attribute [rw] bucket_name + # @return [::String] + # The bucket name of the objects to be transformed in the BucketOperation. + # @!attribute [rw] prefix_list + # @return [::Google::Cloud::StorageBatchOperations::V1::PrefixList] + # Specifies objects matching a prefix set. + # + # Note: The following fields are mutually exclusive: `prefix_list`, `manifest`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] manifest + # @return [::Google::Cloud::StorageBatchOperations::V1::Manifest] + # Specifies objects in a manifest file. + # + # Note: The following fields are mutually exclusive: `manifest`, `prefix_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] put_object_hold + # @return [::Google::Cloud::StorageBatchOperations::V1::PutObjectHold] + # Changes object hold status. + # + # Note: The following fields are mutually exclusive: `put_object_hold`, `delete_object`, `put_metadata`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_object + # @return [::Google::Cloud::StorageBatchOperations::V1::DeleteObject] + # Delete objects. + # + # Note: The following fields are mutually exclusive: `delete_object`, `put_object_hold`, `put_metadata`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] put_metadata + # @return [::Google::Cloud::StorageBatchOperations::V1::PutMetadata] + # Updates object metadata. Allows updating fixed-key and custom metadata + # and fixed-key metadata i.e. Cache-Control, Content-Disposition, + # Content-Encoding, Content-Language, Content-Type, Custom-Time. + # + # Note: The following fields are mutually exclusive: `put_metadata`, `put_object_hold`, `delete_object`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] rewrite_object + # @return [::Google::Cloud::StorageBatchOperations::V1::RewriteObject] + # Rewrite the object and updates metadata like KMS key. + # + # Note: The following fields are mutually exclusive: `rewrite_object`, `put_object_hold`, `delete_object`, `put_metadata`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_object_custom_context + # @return [::Google::Cloud::StorageBatchOperations::V1::UpdateObjectCustomContext] + # Update object custom context. + # + # Note: The following fields are mutually exclusive: `update_object_custom_context`, `put_object_hold`, `delete_object`, `put_metadata`, `rewrite_object`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the BucketOperation was created. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the BucketOperation was started. + # @!attribute [r] complete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the BucketOperation was completed. + # @!attribute [r] counters + # @return [::Google::Cloud::StorageBatchOperations::V1::Counters] + # Output only. Information about the progress of the bucket operation. + # @!attribute [r] error_summaries + # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::ErrorSummary>] + # Output only. Summarizes errors encountered with sample error log entries. + # @!attribute [r] state + # @return [::Google::Cloud::StorageBatchOperations::V1::BucketOperation::State] + # Output only. State of the BucketOperation. + class BucketOperation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes state of the BucketOperation. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # Created but not yet started. + QUEUED = 1 + + # In progress. + RUNNING = 2 + + # Completed successfully. + SUCCEEDED = 3 + + # Cancelled by the user. + CANCELED = 4 + + # Terminated due to an unrecoverable failure. + FAILED = 5 + end + end + + # Describes list of buckets and their objects to be transformed. + # @!attribute [rw] buckets + # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::BucketList::Bucket>] + # Required. List of buckets and their objects to be transformed. Currently, + # only one bucket configuration is supported. If multiple buckets are + # specified, an error will be returned. + class BucketList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes configuration of a single bucket and its objects to be + # transformed. + # @!attribute [rw] bucket + # @return [::String] + # Required. Bucket name for the objects to be transformed. + # @!attribute [rw] prefix_list + # @return [::Google::Cloud::StorageBatchOperations::V1::PrefixList] + # Specifies objects matching a prefix set. + # + # Note: The following fields are mutually exclusive: `prefix_list`, `manifest`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] manifest + # @return [::Google::Cloud::StorageBatchOperations::V1::Manifest] + # Specifies objects in a manifest file. + # + # Note: The following fields are mutually exclusive: `manifest`, `prefix_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Bucket + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes list of objects to be transformed. + # @!attribute [rw] manifest_location + # @return [::String] + # Required. `manifest_location` must contain the manifest source file that is + # a CSV file in a Google Cloud Storage bucket. Each row in the file must + # include the object details i.e. BucketId and Name. Generation may + # optionally be specified. When it is not specified the live object is acted + # upon. `manifest_location` should either be 1) An absolute path to the + # object in the format of `gs://bucket_name/path/file_name.csv`. 2) An + # absolute path with a single wildcard character in the file name, for + # example `gs://bucket_name/path/file_name*.csv`. + # If manifest location is specified with a wildcard, objects in all manifest + # files matching the pattern will be acted upon. + class Manifest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes prefixes of objects to be transformed. + # @!attribute [rw] included_object_prefixes + # @return [::Array<::String>] + # Optional. Include prefixes of the objects to be transformed. + # * Supports full object name + # * Supports prefix of the object name + # * Wildcards are not supported + # * Supports empty string for all objects in a bucket. + class PrefixList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes options to update object hold. + # @!attribute [rw] temporary_hold + # @return [::Google::Cloud::StorageBatchOperations::V1::PutObjectHold::HoldStatus] + # Required. Updates object temporary holds state. When object temporary hold + # is set, object cannot be deleted or replaced. + # @!attribute [rw] event_based_hold + # @return [::Google::Cloud::StorageBatchOperations::V1::PutObjectHold::HoldStatus] + # Required. Updates object event based holds state. When object event based + # hold is set, object cannot be deleted or replaced. Resets object's time in + # the bucket for the purposes of the retention period. + class PutObjectHold + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the status of the hold. + module HoldStatus + # Default value, Object hold status will not be changed. + HOLD_STATUS_UNSPECIFIED = 0 + + # Places the hold. + SET = 1 + + # Releases the hold. + UNSET = 2 + end + end + + # Describes options to delete an object. + # @!attribute [rw] permanent_object_deletion_enabled + # @return [::Boolean] + # Required. Controls deletion behavior when versioning is enabled for the + # object's bucket. If true both live and noncurrent objects will be + # permanently deleted. Otherwise live objects in versioned buckets will + # become noncurrent and objects that were already noncurrent will be skipped. + # This setting doesn't have any impact on the Soft Delete feature. All + # objects deleted by this service can be be restored for the duration of the + # Soft Delete retention duration if enabled. If enabled and the manifest + # doesn't specify an object's generation, a GetObjectMetadata call (a Class B + # operation) will be made to determine the live object generation. + class DeleteObject + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes options for object rewrite. + # @!attribute [rw] kms_key + # @return [::String] + # Required. Resource name of the Cloud KMS key that will be used to encrypt + # the object. The Cloud KMS key must be located in same location as the + # object. Refer to + # https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key + # for additional documentation. Format: + # projects/\\{project}/locations/\\{location}/keyRings/\\{keyring}/cryptoKeys/\\{key} + # For example: + # "projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key". + # The object will be rewritten and set with the specified KMS key. + class RewriteObject + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes options for object retention update. + # @!attribute [rw] retain_until_time + # @return [::String] + # Required. The time when the object will be retained until. UNSET will clear + # the retention. Must be specified in RFC 3339 format e.g. + # YYYY-MM-DD'T'HH:MM:SS.SS'Z' or YYYY-MM-DD'T'HH:MM:SS'Z'. + # @!attribute [rw] retention_mode + # @return [::Google::Cloud::StorageBatchOperations::V1::ObjectRetention::RetentionMode] + # Required. The retention mode of the object. + class ObjectRetention + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the retention mode. + module RetentionMode + # If set and retain_until_time is empty, clears the retention. + RETENTION_MODE_UNSPECIFIED = 0 + + # Sets the retention mode to locked. + LOCKED = 1 + + # Sets the retention mode to unlocked. + UNLOCKED = 2 + end + end + + # Describes options for object metadata update. + # @!attribute [rw] content_disposition + # @return [::String] + # Optional. Updates objects Content-Disposition fixed metadata. Unset values + # will be ignored. Set empty values to clear the metadata. Refer + # https://cloud.google.com/storage/docs/metadata#content-disposition for + # additional documentation. + # @!attribute [rw] content_encoding + # @return [::String] + # Optional. Updates objects Content-Encoding fixed metadata. Unset values + # will be ignored. Set empty values to clear the metadata. Refer to + # documentation in + # https://cloud.google.com/storage/docs/metadata#content-encoding. + # @!attribute [rw] content_language + # @return [::String] + # Optional. Updates objects Content-Language fixed metadata. Refer to ISO + # 639-1 language codes for typical values of this metadata. Max length 100 + # characters. Unset values will be ignored. Set empty values to clear the + # metadata. Refer to documentation in + # https://cloud.google.com/storage/docs/metadata#content-language. + # @!attribute [rw] content_type + # @return [::String] + # Optional. Updates objects Content-Type fixed metadata. Unset values will be + # ignored. Set empty values to clear the metadata. Refer to documentation in + # https://cloud.google.com/storage/docs/metadata#content-type + # @!attribute [rw] cache_control + # @return [::String] + # Optional. Updates objects Cache-Control fixed metadata. Unset values will + # be ignored. Set empty values to clear the metadata. Additionally, the value + # for Custom-Time cannot decrease. Refer to documentation in + # https://cloud.google.com/storage/docs/metadata#caching_data. + # @!attribute [rw] custom_time + # @return [::String] + # Optional. Updates objects Custom-Time fixed metadata. Unset values will be + # ignored. Set empty values to clear the metadata. Refer to documentation in + # https://cloud.google.com/storage/docs/metadata#custom-time. + # @!attribute [rw] custom_metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Updates objects custom metadata. Adds or sets individual custom + # metadata key value pairs on objects. Keys that are set with empty custom + # metadata values will have its value cleared. Existing custom metadata not + # specified with this flag is not changed. Refer to documentation in + # https://cloud.google.com/storage/docs/metadata#custom-metadata + # @!attribute [rw] object_retention + # @return [::Google::Cloud::StorageBatchOperations::V1::ObjectRetention] + # Optional. Updates objects retention lock configuration. Unset values will + # be ignored. Set empty values to clear the retention for the object with + # existing `Unlocked` retention mode. Object with existing `Locked` retention + # mode cannot be cleared or reduce retain_until_time. Refer to documentation + # in https://cloud.google.com/storage/docs/object-lock + class PutMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class CustomMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the payload of a user defined object custom context. + # @!attribute [rw] value + # @return [::String] + # The value of the object custom context. + # If set, `value` must NOT be an empty string since it is a required field in + # custom context. If unset, `value` will be ignored and no changes will be + # made to the `value` field of the custom context payload. + class ObjectCustomContextPayload + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes a collection of updates to apply to custom contexts identified + # by key. + # @!attribute [rw] updates + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::StorageBatchOperations::V1::ObjectCustomContextPayload}] + # Optional. Insert or update the existing custom contexts. + # @!attribute [rw] keys_to_clear + # @return [::Array<::String>] + # Optional. Custom contexts to clear by key. + # A key cannot be present in both `updates` and `keys_to_clear`. + class CustomContextUpdates + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::StorageBatchOperations::V1::ObjectCustomContextPayload] + class UpdatesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes options to update object custom contexts. + # @!attribute [rw] custom_context_updates + # @return [::Google::Cloud::StorageBatchOperations::V1::CustomContextUpdates] + # A collection of updates to apply to specific custom contexts. + # Use this to add, update or delete individual contexts by key. + # + # Note: The following fields are mutually exclusive: `custom_context_updates`, `clear_all`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] clear_all + # @return [::Boolean] + # If set, must be set to true and all existing object custom contexts will + # be deleted. + # + # Note: The following fields are mutually exclusive: `clear_all`, `custom_context_updates`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class UpdateObjectCustomContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A summary of errors by error code, plus a count and sample error log + # entries. + # @!attribute [rw] error_code + # @return [::Google::Rpc::Code] + # Required. The canonical error code. + # @!attribute [rw] error_count + # @return [::Integer] + # Required. Number of errors encountered per `error_code`. + # @!attribute [rw] error_log_entries + # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::ErrorLogEntry>] + # Required. Sample error logs. + class ErrorSummary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An entry describing an error that has occurred. + # @!attribute [r] object_uri + # @return [::String] + # Required. Output only. Object URL. e.g. gs://my_bucket/object.txt + # @!attribute [r] error_details + # @return [::Array<::String>] + # Optional. Output only. At most 5 error log entries are recorded for a given + # error code for a job. + class ErrorLogEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes details about the progress of the job. + # @!attribute [r] total_object_count + # @return [::Integer] + # Output only. Number of objects listed. + # @!attribute [r] succeeded_object_count + # @return [::Integer] + # Output only. Number of objects completed. + # @!attribute [r] failed_object_count + # @return [::Integer] + # Output only. Number of objects failed. + # @!attribute [r] total_bytes_found + # @return [::Integer] + # Output only. Number of bytes found from source. This field is only + # populated for jobs with a prefix list object configuration. + class Counters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the Cloud Logging behavior. + # @!attribute [rw] log_actions + # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::LoggingConfig::LoggableAction>] + # Required. Specifies the actions to be logged. + # @!attribute [rw] log_action_states + # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::LoggingConfig::LoggableActionState>] + # Required. States in which Action are logged.If empty, no logs are + # generated. + class LoggingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Loggable actions types. + module LoggableAction + # Illegal value, to avoid allowing a default. + LOGGABLE_ACTION_UNSPECIFIED = 0 + + # The corresponding transform action in this job. + TRANSFORM = 6 + end + + # Loggable action states filter. + module LoggableActionState + # Illegal value, to avoid allowing a default. + LOGGABLE_ACTION_STATE_UNSPECIFIED = 0 + + # `LoggableAction` completed successfully. `SUCCEEDED` actions are + # logged as [INFO][google.logging.type.LogSeverity.INFO]. + SUCCEEDED = 1 + + # `LoggableAction` terminated in an error state. `FAILED` actions + # are logged as [ERROR][google.logging.type.LogSeverity.ERROR]. + FAILED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/rpc/code.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/code.rb new file mode 100644 index 000000000000..8cf36e815510 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/code.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The canonical error codes for gRPC APIs. + # + # + # Sometimes multiple error codes may apply. Services should return + # the most specific error code that applies. For example, prefer + # `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. + # Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. + module Code + # Not an error; returned on success. + # + # HTTP Mapping: 200 OK + OK = 0 + + # The operation was cancelled, typically by the caller. + # + # HTTP Mapping: 499 Client Closed Request + CANCELLED = 1 + + # Unknown error. For example, this error may be returned when + # a `Status` value received from another address space belongs to + # an error space that is not known in this address space. Also + # errors raised by APIs that do not return enough error information + # may be converted to this error. + # + # HTTP Mapping: 500 Internal Server Error + UNKNOWN = 2 + + # The client specified an invalid argument. Note that this differs + # from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + # that are problematic regardless of the state of the system + # (e.g., a malformed file name). + # + # HTTP Mapping: 400 Bad Request + INVALID_ARGUMENT = 3 + + # The deadline expired before the operation could complete. For operations + # that change the state of the system, this error may be returned + # even if the operation has completed successfully. For example, a + # successful response from a server could have been delayed long + # enough for the deadline to expire. + # + # HTTP Mapping: 504 Gateway Timeout + DEADLINE_EXCEEDED = 4 + + # Some requested entity (e.g., file or directory) was not found. + # + # Note to server developers: if a request is denied for an entire class + # of users, such as gradual feature rollout or undocumented allowlist, + # `NOT_FOUND` may be used. If a request is denied for some users within + # a class of users, such as user-based access control, `PERMISSION_DENIED` + # must be used. + # + # HTTP Mapping: 404 Not Found + NOT_FOUND = 5 + + # The entity that a client attempted to create (e.g., file or directory) + # already exists. + # + # HTTP Mapping: 409 Conflict + ALREADY_EXISTS = 6 + + # The caller does not have permission to execute the specified + # operation. `PERMISSION_DENIED` must not be used for rejections + # caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + # instead for those errors). `PERMISSION_DENIED` must not be + # used if the caller can not be identified (use `UNAUTHENTICATED` + # instead for those errors). This error code does not imply the + # request is valid or the requested entity exists or satisfies + # other pre-conditions. + # + # HTTP Mapping: 403 Forbidden + PERMISSION_DENIED = 7 + + # The request does not have valid authentication credentials for the + # operation. + # + # HTTP Mapping: 401 Unauthorized + UNAUTHENTICATED = 16 + + # Some resource has been exhausted, perhaps a per-user quota, or + # perhaps the entire file system is out of space. + # + # HTTP Mapping: 429 Too Many Requests + RESOURCE_EXHAUSTED = 8 + + # The operation was rejected because the system is not in a state + # required for the operation's execution. For example, the directory + # to be deleted is non-empty, an rmdir operation is applied to + # a non-directory, etc. + # + # Service implementors can use the following guidelines to decide + # between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + # (a) Use `UNAVAILABLE` if the client can retry just the failing call. + # (b) Use `ABORTED` if the client should retry at a higher level. For + # example, when a client-specified test-and-set fails, indicating the + # client should restart a read-modify-write sequence. + # (c) Use `FAILED_PRECONDITION` if the client should not retry until + # the system state has been explicitly fixed. For example, if an "rmdir" + # fails because the directory is non-empty, `FAILED_PRECONDITION` + # should be returned since the client should not retry unless + # the files are deleted from the directory. + # + # HTTP Mapping: 400 Bad Request + FAILED_PRECONDITION = 9 + + # The operation was aborted, typically due to a concurrency issue such as + # a sequencer check failure or transaction abort. + # + # See the guidelines above for deciding between `FAILED_PRECONDITION`, + # `ABORTED`, and `UNAVAILABLE`. + # + # HTTP Mapping: 409 Conflict + ABORTED = 10 + + # The operation was attempted past the valid range. E.g., seeking or + # reading past end-of-file. + # + # Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + # be fixed if the system state changes. For example, a 32-bit file + # system will generate `INVALID_ARGUMENT` if asked to read at an + # offset that is not in the range [0,2^32-1], but it will generate + # `OUT_OF_RANGE` if asked to read from an offset past the current + # file size. + # + # There is a fair bit of overlap between `FAILED_PRECONDITION` and + # `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + # error) when it applies so that callers who are iterating through + # a space can easily look for an `OUT_OF_RANGE` error to detect when + # they are done. + # + # HTTP Mapping: 400 Bad Request + OUT_OF_RANGE = 11 + + # The operation is not implemented or is not supported/enabled in this + # service. + # + # HTTP Mapping: 501 Not Implemented + UNIMPLEMENTED = 12 + + # Internal errors. This means that some invariants expected by the + # underlying system have been broken. This error code is reserved + # for serious errors. + # + # HTTP Mapping: 500 Internal Server Error + INTERNAL = 13 + + # The service is currently unavailable. This is most likely a + # transient condition, which can be corrected by retrying with + # a backoff. Note that it is not always safe to retry + # non-idempotent operations. + # + # See the guidelines above for deciding between `FAILED_PRECONDITION`, + # `ABORTED`, and `UNAVAILABLE`. + # + # HTTP Mapping: 503 Service Unavailable + UNAVAILABLE = 14 + + # Unrecoverable data loss or corruption. + # + # HTTP Mapping: 500 Internal Server Error + DATA_LOSS = 15 + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..3c630675d70b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/Gemfile new file mode 100644 index 000000000000..a750851dbe31 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1", path: "../" +else + gem "google-cloud-storage_batch_operations-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-storage_batch_operations-v1/snippets/snippet_metadata_google.cloud.storagebatchoperations.v1.json b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/snippet_metadata_google.cloud.storagebatchoperations.v1.json new file mode 100644 index 000000000000..abb4b821bbd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/snippet_metadata_google.cloud.storagebatchoperations.v1.json @@ -0,0 +1,295 @@ +{ + "client_library": { + "name": "google-cloud-storage_batch_operations-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.storagebatchoperations.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_ListJobs_sync", + "title": "Snippet for the list_jobs call in the StorageBatchOperations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_jobs.", + "file": "storage_batch_operations/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse", + "client": { + "short_name": "StorageBatchOperations::Client", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.ListJobs", + "service": { + "short_name": "StorageBatchOperations", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_GetJob_sync", + "title": "Snippet for the get_job call in the StorageBatchOperations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_job.", + "file": "storage_batch_operations/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageBatchOperations::V1::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageBatchOperations::V1::Job", + "client": { + "short_name": "StorageBatchOperations::Client", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.GetJob", + "service": { + "short_name": "StorageBatchOperations", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_CreateJob_sync", + "title": "Snippet for the create_job call in the StorageBatchOperations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#create_job.", + "file": "storage_batch_operations/create_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_job", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#create_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageBatchOperations::Client", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" + }, + "method": { + "short_name": "CreateJob", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.CreateJob", + "service": { + "short_name": "StorageBatchOperations", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_DeleteJob_sync", + "title": "Snippet for the delete_job call in the StorageBatchOperations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#delete_job.", + "file": "storage_batch_operations/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageBatchOperations::Client", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.DeleteJob", + "service": { + "short_name": "StorageBatchOperations", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_CancelJob_sync", + "title": "Snippet for the cancel_job call in the StorageBatchOperations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#cancel_job.", + "file": "storage_batch_operations/cancel_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "cancel_job", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#cancel_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse", + "client": { + "short_name": "StorageBatchOperations::Client", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" + }, + "method": { + "short_name": "CancelJob", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.CancelJob", + "service": { + "short_name": "StorageBatchOperations", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_ListBucketOperations_sync", + "title": "Snippet for the list_bucket_operations call in the StorageBatchOperations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_bucket_operations.", + "file": "storage_batch_operations/list_bucket_operations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_bucket_operations", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_bucket_operations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse", + "client": { + "short_name": "StorageBatchOperations::Client", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" + }, + "method": { + "short_name": "ListBucketOperations", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.ListBucketOperations", + "service": { + "short_name": "StorageBatchOperations", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_GetBucketOperation_sync", + "title": "Snippet for the get_bucket_operation call in the StorageBatchOperations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_bucket_operation.", + "file": "storage_batch_operations/get_bucket_operation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_bucket_operation", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_bucket_operation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageBatchOperations::V1::BucketOperation", + "client": { + "short_name": "StorageBatchOperations::Client", + "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" + }, + "method": { + "short_name": "GetBucketOperation", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.GetBucketOperation", + "service": { + "short_name": "StorageBatchOperations", + "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" + } + } + }, + "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-storage_batch_operations-v1/snippets/storage_batch_operations/cancel_job.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/cancel_job.rb new file mode 100644 index 000000000000..59df23ff21d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/cancel_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagebatchoperations_v1_generated_StorageBatchOperations_CancelJob_sync] +require "google/cloud/storage_batch_operations/v1" + +## +# Snippet for the cancel_job call in the StorageBatchOperations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#cancel_job. +# +def cancel_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new + + # Call the cancel_job method. + result = client.cancel_job request + + # The returned object is of type Google::Cloud::StorageBatchOperations::V1::CancelJobResponse. + p result +end +# [END storagebatchoperations_v1_generated_StorageBatchOperations_CancelJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/create_job.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/create_job.rb new file mode 100644 index 000000000000..8ae0dfd2ef7b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/create_job.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagebatchoperations_v1_generated_StorageBatchOperations_CreateJob_sync] +require "google/cloud/storage_batch_operations/v1" + +## +# Snippet for the create_job call in the StorageBatchOperations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#create_job. +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new + + # Call the create_job method. + result = client.create_job request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storagebatchoperations_v1_generated_StorageBatchOperations_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/delete_job.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/delete_job.rb new file mode 100644 index 000000000000..1693866aa9ec --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/delete_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagebatchoperations_v1_generated_StorageBatchOperations_DeleteJob_sync] +require "google/cloud/storage_batch_operations/v1" + +## +# Snippet for the delete_job call in the StorageBatchOperations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#delete_job. +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new + + # Call the delete_job method. + result = client.delete_job request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storagebatchoperations_v1_generated_StorageBatchOperations_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_bucket_operation.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_bucket_operation.rb new file mode 100644 index 000000000000..8619cc1d2684 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_bucket_operation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagebatchoperations_v1_generated_StorageBatchOperations_GetBucketOperation_sync] +require "google/cloud/storage_batch_operations/v1" + +## +# Snippet for the get_bucket_operation call in the StorageBatchOperations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_bucket_operation. +# +def get_bucket_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new + + # Call the get_bucket_operation method. + result = client.get_bucket_operation request + + # The returned object is of type Google::Cloud::StorageBatchOperations::V1::BucketOperation. + p result +end +# [END storagebatchoperations_v1_generated_StorageBatchOperations_GetBucketOperation_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_job.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_job.rb new file mode 100644 index 000000000000..6be0ef372c60 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagebatchoperations_v1_generated_StorageBatchOperations_GetJob_sync] +require "google/cloud/storage_batch_operations/v1" + +## +# Snippet for the get_job call in the StorageBatchOperations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_job. +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::StorageBatchOperations::V1::Job. + p result +end +# [END storagebatchoperations_v1_generated_StorageBatchOperations_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_bucket_operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_bucket_operations.rb new file mode 100644 index 000000000000..cdc367423363 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_bucket_operations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagebatchoperations_v1_generated_StorageBatchOperations_ListBucketOperations_sync] +require "google/cloud/storage_batch_operations/v1" + +## +# Snippet for the list_bucket_operations call in the StorageBatchOperations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_bucket_operations. +# +def list_bucket_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new + + # Call the list_bucket_operations method. + result = client.list_bucket_operations request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::BucketOperation. + p item + end +end +# [END storagebatchoperations_v1_generated_StorageBatchOperations_ListBucketOperations_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_jobs.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_jobs.rb new file mode 100644 index 000000000000..391dddfed522 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_jobs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagebatchoperations_v1_generated_StorageBatchOperations_ListJobs_sync] +require "google/cloud/storage_batch_operations/v1" + +## +# Snippet for the list_jobs call in the StorageBatchOperations service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_jobs. +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new + + # Call the list_jobs method. + result = client.list_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::Job. + p item + end +end +# [END storagebatchoperations_v1_generated_StorageBatchOperations_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_operations_test.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_operations_test.rb new file mode 100644 index 000000000000..4b98b5f03f30 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_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/storagebatchoperations/v1/storage_batch_operations_pb" +require "google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations" + +class ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_paths_test.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_paths_test.rb new file mode 100644 index 000000000000..1ed6c8547c61 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_paths_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/storage_batch_operations/v1/storage_batch_operations" + +class ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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_bucket_operation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.bucket_operation_path project: "value0", location: "value1", job: "value2", bucket_operation: "value3" + assert_equal "projects/value0/locations/value1/jobs/value2/bucketOperations/value3", 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::StorageBatchOperations::V1::StorageBatchOperations::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_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", location: "value1", job: "value2" + assert_equal "projects/value0/locations/value1/jobs/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_rest_test.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_rest_test.rb new file mode 100644 index 000000000000..826a0a156efa --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_rest_test.rb @@ -0,0 +1,491 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest" + + +class ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_jobs + # Create test objects. + client_result = ::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + order_by = "hello world" + + list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_jobs parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_count + end + end + end + + def test_get_job + # Create test objects. + client_result = ::Google::Cloud::StorageBatchOperations::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_job ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_count + end + end + end + + def test_create_job + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job_id = "hello world" + job = {} + request_id = "hello world" + + create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_job parent: parent, job_id: job_id, job: job, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_job ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_count + end + end + end + + def test_delete_job + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + force = true + + delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_job({ name: name, request_id: request_id, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_job name: name, request_id: request_id, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_job ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.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_job({ 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_job(::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.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_job_client_stub.call_count + end + end + end + + def test_cancel_job + # Create test objects. + client_result = ::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse.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" + + cancel_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_cancel_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, cancel_job_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.cancel_job({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.cancel_job name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.cancel_job ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.cancel_job({ 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.cancel_job(::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.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, cancel_job_client_stub.call_count + end + end + end + + def test_list_bucket_operations + # Create test objects. + client_result = ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + order_by = "hello world" + + list_bucket_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_list_bucket_operations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_bucket_operations_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_bucket_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_bucket_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_bucket_operations ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_bucket_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_bucket_operations(::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_bucket_operations_client_stub.call_count + end + end + end + + def test_get_bucket_operation + # Create test objects. + client_result = ::Google::Cloud::StorageBatchOperations::V1::BucketOperation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_bucket_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_get_bucket_operation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_bucket_operation_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_bucket_operation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_bucket_operation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_bucket_operation ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_bucket_operation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_bucket_operation(::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_bucket_operation_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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_test.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_test.rb new file mode 100644 index 000000000000..b8e234640b36 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_test.rb @@ -0,0 +1,567 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" +require "google/cloud/storage_batch_operations/v1/storage_batch_operations" + +class ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + order_by = "hello world" + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs(::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageBatchOperations::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_job, name + assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_rpc_count + end + end + + def test_create_job + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job_id = "hello world" + job = {} + request_id = "hello world" + + create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_job, name + assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["job_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageBatchOperations::V1::Job), request["job"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_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_job parent: parent, job_id: job_id, job: job, request_id: request_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_job ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_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_job({ parent: parent, job_id: job_id, job: job, 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_job(::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, 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_job_client_stub.call_rpc_count + end + end + + def test_delete_job + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + force = true + + delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_job, name + assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest, 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_job_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ name: name, request_id: request_id, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job name: name, request_id: request_id, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new(name: name, request_id: request_id, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ name: name, request_id: request_id, force: force }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new(name: name, request_id: request_id, force: force), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_rpc_count + end + end + + def test_cancel_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + + cancel_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_job, name + assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_job_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_job({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_job name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_job ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_job({ name: name, 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.cancel_job(::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new(name: name, 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, cancel_job_client_stub.call_rpc_count + end + end + + def test_list_bucket_operations + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + order_by = "hello world" + + list_bucket_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_bucket_operations, name + assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_bucket_operations_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_bucket_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations(::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations_client_stub.call_rpc_count + end + end + + def test_get_bucket_operation + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageBatchOperations::V1::BucketOperation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_bucket_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_bucket_operation, name + assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_bucket_operation_client_stub do + # Create client + client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_bucket_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_bucket_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_bucket_operation ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_bucket_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_bucket_operation(::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_bucket_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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/helper.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/.gitignore b/owl-bot-staging/google-cloud-storage_insights-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-storage_insights-v1/.repo-metadata.json new file mode 100644 index 000000000000..be4fdfc8fe3d --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "storageinsights.googleapis.com", + "api_shortname": "storageinsights", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage_insights-v1/latest", + "distribution_name": "google-cloud-storage_insights-v1", + "is_cloud": true, + "language": "ruby", + "name": "storageinsights", + "name_pretty": "Storage Insights V1 API", + "product_documentation": "https://cloud.google.com/storage/docs/insights/storage-insights", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Provides insights capability on Google Cloud Storage. Note that google-cloud-storage_insights-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_insights instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/storage/docs/insights/storage-insights", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/.rubocop.yml b/owl-bot-staging/google-cloud-storage_insights-v1/.rubocop.yml new file mode 100644 index 000000000000..15ce9706de62 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-storage_insights-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-storage_insights-v1.rb" diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/.toys.rb b/owl-bot-staging/google-cloud-storage_insights-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/.yardopts b/owl-bot-staging/google-cloud-storage_insights-v1/.yardopts new file mode 100644 index 000000000000..af463cd7b3be --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Storage Insights 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-storage_insights-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage_insights-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..dc813e50a150 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-storage_insights-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-storage_insights-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/storage_insights/v1" + +client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/storage_insights/v1" + +::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::StorageInsights::V1::StorageInsights::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-storage_insights-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/storage_insights/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::StorageInsights::V1::StorageInsights::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-storage_insights-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-storage_insights-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/Gemfile b/owl-bot-staging/google-cloud-storage_insights-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/LICENSE.md b/owl-bot-staging/google-cloud-storage_insights-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/README.md b/owl-bot-staging/google-cloud-storage_insights-v1/README.md new file mode 100644 index 000000000000..5145f323ce2a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Storage Insights V1 API + +Provides insights capability on Google Cloud Storage. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Storage Insights V1 API. Most users should consider using +the main client gem, +[google-cloud-storage_insights](https://rubygems.org/gems/google-cloud-storage_insights). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-storage_insights-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/storageinsights.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/storage_insights/v1" + +client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new +request = ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new # (request fields as keyword arguments...) +response = client.list_report_configs request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage_insights-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/storage/docs/insights/storage-insights) +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/storage_insights/v1" +require "logger" + +client = ::Google::Cloud::StorageInsights::V1::StorageInsights::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-storage_insights`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-storage_insights-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-storage_insights`. +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-storage_insights-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-storage_insights-v1/Rakefile b/owl-bot-staging/google-cloud-storage_insights-v1/Rakefile new file mode 100644 index 000000000000..44388c6b0350 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-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/storage_insights/v1/storage_insights/credentials" + ::Google::Cloud::StorageInsights::V1::StorageInsights::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-storage_insights-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-storage_insights-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-storage_insights-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-storage_insights-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-storage_insights-v1" + header "google-cloud-storage_insights-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-storage_insights-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-storage_insights-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-storage_insights-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-storage_insights-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-storage_insights-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-storage_insights-v1/gapic_metadata.json new file mode 100644 index 000000000000..33156113a928 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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.storageinsights.v1", + "libraryPackage": "::Google::Cloud::StorageInsights::V1", + "services": { + "StorageInsights": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client", + "rpcs": { + "ListReportConfigs": { + "methods": [ + "list_report_configs" + ] + }, + "GetReportConfig": { + "methods": [ + "get_report_config" + ] + }, + "CreateReportConfig": { + "methods": [ + "create_report_config" + ] + }, + "UpdateReportConfig": { + "methods": [ + "update_report_config" + ] + }, + "DeleteReportConfig": { + "methods": [ + "delete_report_config" + ] + }, + "ListReportDetails": { + "methods": [ + "list_report_details" + ] + }, + "GetReportDetail": { + "methods": [ + "get_report_detail" + ] + }, + "ListDatasetConfigs": { + "methods": [ + "list_dataset_configs" + ] + }, + "GetDatasetConfig": { + "methods": [ + "get_dataset_config" + ] + }, + "CreateDatasetConfig": { + "methods": [ + "create_dataset_config" + ] + }, + "UpdateDatasetConfig": { + "methods": [ + "update_dataset_config" + ] + }, + "DeleteDatasetConfig": { + "methods": [ + "delete_dataset_config" + ] + }, + "LinkDataset": { + "methods": [ + "link_dataset" + ] + }, + "UnlinkDataset": { + "methods": [ + "unlink_dataset" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/google-cloud-storage_insights-v1.gemspec b/owl-bot-staging/google-cloud-storage_insights-v1/google-cloud-storage_insights-v1.gemspec new file mode 100644 index 000000000000..bfc74cade13c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/google-cloud-storage_insights-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/storage_insights/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-storage_insights-v1" + gem.version = Google::Cloud::StorageInsights::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Provides insights capability on Google Cloud Storage. Note that google-cloud-storage_insights-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_insights instead. See the readme for more details." + gem.summary = "Provides insights capability on Google Cloud Storage." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google-cloud-storage_insights-v1.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google-cloud-storage_insights-v1.rb new file mode 100644 index 000000000000..2f17e838e1a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google-cloud-storage_insights-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/storage_insights/v1" diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1.rb new file mode 100644 index 000000000000..87dcbc42f811 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/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/storage_insights/v1/storage_insights" +require "google/cloud/storage_insights/v1/version" + +module Google + module Cloud + module StorageInsights + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/storage_insights/v1" + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/storage_insights/v1" + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/storage_insights/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/bindings_override.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/bindings_override.rb new file mode 100644 index 000000000000..5dd6cc378f61 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/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 StorageInsights + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/storage_insights/v1/rest" + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "StorageInsights"] + parent_config = while namespace.any? + parent_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-storage_insights-v1/lib/google/cloud/storage_insights/v1/rest.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/rest.rb new file mode 100644 index 000000000000..61082da8e33e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/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/storage_insights/v1/storage_insights/rest" +require "google/cloud/storage_insights/v1/bindings_override" +require "google/cloud/storage_insights/v1/version" + +module Google + module Cloud + module StorageInsights + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/storage_insights/v1/rest" + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights.rb new file mode 100644 index 000000000000..8a65f7fc66d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights.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/storage_insights/v1/version" + +require "google/cloud/storage_insights/v1/storage_insights/credentials" +require "google/cloud/storage_insights/v1/storage_insights/paths" +require "google/cloud/storage_insights/v1/storage_insights/operations" +require "google/cloud/storage_insights/v1/storage_insights/client" +require "google/cloud/storage_insights/v1/storage_insights/rest" + +module Google + module Cloud + module StorageInsights + module V1 + ## + # Service describing handlers for resources + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/storage_insights/v1/storage_insights" + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/storage_insights/v1/storage_insights/rest" + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + module StorageInsights + end + end + end + end +end + +helper_path = ::File.join __dir__, "storage_insights", "helpers.rb" +require "google/cloud/storage_insights/v1/storage_insights/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb new file mode 100644 index 000000000000..161b7d011b3c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb @@ -0,0 +1,1944 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/storageinsights/v1/storageinsights_pb" +require "google/cloud/location" + +module Google + module Cloud + module StorageInsights + module V1 + module StorageInsights + ## + # Client for the StorageInsights service. + # + # Service describing handlers for resources + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_insights_stub + + ## + # Configure the StorageInsights Client class. + # + # See {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageInsights clients + # ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "StorageInsights", "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.rpcs.list_report_configs.timeout = 60.0 + default_config.rpcs.list_report_configs.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_report_config.timeout = 60.0 + default_config.rpcs.get_report_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_report_details.timeout = 60.0 + default_config.rpcs.list_report_details.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_report_detail.timeout = 60.0 + default_config.rpcs.get_report_detail.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_dataset_configs.timeout = 60.0 + default_config.rpcs.list_dataset_configs.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_dataset_config.timeout = 60.0 + default_config.rpcs.create_dataset_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_dataset_config.timeout = 60.0 + default_config.rpcs.update_dataset_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_dataset_config.timeout = 60.0 + default_config.rpcs.delete_dataset_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.link_dataset.timeout = 60.0 + default_config.rpcs.link_dataset.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.unlink_dataset.timeout = 60.0 + default_config.rpcs.unlink_dataset.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageInsights Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @storage_insights_stub.universe_domain + end + + ## + # Create a new StorageInsights client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageInsights 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/storageinsights/v1/storageinsights_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 + + @storage_insights_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::StorageInsights::V1::StorageInsights::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 + ) + + @storage_insights_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 = @storage_insights_stub.endpoint + config.universe_domain = @storage_insights_stub.universe_domain + config.logger = @storage_insights_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::StorageInsights::V1::StorageInsights::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 + @storage_insights_stub.logger + end + + # Service calls + + ## + # Lists ReportConfigs in a given project and location. + # + # @overload list_report_configs(request, options = nil) + # Pass arguments to `list_report_configs` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_report_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_report_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent value for ListReportConfigsRequest + # @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::StorageInsights::V1::ReportConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new + # + # # Call the list_report_configs method. + # result = client.list_report_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportConfig. + # p item + # end + # + def list_report_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_report_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_report_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_report_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :list_report_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_report_configs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single ReportConfig. + # + # @overload get_report_config(request, options = nil) + # Pass arguments to `get_report_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::GetReportConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_report_config(name: nil) + # Pass arguments to `get_report_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageInsights::V1::ReportConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new + # + # # Call the get_report_config method. + # result = client.get_report_config request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. + # p result + # + def get_report_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_report_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_report_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_report_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :get_report_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new ReportConfig in a given project and location. + # + # @overload create_report_config(request, options = nil) + # Pass arguments to `create_report_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_report_config(parent: nil, report_config: nil, request_id: nil) + # Pass arguments to `create_report_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Value for parent. + # @param report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageInsights::V1::ReportConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new + # + # # Call the create_report_config method. + # result = client.create_report_config request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. + # p result + # + def create_report_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest + + # Converts hash and nil to 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_report_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_report_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_report_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :create_report_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the parameters of a single ReportConfig. + # + # @overload update_report_config(request, options = nil) + # Pass arguments to `update_report_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_report_config(update_mask: nil, report_config: nil, request_id: nil) + # Pass arguments to `update_report_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # ReportConfig 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 report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::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 [::Google::Cloud::StorageInsights::V1::ReportConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new + # + # # Call the update_report_config method. + # result = client.update_report_config request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. + # p result + # + def update_report_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest + + # Converts hash and nil to 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_report_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.report_config&.name + header_params["report_config.name"] = request.report_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_report_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_report_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :update_report_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single ReportConfig. + # + # @overload delete_report_config(request, options = nil) + # Pass arguments to `delete_report_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_report_config(name: nil, force: nil, request_id: nil) + # Pass arguments to `delete_report_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # @param force [::Boolean] + # Optional. If set, all ReportDetails for this ReportConfig will be deleted. + # @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 [::Google::Protobuf::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/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new + # + # # Call the delete_report_config method. + # result = client.delete_report_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_report_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_report_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_report_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_report_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :delete_report_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists ReportDetails in a given project and location. + # + # @overload list_report_details(request, options = nil) + # Pass arguments to `list_report_details` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_report_details(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_report_details` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 ListReportDetailsRequest + # @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::StorageInsights::V1::ReportDetail>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.new + # + # # Call the list_report_details method. + # result = client.list_report_details request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportDetail. + # p item + # end + # + def list_report_details request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_report_details.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_report_details.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_report_details.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :list_report_details, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_report_details, request, response, 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 ReportDetail. + # + # @overload get_report_detail(request, options = nil) + # Pass arguments to `get_report_detail` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::GetReportDetailRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_report_detail(name: nil) + # Pass arguments to `get_report_detail` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or 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::StorageInsights::V1::ReportDetail] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportDetail] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new + # + # # Call the get_report_detail method. + # result = client.get_report_detail request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportDetail. + # p result + # + def get_report_detail request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_report_detail.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_report_detail.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_report_detail.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :get_report_detail, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the dataset configurations in a given project for a given location. + # + # @overload list_dataset_configs(request, options = nil) + # Pass arguments to `list_dataset_configs` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_dataset_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_dataset_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent value for ListDatasetConfigsRequest + # @param page_size [::Integer] + # Requested page size. Server might return fewer items than requested. + # If unspecified, server picks 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::StorageInsights::V1::DatasetConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.new + # + # # Call the list_dataset_configs method. + # result = client.list_dataset_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageInsights::V1::DatasetConfig. + # p item + # end + # + def list_dataset_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_dataset_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_dataset_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_dataset_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :list_dataset_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_dataset_configs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the dataset configuration in a given project for a given location. + # + # @overload get_dataset_config(request, options = nil) + # Pass arguments to `get_dataset_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_dataset_config(name: nil) + # Pass arguments to `get_dataset_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageInsights::V1::DatasetConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new + # + # # Call the get_dataset_config method. + # result = client.get_dataset_config request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::DatasetConfig. + # p result + # + def get_dataset_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_dataset_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_dataset_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dataset_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :get_dataset_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a dataset configuration in a given project for a given location. + # + # @overload create_dataset_config(request, options = nil) + # Pass arguments to `create_dataset_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_dataset_config(parent: nil, dataset_config_id: nil, dataset_config: nil, request_id: nil) + # Pass arguments to `create_dataset_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Value for parent. + # @param dataset_config_id [::String] + # Required. ID of the requesting object. + # If auto-generating ID is enabled on the server-side, remove this field and + # `dataset_config_id` from the method_signature of Create RPC + # Note: The value should not contain any hyphens. + # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. A unique identifier for your request. + # Specify the request ID if you need to retry the request. + # If you retry the request with the same ID within 60 minutes, the server + # ignores the request if it has already completed the original request. + # + # For example, if your initial request times out and you retry the request + # using the same request ID, the server recognizes the original request and + # does not process the new request. + # + # The request ID must be a valid UUID and cannot be a zero UUID + # (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/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new + # + # # Call the create_dataset_config method. + # result = client.create_dataset_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_dataset_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest + + # Converts hash and nil to 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_dataset_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_dataset_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_dataset_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :create_dataset_config, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a dataset configuration in a given project for a given location. + # + # @overload update_dataset_config(request, options = nil) + # Pass arguments to `update_dataset_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_dataset_config(update_mask: nil, dataset_config: nil, request_id: nil) + # Pass arguments to `update_dataset_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `DatasetConfig` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field is overwritten if it is in the mask. If the + # user does not provide a mask then it returns an "Invalid Argument" error. + # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. A unique identifier for your request. + # Specify the request ID if you need to retry the request. + # If you retry the request with the same ID within 60 minutes, the server + # ignores the request if it has already completed the original request. + # + # For example, if your initial request times out and you retry the request + # using the same request ID, the server recognizes the original request and + # does not process the new request. + # + # The request ID must be a valid UUID and cannot be a zero UUID + # (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/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new + # + # # Call the update_dataset_config method. + # result = client.update_dataset_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_dataset_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest + + # Converts hash and nil to 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_dataset_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.dataset_config&.name + header_params["dataset_config.name"] = request.dataset_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_dataset_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_dataset_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :update_dataset_config, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 dataset configuration in a given project for a given location. + # + # @overload delete_dataset_config(request, options = nil) + # Pass arguments to `delete_dataset_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_dataset_config(name: nil, request_id: nil) + # Pass arguments to `delete_dataset_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # @param request_id [::String] + # Optional. A unique identifier for your request. + # Specify the request ID if you need to retry the request. + # If you retry the request with the same ID within 60 minutes, the server + # ignores the request if it has already completed the original request. + # + # For example, if your initial request times out and you retry the request + # using the same request ID, the server recognizes the original request and + # does not process the new request. + # + # The request ID must be a valid UUID and cannot be a zero UUID + # (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/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.new + # + # # Call the delete_dataset_config method. + # result = client.delete_dataset_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_dataset_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_dataset_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_dataset_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_dataset_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :delete_dataset_config, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Links a dataset to BigQuery in a given project for a given location. + # + # @overload link_dataset(request, options = nil) + # Pass arguments to `link_dataset` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::LinkDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload link_dataset(name: nil) + # Pass arguments to `link_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or 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 [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new + # + # # Call the link_dataset method. + # result = client.link_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def link_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.link_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.link_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.link_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :link_dataset, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Unlinks a dataset from BigQuery in a given project + # for a given location. + # + # @overload unlink_dataset(request, options = nil) + # Pass arguments to `unlink_dataset` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload unlink_dataset(name: nil) + # Pass arguments to `unlink_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or 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 [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new + # + # # Call the unlink_dataset method. + # result = client.unlink_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def unlink_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.unlink_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.unlink_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.unlink_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.call_rpc :unlink_dataset, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 StorageInsights API. + # + # This class represents the configuration for StorageInsights, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_report_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_report_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_report_configs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storageinsights.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the StorageInsights API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_report_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_report_configs + ## + # RPC-specific configuration for `get_report_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_report_config + ## + # RPC-specific configuration for `create_report_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_report_config + ## + # RPC-specific configuration for `update_report_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_report_config + ## + # RPC-specific configuration for `delete_report_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_report_config + ## + # RPC-specific configuration for `list_report_details` + # @return [::Gapic::Config::Method] + # + attr_reader :list_report_details + ## + # RPC-specific configuration for `get_report_detail` + # @return [::Gapic::Config::Method] + # + attr_reader :get_report_detail + ## + # RPC-specific configuration for `list_dataset_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_dataset_configs + ## + # RPC-specific configuration for `get_dataset_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset_config + ## + # RPC-specific configuration for `create_dataset_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dataset_config + ## + # RPC-specific configuration for `update_dataset_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset_config + ## + # RPC-specific configuration for `delete_dataset_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dataset_config + ## + # RPC-specific configuration for `link_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :link_dataset + ## + # RPC-specific configuration for `unlink_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :unlink_dataset + + # @private + def initialize parent_rpcs = nil + list_report_configs_config = parent_rpcs.list_report_configs if parent_rpcs.respond_to? :list_report_configs + @list_report_configs = ::Gapic::Config::Method.new list_report_configs_config + get_report_config_config = parent_rpcs.get_report_config if parent_rpcs.respond_to? :get_report_config + @get_report_config = ::Gapic::Config::Method.new get_report_config_config + create_report_config_config = parent_rpcs.create_report_config if parent_rpcs.respond_to? :create_report_config + @create_report_config = ::Gapic::Config::Method.new create_report_config_config + update_report_config_config = parent_rpcs.update_report_config if parent_rpcs.respond_to? :update_report_config + @update_report_config = ::Gapic::Config::Method.new update_report_config_config + delete_report_config_config = parent_rpcs.delete_report_config if parent_rpcs.respond_to? :delete_report_config + @delete_report_config = ::Gapic::Config::Method.new delete_report_config_config + list_report_details_config = parent_rpcs.list_report_details if parent_rpcs.respond_to? :list_report_details + @list_report_details = ::Gapic::Config::Method.new list_report_details_config + get_report_detail_config = parent_rpcs.get_report_detail if parent_rpcs.respond_to? :get_report_detail + @get_report_detail = ::Gapic::Config::Method.new get_report_detail_config + list_dataset_configs_config = parent_rpcs.list_dataset_configs if parent_rpcs.respond_to? :list_dataset_configs + @list_dataset_configs = ::Gapic::Config::Method.new list_dataset_configs_config + get_dataset_config_config = parent_rpcs.get_dataset_config if parent_rpcs.respond_to? :get_dataset_config + @get_dataset_config = ::Gapic::Config::Method.new get_dataset_config_config + create_dataset_config_config = parent_rpcs.create_dataset_config if parent_rpcs.respond_to? :create_dataset_config + @create_dataset_config = ::Gapic::Config::Method.new create_dataset_config_config + update_dataset_config_config = parent_rpcs.update_dataset_config if parent_rpcs.respond_to? :update_dataset_config + @update_dataset_config = ::Gapic::Config::Method.new update_dataset_config_config + delete_dataset_config_config = parent_rpcs.delete_dataset_config if parent_rpcs.respond_to? :delete_dataset_config + @delete_dataset_config = ::Gapic::Config::Method.new delete_dataset_config_config + link_dataset_config = parent_rpcs.link_dataset if parent_rpcs.respond_to? :link_dataset + @link_dataset = ::Gapic::Config::Method.new link_dataset_config + unlink_dataset_config = parent_rpcs.unlink_dataset if parent_rpcs.respond_to? :unlink_dataset + @unlink_dataset = ::Gapic::Config::Method.new unlink_dataset_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/credentials.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/credentials.rb new file mode 100644 index 000000000000..d7025fc54fe4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/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 StorageInsights + module V1 + module StorageInsights + # Credentials for the StorageInsights 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-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/operations.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/operations.rb new file mode 100644 index 000000000000..518179ea2ee4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/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 StorageInsights + module V1 + module StorageInsights + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StorageInsights 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 StorageInsights 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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::StorageInsights::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::StorageInsights::V1::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 = "storageinsights.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb new file mode 100644 index 000000000000..09f4fba414ac --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module StorageInsights + module V1 + module StorageInsights + # Path helper methods for the StorageInsights API. + module Paths + ## + # Create a fully-qualified DatasetConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasetConfigs/{dataset_config}` + # + # @param project [String] + # @param location [String] + # @param dataset_config [String] + # + # @return [::String] + def dataset_config_path project:, location:, dataset_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasetConfigs/#{dataset_config}" + 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 ReportConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reportConfigs/{report_config}` + # + # @param project [String] + # @param location [String] + # @param report_config [String] + # + # @return [::String] + def report_config_path project:, location:, report_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reportConfigs/#{report_config}" + end + + ## + # Create a fully-qualified ReportDetail resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reportConfigs/{report_config}/reportDetails/{report_detail}` + # + # @param project [String] + # @param location [String] + # @param report_config [String] + # @param report_detail [String] + # + # @return [::String] + def report_detail_path project:, location:, report_config:, report_detail: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "report_config cannot contain /" if report_config.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reportConfigs/#{report_config}/reportDetails/#{report_detail}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest.rb new file mode 100644 index 000000000000..4c9b09b0be65 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/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/storage_insights/v1/version" +require "google/cloud/storage_insights/v1/bindings_override" + +require "google/cloud/storage_insights/v1/storage_insights/credentials" +require "google/cloud/storage_insights/v1/storage_insights/paths" +require "google/cloud/storage_insights/v1/storage_insights/rest/operations" +require "google/cloud/storage_insights/v1/storage_insights/rest/client" + +module Google + module Cloud + module StorageInsights + module V1 + ## + # Service describing handlers for resources + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/storage_insights/v1/storage_insights/rest" + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + module StorageInsights + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/storage_insights/v1/storage_insights/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb new file mode 100644 index 000000000000..55cb5cb8a28d --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb @@ -0,0 +1,1811 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/storageinsights/v1/storageinsights_pb" +require "google/cloud/storage_insights/v1/storage_insights/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module StorageInsights + module V1 + module StorageInsights + module Rest + ## + # REST client for the StorageInsights service. + # + # Service describing handlers for resources + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_insights_stub + + ## + # Configure the StorageInsights Client class. + # + # See {::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageInsights clients + # ::Google::Cloud::StorageInsights::V1::StorageInsights::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", "StorageInsights", "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.rpcs.list_report_configs.timeout = 60.0 + default_config.rpcs.list_report_configs.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_report_config.timeout = 60.0 + default_config.rpcs.get_report_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_report_details.timeout = 60.0 + default_config.rpcs.list_report_details.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_report_detail.timeout = 60.0 + default_config.rpcs.get_report_detail.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_dataset_configs.timeout = 60.0 + default_config.rpcs.list_dataset_configs.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_dataset_config.timeout = 60.0 + default_config.rpcs.create_dataset_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_dataset_config.timeout = 60.0 + default_config.rpcs.update_dataset_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_dataset_config.timeout = 60.0 + default_config.rpcs.delete_dataset_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.link_dataset.timeout = 60.0 + default_config.rpcs.link_dataset.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.unlink_dataset.timeout = 60.0 + default_config.rpcs.unlink_dataset.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageInsights Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::StorageInsights::V1::StorageInsights::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 + @storage_insights_stub.universe_domain + end + + ## + # Create a new StorageInsights REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageInsights 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::StorageInsights::V1::StorageInsights::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 + + @storage_insights_stub = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @storage_insights_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 = @storage_insights_stub.endpoint + config.universe_domain = @storage_insights_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @storage_insights_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::StorageInsights::V1::StorageInsights::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 + @storage_insights_stub.logger + end + + # Service calls + + ## + # Lists ReportConfigs in a given project and location. + # + # @overload list_report_configs(request, options = nil) + # Pass arguments to `list_report_configs` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_report_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_report_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent value for ListReportConfigsRequest + # @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::StorageInsights::V1::ReportConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new + # + # # Call the list_report_configs method. + # result = client.list_report_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportConfig. + # p item + # end + # + def list_report_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_report_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_report_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_report_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.list_report_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_report_configs, "report_configs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single ReportConfig. + # + # @overload get_report_config(request, options = nil) + # Pass arguments to `get_report_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::GetReportConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_report_config(name: nil) + # Pass arguments to `get_report_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new + # + # # Call the get_report_config method. + # result = client.get_report_config request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. + # p result + # + def get_report_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_report_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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_report_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_report_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.get_report_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new ReportConfig in a given project and location. + # + # @overload create_report_config(request, options = nil) + # Pass arguments to `create_report_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_report_config(parent: nil, report_config: nil, request_id: nil) + # Pass arguments to `create_report_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Value for parent. + # @param report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new + # + # # Call the create_report_config method. + # result = client.create_report_config request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. + # p result + # + def create_report_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest + + # Converts hash and nil to an 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_report_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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_report_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_report_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.create_report_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the parameters of a single ReportConfig. + # + # @overload update_report_config(request, options = nil) + # Pass arguments to `update_report_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_report_config(update_mask: nil, report_config: nil, request_id: nil) + # Pass arguments to `update_report_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # ReportConfig 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 report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::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 [::Google::Cloud::StorageInsights::V1::ReportConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new + # + # # Call the update_report_config method. + # result = client.update_report_config request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. + # p result + # + def update_report_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest + + # Converts hash and nil to an 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_report_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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_report_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_report_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.update_report_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single ReportConfig. + # + # @overload delete_report_config(request, options = nil) + # Pass arguments to `delete_report_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_report_config(name: nil, force: nil, request_id: nil) + # Pass arguments to `delete_report_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # @param force [::Boolean] + # Optional. If set, all ReportDetails for this ReportConfig will be deleted. + # @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 [::Google::Protobuf::Empty] + # @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/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new + # + # # Call the delete_report_config method. + # result = client.delete_report_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_report_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_report_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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_report_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_report_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.delete_report_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists ReportDetails in a given project and location. + # + # @overload list_report_details(request, options = nil) + # Pass arguments to `list_report_details` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_report_details(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_report_details` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 ListReportDetailsRequest + # @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::StorageInsights::V1::ReportDetail>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.new + # + # # Call the list_report_details method. + # result = client.list_report_details request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportDetail. + # p item + # end + # + def list_report_details request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_report_details.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_report_details.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_report_details.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.list_report_details request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_report_details, "report_details", request, result, 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 ReportDetail. + # + # @overload get_report_detail(request, options = nil) + # Pass arguments to `get_report_detail` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::GetReportDetailRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_report_detail(name: nil) + # Pass arguments to `get_report_detail` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or 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::StorageInsights::V1::ReportDetail] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportDetail] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new + # + # # Call the get_report_detail method. + # result = client.get_report_detail request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportDetail. + # p result + # + def get_report_detail request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_report_detail.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_report_detail.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_report_detail.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.get_report_detail request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the dataset configurations in a given project for a given location. + # + # @overload list_dataset_configs(request, options = nil) + # Pass arguments to `list_dataset_configs` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_dataset_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_dataset_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent value for ListDatasetConfigsRequest + # @param page_size [::Integer] + # Requested page size. Server might return fewer items than requested. + # If unspecified, server picks 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::StorageInsights::V1::DatasetConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.new + # + # # Call the list_dataset_configs method. + # result = client.list_dataset_configs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageInsights::V1::DatasetConfig. + # p item + # end + # + def list_dataset_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_dataset_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_dataset_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_dataset_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.list_dataset_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_dataset_configs, "dataset_configs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the dataset configuration in a given project for a given location. + # + # @overload get_dataset_config(request, options = nil) + # Pass arguments to `get_dataset_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_dataset_config(name: nil) + # Pass arguments to `get_dataset_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::DatasetConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new + # + # # Call the get_dataset_config method. + # result = client.get_dataset_config request + # + # # The returned object is of type Google::Cloud::StorageInsights::V1::DatasetConfig. + # p result + # + def get_dataset_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_dataset_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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_dataset_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dataset_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.get_dataset_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a dataset configuration in a given project for a given location. + # + # @overload create_dataset_config(request, options = nil) + # Pass arguments to `create_dataset_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_dataset_config(parent: nil, dataset_config_id: nil, dataset_config: nil, request_id: nil) + # Pass arguments to `create_dataset_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Value for parent. + # @param dataset_config_id [::String] + # Required. ID of the requesting object. + # If auto-generating ID is enabled on the server-side, remove this field and + # `dataset_config_id` from the method_signature of Create RPC + # Note: The value should not contain any hyphens. + # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. A unique identifier for your request. + # Specify the request ID if you need to retry the request. + # If you retry the request with the same ID within 60 minutes, the server + # ignores the request if it has already completed the original request. + # + # For example, if your initial request times out and you retry the request + # using the same request ID, the server recognizes the original request and + # does not process the new request. + # + # The request ID must be a valid UUID and cannot be a zero UUID + # (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/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new + # + # # Call the create_dataset_config method. + # result = client.create_dataset_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_dataset_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest + + # Converts hash and nil to an 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_dataset_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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_dataset_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_dataset_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.create_dataset_config request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 dataset configuration in a given project for a given location. + # + # @overload update_dataset_config(request, options = nil) + # Pass arguments to `update_dataset_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_dataset_config(update_mask: nil, dataset_config: nil, request_id: nil) + # Pass arguments to `update_dataset_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `DatasetConfig` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field is overwritten if it is in the mask. If the + # user does not provide a mask then it returns an "Invalid Argument" error. + # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. A unique identifier for your request. + # Specify the request ID if you need to retry the request. + # If you retry the request with the same ID within 60 minutes, the server + # ignores the request if it has already completed the original request. + # + # For example, if your initial request times out and you retry the request + # using the same request ID, the server recognizes the original request and + # does not process the new request. + # + # The request ID must be a valid UUID and cannot be a zero UUID + # (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/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new + # + # # Call the update_dataset_config method. + # result = client.update_dataset_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_dataset_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest + + # Converts hash and nil to an 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_dataset_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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_dataset_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_dataset_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.update_dataset_config request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 dataset configuration in a given project for a given location. + # + # @overload delete_dataset_config(request, options = nil) + # Pass arguments to `delete_dataset_config` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_dataset_config(name: nil, request_id: nil) + # Pass arguments to `delete_dataset_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource + # @param request_id [::String] + # Optional. A unique identifier for your request. + # Specify the request ID if you need to retry the request. + # If you retry the request with the same ID within 60 minutes, the server + # ignores the request if it has already completed the original request. + # + # For example, if your initial request times out and you retry the request + # using the same request ID, the server recognizes the original request and + # does not process the new request. + # + # The request ID must be a valid UUID and cannot be a zero UUID + # (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/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.new + # + # # Call the delete_dataset_config method. + # result = client.delete_dataset_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_dataset_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_dataset_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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_dataset_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_dataset_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.delete_dataset_config request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Links a dataset to BigQuery in a given project for a given location. + # + # @overload link_dataset(request, options = nil) + # Pass arguments to `link_dataset` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::LinkDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload link_dataset(name: nil) + # Pass arguments to `link_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or 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 [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new + # + # # Call the link_dataset method. + # result = client.link_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def link_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.link_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.link_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.link_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.link_dataset request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Unlinks a dataset from BigQuery in a given project + # for a given location. + # + # @overload unlink_dataset(request, options = nil) + # Pass arguments to `unlink_dataset` via a request object, either of type + # {::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload unlink_dataset(name: nil) + # Pass arguments to `unlink_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or 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 [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_insights/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new + # + # # Call the unlink_dataset method. + # result = client.unlink_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def unlink_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.unlink_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.unlink_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.unlink_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_insights_stub.unlink_dataset request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 StorageInsights REST API. + # + # This class represents the configuration for StorageInsights REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_report_configs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_report_configs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_report_configs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storageinsights.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 StorageInsights API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_report_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_report_configs + ## + # RPC-specific configuration for `get_report_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_report_config + ## + # RPC-specific configuration for `create_report_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_report_config + ## + # RPC-specific configuration for `update_report_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_report_config + ## + # RPC-specific configuration for `delete_report_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_report_config + ## + # RPC-specific configuration for `list_report_details` + # @return [::Gapic::Config::Method] + # + attr_reader :list_report_details + ## + # RPC-specific configuration for `get_report_detail` + # @return [::Gapic::Config::Method] + # + attr_reader :get_report_detail + ## + # RPC-specific configuration for `list_dataset_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_dataset_configs + ## + # RPC-specific configuration for `get_dataset_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset_config + ## + # RPC-specific configuration for `create_dataset_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dataset_config + ## + # RPC-specific configuration for `update_dataset_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dataset_config + ## + # RPC-specific configuration for `delete_dataset_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dataset_config + ## + # RPC-specific configuration for `link_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :link_dataset + ## + # RPC-specific configuration for `unlink_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :unlink_dataset + + # @private + def initialize parent_rpcs = nil + list_report_configs_config = parent_rpcs.list_report_configs if parent_rpcs.respond_to? :list_report_configs + @list_report_configs = ::Gapic::Config::Method.new list_report_configs_config + get_report_config_config = parent_rpcs.get_report_config if parent_rpcs.respond_to? :get_report_config + @get_report_config = ::Gapic::Config::Method.new get_report_config_config + create_report_config_config = parent_rpcs.create_report_config if parent_rpcs.respond_to? :create_report_config + @create_report_config = ::Gapic::Config::Method.new create_report_config_config + update_report_config_config = parent_rpcs.update_report_config if parent_rpcs.respond_to? :update_report_config + @update_report_config = ::Gapic::Config::Method.new update_report_config_config + delete_report_config_config = parent_rpcs.delete_report_config if parent_rpcs.respond_to? :delete_report_config + @delete_report_config = ::Gapic::Config::Method.new delete_report_config_config + list_report_details_config = parent_rpcs.list_report_details if parent_rpcs.respond_to? :list_report_details + @list_report_details = ::Gapic::Config::Method.new list_report_details_config + get_report_detail_config = parent_rpcs.get_report_detail if parent_rpcs.respond_to? :get_report_detail + @get_report_detail = ::Gapic::Config::Method.new get_report_detail_config + list_dataset_configs_config = parent_rpcs.list_dataset_configs if parent_rpcs.respond_to? :list_dataset_configs + @list_dataset_configs = ::Gapic::Config::Method.new list_dataset_configs_config + get_dataset_config_config = parent_rpcs.get_dataset_config if parent_rpcs.respond_to? :get_dataset_config + @get_dataset_config = ::Gapic::Config::Method.new get_dataset_config_config + create_dataset_config_config = parent_rpcs.create_dataset_config if parent_rpcs.respond_to? :create_dataset_config + @create_dataset_config = ::Gapic::Config::Method.new create_dataset_config_config + update_dataset_config_config = parent_rpcs.update_dataset_config if parent_rpcs.respond_to? :update_dataset_config + @update_dataset_config = ::Gapic::Config::Method.new update_dataset_config_config + delete_dataset_config_config = parent_rpcs.delete_dataset_config if parent_rpcs.respond_to? :delete_dataset_config + @delete_dataset_config = ::Gapic::Config::Method.new delete_dataset_config_config + link_dataset_config = parent_rpcs.link_dataset if parent_rpcs.respond_to? :link_dataset + @link_dataset = ::Gapic::Config::Method.new link_dataset_config + unlink_dataset_config = parent_rpcs.unlink_dataset if parent_rpcs.respond_to? :unlink_dataset + @unlink_dataset = ::Gapic::Config::Method.new unlink_dataset_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/operations.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/operations.rb new file mode 100644 index 000000000000..641ca5a6525f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/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 StorageInsights + module V1 + module StorageInsights + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StorageInsights 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 StorageInsights 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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageInsights::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "storageinsights.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_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-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb new file mode 100644 index 000000000000..2e360ee0386f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb @@ -0,0 +1,941 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/storageinsights/v1/storageinsights_pb" + +module Google + module Cloud + module StorageInsights + module V1 + module StorageInsights + module Rest + ## + # REST service stub for the StorageInsights 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_report_configs REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse] + # A result object deserialized from the server's reply + def list_report_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_report_configs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_report_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_report_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::GetReportConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # A result object deserialized from the server's reply + def get_report_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_report_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_report_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageInsights::V1::ReportConfig.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_report_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # A result object deserialized from the server's reply + def create_report_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_report_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_report_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageInsights::V1::ReportConfig.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_report_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # A result object deserialized from the server's reply + def update_report_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_report_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_report_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageInsights::V1::ReportConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_report_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_report_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_report_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_report_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_report_details REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse] + # A result object deserialized from the server's reply + def list_report_details request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_report_details_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_report_details", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_report_detail REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::GetReportDetailRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportDetail] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ReportDetail] + # A result object deserialized from the server's reply + def get_report_detail request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_report_detail_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_report_detail", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageInsights::V1::ReportDetail.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_dataset_configs REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse] + # A result object deserialized from the server's reply + def list_dataset_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_dataset_configs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_dataset_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_dataset_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageInsights::V1::DatasetConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] + # A result object deserialized from the server's reply + def get_dataset_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dataset_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_dataset_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageInsights::V1::DatasetConfig.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_dataset_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_dataset_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_dataset_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_dataset_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_dataset_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_dataset_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_dataset_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_dataset_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_dataset_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_dataset_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_dataset_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_dataset_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the link_dataset REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def link_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_link_dataset_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "link_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the unlink_dataset REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def unlink_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_unlink_dataset_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "unlink_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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_report_configs REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_report_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/reportConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_report_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::GetReportConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_report_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_report_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest] + # 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_report_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/reportConfigs", + body: "report_config", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_report_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest] + # 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_report_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{report_config.name}", + body: "report_config", + matches: [ + ["report_config.name", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_report_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_report_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_report_details REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_report_details_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/reportDetails", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_report_detail REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::GetReportDetailRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_report_detail_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/reportDetails/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_dataset_configs REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_dataset_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/datasetConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dataset_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_dataset_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_dataset_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest] + # 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_dataset_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/datasetConfigs", + body: "dataset_config", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_dataset_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest] + # 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_dataset_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{dataset_config.name}", + body: "dataset_config", + matches: [ + ["dataset_config.name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_dataset_config REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_dataset_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the link_dataset REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_link_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:linkDataset", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the unlink_dataset REST call + # + # @param request_pb [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_unlink_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:unlinkDataset", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/version.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/version.rb new file mode 100644 index 000000000000..db245c92063b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/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 StorageInsights + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb new file mode 100644 index 000000000000..5281c25b3f44 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/storageinsights/v1/storageinsights.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/date_pb' +require 'google/type/datetime_pb' + + +descriptor_data = "\n5google/cloud/storageinsights/v1/storageinsights.proto\x12\x1fgoogle.cloud.storageinsights.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\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/date.proto\x1a\x1agoogle/type/datetime.proto\"\xa8\x01\n\x18ListReportConfigsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+storageinsights.googleapis.com/ReportConfig\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\"\x90\x01\n\x19ListReportConfigsResponse\x12\x45\n\x0ereport_configs\x18\x01 \x03(\x0b\x32-.google.cloud.storageinsights.v1.ReportConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"[\n\x16GetReportConfigRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+storageinsights.googleapis.com/ReportConfig\"\xc4\x01\n\x19\x43reateReportConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+storageinsights.googleapis.com/ReportConfig\x12I\n\rreport_config\x18\x03 \x01(\x0b\x32-.google.cloud.storageinsights.v1.ReportConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb5\x01\n\x19UpdateReportConfigRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12I\n\rreport_config\x18\x02 \x01(\x0b\x32-.google.cloud.storageinsights.v1.ReportConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x8b\x01\n\x19\x44\x65leteReportConfigRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+storageinsights.googleapis.com/ReportConfig\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xe3\x04\n\x0cReportDetail\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\rsnapshot_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x12report_path_prefix\x18\x08 \x01(\t\x12\x14\n\x0cshards_count\x18\t \x01(\x03\x12\"\n\x06status\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\x12I\n\x06labels\x18\x05 \x03(\x0b\x32\x39.google.cloud.storageinsights.v1.ReportDetail.LabelsEntry\x12.\n\x0ftarget_datetime\x18\x06 \x01(\x0b\x32\x15.google.type.DateTime\x12M\n\x0ereport_metrics\x18\x07 \x01(\x0b\x32\x35.google.cloud.storageinsights.v1.ReportDetail.Metrics\x1a*\n\x07Metrics\x12\x1f\n\x17processed_records_count\x18\x01 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x96\x01\xea\x41\x92\x01\n+storageinsights.googleapis.com/ReportDetail\x12\x63projects/{project}/locations/{location}/reportConfigs/{report_config}/reportDetails/{report_detail}\"\xa8\x01\n\x18ListReportDetailsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+storageinsights.googleapis.com/ReportDetail\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\"\x90\x01\n\x19ListReportDetailsResponse\x12\x45\n\x0ereport_details\x18\x01 \x03(\x0b\x32-.google.cloud.storageinsights.v1.ReportDetail\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"[\n\x16GetReportDetailRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+storageinsights.googleapis.com/ReportDetail\"\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\"\xed\x01\n\x10\x46requencyOptions\x12N\n\tfrequency\x18\x01 \x01(\x0e\x32;.google.cloud.storageinsights.v1.FrequencyOptions.Frequency\x12%\n\nstart_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12#\n\x08\x65nd_date\x18\x03 \x01(\x0b\x32\x11.google.type.Date\"=\n\tFrequency\x12\x19\n\x15\x46REQUENCY_UNSPECIFIED\x10\x00\x12\t\n\x05\x44\x41ILY\x10\x01\x12\n\n\x06WEEKLY\x10\x02\"R\n\nCSVOptions\x12\x18\n\x10record_separator\x18\x01 \x01(\t\x12\x11\n\tdelimiter\x18\x02 \x01(\t\x12\x17\n\x0fheader_required\x18\x03 \x01(\x08\"\x10\n\x0eParquetOptions\"%\n\x13\x43loudStorageFilters\x12\x0e\n\x06\x62ucket\x18\x01 \x01(\t\"J\n\x1e\x43loudStorageDestinationOptions\x12\x0e\n\x06\x62ucket\x18\x01 \x01(\t\x12\x18\n\x10\x64\x65stination_path\x18\x02 \x01(\t\"\x90\x02\n\x1bObjectMetadataReportOptions\x12\x17\n\x0fmetadata_fields\x18\x01 \x03(\t\x12O\n\x0fstorage_filters\x18\x02 \x01(\x0b\x32\x34.google.cloud.storageinsights.v1.CloudStorageFiltersH\x00\x12\x66\n\x1bstorage_destination_options\x18\x03 \x01(\x0b\x32?.google.cloud.storageinsights.v1.CloudStorageDestinationOptionsH\x01\x42\x08\n\x06\x66ilterB\x15\n\x13\x64\x65stination_options\"\xf7\x05\n\x0cReportConfig\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\x12L\n\x11\x66requency_options\x18\x05 \x01(\x0b\x32\x31.google.cloud.storageinsights.v1.FrequencyOptions\x12\x42\n\x0b\x63sv_options\x18\x06 \x01(\x0b\x32+.google.cloud.storageinsights.v1.CSVOptionsH\x00\x12J\n\x0fparquet_options\x18\x07 \x01(\x0b\x32/.google.cloud.storageinsights.v1.ParquetOptionsH\x00\x12\x66\n\x1eobject_metadata_report_options\x18\x08 \x01(\x0b\x32<.google.cloud.storageinsights.v1.ObjectMetadataReportOptionsH\x01\x12I\n\x06labels\x18\n \x03(\x0b\x32\x39.google.cloud.storageinsights.v1.ReportConfig.LabelsEntry\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:w\xea\x41t\n+storageinsights.googleapis.com/ReportConfig\x12\x45projects/{project}/locations/{location}/reportConfigs/{report_config}B\x0f\n\rreport_formatB\r\n\x0breport_kind\"\xcf\x01\n\x08Identity\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x44\n\x04type\x18\x02 \x01(\x0e\x32\x36.google.cloud.storageinsights.v1.Identity.IdentityType\"j\n\x0cIdentityType\x12\x1d\n\x19IDENTITY_TYPE_UNSPECIFIED\x10\x00\x12\x1c\n\x18IDENTITY_TYPE_PER_CONFIG\x10\x01\x12\x1d\n\x19IDENTITY_TYPE_PER_PROJECT\x10\x02\"\x9d\x1b\n\rDatasetConfig\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\x12J\n\x06labels\x18\x04 \x03(\x0b\x32:.google.cloud.storageinsights.v1.DatasetConfig.LabelsEntry\x12\x10\n\x03uid\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12 \n\x13organization_number\x18\x16 \x01(\x03\x42\x03\xe0\x41\x01\x12X\n\x0fsource_projects\x18\x07 \x01(\x0b\x32=.google.cloud.storageinsights.v1.DatasetConfig.SourceProjectsH\x00\x12V\n\x0esource_folders\x18\x18 \x01(\x0b\x32<.google.cloud.storageinsights.v1.DatasetConfig.SourceFoldersH\x00\x12\x1c\n\x12organization_scope\x18\x19 \x01(\x08H\x00\x12(\n\x19\x63loud_storage_object_path\x18\x15 \x01(\tB\x03\xe0\x41\x04H\x00\x12o\n\x1finclude_cloud_storage_locations\x18\x08 \x01(\x0b\x32\x44.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageLocationsH\x01\x12o\n\x1f\x65xclude_cloud_storage_locations\x18\t \x01(\x0b\x32\x44.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageLocationsH\x01\x12k\n\x1dinclude_cloud_storage_buckets\x18\n \x01(\x0b\x32\x42.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBucketsH\x02\x12k\n\x1d\x65xclude_cloud_storage_buckets\x18\x0b \x01(\x0b\x32\x42.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBucketsH\x02\x12%\n\x1dinclude_newly_created_buckets\x18\x0c \x01(\x08\x12+\n\x1cskip_verification_and_ingest\x18\x13 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12\x1d\n\x15retention_period_days\x18\x0e \x01(\x05\x12\x41\n\x04link\x18\x0f \x01(\x0b\x32\x33.google.cloud.storageinsights.v1.DatasetConfig.Link\x12;\n\x08identity\x18\x10 \x01(\x0b\x32).google.cloud.storageinsights.v1.Identity\x12\'\n\x06status\x18\x11 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12]\n\x14\x64\x61taset_config_state\x18\x12 \x01(\x0e\x32:.google.cloud.storageinsights.v1.DatasetConfig.ConfigStateB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x14 \x01(\tB\x03\xe0\x41\x01\x1a)\n\x0eSourceProjects\x12\x17\n\x0fproject_numbers\x18\x01 \x03(\x03\x1a,\n\rSourceFolders\x12\x1b\n\x0e\x66older_numbers\x18\x01 \x03(\x03\x42\x03\xe0\x41\x01\x1a*\n\x15\x43loudStorageLocations\x12\x11\n\tlocations\x18\x01 \x03(\t\x1a\xef\x01\n\x13\x43loudStorageBuckets\x12t\n\x15\x63loud_storage_buckets\x18\x01 \x03(\x0b\x32U.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBuckets.CloudStorageBucket\x1a\x62\n\x12\x43loudStorageBucket\x12\x15\n\x0b\x62ucket_name\x18\x01 \x01(\tH\x00\x12\x1d\n\x13\x62ucket_prefix_regex\x18\x02 \x01(\tH\x00\x42\x16\n\x14\x63loud_storage_bucket\x1a\x31\n\x04Link\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06linked\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a\xc3\x02\n\x0c\x42ucketErrors\x12\x1c\n\x0fvalidated_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12$\n\x17permission_denied_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12)\n\x1cpermission_denied_bucket_ids\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x30\n!non_management_hub_entitled_count\x18\x05 \x01(\x03\x42\x05\x18\x01\xe0\x41\x01\x12!\n\x14internal_error_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\x12\x34\n\'non_storage_intelligence_entitled_count\x18\x07 \x01(\x03\x42\x03\xe0\x41\x01\x12\x39\n,non_storage_intelligence_entitled_bucket_ids\x18\x08 \x03(\tB\x03\xe0\x41\x01\x1a\xdf\x05\n\rProjectErrors\x12!\n\x0fvalidated_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12)\n\x17outside_org_error_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12(\n\x1boutside_org_project_numbers\x18\x03 \x03(\x03\x42\x03\xe0\x41\x01\x12;\n\'non_management_hub_entitled_error_count\x18\x07 \x01(\x03\x42\x05\x18\x01\xe0\x41\x01H\x03\x88\x01\x01\x12:\n+non_management_hub_entitled_project_numbers\x18\x08 \x03(\x03\x42\x05\x18\x01\xe0\x41\x01\x12?\n-non_storage_intelligence_entitled_error_count\x18\t \x01(\x03\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12>\n1non_storage_intelligence_entitled_project_numbers\x18\n \x03(\x03\x42\x03\xe0\x41\x01\x12&\n\x14internal_error_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12,\n\x1d\x64\x65stination_project_org_error\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x12;\n,destination_project_check_has_internal_error\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x42\"\n destination_project_check_resultB\x12\n\x10_validated_countB\x1a\n\x18_outside_org_error_countB*\n(_non_management_hub_entitled_error_countB0\n._non_storage_intelligence_entitled_error_countB\x17\n\x15_internal_error_count\x1a\xd5\x01\n\x1fValidationErrorsBeforeIngestion\x12W\n\rbucket_errors\x18\x01 \x01(\x0b\x32;.google.cloud.storageinsights.v1.DatasetConfig.BucketErrorsB\x03\xe0\x41\x01\x12Y\n\x0eproject_errors\x18\x02 \x01(\x0b\x32<.google.cloud.storageinsights.v1.DatasetConfig.ProjectErrorsB\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\"\xa6\x01\n\x0b\x43onfigState\x12\x1c\n\x18\x43ONFIG_STATE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x43ONFIG_STATE_ACTIVE\x10\x01\x12)\n%CONFIG_STATE_VERIFICATION_IN_PROGRESS\x10\x02\x12\x18\n\x14\x43ONFIG_STATE_CREATED\x10\x03\x12\x1b\n\x17\x43ONFIG_STATE_PROCESSING\x10\x04:z\xea\x41w\n,storageinsights.googleapis.com/DatasetConfig\x12Gprojects/{project}/locations/{location}/datasetConfigs/{dataset_config}B\x10\n\x0esource_optionsB\x19\n\x17\x63loud_storage_locationsB\x17\n\x15\x63loud_storage_buckets\"\xaa\x01\n\x19ListDatasetConfigsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,storageinsights.googleapis.com/DatasetConfig\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\"\x93\x01\n\x1aListDatasetConfigsResponse\x12G\n\x0f\x64\x61taset_configs\x18\x01 \x03(\x0b\x32..google.cloud.storageinsights.v1.DatasetConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"]\n\x17GetDatasetConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,storageinsights.googleapis.com/DatasetConfig\"\xe8\x01\n\x1a\x43reateDatasetConfigRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,storageinsights.googleapis.com/DatasetConfig\x12\x1e\n\x11\x64\x61taset_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\x0e\x64\x61taset_config\x18\x03 \x01(\x0b\x32..google.cloud.storageinsights.v1.DatasetConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb8\x01\n\x1aUpdateDatasetConfigRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12K\n\x0e\x64\x61taset_config\x18\x02 \x01(\x0b\x32..google.cloud.storageinsights.v1.DatasetConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"y\n\x1a\x44\x65leteDatasetConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,storageinsights.googleapis.com/DatasetConfig\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"X\n\x12LinkDatasetRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,storageinsights.googleapis.com/DatasetConfig\"\x15\n\x13LinkDatasetResponse\"Z\n\x14UnlinkDatasetRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,storageinsights.googleapis.com/DatasetConfig\"U\n\x10LocationMetadata\x12\x1f\n\x17report_config_available\x18\x01 \x01(\x08\x12 \n\x18\x64\x61taset_config_available\x18\x02 \x01(\x08\x32\x90\x19\n\x0fStorageInsights\x12\xce\x01\n\x11ListReportConfigs\x12\x39.google.cloud.storageinsights.v1.ListReportConfigsRequest\x1a:.google.cloud.storageinsights.v1.ListReportConfigsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=projects/*/locations/*}/reportConfigs\x12\xbb\x01\n\x0fGetReportConfig\x12\x37.google.cloud.storageinsights.v1.GetReportConfigRequest\x1a-.google.cloud.storageinsights.v1.ReportConfig\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=projects/*/locations/*/reportConfigs/*}\x12\xe0\x01\n\x12\x43reateReportConfig\x12:.google.cloud.storageinsights.v1.CreateReportConfigRequest\x1a-.google.cloud.storageinsights.v1.ReportConfig\"_\xda\x41\x14parent,report_config\x82\xd3\xe4\x93\x02\x42\"1/v1/{parent=projects/*/locations/*}/reportConfigs:\rreport_config\x12\xf3\x01\n\x12UpdateReportConfig\x12:.google.cloud.storageinsights.v1.UpdateReportConfigRequest\x1a-.google.cloud.storageinsights.v1.ReportConfig\"r\xda\x41\x19report_config,update_mask\x82\xd3\xe4\x93\x02P2?/v1/{report_config.name=projects/*/locations/*/reportConfigs/*}:\rreport_config\x12\xaa\x01\n\x12\x44\x65leteReportConfig\x12:.google.cloud.storageinsights.v1.DeleteReportConfigRequest\x1a\x16.google.protobuf.Empty\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1/{name=projects/*/locations/*/reportConfigs/*}\x12\xde\x01\n\x11ListReportDetails\x12\x39.google.cloud.storageinsights.v1.ListReportDetailsRequest\x1a:.google.cloud.storageinsights.v1.ListReportDetailsResponse\"R\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{parent=projects/*/locations/*/reportConfigs/*}/reportDetails\x12\xcb\x01\n\x0fGetReportDetail\x12\x37.google.cloud.storageinsights.v1.GetReportDetailRequest\x1a-.google.cloud.storageinsights.v1.ReportDetail\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{name=projects/*/locations/*/reportConfigs/*/reportDetails/*}\x12\xd2\x01\n\x12ListDatasetConfigs\x12:.google.cloud.storageinsights.v1.ListDatasetConfigsRequest\x1a;.google.cloud.storageinsights.v1.ListDatasetConfigsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/datasetConfigs\x12\xbf\x01\n\x10GetDatasetConfig\x12\x38.google.cloud.storageinsights.v1.GetDatasetConfigRequest\x1a..google.cloud.storageinsights.v1.DatasetConfig\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/datasetConfigs/*}\x12\x8d\x02\n\x13\x43reateDatasetConfig\x12;.google.cloud.storageinsights.v1.CreateDatasetConfigRequest\x1a\x1d.google.longrunning.Operation\"\x99\x01\xca\x41\"\n\rDatasetConfig\x12\x11OperationMetadata\xda\x41\'parent,dataset_config,dataset_config_id\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/datasetConfigs:\x0e\x64\x61taset_config\x12\x8f\x02\n\x13UpdateDatasetConfig\x12;.google.cloud.storageinsights.v1.UpdateDatasetConfigRequest\x1a\x1d.google.longrunning.Operation\"\x9b\x01\xca\x41\"\n\rDatasetConfig\x12\x11OperationMetadata\xda\x41\x1a\x64\x61taset_config,update_mask\x82\xd3\xe4\x93\x02S2A/v1/{dataset_config.name=projects/*/locations/*/datasetConfigs/*}:\x0e\x64\x61taset_config\x12\xe1\x01\n\x13\x44\x65leteDatasetConfig\x12;.google.cloud.storageinsights.v1.DeleteDatasetConfigRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v1/{name=projects/*/locations/*/datasetConfigs/*}\x12\xde\x01\n\x0bLinkDataset\x12\x33.google.cloud.storageinsights.v1.LinkDatasetRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41(\n\x13LinkDatasetResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/locations/*/datasetConfigs/*}:linkDataset:\x01*\x12\xe6\x01\n\rUnlinkDataset\x12\x35.google.cloud.storageinsights.v1.UnlinkDatasetRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\"@/v1/{name=projects/*/locations/*/datasetConfigs/*}:unlinkDataset:\x01*\x1aR\xca\x41\x1estorageinsights.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe8\x01\n#com.google.cloud.storageinsights.v1B\x07V1ProtoP\x01ZMcloud.google.com/go/storageinsights/apiv1/storageinsightspb;storageinsightspb\xaa\x02\x1fGoogle.Cloud.StorageInsights.V1\xca\x02\x1fGoogle\\Cloud\\StorageInsights\\V1\xea\x02\"Google::Cloud::StorageInsights::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module StorageInsights + module V1 + ListReportConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListReportConfigsRequest").msgclass + ListReportConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListReportConfigsResponse").msgclass + GetReportConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.GetReportConfigRequest").msgclass + CreateReportConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CreateReportConfigRequest").msgclass + UpdateReportConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.UpdateReportConfigRequest").msgclass + DeleteReportConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DeleteReportConfigRequest").msgclass + ReportDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ReportDetail").msgclass + ReportDetail::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ReportDetail.Metrics").msgclass + ListReportDetailsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListReportDetailsRequest").msgclass + ListReportDetailsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListReportDetailsResponse").msgclass + GetReportDetailRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.GetReportDetailRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.OperationMetadata").msgclass + FrequencyOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.FrequencyOptions").msgclass + FrequencyOptions::Frequency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.FrequencyOptions.Frequency").enummodule + CSVOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CSVOptions").msgclass + ParquetOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ParquetOptions").msgclass + CloudStorageFilters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CloudStorageFilters").msgclass + CloudStorageDestinationOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CloudStorageDestinationOptions").msgclass + ObjectMetadataReportOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ObjectMetadataReportOptions").msgclass + ReportConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ReportConfig").msgclass + Identity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.Identity").msgclass + Identity::IdentityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.Identity.IdentityType").enummodule + DatasetConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig").msgclass + DatasetConfig::SourceProjects = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.SourceProjects").msgclass + DatasetConfig::SourceFolders = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.SourceFolders").msgclass + DatasetConfig::CloudStorageLocations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.CloudStorageLocations").msgclass + DatasetConfig::CloudStorageBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBuckets").msgclass + DatasetConfig::CloudStorageBuckets::CloudStorageBucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBuckets.CloudStorageBucket").msgclass + DatasetConfig::Link = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.Link").msgclass + DatasetConfig::BucketErrors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.BucketErrors").msgclass + DatasetConfig::ProjectErrors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.ProjectErrors").msgclass + DatasetConfig::ValidationErrorsBeforeIngestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.ValidationErrorsBeforeIngestion").msgclass + DatasetConfig::ConfigState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.ConfigState").enummodule + ListDatasetConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListDatasetConfigsRequest").msgclass + ListDatasetConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListDatasetConfigsResponse").msgclass + GetDatasetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.GetDatasetConfigRequest").msgclass + CreateDatasetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CreateDatasetConfigRequest").msgclass + UpdateDatasetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.UpdateDatasetConfigRequest").msgclass + DeleteDatasetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DeleteDatasetConfigRequest").msgclass + LinkDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.LinkDatasetRequest").msgclass + LinkDatasetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.LinkDatasetResponse").msgclass + UnlinkDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.UnlinkDatasetRequest").msgclass + LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.LocationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb new file mode 100644 index 000000000000..6b36d9b1d713 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb @@ -0,0 +1,72 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/storageinsights/v1/storageinsights.proto for package 'Google.Cloud.StorageInsights.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/storageinsights/v1/storageinsights_pb' + +module Google + module Cloud + module StorageInsights + module V1 + module StorageInsights + # 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.storageinsights.v1.StorageInsights' + + # Lists ReportConfigs in a given project and location. + rpc :ListReportConfigs, ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, ::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse + # Gets details of a single ReportConfig. + rpc :GetReportConfig, ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, ::Google::Cloud::StorageInsights::V1::ReportConfig + # Creates a new ReportConfig in a given project and location. + rpc :CreateReportConfig, ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, ::Google::Cloud::StorageInsights::V1::ReportConfig + # Updates the parameters of a single ReportConfig. + rpc :UpdateReportConfig, ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, ::Google::Cloud::StorageInsights::V1::ReportConfig + # Deletes a single ReportConfig. + rpc :DeleteReportConfig, ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, ::Google::Protobuf::Empty + # Lists ReportDetails in a given project and location. + rpc :ListReportDetails, ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, ::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse + # Gets details of a single ReportDetail. + rpc :GetReportDetail, ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, ::Google::Cloud::StorageInsights::V1::ReportDetail + # Lists the dataset configurations in a given project for a given location. + rpc :ListDatasetConfigs, ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse + # Gets the dataset configuration in a given project for a given location. + rpc :GetDatasetConfig, ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, ::Google::Cloud::StorageInsights::V1::DatasetConfig + # Creates a dataset configuration in a given project for a given location. + rpc :CreateDatasetConfig, ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, ::Google::Longrunning::Operation + # Updates a dataset configuration in a given project for a given location. + rpc :UpdateDatasetConfig, ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, ::Google::Longrunning::Operation + # Deletes a dataset configuration in a given project for a given location. + rpc :DeleteDatasetConfig, ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, ::Google::Longrunning::Operation + # Links a dataset to BigQuery in a given project for a given location. + rpc :LinkDataset, ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, ::Google::Longrunning::Operation + # Unlinks a dataset from BigQuery in a given project + # for a given location. + rpc :UnlinkDataset, ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/README.md new file mode 100644 index 000000000000..9bdfaa290d57 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Storage Insights 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-storage_insights-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb new file mode 100644 index 000000000000..523cad53f1b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb @@ -0,0 +1,930 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module StorageInsights + module V1 + # Request message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_configs `ListReportConfigs`} + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListReportConfigsRequest + # @!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 ListReportConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing ReportConfigs + # @!attribute [rw] report_configs + # @return [::Array<::Google::Cloud::StorageInsights::V1::ReportConfig>] + # The list of ReportConfig + # @!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 ListReportConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a ReportConfig + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + class GetReportConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a ReportConfig + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] report_config + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateReportConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a ReportConfig + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # ReportConfig 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] report_config + # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] + # 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 UpdateReportConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a ReportConfig + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set, all ReportDetails for this ReportConfig will be deleted. + # @!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 DeleteReportConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing ReportDetail object. ReportDetail represents metadata of + # generated reports for a ReportConfig. + # Next ID: 10 + # @!attribute [rw] name + # @return [::String] + # Name of resource. It will be of form + # projects//locations//reportConfigs//reportDetails/. + # @!attribute [rw] snapshot_time + # @return [::Google::Protobuf::Timestamp] + # The snapshot time. + # All the report data is referenced at this point of time. + # @!attribute [rw] report_path_prefix + # @return [::String] + # Prefix of the object name of each report's shard. This will have full + # prefix except the "extension" and "shard_id". + # For example, if the `destination_path` is + # `{{report-config-id}}/dt={{datetime}}`, the shard object name would be + # `gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv` + # and the value of `report_path_prefix` field would be + # `gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_`. + # @!attribute [rw] shards_count + # @return [::Integer] + # Total shards generated for the report. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Status of the ReportDetail. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [rw] target_datetime + # @return [::Google::Type::DateTime] + # The date for which report is generated. The time part of target_datetime + # will be zero till we support multiple reports per day. + # @!attribute [rw] report_metrics + # @return [::Google::Cloud::StorageInsights::V1::ReportDetail::Metrics] + # Metrics of the report. + class ReportDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Different metrics associated with the generated report. + # @!attribute [rw] processed_records_count + # @return [::Integer] + # Count of Cloud Storage objects which are part of the report. + class Metrics + 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 + + # Message for requesting list of ReportDetails + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListReportDetailsRequest + # @!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 ListReportDetailsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing ReportDetails + # @!attribute [rw] report_details + # @return [::Array<::Google::Cloud::StorageInsights::V1::ReportDetail>] + # The list of ReportDetail + # @!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 ListReportDetailsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a ReportDetail + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + class GetReportDetailRequest + 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 + + # ReportConfig Resource: + # + # Options to setup frequency of report generation. + # @!attribute [rw] frequency + # @return [::Google::Cloud::StorageInsights::V1::FrequencyOptions::Frequency] + # Frequency of report generation. + # @!attribute [rw] start_date + # @return [::Google::Type::Date] + # The date from which report generation should start. + # UTC time zone. + # @!attribute [rw] end_date + # @return [::Google::Type::Date] + # The date on which report generation should stop (Inclusive). + # UTC time zone. + class FrequencyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This ENUM specifies possible frequencies of report generation. + module Frequency + # Unspecified. + FREQUENCY_UNSPECIFIED = 0 + + # Report will be generated daily. + DAILY = 1 + + # Report will be generated weekly. + WEEKLY = 2 + end + end + + # Options to configure CSV formatted reports. + # @!attribute [rw] record_separator + # @return [::String] + # Record separator characters in CSV. + # @!attribute [rw] delimiter + # @return [::String] + # Delimiter characters in CSV. + # @!attribute [rw] header_required + # @return [::Boolean] + # If set, will include a header row in the CSV report. + class CSVOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options to configure Parquet formatted reports. + class ParquetOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options to filter data on storage systems. + # Next ID: 2 + # @!attribute [rw] bucket + # @return [::String] + # Bucket for which the report will be generated. + class CloudStorageFilters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options to store reports in storage systems. + # Next ID: 3 + # @!attribute [rw] bucket + # @return [::String] + # Destination bucket. + # @!attribute [rw] destination_path + # @return [::String] + # Destination path is the path in the bucket where the report should be + # generated. + class CloudStorageDestinationOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Report specification for exporting object metadata. + # Next ID: 4 + # @!attribute [rw] metadata_fields + # @return [::Array<::String>] + # Metadata fields to be included in the report. + # @!attribute [rw] storage_filters + # @return [::Google::Cloud::StorageInsights::V1::CloudStorageFilters] + # Cloud Storage as the storage system. + # @!attribute [rw] storage_destination_options + # @return [::Google::Cloud::StorageInsights::V1::CloudStorageDestinationOptions] + # Cloud Storage as the storage system. + class ObjectMetadataReportOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing ReportConfig object. ReportConfig is the configuration to + # generate reports. + # See + # https://cloud.google.com/storage/docs/insights/using-inventory-reports#create-config-rest + # for more details on how to set various fields. + # Next ID: 12 + # @!attribute [rw] name + # @return [::String] + # name of resource. It will be of form + # projects//locations//reportConfigs/. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Create time stamp + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Update time stamp + # @!attribute [rw] frequency_options + # @return [::Google::Cloud::StorageInsights::V1::FrequencyOptions] + # The frequency of report generation. + # @!attribute [rw] csv_options + # @return [::Google::Cloud::StorageInsights::V1::CSVOptions] + # Options for CSV formatted reports. + # + # Note: The following fields are mutually exclusive: `csv_options`, `parquet_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parquet_options + # @return [::Google::Cloud::StorageInsights::V1::ParquetOptions] + # Options for Parquet formatted reports. + # + # Note: The following fields are mutually exclusive: `parquet_options`, `csv_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] object_metadata_report_options + # @return [::Google::Cloud::StorageInsights::V1::ObjectMetadataReportOptions] + # Report for exporting object metadata. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [rw] display_name + # @return [::String] + # User provided display name which can be empty and limited to 256 characters + # that is editable. + class ReportConfig + 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 + + # Identity lets the user provide the type of identity to use, and outputs + # the identity string that can be used for IAM policy changes. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the identity. + # @!attribute [rw] type + # @return [::Google::Cloud::StorageInsights::V1::Identity::IdentityType] + # Type of identity to use for the datasetConfig. + class Identity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of service account to use for the dataset configuration. + module IdentityType + # Default is unspecified and should not be used. + IDENTITY_TYPE_UNSPECIFIED = 0 + + # Google managed service account per resource. + IDENTITY_TYPE_PER_CONFIG = 1 + + # Google managed service account per project. + IDENTITY_TYPE_PER_PROJECT = 2 + end + end + + # Message describing the dataset configuration properties. For more + # information, see [Dataset configuration + # properties](https://cloud.google.com/storage/docs/insights/datasets#dataset-config). + # @!attribute [rw] name + # @return [::String] + # Identifier. name of resource + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The UTC time at which the dataset configuration was created. + # This is auto-populated. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The UTC time at which the dataset configuration was last + # updated. This is auto-populated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [r] uid + # @return [::String] + # Output only. System generated unique identifier for the resource. + # @!attribute [rw] organization_number + # @return [::Integer] + # Optional. Organization resource ID that the source projects should belong + # to. Projects that do not belong to the provided organization are not + # considered when creating the dataset. + # @!attribute [rw] source_projects + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::SourceProjects] + # Defines the options for providing source projects for the dataset. + # + # Note: The following fields are mutually exclusive: `source_projects`, `source_folders`, `organization_scope`, `cloud_storage_object_path`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] source_folders + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::SourceFolders] + # Defines the options for providing source folders for the dataset. + # + # Note: The following fields are mutually exclusive: `source_folders`, `source_projects`, `organization_scope`, `cloud_storage_object_path`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] organization_scope + # @return [::Boolean] + # Defines the options for providing a source organization for the dataset. + # + # Note: The following fields are mutually exclusive: `organization_scope`, `source_projects`, `source_folders`, `cloud_storage_object_path`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] cloud_storage_object_path + # @return [::String] + # Input only. Cloud Storage object path containing a list of + # project or folder numbers to include in the dataset; + # it cannot contain a mix of project and folders. + # + # The object must be a text file where each line has one of the following + # entries: + # + # - Project number, formatted as `projects/{project_number}`, for example, + # `projects/1234567890`. + # - Folder identifier, formatted as `folders/{folder_number}`, for example, + # `folders/9876543210`. + # Path must be in the format `gs://{bucket_name}/{object_name}`. + # + # Note: The following fields are mutually exclusive: `cloud_storage_object_path`, `source_projects`, `source_folders`, `organization_scope`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] include_cloud_storage_locations + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageLocations] + # Note: The following fields are mutually exclusive: `include_cloud_storage_locations`, `exclude_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclude_cloud_storage_locations + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageLocations] + # Note: The following fields are mutually exclusive: `exclude_cloud_storage_locations`, `include_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] include_cloud_storage_buckets + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageBuckets] + # Note: The following fields are mutually exclusive: `include_cloud_storage_buckets`, `exclude_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclude_cloud_storage_buckets + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageBuckets] + # Note: The following fields are mutually exclusive: `exclude_cloud_storage_buckets`, `include_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] include_newly_created_buckets + # @return [::Boolean] + # If set to `true`, the request includes all the newly created buckets in the + # dataset that meet the inclusion and exclusion rules. + # @!attribute [rw] skip_verification_and_ingest + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. If set to `false`, then all the permission checks must be + # successful before the system can start ingesting data. This field can only + # be updated before the system ingests data for the first time. Any attempt + # to modify the field after data ingestion starts results in an error. + # @!attribute [rw] retention_period_days + # @return [::Integer] + # Number of days of history that must be retained. + # @!attribute [rw] link + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::Link] + # Details of the linked dataset. + # @!attribute [rw] identity + # @return [::Google::Cloud::StorageInsights::V1::Identity] + # Identity used by this `datasetConfig`. + # @!attribute [r] status + # @return [::Google::Rpc::Status] + # Output only. Status of the `datasetConfig`. + # @!attribute [r] dataset_config_state + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::ConfigState] + # Output only. State of the `datasetConfig`. + # @!attribute [rw] description + # @return [::String] + # Optional. A user-provided description for the dataset configuration. + # + # Maximum length: 256 characters. + class DatasetConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Collection of project numbers + # @!attribute [rw] project_numbers + # @return [::Array<::Integer>] + class SourceProjects + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies a set of folders to include in the dataset + # @!attribute [rw] folder_numbers + # @return [::Array<::Integer>] + # Optional. The list of folder numbers to include in the dataset. + class SourceFolders + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Collection of Cloud Storage locations. + # @!attribute [rw] locations + # @return [::Array<::String>] + class CloudStorageLocations + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Collection of Cloud Storage buckets. + # @!attribute [rw] cloud_storage_buckets + # @return [::Array<::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageBuckets::CloudStorageBucket>] + class CloudStorageBuckets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines the bucket by its name or a regex pattern to match buckets. + # @!attribute [rw] bucket_name + # @return [::String] + # Cloud Storage bucket name. + # + # Note: The following fields are mutually exclusive: `bucket_name`, `bucket_prefix_regex`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bucket_prefix_regex + # @return [::String] + # A regex pattern for bucket names matching the regex. Regex should + # follow the syntax specified in `google/re2` on GitHub. + # + # Note: The following fields are mutually exclusive: `bucket_prefix_regex`, `bucket_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class CloudStorageBucket + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Defines the details about the linked dataset. + # @!attribute [r] dataset + # @return [::String] + # Output only. Dataset name for linked dataset. + # @!attribute [r] linked + # @return [::Boolean] + # Output only. State of the linked dataset. + class Link + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides a summary of the bucket level error statistics. + # @!attribute [rw] validated_count + # @return [::Integer] + # Optional. Count of successfully validated buckets. + # @!attribute [rw] permission_denied_count + # @return [::Integer] + # Optional. Count of buckets with permission denied errors. + # @!attribute [rw] permission_denied_bucket_ids + # @return [::Array<::String>] + # Optional. Subset of bucket names that have permission denied. + # @!attribute [rw] non_management_hub_entitled_count + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Optional. Count of buckets that are not subscribed to Storage + # Intelligence. + # @!attribute [rw] internal_error_count + # @return [::Integer] + # Optional. Number of buckets that encountered internal errors during the + # validation process. These buckets are automatically retried in subsequent + # validation attempts. + # @!attribute [rw] non_storage_intelligence_entitled_count + # @return [::Integer] + # Optional. Count of buckets that are not subscribed to Storage + # Intelligence. + # @!attribute [rw] non_storage_intelligence_entitled_bucket_ids + # @return [::Array<::String>] + # Optional. Subset of bucket names that are not subscribed to Storage + # Intelligence. + class BucketErrors + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides a summary of the project level error statistics. + # @!attribute [rw] validated_count + # @return [::Integer] + # Optional. Count of successfully validated projects. + # @!attribute [rw] outside_org_error_count + # @return [::Integer] + # Optional. Count of projects which are not in the same organization. + # @!attribute [rw] outside_org_project_numbers + # @return [::Array<::Integer>] + # Optional. Subset of project numbers which are not in the same + # organization. + # @!attribute [rw] non_management_hub_entitled_error_count + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # Optional. Count of projects that are not subscribed to Storage + # Intelligence. + # @!attribute [rw] non_management_hub_entitled_project_numbers + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Integer>] + # Optional. Subset of project numbers that are not subscribed to Storage + # Intelligence. + # @!attribute [rw] non_storage_intelligence_entitled_error_count + # @return [::Integer] + # Optional. Count of projects that are not subscribed to Storage + # Intelligence. + # @!attribute [rw] non_storage_intelligence_entitled_project_numbers + # @return [::Array<::Integer>] + # Optional. Subset of project numbers that are not subscribed to Storage + # Intelligence. + # @!attribute [rw] internal_error_count + # @return [::Integer] + # Optional. Number of projects that encountered internal errors during + # validation and are automatically retried. + # @!attribute [rw] destination_project_org_error + # @return [::Boolean] + # Optional. Indicates if the destination project resides within the same + # organization as the source project. + # + # Note: The following fields are mutually exclusive: `destination_project_org_error`, `destination_project_check_has_internal_error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] destination_project_check_has_internal_error + # @return [::Boolean] + # Optional. Indicates whether the destination project check failed due to + # an internal error. If `true`, the system automatically retries the + # check. + # + # Note: The following fields are mutually exclusive: `destination_project_check_has_internal_error`, `destination_project_org_error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ProjectErrors + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Summary of validation errors that occurred during the verification phase. + # @!attribute [rw] bucket_errors + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::BucketErrors] + # Optional. Provides a summary of the bucket level error stats. + # @!attribute [rw] project_errors + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::ProjectErrors] + # Optional. Provides a summary of the project level error stats. + class ValidationErrorsBeforeIngestion + 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 + + # State of the configuration. + module ConfigState + # Unspecified state. + CONFIG_STATE_UNSPECIFIED = 0 + + # Active configuration indicates that the configuration is + # actively ingesting data. + CONFIG_STATE_ACTIVE = 1 + + # In this state, the configuration is being verified for various + # permissions. + CONFIG_STATE_VERIFICATION_IN_PROGRESS = 2 + + # Configuration is created and further processing needs to happen. + CONFIG_STATE_CREATED = 3 + + # Configuration is under processing + CONFIG_STATE_PROCESSING = 4 + end + end + + # Request message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs `ListDatasetConfigs`} + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListDatasetConfigsRequest + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server might return fewer items than requested. + # If unspecified, server picks 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 ListDatasetConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs `ListDatasetConfigs`} + # @!attribute [rw] dataset_configs + # @return [::Array<::Google::Cloud::StorageInsights::V1::DatasetConfig>] + # The list of `DatasetConfigs` + # @!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 ListDatasetConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_dataset_config `GetDatasetConfig`} + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + class GetDatasetConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_dataset_config `CreateDatasetConfig`} + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] dataset_config_id + # @return [::String] + # Required. ID of the requesting object. + # If auto-generating ID is enabled on the server-side, remove this field and + # `dataset_config_id` from the method_signature of Create RPC + # Note: The value should not contain any hyphens. + # @!attribute [rw] dataset_config + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for your request. + # Specify the request ID if you need to retry the request. + # If you retry the request with the same ID within 60 minutes, the server + # ignores the request if it has already completed the original request. + # + # For example, if your initial request times out and you retry the request + # using the same request ID, the server recognizes the original request and + # does not process the new request. + # + # The request ID must be a valid UUID and cannot be a zero UUID + # (00000000-0000-0000-0000-000000000000). + class CreateDatasetConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_dataset_config `UpdateDatasetConfig`} + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `DatasetConfig` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field is overwritten if it is in the mask. If the + # user does not provide a mask then it returns an "Invalid Argument" error. + # @!attribute [rw] dataset_config + # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] + # Required. The resource being updated + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for your request. + # Specify the request ID if you need to retry the request. + # If you retry the request with the same ID within 60 minutes, the server + # ignores the request if it has already completed the original request. + # + # For example, if your initial request times out and you retry the request + # using the same request ID, the server recognizes the original request and + # does not process the new request. + # + # The request ID must be a valid UUID and cannot be a zero UUID + # (00000000-0000-0000-0000-000000000000). + class UpdateDatasetConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_dataset_config `DeleteDatasetConfig`} + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for your request. + # Specify the request ID if you need to retry the request. + # If you retry the request with the same ID within 60 minutes, the server + # ignores the request if it has already completed the original request. + # + # For example, if your initial request times out and you retry the request + # using the same request ID, the server recognizes the original request and + # does not process the new request. + # + # The request ID must be a valid UUID and cannot be a zero UUID + # (00000000-0000-0000-0000-000000000000). + class DeleteDatasetConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset `LinkDataset`} + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + class LinkDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset `LinkDataset`} + class LinkDatasetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#unlink_dataset `UnlinkDataset`} + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + class UnlinkDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata that helps discover which resources are available in a location. + # @!attribute [rw] report_config_available + # @return [::Boolean] + # If true, `storageinsights.googleapis.com/ReportConfig` resource is + # available at the location. + # @!attribute [rw] dataset_config_available + # @return [::Boolean] + # If true, `storageinsights.googleapis.com/DatasetConfig` resource is + # available at the location. + class LocationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/date.rb new file mode 100644 index 000000000000..1d0a9780457f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/date.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a whole or partial calendar date, such as a birthday. The time of + # day and time zone are either specified elsewhere or are insignificant. The + # date is relative to the Gregorian Calendar. This can represent one of the + # following: + # + # * A full date, with non-zero year, month, and day values + # * A month and day value, with a zero year, such as an anniversary + # * A year on its own, with zero month and day values + # * A year and month value, with a zero day, such as a credit card expiration + # date + # + # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] year + # @return [::Integer] + # Year of the date. Must be from 1 to 9999, or 0 to specify a date without + # a year. + # @!attribute [rw] month + # @return [::Integer] + # Month of a year. Must be from 1 to 12, or 0 to specify a year without a + # month and day. + # @!attribute [rw] day + # @return [::Integer] + # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + # to specify a year by itself or a year and month where the day isn't + # significant. + class Date + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/datetime.rb new file mode 100644 index 000000000000..d15ba7af54e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/datetime.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents civil time (or occasionally physical time). + # + # This type can represent a civil time in one of a few possible ways: + # + # * When utc_offset is set and time_zone is unset: a civil time on a calendar + # day with a particular offset from UTC. + # * When time_zone is set and utc_offset is unset: a civil time on a calendar + # day in a particular time zone. + # * When neither time_zone nor utc_offset is set: a civil time on a calendar + # day in local time. + # + # The date is relative to the Proleptic Gregorian Calendar. + # + # If year is 0, the DateTime is considered not to have a specific year. month + # and day must have valid, non-zero values. + # + # This type may also be used to represent a physical time if all the date and + # time fields are set and either case of the `time_offset` oneof is set. + # Consider using `Timestamp` message for physical time instead. If your use + # case also would like to store the user's timezone, that can be done in + # another field. + # + # This type is more flexible than some applications may want. Make sure to + # document and validate your application's limitations. + # @!attribute [rw] year + # @return [::Integer] + # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + # datetime without a year. + # @!attribute [rw] month + # @return [::Integer] + # Required. Month of year. Must be from 1 to 12. + # @!attribute [rw] day + # @return [::Integer] + # Required. Day of month. Must be from 1 to 31 and valid for the year and + # month. + # @!attribute [rw] hours + # @return [::Integer] + # Required. 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] + # Required. Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Required. 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] + # Required. Fractions of seconds in nanoseconds. Must be from 0 to + # 999,999,999. + # @!attribute [rw] utc_offset + # @return [::Google::Protobuf::Duration] + # UTC offset. Must be whole seconds, between -18 hours and +18 hours. + # For example, a UTC offset of -4:00 would be represented as + # { seconds: -14400 }. + # + # Note: The following fields are mutually exclusive: `utc_offset`, `time_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] time_zone + # @return [::Google::Type::TimeZone] + # Time zone. + # + # Note: The following fields are mutually exclusive: `time_zone`, `utc_offset`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class DateTime + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a time zone from the + # [IANA Time Zone Database](https://www.iana.org/time-zones). + # @!attribute [rw] id + # @return [::String] + # IANA Time Zone Database time zone, e.g. "America/New_York". + # @!attribute [rw] version + # @return [::String] + # Optional. IANA Time Zone Database version number, e.g. "2019a". + class TimeZone + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/Gemfile new file mode 100644 index 000000000000..47a364cb06ed --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1", path: "../" +else + gem "google-cloud-storage_insights-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-storage_insights-v1/snippets/snippet_metadata_google.cloud.storageinsights.v1.json b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/snippet_metadata_google.cloud.storageinsights.v1.json new file mode 100644 index 000000000000..4ab1f1cc7f7f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/snippet_metadata_google.cloud.storageinsights.v1.json @@ -0,0 +1,575 @@ +{ + "client_library": { + "name": "google-cloud-storage_insights-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.storageinsights.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "storageinsights_v1_generated_StorageInsights_ListReportConfigs_sync", + "title": "Snippet for the list_report_configs call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_configs.", + "file": "storage_insights/list_report_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_report_configs", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "ListReportConfigs", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.ListReportConfigs", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_GetReportConfig_sync", + "title": "Snippet for the get_report_config call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_config.", + "file": "storage_insights/get_report_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_report_config", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::GetReportConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageInsights::V1::ReportConfig", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "GetReportConfig", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.GetReportConfig", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_CreateReportConfig_sync", + "title": "Snippet for the create_report_config call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_report_config.", + "file": "storage_insights/create_report_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_report_config", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_report_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageInsights::V1::ReportConfig", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "CreateReportConfig", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.CreateReportConfig", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_UpdateReportConfig_sync", + "title": "Snippet for the update_report_config call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_report_config.", + "file": "storage_insights/update_report_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_report_config", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_report_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageInsights::V1::ReportConfig", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "UpdateReportConfig", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.UpdateReportConfig", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_DeleteReportConfig_sync", + "title": "Snippet for the delete_report_config call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_report_config.", + "file": "storage_insights/delete_report_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_report_config", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_report_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "DeleteReportConfig", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.DeleteReportConfig", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_ListReportDetails_sync", + "title": "Snippet for the list_report_details call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_details.", + "file": "storage_insights/list_report_details.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_report_details", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_details", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "ListReportDetails", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.ListReportDetails", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_GetReportDetail_sync", + "title": "Snippet for the get_report_detail call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_detail.", + "file": "storage_insights/get_report_detail.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_report_detail", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_detail", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::GetReportDetailRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageInsights::V1::ReportDetail", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "GetReportDetail", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.GetReportDetail", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_ListDatasetConfigs_sync", + "title": "Snippet for the list_dataset_configs call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs.", + "file": "storage_insights/list_dataset_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_dataset_configs", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "ListDatasetConfigs", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.ListDatasetConfigs", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_GetDatasetConfig_sync", + "title": "Snippet for the get_dataset_config call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_dataset_config.", + "file": "storage_insights/get_dataset_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_dataset_config", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_dataset_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageInsights::V1::DatasetConfig", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "GetDatasetConfig", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.GetDatasetConfig", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_CreateDatasetConfig_sync", + "title": "Snippet for the create_dataset_config call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_dataset_config.", + "file": "storage_insights/create_dataset_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_dataset_config", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_dataset_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "CreateDatasetConfig", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.CreateDatasetConfig", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_UpdateDatasetConfig_sync", + "title": "Snippet for the update_dataset_config call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_dataset_config.", + "file": "storage_insights/update_dataset_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_dataset_config", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_dataset_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "UpdateDatasetConfig", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.UpdateDatasetConfig", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_DeleteDatasetConfig_sync", + "title": "Snippet for the delete_dataset_config call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_dataset_config.", + "file": "storage_insights/delete_dataset_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_dataset_config", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_dataset_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "DeleteDatasetConfig", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.DeleteDatasetConfig", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_LinkDataset_sync", + "title": "Snippet for the link_dataset call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset.", + "file": "storage_insights/link_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "link_dataset", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::LinkDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "LinkDataset", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.LinkDataset", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storageinsights_v1_generated_StorageInsights_UnlinkDataset_sync", + "title": "Snippet for the unlink_dataset call in the StorageInsights service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#unlink_dataset.", + "file": "storage_insights/unlink_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "unlink_dataset", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#unlink_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageInsights::Client", + "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" + }, + "method": { + "short_name": "UnlinkDataset", + "full_name": "google.cloud.storageinsights.v1.StorageInsights.UnlinkDataset", + "service": { + "short_name": "StorageInsights", + "full_name": "google.cloud.storageinsights.v1.StorageInsights" + } + } + }, + "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-storage_insights-v1/snippets/storage_insights/create_dataset_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_dataset_config.rb new file mode 100644 index 000000000000..7cd9ac123ca3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_dataset_config.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storageinsights_v1_generated_StorageInsights_CreateDatasetConfig_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the create_dataset_config call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_dataset_config. +# +def create_dataset_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new + + # Call the create_dataset_config method. + result = client.create_dataset_config request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storageinsights_v1_generated_StorageInsights_CreateDatasetConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_report_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_report_config.rb new file mode 100644 index 000000000000..c8c6c0d174ec --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_report_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 storageinsights_v1_generated_StorageInsights_CreateReportConfig_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the create_report_config call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_report_config. +# +def create_report_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new + + # Call the create_report_config method. + result = client.create_report_config request + + # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. + p result +end +# [END storageinsights_v1_generated_StorageInsights_CreateReportConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_dataset_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_dataset_config.rb new file mode 100644 index 000000000000..d9579acbf677 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_dataset_config.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storageinsights_v1_generated_StorageInsights_DeleteDatasetConfig_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the delete_dataset_config call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_dataset_config. +# +def delete_dataset_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.new + + # Call the delete_dataset_config method. + result = client.delete_dataset_config request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storageinsights_v1_generated_StorageInsights_DeleteDatasetConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_report_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_report_config.rb new file mode 100644 index 000000000000..58805a1019b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_report_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 storageinsights_v1_generated_StorageInsights_DeleteReportConfig_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the delete_report_config call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_report_config. +# +def delete_report_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new + + # Call the delete_report_config method. + result = client.delete_report_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storageinsights_v1_generated_StorageInsights_DeleteReportConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_dataset_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_dataset_config.rb new file mode 100644 index 000000000000..e053a3ec3083 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_dataset_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 storageinsights_v1_generated_StorageInsights_GetDatasetConfig_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the get_dataset_config call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_dataset_config. +# +def get_dataset_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new + + # Call the get_dataset_config method. + result = client.get_dataset_config request + + # The returned object is of type Google::Cloud::StorageInsights::V1::DatasetConfig. + p result +end +# [END storageinsights_v1_generated_StorageInsights_GetDatasetConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_config.rb new file mode 100644 index 000000000000..74591709f31a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_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 storageinsights_v1_generated_StorageInsights_GetReportConfig_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the get_report_config call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_config. +# +def get_report_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new + + # Call the get_report_config method. + result = client.get_report_config request + + # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. + p result +end +# [END storageinsights_v1_generated_StorageInsights_GetReportConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_detail.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_detail.rb new file mode 100644 index 000000000000..04b01526bb8d --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_detail.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storageinsights_v1_generated_StorageInsights_GetReportDetail_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the get_report_detail call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_detail. +# +def get_report_detail + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new + + # Call the get_report_detail method. + result = client.get_report_detail request + + # The returned object is of type Google::Cloud::StorageInsights::V1::ReportDetail. + p result +end +# [END storageinsights_v1_generated_StorageInsights_GetReportDetail_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/link_dataset.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/link_dataset.rb new file mode 100644 index 000000000000..b57ffa2d799c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/link_dataset.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storageinsights_v1_generated_StorageInsights_LinkDataset_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the link_dataset call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset. +# +def link_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new + + # Call the link_dataset method. + result = client.link_dataset request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storageinsights_v1_generated_StorageInsights_LinkDataset_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_dataset_configs.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_dataset_configs.rb new file mode 100644 index 000000000000..a430968a524a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_dataset_configs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storageinsights_v1_generated_StorageInsights_ListDatasetConfigs_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the list_dataset_configs call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs. +# +def list_dataset_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.new + + # Call the list_dataset_configs method. + result = client.list_dataset_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::StorageInsights::V1::DatasetConfig. + p item + end +end +# [END storageinsights_v1_generated_StorageInsights_ListDatasetConfigs_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_configs.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_configs.rb new file mode 100644 index 000000000000..d43b7dc08ed1 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_configs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storageinsights_v1_generated_StorageInsights_ListReportConfigs_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the list_report_configs call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_configs. +# +def list_report_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new + + # Call the list_report_configs method. + result = client.list_report_configs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportConfig. + p item + end +end +# [END storageinsights_v1_generated_StorageInsights_ListReportConfigs_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_details.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_details.rb new file mode 100644 index 000000000000..7377d5cb45d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_details.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 storageinsights_v1_generated_StorageInsights_ListReportDetails_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the list_report_details call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_details. +# +def list_report_details + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.new + + # Call the list_report_details method. + result = client.list_report_details request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportDetail. + p item + end +end +# [END storageinsights_v1_generated_StorageInsights_ListReportDetails_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/unlink_dataset.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/unlink_dataset.rb new file mode 100644 index 000000000000..e9a3e2500962 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/unlink_dataset.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storageinsights_v1_generated_StorageInsights_UnlinkDataset_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the unlink_dataset call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#unlink_dataset. +# +def unlink_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new + + # Call the unlink_dataset method. + result = client.unlink_dataset request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storageinsights_v1_generated_StorageInsights_UnlinkDataset_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_dataset_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_dataset_config.rb new file mode 100644 index 000000000000..3a60645b50bc --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_dataset_config.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storageinsights_v1_generated_StorageInsights_UpdateDatasetConfig_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the update_dataset_config call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_dataset_config. +# +def update_dataset_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new + + # Call the update_dataset_config method. + result = client.update_dataset_config request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storageinsights_v1_generated_StorageInsights_UpdateDatasetConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_report_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_report_config.rb new file mode 100644 index 000000000000..a7924d487517 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_report_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 storageinsights_v1_generated_StorageInsights_UpdateReportConfig_sync] +require "google/cloud/storage_insights/v1" + +## +# Snippet for the update_report_config call in the StorageInsights service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_report_config. +# +def update_report_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new + + # Call the update_report_config method. + result = client.update_report_config request + + # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. + p result +end +# [END storageinsights_v1_generated_StorageInsights_UpdateReportConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_operations_test.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_operations_test.rb new file mode 100644 index 000000000000..951ff810d844 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_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/storageinsights/v1/storageinsights_pb" +require "google/cloud/storageinsights/v1/storageinsights_services_pb" +require "google/cloud/storage_insights/v1/storage_insights" + +class ::Google::Cloud::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb new file mode 100644 index 000000000000..a11e979ff863 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/storage_insights/v1/storage_insights" + +class ::Google::Cloud::StorageInsights::V1::StorageInsights::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_dataset_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::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dataset_config_path project: "value0", location: "value1", dataset_config: "value2" + assert_equal "projects/value0/locations/value1/datasetConfigs/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::StorageInsights::V1::StorageInsights::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_report_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::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.report_config_path project: "value0", location: "value1", report_config: "value2" + assert_equal "projects/value0/locations/value1/reportConfigs/value2", path + end + end + + def test_report_detail_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.report_detail_path project: "value0", location: "value1", report_config: "value2", report_detail: "value3" + assert_equal "projects/value0/locations/value1/reportConfigs/value2/reportDetails/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb new file mode 100644 index 000000000000..5d74730e0c70 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb @@ -0,0 +1,879 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/storageinsights/v1/storageinsights_pb" +require "google/cloud/storage_insights/v1/storage_insights/rest" + + +class ::Google::Cloud::StorageInsights::V1::StorageInsights::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_report_configs + # Create test objects. + client_result = ::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse.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_report_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_list_report_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_report_configs_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_report_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_report_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_report_configs ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.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_report_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_report_configs(::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.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_report_configs_client_stub.call_count + end + end + end + + def test_get_report_config + # Create test objects. + client_result = ::Google::Cloud::StorageInsights::V1::ReportConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_report_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_get_report_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_report_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_report_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_report_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_report_config ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_report_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_report_config(::Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_report_config_client_stub.call_count + end + end + end + + def test_create_report_config + # Create test objects. + client_result = ::Google::Cloud::StorageInsights::V1::ReportConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + report_config = {} + request_id = "hello world" + + create_report_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_create_report_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_report_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_report_config({ parent: parent, report_config: report_config, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_report_config parent: parent, report_config: report_config, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_report_config ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new(parent: parent, report_config: report_config, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_report_config({ parent: parent, report_config: report_config, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_report_config(::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new(parent: parent, report_config: report_config, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_report_config_client_stub.call_count + end + end + end + + def test_update_report_config + # Create test objects. + client_result = ::Google::Cloud::StorageInsights::V1::ReportConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + report_config = {} + request_id = "hello world" + + update_report_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_update_report_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_report_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_report_config({ update_mask: update_mask, report_config: report_config, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_report_config update_mask: update_mask, report_config: report_config, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_report_config ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new(update_mask: update_mask, report_config: report_config, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_report_config({ update_mask: update_mask, report_config: report_config, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_report_config(::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new(update_mask: update_mask, report_config: report_config, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_report_config_client_stub.call_count + end + end + end + + def test_delete_report_config + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + request_id = "hello world" + + delete_report_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_delete_report_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_report_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_report_config({ name: name, force: force, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_report_config name: name, force: force, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_report_config ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new(name: name, force: force, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_report_config({ name: name, force: force, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_report_config(::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new(name: name, force: force, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_report_config_client_stub.call_count + end + end + end + + def test_list_report_details + # Create test objects. + client_result = ::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse.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_report_details_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_list_report_details_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_report_details_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_report_details({ 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_report_details 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_report_details ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.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_report_details({ 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_report_details(::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.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_report_details_client_stub.call_count + end + end + end + + def test_get_report_detail + # Create test objects. + client_result = ::Google::Cloud::StorageInsights::V1::ReportDetail.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_report_detail_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_get_report_detail_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_report_detail_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_report_detail({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_report_detail name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_report_detail ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_report_detail({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_report_detail(::Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_report_detail_client_stub.call_count + end + end + end + + def test_list_dataset_configs + # Create test objects. + client_result = ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse.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_dataset_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_list_dataset_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_dataset_configs_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_dataset_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_dataset_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_dataset_configs ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.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_dataset_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_dataset_configs(::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.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_dataset_configs_client_stub.call_count + end + end + end + + def test_get_dataset_config + # Create test objects. + client_result = ::Google::Cloud::StorageInsights::V1::DatasetConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dataset_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_get_dataset_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_dataset_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_dataset_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_dataset_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_dataset_config ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_dataset_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_dataset_config(::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_dataset_config_client_stub.call_count + end + end + end + + def test_create_dataset_config + # Create test objects. + 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" + dataset_config_id = "hello world" + dataset_config = {} + request_id = "hello world" + + create_dataset_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_create_dataset_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_dataset_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_dataset_config({ parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_dataset_config parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_dataset_config ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new(parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_dataset_config({ parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_dataset_config(::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new(parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_dataset_config_client_stub.call_count + end + end + end + + def test_update_dataset_config + # Create test objects. + 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 = {} + dataset_config = {} + request_id = "hello world" + + update_dataset_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_update_dataset_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_dataset_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_dataset_config({ update_mask: update_mask, dataset_config: dataset_config, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_dataset_config update_mask: update_mask, dataset_config: dataset_config, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_dataset_config ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new(update_mask: update_mask, dataset_config: dataset_config, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_dataset_config({ update_mask: update_mask, dataset_config: dataset_config, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_dataset_config(::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new(update_mask: update_mask, dataset_config: dataset_config, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_dataset_config_client_stub.call_count + end + end + end + + def test_delete_dataset_config + # Create test objects. + 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_dataset_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_delete_dataset_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_dataset_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_dataset_config({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_dataset_config name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_dataset_config ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.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_dataset_config({ 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_dataset_config(::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.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_dataset_config_client_stub.call_count + end + end + end + + def test_link_dataset + # Create test objects. + 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" + + link_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_link_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, link_dataset_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.link_dataset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.link_dataset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.link_dataset ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.link_dataset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.link_dataset(::Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, link_dataset_client_stub.call_count + end + end + end + + def test_unlink_dataset + # Create test objects. + 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" + + unlink_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_unlink_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, unlink_dataset_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.unlink_dataset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.unlink_dataset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.unlink_dataset ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.unlink_dataset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.unlink_dataset(::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, unlink_dataset_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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb new file mode 100644 index 000000000000..e3460b7a30bf --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_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/storageinsights/v1/storageinsights_pb" +require "google/cloud/storage_insights/v1/storage_insights" + +class ::Google::Cloud::StorageInsights::V1::StorageInsights::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_report_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_report_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_report_configs, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, 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_report_configs_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_report_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_report_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_report_configs ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.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_report_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_report_configs(::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.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_report_configs_client_stub.call_rpc_count + end + end + + def test_get_report_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageInsights::V1::ReportConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_report_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_report_config, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_report_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_report_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_report_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_report_config ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_report_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_report_config(::Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_report_config_client_stub.call_rpc_count + end + end + + def test_create_report_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageInsights::V1::ReportConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + report_config = {} + request_id = "hello world" + + create_report_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_report_config, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageInsights::V1::ReportConfig), request["report_config"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_report_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_report_config({ parent: parent, report_config: report_config, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_report_config parent: parent, report_config: report_config, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_report_config ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new(parent: parent, report_config: report_config, 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_report_config({ parent: parent, report_config: report_config, 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_report_config(::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new(parent: parent, report_config: report_config, 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_report_config_client_stub.call_rpc_count + end + end + + def test_update_report_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageInsights::V1::ReportConfig.new + grpc_operation = GRPC::ActiveCall::Operation.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 = {} + report_config = {} + request_id = "hello world" + + update_report_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_report_config, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageInsights::V1::ReportConfig), request["report_config"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_report_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_report_config({ update_mask: update_mask, report_config: report_config, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_report_config update_mask: update_mask, report_config: report_config, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_report_config ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new(update_mask: update_mask, report_config: report_config, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_report_config({ update_mask: update_mask, report_config: report_config, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_report_config(::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new(update_mask: update_mask, report_config: report_config, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_report_config_client_stub.call_rpc_count + end + end + + def test_delete_report_config + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + request_id = "hello world" + + delete_report_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_report_config, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_report_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_report_config({ name: name, force: force, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_report_config name: name, force: force, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_report_config ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new(name: name, force: force, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_report_config({ name: name, force: force, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_report_config(::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new(name: name, force: force, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_report_config_client_stub.call_rpc_count + end + end + + def test_list_report_details + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_report_details_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_report_details, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, 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_report_details_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_report_details({ 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_report_details 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_report_details ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.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_report_details({ 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_report_details(::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.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_report_details_client_stub.call_rpc_count + end + end + + def test_get_report_detail + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageInsights::V1::ReportDetail.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_report_detail_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_report_detail, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_report_detail_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_report_detail({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_report_detail name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_report_detail ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_report_detail({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_report_detail(::Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_report_detail_client_stub.call_rpc_count + end + end + + def test_list_dataset_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_dataset_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_dataset_configs, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, 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_dataset_configs_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_dataset_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_dataset_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_dataset_configs ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.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_dataset_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_dataset_configs(::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.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_dataset_configs_client_stub.call_rpc_count + end + end + + def test_get_dataset_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageInsights::V1::DatasetConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dataset_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_dataset_config, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_dataset_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_dataset_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_dataset_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_dataset_config ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_dataset_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_dataset_config(::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_dataset_config_client_stub.call_rpc_count + end + end + + def test_create_dataset_config + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + dataset_config_id = "hello world" + dataset_config = {} + request_id = "hello world" + + create_dataset_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_dataset_config, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["dataset_config_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageInsights::V1::DatasetConfig), request["dataset_config"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_dataset_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_dataset_config({ parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_dataset_config parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_dataset_config ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new(parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_dataset_config({ parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_dataset_config(::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new(parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_dataset_config_client_stub.call_rpc_count + end + end + + def test_update_dataset_config + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.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 = {} + dataset_config = {} + request_id = "hello world" + + update_dataset_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_dataset_config, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageInsights::V1::DatasetConfig), request["dataset_config"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_dataset_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_dataset_config({ update_mask: update_mask, dataset_config: dataset_config, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_dataset_config update_mask: update_mask, dataset_config: dataset_config, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_dataset_config ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new(update_mask: update_mask, dataset_config: dataset_config, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_dataset_config({ update_mask: update_mask, dataset_config: dataset_config, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_dataset_config(::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new(update_mask: update_mask, dataset_config: dataset_config, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_dataset_config_client_stub.call_rpc_count + end + end + + def test_delete_dataset_config + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_dataset_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_dataset_config, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_dataset_config_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_dataset_config({ 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_dataset_config 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_dataset_config ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.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_dataset_config({ 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_dataset_config(::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.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_dataset_config_client_stub.call_rpc_count + end + end + + def test_link_dataset + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + link_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :link_dataset, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, link_dataset_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.link_dataset({ name: 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.link_dataset name: 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.link_dataset ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest.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.link_dataset({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.link_dataset(::Google::Cloud::StorageInsights::V1::LinkDatasetRequest.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, link_dataset_client_stub.call_rpc_count + end + end + + def test_unlink_dataset + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + unlink_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :unlink_dataset, name + assert_kind_of ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, unlink_dataset_client_stub do + # Create client + client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.unlink_dataset({ name: 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.unlink_dataset name: 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.unlink_dataset ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.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.unlink_dataset({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.unlink_dataset(::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.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, unlink_dataset_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::StorageInsights::V1::StorageInsights::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/helper.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_insights-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/.gitignore b/owl-bot-staging/google-cloud-storage_transfer-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-storage_transfer-v1/.repo-metadata.json new file mode 100644 index 000000000000..7e07d441e56a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "storagetransfer.googleapis.com", + "api_shortname": "storagetransfer", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage_transfer-v1/latest", + "distribution_name": "google-cloud-storage_transfer-v1", + "is_cloud": true, + "language": "ruby", + "name": "storagetransfer", + "name_pretty": "Storage Transfer Service V1 API", + "product_documentation": "https://cloud.google.com/storage-transfer-service/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Storage Transfer Service allows you to quickly import online data into Cloud Storage. You can also set up a repeating schedule for transferring data, as well as transfer data within Cloud Storage, from one bucket to another. Note that google-cloud-storage_transfer-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_transfer instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/storage-transfer-service/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/.rubocop.yml b/owl-bot-staging/google-cloud-storage_transfer-v1/.rubocop.yml new file mode 100644 index 000000000000..9372f2dc47b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-storage_transfer-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-storage_transfer-v1.rb" diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/.toys.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/.yardopts b/owl-bot-staging/google-cloud-storage_transfer-v1/.yardopts new file mode 100644 index 000000000000..7089b8062b51 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Storage Transfer Service V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage_transfer-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..bbd40b1c7b37 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-storage_transfer-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-storage_transfer-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/storage_transfer/v1" + +client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/storage_transfer/v1" + +::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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-storage_transfer-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/storage_transfer/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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-storage_transfer-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-storage_transfer-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/Gemfile b/owl-bot-staging/google-cloud-storage_transfer-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/LICENSE.md b/owl-bot-staging/google-cloud-storage_transfer-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/README.md b/owl-bot-staging/google-cloud-storage_transfer-v1/README.md new file mode 100644 index 000000000000..1a9aacfea26b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Storage Transfer Service V1 API + +Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets. + +Storage Transfer Service allows you to quickly import online data into Cloud Storage. You can also set up a repeating schedule for transferring data, as well as transfer data within Cloud Storage, from one bucket to another. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Storage Transfer Service V1 API. Most users should consider using +the main client gem, +[google-cloud-storage_transfer](https://rubygems.org/gems/google-cloud-storage_transfer). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-storage_transfer-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/storagetransfer.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/storage_transfer/v1" + +client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +request = ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new # (request fields as keyword arguments...) +response = client.get_google_service_account request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage_transfer-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/storage-transfer-service/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/storage_transfer/v1" +require "logger" + +client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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-storage_transfer`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-storage_transfer-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-storage_transfer`. +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-storage_transfer-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-storage_transfer-v1/Rakefile b/owl-bot-staging/google-cloud-storage_transfer-v1/Rakefile new file mode 100644 index 000000000000..2dae212edd97 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-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/storage_transfer/v1/storage_transfer_service/credentials" + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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-storage_transfer-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-storage_transfer-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-storage_transfer-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-storage_transfer-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-storage_transfer-v1" + header "google-cloud-storage_transfer-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-storage_transfer-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-storage_transfer-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-storage_transfer-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-storage_transfer-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-storage_transfer-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-storage_transfer-v1/gapic_metadata.json new file mode 100644 index 000000000000..7b82525e8f4b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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.storagetransfer.v1", + "libraryPackage": "::Google::Cloud::StorageTransfer::V1", + "services": { + "StorageTransferService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client", + "rpcs": { + "GetGoogleServiceAccount": { + "methods": [ + "get_google_service_account" + ] + }, + "CreateTransferJob": { + "methods": [ + "create_transfer_job" + ] + }, + "UpdateTransferJob": { + "methods": [ + "update_transfer_job" + ] + }, + "GetTransferJob": { + "methods": [ + "get_transfer_job" + ] + }, + "ListTransferJobs": { + "methods": [ + "list_transfer_jobs" + ] + }, + "PauseTransferOperation": { + "methods": [ + "pause_transfer_operation" + ] + }, + "ResumeTransferOperation": { + "methods": [ + "resume_transfer_operation" + ] + }, + "RunTransferJob": { + "methods": [ + "run_transfer_job" + ] + }, + "DeleteTransferJob": { + "methods": [ + "delete_transfer_job" + ] + }, + "CreateAgentPool": { + "methods": [ + "create_agent_pool" + ] + }, + "UpdateAgentPool": { + "methods": [ + "update_agent_pool" + ] + }, + "GetAgentPool": { + "methods": [ + "get_agent_pool" + ] + }, + "ListAgentPools": { + "methods": [ + "list_agent_pools" + ] + }, + "DeleteAgentPool": { + "methods": [ + "delete_agent_pool" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/google-cloud-storage_transfer-v1.gemspec b/owl-bot-staging/google-cloud-storage_transfer-v1/google-cloud-storage_transfer-v1.gemspec new file mode 100644 index 000000000000..63a9a0925bda --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/google-cloud-storage_transfer-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/storage_transfer/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-storage_transfer-v1" + gem.version = Google::Cloud::StorageTransfer::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Storage Transfer Service allows you to quickly import online data into Cloud Storage. You can also set up a repeating schedule for transferring data, as well as transfer data within Cloud Storage, from one bucket to another. Note that google-cloud-storage_transfer-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_transfer instead. See the readme for more details." + gem.summary = "Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google-cloud-storage_transfer-v1.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google-cloud-storage_transfer-v1.rb new file mode 100644 index 000000000000..8d192d1af8ef --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google-cloud-storage_transfer-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/storage_transfer/v1" diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1.rb new file mode 100644 index 000000000000..1efd00697fd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/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/storage_transfer/v1/storage_transfer_service" +require "google/cloud/storage_transfer/v1/version" + +module Google + module Cloud + module StorageTransfer + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/storage_transfer/v1" + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/storage_transfer/v1" + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/storage_transfer/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/rest.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/rest.rb new file mode 100644 index 000000000000..011f181029a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/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/storage_transfer/v1/storage_transfer_service/rest" +require "google/cloud/storage_transfer/v1/version" + +module Google + module Cloud + module StorageTransfer + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/storage_transfer/v1/rest" + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service.rb new file mode 100644 index 000000000000..77477cb89a2b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/storage_transfer/v1/version" + +require "google/cloud/storage_transfer/v1/storage_transfer_service/credentials" +require "google/cloud/storage_transfer/v1/storage_transfer_service/paths" +require "google/cloud/storage_transfer/v1/storage_transfer_service/operations" +require "google/cloud/storage_transfer/v1/storage_transfer_service/client" +require "google/cloud/storage_transfer/v1/storage_transfer_service/rest" + +module Google + module Cloud + module StorageTransfer + module V1 + ## + # Storage Transfer Service and its protos. + # Transfers data between between Google Cloud Storage buckets or from a data + # source external to Google to a Cloud Storage bucket. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/storage_transfer/v1/storage_transfer_service" + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/storage_transfer/v1/storage_transfer_service/rest" + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + module StorageTransferService + end + end + end + end +end + +helper_path = ::File.join __dir__, "storage_transfer_service", "helpers.rb" +require "google/cloud/storage_transfer/v1/storage_transfer_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/client.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/client.rb new file mode 100644 index 000000000000..6bea975696d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/client.rb @@ -0,0 +1,1832 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/storagetransfer/v1/transfer_pb" + +module Google + module Cloud + module StorageTransfer + module V1 + module StorageTransferService + ## + # Client for the StorageTransferService service. + # + # Storage Transfer Service and its protos. + # Transfers data between between Google Cloud Storage buckets or from a data + # source external to Google to a Cloud Storage bucket. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storagetransfer.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_transfer_service_stub + + ## + # Configure the StorageTransferService Client class. + # + # See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageTransferService clients + # ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "StorageTransfer", "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: 2, retry_codes: [14] + } + + default_config.rpcs.create_transfer_job.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageTransferService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @storage_transfer_service_stub.universe_domain + end + + ## + # Create a new StorageTransferService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageTransferService 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/storagetransfer/v1/transfer_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 + + @storage_transfer_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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 + ) + + @storage_transfer_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::StorageTransfer::V1::StorageTransferService::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @storage_transfer_service_stub.logger + end + + # Service calls + + ## + # Returns the Google service account that is used by Storage Transfer + # Service to access buckets in the project where transfers + # run or in other projects. Each Google service account is associated + # with one Google Cloud project. Users + # should add this service account to the Google Cloud Storage bucket + # ACLs to grant access to Storage Transfer Service. This service + # account is created and owned by Storage Transfer Service and can + # only be used by Storage Transfer Service. + # + # @overload get_google_service_account(request, options = nil) + # Pass arguments to `get_google_service_account` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_google_service_account(project_id: nil) + # Pass arguments to `get_google_service_account` via keyword arguments. Note that at + # least one keyword argument is 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_id [::String] + # Required. The ID of the Google Cloud project that the Google service + # account is associated with. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new + # + # # Call the get_google_service_account method. + # result = client.get_google_service_account request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::GoogleServiceAccount. + # p result + # + def get_google_service_account request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_google_service_account.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-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_id + header_params["project_id"] = request.project_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_google_service_account.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_google_service_account.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :get_google_service_account, request, 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 transfer job that runs periodically. + # + # @overload create_transfer_job(request, options = nil) + # Pass arguments to `create_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_transfer_job(transfer_job: nil) + # Pass arguments to `create_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash] + # Required. The job to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageTransfer::V1::TransferJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new + # + # # Call the create_transfer_job method. + # result = client.create_transfer_job request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + # p result + # + def create_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest + + # Converts hash and nil to 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_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_transfer_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :create_transfer_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a transfer job. Updating a job's transfer spec does not affect + # transfer operations that are running already. + # + # **Note:** The job's {::Google::Cloud::StorageTransfer::V1::TransferJob#status status} + # field can be modified using this RPC (for example, to set a job's status to + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}, or + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED}). + # + # @overload update_transfer_job(request, options = nil) + # Pass arguments to `update_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_transfer_job(job_name: nil, project_id: nil, transfer_job: nil, update_transfer_job_field_mask: nil) + # Pass arguments to `update_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job_name [::String] + # Required. The name of job to update. + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the + # job. + # @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash] + # Required. The job to update. `transferJob` is expected to specify one or + # more of five fields: + # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and + # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. An + # `UpdateTransferJobRequest` that specifies other fields are rejected with + # the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. Updating a + # job status to + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} requires + # `storagetransfer.jobs.delete` permission. + # @param update_transfer_job_field_mask [::Google::Protobuf::FieldMask, ::Hash] + # The field mask of the fields in `transferJob` that are to be updated in + # this request. Fields in `transferJob` that can be updated are: + # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and + # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. To update the + # `transfer_spec` of the job, a complete transfer specification must be + # provided. An incomplete specification missing any required fields is + # rejected with the error + # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageTransfer::V1::TransferJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new + # + # # Call the update_transfer_job method. + # result = client.update_transfer_job request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + # p result + # + def update_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest + + # Converts hash and nil to 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_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.job_name + header_params["job_name"] = request.job_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_transfer_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :update_transfer_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a transfer job. + # + # @overload get_transfer_job(request, options = nil) + # Pass arguments to `get_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_transfer_job(job_name: nil, project_id: nil) + # Pass arguments to `get_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job_name [::String] + # Required. The job to get. + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the + # job. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageTransfer::V1::TransferJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new + # + # # Call the get_transfer_job method. + # result = client.get_transfer_job request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + # p result + # + def get_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.job_name + header_params["job_name"] = request.job_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_transfer_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :get_transfer_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists transfer jobs. + # + # @overload list_transfer_jobs(request, options = nil) + # Pass arguments to `list_transfer_jobs` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_transfer_jobs(filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_transfer_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param filter [::String] + # Required. A list of query parameters specified as JSON text in the form of: + # + # ``` + # { + # "projectId":"my_project_id", + # "jobNames":["jobid1","jobid2",...], + # "jobStatuses":["status1","status2",...], + # "dataBackend":"QUERY_REPLICATION_CONFIGS", + # "sourceBucket":"source-bucket-name", + # "sinkBucket":"sink-bucket-name", + # } + # ``` + # + # The JSON formatting in the example is for display only; provide the + # query parameters without spaces or line breaks. + # + # * `projectId` is required. + # * Since `jobNames` and `jobStatuses` support multiple values, their values + # must be specified with array notation. `jobNames` and `jobStatuses` are + # optional. Valid values are case-insensitive: + # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED} + # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED} + # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} + # * Specify `"dataBackend":"QUERY_REPLICATION_CONFIGS"` to return a list of + # cross-bucket replication jobs. + # * Limit the results to jobs from a particular bucket with `sourceBucket` + # and/or to a particular bucket with `sinkBucket`. + # @param page_size [::Integer] + # The list page size. The max allowed value is 256. + # @param page_token [::String] + # The list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new + # + # # Call the list_transfer_jobs method. + # result = client.list_transfer_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageTransfer::V1::TransferJob. + # p item + # end + # + def list_transfer_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_transfer_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_transfer_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_transfer_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :list_transfer_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_transfer_service_stub, :list_transfer_jobs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses a transfer operation. + # + # @overload pause_transfer_operation(request, options = nil) + # Pass arguments to `pause_transfer_operation` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transfer_operation(name: nil) + # Pass arguments to `pause_transfer_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 transfer operation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new + # + # # Call the pause_transfer_operation method. + # result = client.pause_transfer_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def pause_transfer_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest + + # Converts hash and nil to 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_transfer_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_transfer_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_transfer_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :pause_transfer_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 + + ## + # Resumes a transfer operation that is paused. + # + # @overload resume_transfer_operation(request, options = nil) + # Pass arguments to `resume_transfer_operation` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transfer_operation(name: nil) + # Pass arguments to `resume_transfer_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 transfer operation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new + # + # # Call the resume_transfer_operation method. + # result = client.resume_transfer_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def resume_transfer_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest + + # Converts hash and nil to 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_transfer_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_transfer_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_transfer_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :resume_transfer_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 a new operation for the specified transfer job. + # A `TransferJob` has a maximum of one active `TransferOperation`. If this + # method is called while a `TransferOperation` is active, an error is + # returned. + # + # @overload run_transfer_job(request, options = nil) + # Pass arguments to `run_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_transfer_job(job_name: nil, project_id: nil) + # Pass arguments to `run_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job_name [::String] + # Required. The name of the transfer job. + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the transfer + # job. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new + # + # # Call the run_transfer_job method. + # result = client.run_transfer_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def run_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.run_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.job_name + header_params["job_name"] = request.job_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_transfer_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :run_transfer_job, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 transfer job. Deleting a transfer job sets its status to + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}. + # + # @overload delete_transfer_job(request, options = nil) + # Pass arguments to `delete_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_transfer_job(job_name: nil, project_id: nil) + # Pass arguments to `delete_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job_name [::String] + # Required. The job to delete. + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the + # job. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new + # + # # Call the delete_transfer_job method. + # result = client.delete_transfer_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.job_name + header_params["job_name"] = request.job_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_transfer_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :delete_transfer_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an agent pool resource. + # + # @overload create_agent_pool(request, options = nil) + # Pass arguments to `create_agent_pool` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_agent_pool(project_id: nil, agent_pool: nil, agent_pool_id: nil) + # Pass arguments to `create_agent_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the + # agent pool. + # @param agent_pool [::Google::Cloud::StorageTransfer::V1::AgentPool, ::Hash] + # Required. The agent pool to create. + # @param agent_pool_id [::String] + # Required. The ID of the agent pool to create. + # + # The `agent_pool_id` must meet the following requirements: + # + # * Length of 128 characters or less. + # * Not start with the string `goog`. + # * Start with a lowercase ASCII character, followed by: + # * Zero or more: lowercase Latin alphabet characters, numerals, + # hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + # * One or more numerals or lowercase ASCII characters. + # + # As expressed by the regular expression: + # `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageTransfer::V1::AgentPool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new + # + # # Call the create_agent_pool method. + # result = client.create_agent_pool request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + # p result + # + def create_agent_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest + + # Converts hash and nil to 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_agent_pool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-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_id + header_params["project_id"] = request.project_id + end + + request_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_agent_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_agent_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :create_agent_pool, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing agent pool resource. + # + # @overload update_agent_pool(request, options = nil) + # Pass arguments to `update_agent_pool` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_agent_pool(agent_pool: nil, update_mask: nil) + # Pass arguments to `update_agent_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param agent_pool [::Google::Cloud::StorageTransfer::V1::AgentPool, ::Hash] + # Required. The agent pool to update. `agent_pool` is expected to specify + # following fields: + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#name name} + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} + # An `UpdateAgentPoolRequest` with any other fields is rejected + # with the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The [field mask] + # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + # of the fields in `agentPool` to update in this request. + # The following `agentPool` fields can be updated: + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageTransfer::V1::AgentPool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new + # + # # Call the update_agent_pool method. + # result = client.update_agent_pool request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + # p result + # + def update_agent_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest + + # Converts hash and nil to 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_agent_pool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.agent_pool&.name + header_params["agent_pool.name"] = request.agent_pool.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_agent_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_agent_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :update_agent_pool, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an agent pool. + # + # @overload get_agent_pool(request, options = nil) + # Pass arguments to `get_agent_pool` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_agent_pool(name: nil) + # Pass arguments to `get_agent_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the agent pool to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::StorageTransfer::V1::AgentPool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new + # + # # Call the get_agent_pool method. + # result = client.get_agent_pool request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + # p result + # + def get_agent_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_agent_pool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_agent_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_agent_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :get_agent_pool, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists agent pools. + # + # @overload list_agent_pools(request, options = nil) + # Pass arguments to `list_agent_pools` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_agent_pools(project_id: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_agent_pools` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the job. + # @param filter [::String] + # An optional list of query parameters specified as JSON text in the + # form of: + # + # `{"agentPoolNames":["agentpool1","agentpool2",...]}` + # + # Since `agentPoolNames` support multiple values, its values must be + # specified with array notation. When the filter is either empty or not + # provided, the list returns all agent pools for the project. + # @param page_size [::Integer] + # The list page size. The max allowed value is `256`. + # @param page_token [::String] + # The list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new + # + # # Call the list_agent_pools method. + # result = client.list_agent_pools request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageTransfer::V1::AgentPool. + # p item + # end + # + def list_agent_pools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_agent_pools.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-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_id + header_params["project_id"] = request.project_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_agent_pools.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_agent_pools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :list_agent_pools, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_transfer_service_stub, :list_agent_pools, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an agent pool. + # + # @overload delete_agent_pool(request, options = nil) + # Pass arguments to `delete_agent_pool` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_agent_pool(name: nil) + # Pass arguments to `delete_agent_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the agent pool to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new + # + # # Call the delete_agent_pool method. + # result = client.delete_agent_pool request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_agent_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_agent_pool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_agent_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_agent_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.call_rpc :delete_agent_pool, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the StorageTransferService API. + # + # This class represents the configuration for StorageTransferService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_google_service_account to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_google_service_account.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_google_service_account.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::StorageTransfer::V1::StorageTransferService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storagetransfer.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the StorageTransferService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_google_service_account` + # @return [::Gapic::Config::Method] + # + attr_reader :get_google_service_account + ## + # RPC-specific configuration for `create_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_transfer_job + ## + # RPC-specific configuration for `update_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_transfer_job + ## + # RPC-specific configuration for `get_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_transfer_job + ## + # RPC-specific configuration for `list_transfer_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_transfer_jobs + ## + # RPC-specific configuration for `pause_transfer_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_transfer_operation + ## + # RPC-specific configuration for `resume_transfer_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_transfer_operation + ## + # RPC-specific configuration for `run_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_transfer_job + ## + # RPC-specific configuration for `delete_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_transfer_job + ## + # RPC-specific configuration for `create_agent_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_agent_pool + ## + # RPC-specific configuration for `update_agent_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_agent_pool + ## + # RPC-specific configuration for `get_agent_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_agent_pool + ## + # RPC-specific configuration for `list_agent_pools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_agent_pools + ## + # RPC-specific configuration for `delete_agent_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_agent_pool + + # @private + def initialize parent_rpcs = nil + get_google_service_account_config = parent_rpcs.get_google_service_account if parent_rpcs.respond_to? :get_google_service_account + @get_google_service_account = ::Gapic::Config::Method.new get_google_service_account_config + create_transfer_job_config = parent_rpcs.create_transfer_job if parent_rpcs.respond_to? :create_transfer_job + @create_transfer_job = ::Gapic::Config::Method.new create_transfer_job_config + update_transfer_job_config = parent_rpcs.update_transfer_job if parent_rpcs.respond_to? :update_transfer_job + @update_transfer_job = ::Gapic::Config::Method.new update_transfer_job_config + get_transfer_job_config = parent_rpcs.get_transfer_job if parent_rpcs.respond_to? :get_transfer_job + @get_transfer_job = ::Gapic::Config::Method.new get_transfer_job_config + list_transfer_jobs_config = parent_rpcs.list_transfer_jobs if parent_rpcs.respond_to? :list_transfer_jobs + @list_transfer_jobs = ::Gapic::Config::Method.new list_transfer_jobs_config + pause_transfer_operation_config = parent_rpcs.pause_transfer_operation if parent_rpcs.respond_to? :pause_transfer_operation + @pause_transfer_operation = ::Gapic::Config::Method.new pause_transfer_operation_config + resume_transfer_operation_config = parent_rpcs.resume_transfer_operation if parent_rpcs.respond_to? :resume_transfer_operation + @resume_transfer_operation = ::Gapic::Config::Method.new resume_transfer_operation_config + run_transfer_job_config = parent_rpcs.run_transfer_job if parent_rpcs.respond_to? :run_transfer_job + @run_transfer_job = ::Gapic::Config::Method.new run_transfer_job_config + delete_transfer_job_config = parent_rpcs.delete_transfer_job if parent_rpcs.respond_to? :delete_transfer_job + @delete_transfer_job = ::Gapic::Config::Method.new delete_transfer_job_config + create_agent_pool_config = parent_rpcs.create_agent_pool if parent_rpcs.respond_to? :create_agent_pool + @create_agent_pool = ::Gapic::Config::Method.new create_agent_pool_config + update_agent_pool_config = parent_rpcs.update_agent_pool if parent_rpcs.respond_to? :update_agent_pool + @update_agent_pool = ::Gapic::Config::Method.new update_agent_pool_config + get_agent_pool_config = parent_rpcs.get_agent_pool if parent_rpcs.respond_to? :get_agent_pool + @get_agent_pool = ::Gapic::Config::Method.new get_agent_pool_config + list_agent_pools_config = parent_rpcs.list_agent_pools if parent_rpcs.respond_to? :list_agent_pools + @list_agent_pools = ::Gapic::Config::Method.new list_agent_pools_config + delete_agent_pool_config = parent_rpcs.delete_agent_pool if parent_rpcs.respond_to? :delete_agent_pool + @delete_agent_pool = ::Gapic::Config::Method.new delete_agent_pool_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/credentials.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/credentials.rb new file mode 100644 index 000000000000..483f0600c63e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/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 StorageTransfer + module V1 + module StorageTransferService + # Credentials for the StorageTransferService 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-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/operations.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/operations.rb new file mode 100644 index 000000000000..0b3f97869c7f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_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 StorageTransfer + module V1 + module StorageTransferService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storagetransfer.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StorageTransferService 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 StorageTransferService 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::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::StorageTransfer::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::StorageTransfer::V1::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 = "storagetransfer.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/paths.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/paths.rb new file mode 100644 index 000000000000..1d20532cf22e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/paths.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module StorageTransfer + module V1 + module StorageTransferService + # Path helper methods for the StorageTransferService API. + module Paths + ## + # Create a fully-qualified agentPools resource string. + # + # The resource will be in the following format: + # + # `projects/{project_id}/agentPools/{agent_pool_id}` + # + # @param project_id [String] + # @param agent_pool_id [String] + # + # @return [::String] + def agent_pools_path project_id:, agent_pool_id: + raise ::ArgumentError, "project_id cannot contain /" if project_id.to_s.include? "/" + + "projects/#{project_id}/agentPools/#{agent_pool_id}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest.rb new file mode 100644 index 000000000000..cb60b590943e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/storage_transfer/v1/version" + +require "google/cloud/storage_transfer/v1/storage_transfer_service/credentials" +require "google/cloud/storage_transfer/v1/storage_transfer_service/paths" +require "google/cloud/storage_transfer/v1/storage_transfer_service/rest/operations" +require "google/cloud/storage_transfer/v1/storage_transfer_service/rest/client" + +module Google + module Cloud + module StorageTransfer + module V1 + ## + # Storage Transfer Service and its protos. + # Transfers data between between Google Cloud Storage buckets or from a data + # source external to Google to a Cloud Storage bucket. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/storage_transfer/v1/storage_transfer_service/rest" + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + module StorageTransferService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/storage_transfer/v1/storage_transfer_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/client.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/client.rb new file mode 100644 index 000000000000..db426430410d --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/client.rb @@ -0,0 +1,1707 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/storagetransfer/v1/transfer_pb" +require "google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub" + +module Google + module Cloud + module StorageTransfer + module V1 + module StorageTransferService + module Rest + ## + # REST client for the StorageTransferService service. + # + # Storage Transfer Service and its protos. + # Transfers data between between Google Cloud Storage buckets or from a data + # source external to Google to a Cloud Storage bucket. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storagetransfer.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_transfer_service_stub + + ## + # Configure the StorageTransferService Client class. + # + # See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageTransferService clients + # ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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", "StorageTransfer", "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: 2, retry_codes: [14] + } + + default_config.rpcs.create_transfer_job.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageTransferService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::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 + @storage_transfer_service_stub.universe_domain + end + + ## + # Create a new StorageTransferService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageTransferService 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::StorageTransfer::V1::StorageTransferService::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 + + @storage_transfer_service_stub = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @storage_transfer_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::StorageTransfer::V1::StorageTransferService::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @storage_transfer_service_stub.logger + end + + # Service calls + + ## + # Returns the Google service account that is used by Storage Transfer + # Service to access buckets in the project where transfers + # run or in other projects. Each Google service account is associated + # with one Google Cloud project. Users + # should add this service account to the Google Cloud Storage bucket + # ACLs to grant access to Storage Transfer Service. This service + # account is created and owned by Storage Transfer Service and can + # only be used by Storage Transfer Service. + # + # @overload get_google_service_account(request, options = nil) + # Pass arguments to `get_google_service_account` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_google_service_account(project_id: nil) + # Pass arguments to `get_google_service_account` via keyword arguments. Note that at + # least one keyword argument is 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_id [::String] + # Required. The ID of the Google Cloud project that the Google service + # account is associated with. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new + # + # # Call the get_google_service_account method. + # result = client.get_google_service_account request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::GoogleServiceAccount. + # p result + # + def get_google_service_account request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_google_service_account.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_google_service_account.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_google_service_account.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.get_google_service_account request, 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 transfer job that runs periodically. + # + # @overload create_transfer_job(request, options = nil) + # Pass arguments to `create_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_transfer_job(transfer_job: nil) + # Pass arguments to `create_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash] + # Required. The job to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new + # + # # Call the create_transfer_job method. + # result = client.create_transfer_job request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + # p result + # + def create_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest + + # Converts hash and nil to an 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_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_transfer_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.create_transfer_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a transfer job. Updating a job's transfer spec does not affect + # transfer operations that are running already. + # + # **Note:** The job's {::Google::Cloud::StorageTransfer::V1::TransferJob#status status} + # field can be modified using this RPC (for example, to set a job's status to + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}, or + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED}). + # + # @overload update_transfer_job(request, options = nil) + # Pass arguments to `update_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_transfer_job(job_name: nil, project_id: nil, transfer_job: nil, update_transfer_job_field_mask: nil) + # Pass arguments to `update_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job_name [::String] + # Required. The name of job to update. + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the + # job. + # @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash] + # Required. The job to update. `transferJob` is expected to specify one or + # more of five fields: + # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and + # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. An + # `UpdateTransferJobRequest` that specifies other fields are rejected with + # the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. Updating a + # job status to + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} requires + # `storagetransfer.jobs.delete` permission. + # @param update_transfer_job_field_mask [::Google::Protobuf::FieldMask, ::Hash] + # The field mask of the fields in `transferJob` that are to be updated in + # this request. Fields in `transferJob` that can be updated are: + # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and + # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. To update the + # `transfer_spec` of the job, a complete transfer specification must be + # provided. An incomplete specification missing any required fields is + # rejected with the error + # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new + # + # # Call the update_transfer_job method. + # result = client.update_transfer_job request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + # p result + # + def update_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest + + # Converts hash and nil to an 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_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_transfer_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.update_transfer_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a transfer job. + # + # @overload get_transfer_job(request, options = nil) + # Pass arguments to `get_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_transfer_job(job_name: nil, project_id: nil) + # Pass arguments to `get_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job_name [::String] + # Required. The job to get. + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the + # job. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new + # + # # Call the get_transfer_job method. + # result = client.get_transfer_job request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + # p result + # + def get_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_transfer_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.get_transfer_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists transfer jobs. + # + # @overload list_transfer_jobs(request, options = nil) + # Pass arguments to `list_transfer_jobs` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_transfer_jobs(filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_transfer_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param filter [::String] + # Required. A list of query parameters specified as JSON text in the form of: + # + # ``` + # { + # "projectId":"my_project_id", + # "jobNames":["jobid1","jobid2",...], + # "jobStatuses":["status1","status2",...], + # "dataBackend":"QUERY_REPLICATION_CONFIGS", + # "sourceBucket":"source-bucket-name", + # "sinkBucket":"sink-bucket-name", + # } + # ``` + # + # The JSON formatting in the example is for display only; provide the + # query parameters without spaces or line breaks. + # + # * `projectId` is required. + # * Since `jobNames` and `jobStatuses` support multiple values, their values + # must be specified with array notation. `jobNames` and `jobStatuses` are + # optional. Valid values are case-insensitive: + # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED} + # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED} + # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} + # * Specify `"dataBackend":"QUERY_REPLICATION_CONFIGS"` to return a list of + # cross-bucket replication jobs. + # * Limit the results to jobs from a particular bucket with `sourceBucket` + # and/or to a particular bucket with `sinkBucket`. + # @param page_size [::Integer] + # The list page size. The max allowed value is 256. + # @param page_token [::String] + # The list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new + # + # # Call the list_transfer_jobs method. + # result = client.list_transfer_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageTransfer::V1::TransferJob. + # p item + # end + # + def list_transfer_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_transfer_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_transfer_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_transfer_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.list_transfer_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @storage_transfer_service_stub, :list_transfer_jobs, "transfer_jobs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses a transfer operation. + # + # @overload pause_transfer_operation(request, options = nil) + # Pass arguments to `pause_transfer_operation` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transfer_operation(name: nil) + # Pass arguments to `pause_transfer_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 transfer operation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new + # + # # Call the pause_transfer_operation method. + # result = client.pause_transfer_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def pause_transfer_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest + + # Converts hash and nil to an 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_transfer_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_transfer_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_transfer_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.pause_transfer_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 + + ## + # Resumes a transfer operation that is paused. + # + # @overload resume_transfer_operation(request, options = nil) + # Pass arguments to `resume_transfer_operation` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_transfer_operation(name: nil) + # Pass arguments to `resume_transfer_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 transfer operation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new + # + # # Call the resume_transfer_operation method. + # result = client.resume_transfer_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def resume_transfer_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest + + # Converts hash and nil to an 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_transfer_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_transfer_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_transfer_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.resume_transfer_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 a new operation for the specified transfer job. + # A `TransferJob` has a maximum of one active `TransferOperation`. If this + # method is called while a `TransferOperation` is active, an error is + # returned. + # + # @overload run_transfer_job(request, options = nil) + # Pass arguments to `run_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_transfer_job(job_name: nil, project_id: nil) + # Pass arguments to `run_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job_name [::String] + # Required. The name of the transfer job. + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the transfer + # job. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new + # + # # Call the run_transfer_job method. + # result = client.run_transfer_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def run_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.run_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.run_transfer_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.run_transfer_job request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 transfer job. Deleting a transfer job sets its status to + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}. + # + # @overload delete_transfer_job(request, options = nil) + # Pass arguments to `delete_transfer_job` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_transfer_job(job_name: nil, project_id: nil) + # Pass arguments to `delete_transfer_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job_name [::String] + # Required. The job to delete. + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the + # job. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new + # + # # Call the delete_transfer_job method. + # result = client.delete_transfer_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_transfer_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_transfer_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_transfer_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_transfer_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.delete_transfer_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an agent pool resource. + # + # @overload create_agent_pool(request, options = nil) + # Pass arguments to `create_agent_pool` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_agent_pool(project_id: nil, agent_pool: nil, agent_pool_id: nil) + # Pass arguments to `create_agent_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the + # agent pool. + # @param agent_pool [::Google::Cloud::StorageTransfer::V1::AgentPool, ::Hash] + # Required. The agent pool to create. + # @param agent_pool_id [::String] + # Required. The ID of the agent pool to create. + # + # The `agent_pool_id` must meet the following requirements: + # + # * Length of 128 characters or less. + # * Not start with the string `goog`. + # * Start with a lowercase ASCII character, followed by: + # * Zero or more: lowercase Latin alphabet characters, numerals, + # hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + # * One or more numerals or lowercase ASCII characters. + # + # As expressed by the regular expression: + # `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new + # + # # Call the create_agent_pool method. + # result = client.create_agent_pool request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + # p result + # + def create_agent_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest + + # Converts hash and nil to an 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_agent_pool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agent_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_agent_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.create_agent_pool request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing agent pool resource. + # + # @overload update_agent_pool(request, options = nil) + # Pass arguments to `update_agent_pool` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_agent_pool(agent_pool: nil, update_mask: nil) + # Pass arguments to `update_agent_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param agent_pool [::Google::Cloud::StorageTransfer::V1::AgentPool, ::Hash] + # Required. The agent pool to update. `agent_pool` is expected to specify + # following fields: + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#name name} + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} + # An `UpdateAgentPoolRequest` with any other fields is rejected + # with the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The [field mask] + # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + # of the fields in `agentPool` to update in this request. + # The following `agentPool` fields can be updated: + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new + # + # # Call the update_agent_pool method. + # result = client.update_agent_pool request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + # p result + # + def update_agent_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest + + # Converts hash and nil to an 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_agent_pool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agent_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_agent_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.update_agent_pool request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an agent pool. + # + # @overload get_agent_pool(request, options = nil) + # Pass arguments to `get_agent_pool` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_agent_pool(name: nil) + # Pass arguments to `get_agent_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the agent pool to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new + # + # # Call the get_agent_pool method. + # result = client.get_agent_pool request + # + # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + # p result + # + def get_agent_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_agent_pool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_agent_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_agent_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.get_agent_pool request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists agent pools. + # + # @overload list_agent_pools(request, options = nil) + # Pass arguments to `list_agent_pools` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_agent_pools(project_id: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_agent_pools` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud project that owns the job. + # @param filter [::String] + # An optional list of query parameters specified as JSON text in the + # form of: + # + # `{"agentPoolNames":["agentpool1","agentpool2",...]}` + # + # Since `agentPoolNames` support multiple values, its values must be + # specified with array notation. When the filter is either empty or not + # provided, the list returns all agent pools for the project. + # @param page_size [::Integer] + # The list page size. The max allowed value is `256`. + # @param page_token [::String] + # The list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new + # + # # Call the list_agent_pools method. + # result = client.list_agent_pools request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::StorageTransfer::V1::AgentPool. + # p item + # end + # + def list_agent_pools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_agent_pools.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_agent_pools.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_agent_pools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.list_agent_pools request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @storage_transfer_service_stub, :list_agent_pools, "agent_pools", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an agent pool. + # + # @overload delete_agent_pool(request, options = nil) + # Pass arguments to `delete_agent_pool` via a request object, either of type + # {::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_agent_pool(name: nil) + # Pass arguments to `delete_agent_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the agent pool to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage_transfer/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new + # + # # Call the delete_agent_pool method. + # result = client.delete_agent_pool request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_agent_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_agent_pool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_agent_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_agent_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_transfer_service_stub.delete_agent_pool request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the StorageTransferService REST API. + # + # This class represents the configuration for StorageTransferService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_google_service_account to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_google_service_account.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_google_service_account.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storagetransfer.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the StorageTransferService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_google_service_account` + # @return [::Gapic::Config::Method] + # + attr_reader :get_google_service_account + ## + # RPC-specific configuration for `create_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_transfer_job + ## + # RPC-specific configuration for `update_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_transfer_job + ## + # RPC-specific configuration for `get_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_transfer_job + ## + # RPC-specific configuration for `list_transfer_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_transfer_jobs + ## + # RPC-specific configuration for `pause_transfer_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_transfer_operation + ## + # RPC-specific configuration for `resume_transfer_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_transfer_operation + ## + # RPC-specific configuration for `run_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_transfer_job + ## + # RPC-specific configuration for `delete_transfer_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_transfer_job + ## + # RPC-specific configuration for `create_agent_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_agent_pool + ## + # RPC-specific configuration for `update_agent_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_agent_pool + ## + # RPC-specific configuration for `get_agent_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_agent_pool + ## + # RPC-specific configuration for `list_agent_pools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_agent_pools + ## + # RPC-specific configuration for `delete_agent_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_agent_pool + + # @private + def initialize parent_rpcs = nil + get_google_service_account_config = parent_rpcs.get_google_service_account if parent_rpcs.respond_to? :get_google_service_account + @get_google_service_account = ::Gapic::Config::Method.new get_google_service_account_config + create_transfer_job_config = parent_rpcs.create_transfer_job if parent_rpcs.respond_to? :create_transfer_job + @create_transfer_job = ::Gapic::Config::Method.new create_transfer_job_config + update_transfer_job_config = parent_rpcs.update_transfer_job if parent_rpcs.respond_to? :update_transfer_job + @update_transfer_job = ::Gapic::Config::Method.new update_transfer_job_config + get_transfer_job_config = parent_rpcs.get_transfer_job if parent_rpcs.respond_to? :get_transfer_job + @get_transfer_job = ::Gapic::Config::Method.new get_transfer_job_config + list_transfer_jobs_config = parent_rpcs.list_transfer_jobs if parent_rpcs.respond_to? :list_transfer_jobs + @list_transfer_jobs = ::Gapic::Config::Method.new list_transfer_jobs_config + pause_transfer_operation_config = parent_rpcs.pause_transfer_operation if parent_rpcs.respond_to? :pause_transfer_operation + @pause_transfer_operation = ::Gapic::Config::Method.new pause_transfer_operation_config + resume_transfer_operation_config = parent_rpcs.resume_transfer_operation if parent_rpcs.respond_to? :resume_transfer_operation + @resume_transfer_operation = ::Gapic::Config::Method.new resume_transfer_operation_config + run_transfer_job_config = parent_rpcs.run_transfer_job if parent_rpcs.respond_to? :run_transfer_job + @run_transfer_job = ::Gapic::Config::Method.new run_transfer_job_config + delete_transfer_job_config = parent_rpcs.delete_transfer_job if parent_rpcs.respond_to? :delete_transfer_job + @delete_transfer_job = ::Gapic::Config::Method.new delete_transfer_job_config + create_agent_pool_config = parent_rpcs.create_agent_pool if parent_rpcs.respond_to? :create_agent_pool + @create_agent_pool = ::Gapic::Config::Method.new create_agent_pool_config + update_agent_pool_config = parent_rpcs.update_agent_pool if parent_rpcs.respond_to? :update_agent_pool + @update_agent_pool = ::Gapic::Config::Method.new update_agent_pool_config + get_agent_pool_config = parent_rpcs.get_agent_pool if parent_rpcs.respond_to? :get_agent_pool + @get_agent_pool = ::Gapic::Config::Method.new get_agent_pool_config + list_agent_pools_config = parent_rpcs.list_agent_pools if parent_rpcs.respond_to? :list_agent_pools + @list_agent_pools = ::Gapic::Config::Method.new list_agent_pools_config + delete_agent_pool_config = parent_rpcs.delete_agent_pool if parent_rpcs.respond_to? :delete_agent_pool + @delete_agent_pool = ::Gapic::Config::Method.new delete_agent_pool_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/operations.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/operations.rb new file mode 100644 index 000000000000..6c56fc513acf --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/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 StorageTransfer + module V1 + module StorageTransferService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storagetransfer.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StorageTransferService 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 StorageTransferService 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::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageTransfer::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "storagetransfer.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^transferOperations/?$}, 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{^transferOperations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^transferOperations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb new file mode 100644 index 000000000000..f64c18316bd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb @@ -0,0 +1,938 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/storagetransfer/v1/transfer_pb" + +module Google + module Cloud + module StorageTransfer + module V1 + module StorageTransferService + module Rest + ## + # REST service stub for the StorageTransferService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_google_service_account REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] + # A result object deserialized from the server's reply + def get_google_service_account request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_google_service_account_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_google_service_account", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount.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_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # A result object deserialized from the server's reply + def create_transfer_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_transfer_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_transfer_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageTransfer::V1::TransferJob.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_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # A result object deserialized from the server's reply + def update_transfer_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_transfer_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_transfer_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageTransfer::V1::TransferJob.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # A result object deserialized from the server's reply + def get_transfer_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_transfer_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_transfer_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageTransfer::V1::TransferJob.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_transfer_jobs REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse] + # A result object deserialized from the server's reply + def list_transfer_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_transfer_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_transfer_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse.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_transfer_operation REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def pause_transfer_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_transfer_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_transfer_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 resume_transfer_operation REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def resume_transfer_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_transfer_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_transfer_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 run_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def run_transfer_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_transfer_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "run_transfer_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_transfer_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_transfer_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_transfer_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_agent_pool REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # A result object deserialized from the server's reply + def create_agent_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_agent_pool_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_agent_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageTransfer::V1::AgentPool.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_agent_pool REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # A result object deserialized from the server's reply + def update_agent_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_agent_pool_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_agent_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageTransfer::V1::AgentPool.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_agent_pool REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # A result object deserialized from the server's reply + def get_agent_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_agent_pool_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_agent_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageTransfer::V1::AgentPool.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_agent_pools REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse] + # A result object deserialized from the server's reply + def list_agent_pools request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_agent_pools_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_agent_pools", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_agent_pool REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_agent_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_agent_pool_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_agent_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 get_google_service_account REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_google_service_account_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/googleServiceAccounts/{project_id}", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest] + # 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_transfer_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/transferJobs", + body: "transfer_job", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest] + # 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_transfer_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{job_name}", + body: "*", + matches: [ + ["job_name", %r{^transferJobs(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_transfer_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{job_name}", + matches: [ + ["job_name", %r{^transferJobs(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_transfer_jobs REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_transfer_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/transferJobs", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_transfer_operation REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest] + # 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_transfer_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:pause", + body: "*", + matches: [ + ["name", %r{^transferOperations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_transfer_operation REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest] + # 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_transfer_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:resume", + body: "*", + matches: [ + ["name", %r{^transferOperations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_transfer_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{job_name}:run", + body: "*", + matches: [ + ["job_name", %r{^transferJobs(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_transfer_job REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_transfer_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{job_name}", + matches: [ + ["job_name", %r{^transferJobs(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_agent_pool REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest] + # 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_agent_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}/agentPools", + body: "agent_pool", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_agent_pool REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest] + # 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_agent_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{agent_pool.name}", + body: "agent_pool", + matches: [ + ["agent_pool.name", %r{^projects/[^/]+/agentPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_agent_pool REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_agent_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agentPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_agent_pools REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_agent_pools_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/projects/{project_id}/agentPools", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_agent_pool REST call + # + # @param request_pb [::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_agent_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agentPools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/version.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/version.rb new file mode 100644 index 000000000000..1de61ccd8b91 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/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 StorageTransfer + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_pb.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_pb.rb new file mode 100644 index 000000000000..3f2865fa0d61 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/storagetransfer/v1/transfer.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/storagetransfer/v1/transfer_types_pb' + + +descriptor_data = "\n(google/storagetransfer/v1/transfer.proto\x12\x19google.storagetransfer.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.google/storagetransfer/v1/transfer_types.proto\"9\n\x1eGetGoogleServiceAccountRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\"]\n\x18\x43reateTransferJobRequest\x12\x41\n\x0ctransfer_job\x18\x01 \x01(\x0b\x32&.google.storagetransfer.v1.TransferJobB\x03\xe0\x41\x02\"\xd1\x01\n\x18UpdateTransferJobRequest\x12\x15\n\x08job_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nproject_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0ctransfer_job\x18\x03 \x01(\x0b\x32&.google.storagetransfer.v1.TransferJobB\x03\xe0\x41\x02\x12\x42\n\x1eupdate_transfer_job_field_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x15GetTransferJobRequest\x12\x15\n\x08job_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nproject_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"J\n\x18\x44\x65leteTransferJobRequest\x12\x15\n\x08job_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nproject_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"U\n\x17ListTransferJobsRequest\x12\x13\n\x06\x66ilter\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"r\n\x18ListTransferJobsResponse\x12=\n\rtransfer_jobs\x18\x01 \x03(\x0b\x32&.google.storagetransfer.v1.TransferJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"2\n\x1dPauseTransferOperationRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"3\n\x1eResumeTransferOperationRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"G\n\x15RunTransferJobRequest\x12\x15\n\x08job_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nproject_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x8c\x01\n\x16\x43reateAgentPoolRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\nagent_pool\x18\x02 \x01(\x0b\x32$.google.storagetransfer.v1.AgentPoolB\x03\xe0\x41\x02\x12\x1a\n\ragent_pool_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x88\x01\n\x16UpdateAgentPoolRequest\x12=\n\nagent_pool\x18\x01 \x01(\x0b\x32$.google.storagetransfer.v1.AgentPoolB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"(\n\x13GetAgentPoolRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"+\n\x16\x44\x65leteAgentPoolRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"g\n\x15ListAgentPoolsRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"l\n\x16ListAgentPoolsResponse\x12\x39\n\x0b\x61gent_pools\x18\x01 \x03(\x0b\x32$.google.storagetransfer.v1.AgentPool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x91\x13\n\x16StorageTransferService\x12\xb5\x01\n\x17GetGoogleServiceAccount\x12\x39.google.storagetransfer.v1.GetGoogleServiceAccountRequest\x1a/.google.storagetransfer.v1.GoogleServiceAccount\".\x82\xd3\xe4\x93\x02(\x12&/v1/googleServiceAccounts/{project_id}\x12\x98\x01\n\x11\x43reateTransferJob\x12\x33.google.storagetransfer.v1.CreateTransferJobRequest\x1a&.google.storagetransfer.v1.TransferJob\"&\x82\xd3\xe4\x93\x02 \"\x10/v1/transferJobs:\x0ctransfer_job\x12\x9b\x01\n\x11UpdateTransferJob\x12\x33.google.storagetransfer.v1.UpdateTransferJobRequest\x1a&.google.storagetransfer.v1.TransferJob\")\x82\xd3\xe4\x93\x02#2\x1e/v1/{job_name=transferJobs/**}:\x01*\x12\x92\x01\n\x0eGetTransferJob\x12\x30.google.storagetransfer.v1.GetTransferJobRequest\x1a&.google.storagetransfer.v1.TransferJob\"&\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{job_name=transferJobs/**}\x12\x95\x01\n\x10ListTransferJobs\x12\x32.google.storagetransfer.v1.ListTransferJobsRequest\x1a\x33.google.storagetransfer.v1.ListTransferJobsResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/transferJobs\x12\x9d\x01\n\x16PauseTransferOperation\x12\x38.google.storagetransfer.v1.PauseTransferOperationRequest\x1a\x16.google.protobuf.Empty\"1\x82\xd3\xe4\x93\x02+\"&/v1/{name=transferOperations/**}:pause:\x01*\x12\xa0\x01\n\x17ResumeTransferOperation\x12\x39.google.storagetransfer.v1.ResumeTransferOperationRequest\x1a\x16.google.protobuf.Empty\"2\x82\xd3\xe4\x93\x02,\"\'/v1/{name=transferOperations/**}:resume:\x01*\x12\xbd\x01\n\x0eRunTransferJob\x12\x30.google.storagetransfer.v1.RunTransferJobRequest\x1a\x1d.google.longrunning.Operation\"Z\xca\x41*\n\x15google.protobuf.Empty\x12\x11TransferOperation\x82\xd3\xe4\x93\x02\'\"\"/v1/{job_name=transferJobs/**}:run:\x01*\x12\x88\x01\n\x11\x44\x65leteTransferJob\x12\x33.google.storagetransfer.v1.DeleteTransferJobRequest\x1a\x16.google.protobuf.Empty\"&\x82\xd3\xe4\x93\x02 *\x1e/v1/{job_name=transferJobs/**}\x12\xcc\x01\n\x0f\x43reateAgentPool\x12\x31.google.storagetransfer.v1.CreateAgentPoolRequest\x1a$.google.storagetransfer.v1.AgentPool\"`\xda\x41#project_id,agent_pool,agent_pool_id\x82\xd3\xe4\x93\x02\x34\"&/v1/projects/{project_id=*}/agentPools:\nagent_pool\x12\xc6\x01\n\x0fUpdateAgentPool\x12\x31.google.storagetransfer.v1.UpdateAgentPoolRequest\x1a$.google.storagetransfer.v1.AgentPool\"Z\xda\x41\x16\x61gent_pool,update_mask\x82\xd3\xe4\x93\x02;2-/v1/{agent_pool.name=projects/*/agentPools/*}:\nagent_pool\x12\x97\x01\n\x0cGetAgentPool\x12..google.storagetransfer.v1.GetAgentPoolRequest\x1a$.google.storagetransfer.v1.AgentPool\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$\x12\"/v1/{name=projects/*/agentPools/*}\x12\xb2\x01\n\x0eListAgentPools\x12\x30.google.storagetransfer.v1.ListAgentPoolsRequest\x1a\x31.google.storagetransfer.v1.ListAgentPoolsResponse\";\xda\x41\nproject_id\x82\xd3\xe4\x93\x02(\x12&/v1/projects/{project_id=*}/agentPools\x12\x8f\x01\n\x0f\x44\x65leteAgentPool\x12\x31.google.storagetransfer.v1.DeleteAgentPoolRequest\x1a\x16.google.protobuf.Empty\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$*\"/v1/{name=projects/*/agentPools/*}\x1aR\xca\x41\x1estoragetransfer.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xec\x01\n#com.google.storagetransfer.v1.protoB\rTransferProtoZMcloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpb\xaa\x02\x1fGoogle.Cloud.StorageTransfer.V1\xca\x02\x1fGoogle\\Cloud\\StorageTransfer\\V1\xea\x02\"Google::Cloud::StorageTransfer::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module StorageTransfer + module V1 + GetGoogleServiceAccountRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GetGoogleServiceAccountRequest").msgclass + CreateTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.CreateTransferJobRequest").msgclass + UpdateTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.UpdateTransferJobRequest").msgclass + GetTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GetTransferJobRequest").msgclass + DeleteTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.DeleteTransferJobRequest").msgclass + ListTransferJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ListTransferJobsRequest").msgclass + ListTransferJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ListTransferJobsResponse").msgclass + PauseTransferOperationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.PauseTransferOperationRequest").msgclass + ResumeTransferOperationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ResumeTransferOperationRequest").msgclass + RunTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.RunTransferJobRequest").msgclass + CreateAgentPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.CreateAgentPoolRequest").msgclass + UpdateAgentPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.UpdateAgentPoolRequest").msgclass + GetAgentPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GetAgentPoolRequest").msgclass + DeleteAgentPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.DeleteAgentPoolRequest").msgclass + ListAgentPoolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ListAgentPoolsRequest").msgclass + ListAgentPoolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ListAgentPoolsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_services_pb.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_services_pb.rb new file mode 100644 index 000000000000..25ee4b7f2d98 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_services_pb.rb @@ -0,0 +1,91 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/storagetransfer/v1/transfer.proto for package 'Google.Cloud.StorageTransfer.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/storagetransfer/v1/transfer_pb' + +module Google + module Cloud + module StorageTransfer + module V1 + module StorageTransferService + # Storage Transfer Service and its protos. + # Transfers data between between Google Cloud Storage buckets or from a data + # source external to Google to a Cloud Storage bucket. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.storagetransfer.v1.StorageTransferService' + + # Returns the Google service account that is used by Storage Transfer + # Service to access buckets in the project where transfers + # run or in other projects. Each Google service account is associated + # with one Google Cloud project. Users + # should add this service account to the Google Cloud Storage bucket + # ACLs to grant access to Storage Transfer Service. This service + # account is created and owned by Storage Transfer Service and can + # only be used by Storage Transfer Service. + rpc :GetGoogleServiceAccount, ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount + # Creates a transfer job that runs periodically. + rpc :CreateTransferJob, ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, ::Google::Cloud::StorageTransfer::V1::TransferJob + # Updates a transfer job. Updating a job's transfer spec does not affect + # transfer operations that are running already. + # + # **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] + # field can be modified using this RPC (for example, to set a job's status to + # [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], + # [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or + # [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]). + rpc :UpdateTransferJob, ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, ::Google::Cloud::StorageTransfer::V1::TransferJob + # Gets a transfer job. + rpc :GetTransferJob, ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, ::Google::Cloud::StorageTransfer::V1::TransferJob + # Lists transfer jobs. + rpc :ListTransferJobs, ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, ::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse + # Pauses a transfer operation. + rpc :PauseTransferOperation, ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, ::Google::Protobuf::Empty + # Resumes a transfer operation that is paused. + rpc :ResumeTransferOperation, ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, ::Google::Protobuf::Empty + # Starts a new operation for the specified transfer job. + # A `TransferJob` has a maximum of one active `TransferOperation`. If this + # method is called while a `TransferOperation` is active, an error is + # returned. + rpc :RunTransferJob, ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, ::Google::Longrunning::Operation + # Deletes a transfer job. Deleting a transfer job sets its status to + # [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. + rpc :DeleteTransferJob, ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest, ::Google::Protobuf::Empty + # Creates an agent pool resource. + rpc :CreateAgentPool, ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest, ::Google::Cloud::StorageTransfer::V1::AgentPool + # Updates an existing agent pool resource. + rpc :UpdateAgentPool, ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest, ::Google::Cloud::StorageTransfer::V1::AgentPool + # Gets an agent pool. + rpc :GetAgentPool, ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest, ::Google::Cloud::StorageTransfer::V1::AgentPool + # Lists agent pools. + rpc :ListAgentPools, ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest, ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse + # Deletes an agent pool. + rpc :DeleteAgentPool, ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_types_pb.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_types_pb.rb new file mode 100644 index 000000000000..9dd1ba638947 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_types_pb.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/storagetransfer/v1/transfer_types.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/code_pb' +require 'google/type/date_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n.google/storagetransfer/v1/transfer_types.proto\x12\x19google.storagetransfer.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15google/rpc/code.proto\x1a\x16google/type/date.proto\x1a\x1bgoogle/type/timeofday.proto\"A\n\x14GoogleServiceAccount\x12\x15\n\raccount_email\x18\x01 \x01(\t\x12\x12\n\nsubject_id\x18\x02 \x01(\t\"J\n\x0c\x41wsAccessKey\x12\x1a\n\raccess_key_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11secret_access_key\x18\x02 \x01(\tB\x03\xe0\x41\x02\"*\n\x10\x41zureCredentials\x12\x16\n\tsas_token\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xd3\x02\n\x10ObjectConditions\x12K\n(min_time_elapsed_since_last_modification\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12K\n(max_time_elapsed_since_last_modification\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10include_prefixes\x18\x03 \x03(\t\x12\x18\n\x10\x65xclude_prefixes\x18\x04 \x03(\t\x12\x37\n\x13last_modified_since\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14last_modified_before\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Z\n\x07GcsData\x12\x18\n\x0b\x62ucket_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04path\x18\x03 \x01(\t\x12\'\n\x1fmanaged_folder_transfer_enabled\x18\x04 \x01(\x08\"\x82\x02\n\tAwsS3Data\x12\x18\n\x0b\x62ucket_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x0e\x61ws_access_key\x18\x02 \x01(\x0b\x32\'.google.storagetransfer.v1.AwsAccessKeyB\x03\xe0\x41\x04\x12\x0c\n\x04path\x18\x03 \x01(\t\x12\x10\n\x08role_arn\x18\x04 \x01(\t\x12\x1e\n\x11\x63loudfront_domain\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x63redentials_secret\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12!\n\x17managed_private_network\x18\x08 \x01(\x08H\x00\x42\x11\n\x0fprivate_network\"\x87\x03\n\x14\x41zureBlobStorageData\x12\x1c\n\x0fstorage_account\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12N\n\x11\x61zure_credentials\x18\x02 \x01(\x0b\x32+.google.storagetransfer.v1.AzureCredentialsB\x06\xe0\x41\x02\xe0\x41\x04\x12\x16\n\tcontainer\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04path\x18\x05 \x01(\t\x12\x1f\n\x12\x63redentials_secret\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12o\n\x19\x66\x65\x64\x65rated_identity_config\x18\x08 \x01(\x0b\x32G.google.storagetransfer.v1.AzureBlobStorageData.FederatedIdentityConfigB\x03\xe0\x41\x01\x1aI\n\x17\x46\x65\x64\x65ratedIdentityConfig\x12\x16\n\tclient_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\ttenant_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"!\n\x08HttpData\x12\x15\n\x08list_url\x18\x01 \x01(\tB\x03\xe0\x41\x02\")\n\x0fPosixFilesystem\x12\x16\n\x0eroot_directory\x18\x01 \x01(\t\"\x18\n\x08HdfsData\x12\x0c\n\x04path\x18\x01 \x01(\t\"\xbd\x01\n\x13\x41wsS3CompatibleData\x12\x18\n\x0b\x62ucket_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\x15\n\x08\x65ndpoint\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06region\x18\x05 \x01(\t\x12\x46\n\x0bs3_metadata\x18\x04 \x01(\x0b\x32/.google.storagetransfer.v1.S3CompatibleMetadataH\x00\x42\x0f\n\rdata_provider\"\xf6\x05\n\x14S3CompatibleMetadata\x12O\n\x0b\x61uth_method\x18\x01 \x01(\x0e\x32:.google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod\x12S\n\rrequest_model\x18\x02 \x01(\x0e\x32<.google.storagetransfer.v1.S3CompatibleMetadata.RequestModel\x12Q\n\x08protocol\x18\x03 \x01(\x0e\x32?.google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol\x12I\n\x08list_api\x18\x04 \x01(\x0e\x32\x37.google.storagetransfer.v1.S3CompatibleMetadata.ListApi\"m\n\nAuthMethod\x12\x1b\n\x17\x41UTH_METHOD_UNSPECIFIED\x10\x00\x12 \n\x1c\x41UTH_METHOD_AWS_SIGNATURE_V4\x10\x01\x12 \n\x1c\x41UTH_METHOD_AWS_SIGNATURE_V2\x10\x02\"s\n\x0cRequestModel\x12\x1d\n\x19REQUEST_MODEL_UNSPECIFIED\x10\x00\x12&\n\"REQUEST_MODEL_VIRTUAL_HOSTED_STYLE\x10\x01\x12\x1c\n\x18REQUEST_MODEL_PATH_STYLE\x10\x02\"j\n\x0fNetworkProtocol\x12 \n\x1cNETWORK_PROTOCOL_UNSPECIFIED\x10\x00\x12\x1a\n\x16NETWORK_PROTOCOL_HTTPS\x10\x01\x12\x19\n\x15NETWORK_PROTOCOL_HTTP\x10\x02\"J\n\x07ListApi\x12\x18\n\x14LIST_API_UNSPECIFIED\x10\x00\x12\x13\n\x0fLIST_OBJECTS_V2\x10\x01\x12\x10\n\x0cLIST_OBJECTS\x10\x02\"\x93\x03\n\tAgentPool\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12>\n\x05state\x18\x04 \x01(\x0e\x32*.google.storagetransfer.v1.AgentPool.StateB\x03\xe0\x41\x03\x12L\n\x0f\x62\x61ndwidth_limit\x18\x05 \x01(\x0b\x32\x33.google.storagetransfer.v1.AgentPool.BandwidthLimit\x1a$\n\x0e\x42\x61ndwidthLimit\x12\x12\n\nlimit_mbps\x18\x01 \x01(\x03\"G\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07\x43REATED\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03:`\xea\x41]\n)storagetransfer.googleapis.com/agentPools\x12\x30projects/{project_id}/agentPools/{agent_pool_id}\"\x8e\x03\n\x0fTransferOptions\x12\x32\n*overwrite_objects_already_existing_in_sink\x18\x01 \x01(\x08\x12%\n\x1d\x64\x65lete_objects_unique_in_sink\x18\x02 \x01(\x08\x12\x31\n)delete_objects_from_source_after_transfer\x18\x03 \x01(\x08\x12P\n\x0eoverwrite_when\x18\x04 \x01(\x0e\x32\x38.google.storagetransfer.v1.TransferOptions.OverwriteWhen\x12\x44\n\x10metadata_options\x18\x05 \x01(\x0b\x32*.google.storagetransfer.v1.MetadataOptions\"U\n\rOverwriteWhen\x12\x1e\n\x1aOVERWRITE_WHEN_UNSPECIFIED\x10\x00\x12\r\n\tDIFFERENT\x10\x01\x12\t\n\x05NEVER\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"\xb0\x08\n\x0cTransferSpec\x12;\n\rgcs_data_sink\x18\x04 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x00\x12\x45\n\x0fposix_data_sink\x18\r \x01(\x0b\x32*.google.storagetransfer.v1.PosixFilesystemH\x00\x12=\n\x0fgcs_data_source\x18\x01 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x01\x12\x42\n\x12\x61ws_s3_data_source\x18\x02 \x01(\x0b\x32$.google.storagetransfer.v1.AwsS3DataH\x01\x12?\n\x10http_data_source\x18\x03 \x01(\x0b\x32#.google.storagetransfer.v1.HttpDataH\x01\x12G\n\x11posix_data_source\x18\x0e \x01(\x0b\x32*.google.storagetransfer.v1.PosixFilesystemH\x01\x12Y\n\x1e\x61zure_blob_storage_data_source\x18\x08 \x01(\x0b\x32/.google.storagetransfer.v1.AzureBlobStorageDataH\x01\x12W\n\x1d\x61ws_s3_compatible_data_source\x18\x13 \x01(\x0b\x32..google.storagetransfer.v1.AwsS3CompatibleDataH\x01\x12?\n\x10hdfs_data_source\x18\x14 \x01(\x0b\x32#.google.storagetransfer.v1.HdfsDataH\x01\x12L\n\x1egcs_intermediate_data_location\x18\x10 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x02\x12\x46\n\x11object_conditions\x18\x05 \x01(\x0b\x32+.google.storagetransfer.v1.ObjectConditions\x12\x44\n\x10transfer_options\x18\x06 \x01(\x0b\x32*.google.storagetransfer.v1.TransferOptions\x12\x46\n\x11transfer_manifest\x18\x0f \x01(\x0b\x32+.google.storagetransfer.v1.TransferManifest\x12\x1e\n\x16source_agent_pool_name\x18\x11 \x01(\t\x12\x1c\n\x14sink_agent_pool_name\x18\x12 \x01(\tB\x0b\n\tdata_sinkB\r\n\x0b\x64\x61ta_sourceB\x1c\n\x1aintermediate_data_location\"\xb7\x02\n\x0fReplicationSpec\x12=\n\x0fgcs_data_source\x18\x01 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x00\x12;\n\rgcs_data_sink\x18\x02 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x01\x12\x46\n\x11object_conditions\x18\x03 \x01(\x0b\x32+.google.storagetransfer.v1.ObjectConditions\x12\x44\n\x10transfer_options\x18\x04 \x01(\x0b\x32*.google.storagetransfer.v1.TransferOptionsB\r\n\x0b\x64\x61ta_sourceB\x0b\n\tdata_sink\"\xf1\x0b\n\x0fMetadataOptions\x12\x43\n\x07symlink\x18\x01 \x01(\x0e\x32\x32.google.storagetransfer.v1.MetadataOptions.Symlink\x12=\n\x04mode\x18\x02 \x01(\x0e\x32/.google.storagetransfer.v1.MetadataOptions.Mode\x12;\n\x03gid\x18\x03 \x01(\x0e\x32..google.storagetransfer.v1.MetadataOptions.GID\x12;\n\x03uid\x18\x04 \x01(\x0e\x32..google.storagetransfer.v1.MetadataOptions.UID\x12;\n\x03\x61\x63l\x18\x05 \x01(\x0e\x32..google.storagetransfer.v1.MetadataOptions.Acl\x12N\n\rstorage_class\x18\x06 \x01(\x0e\x32\x37.google.storagetransfer.v1.MetadataOptions.StorageClass\x12P\n\x0etemporary_hold\x18\x07 \x01(\x0e\x32\x38.google.storagetransfer.v1.MetadataOptions.TemporaryHold\x12\x42\n\x07kms_key\x18\x08 \x01(\x0e\x32\x31.google.storagetransfer.v1.MetadataOptions.KmsKey\x12L\n\x0ctime_created\x18\t \x01(\x0e\x32\x36.google.storagetransfer.v1.MetadataOptions.TimeCreated\"J\n\x07Symlink\x12\x17\n\x13SYMLINK_UNSPECIFIED\x10\x00\x12\x10\n\x0cSYMLINK_SKIP\x10\x01\x12\x14\n\x10SYMLINK_PRESERVE\x10\x02\">\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\r\n\tMODE_SKIP\x10\x01\x12\x11\n\rMODE_PRESERVE\x10\x02\"8\n\x03GID\x12\x13\n\x0fGID_UNSPECIFIED\x10\x00\x12\x0c\n\x08GID_SKIP\x10\x01\x12\x0e\n\nGID_NUMBER\x10\x02\"8\n\x03UID\x12\x13\n\x0fUID_UNSPECIFIED\x10\x00\x12\x0c\n\x08UID_SKIP\x10\x01\x12\x0e\n\nUID_NUMBER\x10\x02\"P\n\x03\x41\x63l\x12\x13\n\x0f\x41\x43L_UNSPECIFIED\x10\x00\x12\"\n\x1e\x41\x43L_DESTINATION_BUCKET_DEFAULT\x10\x01\x12\x10\n\x0c\x41\x43L_PRESERVE\x10\x02\"\xe6\x01\n\x0cStorageClass\x12\x1d\n\x19STORAGE_CLASS_UNSPECIFIED\x10\x00\x12,\n(STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT\x10\x01\x12\x1a\n\x16STORAGE_CLASS_PRESERVE\x10\x02\x12\x1a\n\x16STORAGE_CLASS_STANDARD\x10\x03\x12\x1a\n\x16STORAGE_CLASS_NEARLINE\x10\x04\x12\x1a\n\x16STORAGE_CLASS_COLDLINE\x10\x05\x12\x19\n\x15STORAGE_CLASS_ARCHIVE\x10\x06\"e\n\rTemporaryHold\x12\x1e\n\x1aTEMPORARY_HOLD_UNSPECIFIED\x10\x00\x12\x17\n\x13TEMPORARY_HOLD_SKIP\x10\x01\x12\x1b\n\x17TEMPORARY_HOLD_PRESERVE\x10\x02\"_\n\x06KmsKey\x12\x17\n\x13KMS_KEY_UNSPECIFIED\x10\x00\x12&\n\"KMS_KEY_DESTINATION_BUCKET_DEFAULT\x10\x01\x12\x14\n\x10KMS_KEY_PRESERVE\x10\x02\"l\n\x0bTimeCreated\x12\x1c\n\x18TIME_CREATED_UNSPECIFIED\x10\x00\x12\x15\n\x11TIME_CREATED_SKIP\x10\x01\x12(\n$TIME_CREATED_PRESERVE_AS_CUSTOM_TIME\x10\x02\"$\n\x10TransferManifest\x12\x10\n\x08location\x18\x01 \x01(\t\"\x85\x02\n\x08Schedule\x12\x33\n\x13schedule_start_date\x18\x01 \x01(\x0b\x32\x11.google.type.DateB\x03\xe0\x41\x02\x12,\n\x11schedule_end_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12\x31\n\x11start_time_of_day\x18\x03 \x01(\x0b\x32\x16.google.type.TimeOfDay\x12/\n\x0f\x65nd_time_of_day\x18\x04 \x01(\x0b\x32\x16.google.type.TimeOfDay\x12\x32\n\x0frepeat_interval\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\"\x9f\x01\n\x0b\x45ventStream\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12;\n\x17\x65vent_stream_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12@\n\x1c\x65vent_stream_expiration_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc4\x06\n\x0bTransferJob\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x12\n\nproject_id\x18\x03 \x01(\t\x12\x1c\n\x0fservice_account\x18\x12 \x01(\tB\x03\xe0\x41\x01\x12>\n\rtransfer_spec\x18\x04 \x01(\x0b\x32\'.google.storagetransfer.v1.TransferSpec\x12\x44\n\x10replication_spec\x18\x11 \x01(\x0b\x32*.google.storagetransfer.v1.ReplicationSpec\x12J\n\x13notification_config\x18\x0b \x01(\x0b\x32-.google.storagetransfer.v1.NotificationConfig\x12@\n\x0elogging_config\x18\x0e \x01(\x0b\x32(.google.storagetransfer.v1.LoggingConfig\x12\x35\n\x08schedule\x18\x05 \x01(\x0b\x32#.google.storagetransfer.v1.Schedule\x12<\n\x0c\x65vent_stream\x18\x0f \x01(\x0b\x32&.google.storagetransfer.v1.EventStream\x12=\n\x06status\x18\x06 \x01(\x0e\x32-.google.storagetransfer.v1.TransferJob.Status\x12\x36\n\rcreation_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x16last_modification_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rdeletion_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1d\n\x15latest_operation_name\x18\x0c \x01(\t\"H\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x03\"8\n\rErrorLogEntry\x12\x10\n\x03url\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rerror_details\x18\x03 \x03(\t\"\x98\x01\n\x0c\x45rrorSummary\x12)\n\nerror_code\x18\x01 \x01(\x0e\x32\x10.google.rpc.CodeB\x03\xe0\x41\x02\x12\x18\n\x0b\x65rror_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02\x12\x43\n\x11\x65rror_log_entries\x18\x03 \x03(\x0b\x32(.google.storagetransfer.v1.ErrorLogEntry\"\xc3\x06\n\x10TransferCounters\x12!\n\x19objects_found_from_source\x18\x01 \x01(\x03\x12\x1f\n\x17\x62ytes_found_from_source\x18\x02 \x01(\x03\x12$\n\x1cobjects_found_only_from_sink\x18\x03 \x01(\x03\x12\"\n\x1a\x62ytes_found_only_from_sink\x18\x04 \x01(\x03\x12+\n#objects_from_source_skipped_by_sync\x18\x05 \x01(\x03\x12)\n!bytes_from_source_skipped_by_sync\x18\x06 \x01(\x03\x12\x1e\n\x16objects_copied_to_sink\x18\x07 \x01(\x03\x12\x1c\n\x14\x62ytes_copied_to_sink\x18\x08 \x01(\x03\x12#\n\x1bobjects_deleted_from_source\x18\t \x01(\x03\x12!\n\x19\x62ytes_deleted_from_source\x18\n \x01(\x03\x12!\n\x19objects_deleted_from_sink\x18\x0b \x01(\x03\x12\x1f\n\x17\x62ytes_deleted_from_sink\x18\x0c \x01(\x03\x12\"\n\x1aobjects_from_source_failed\x18\r \x01(\x03\x12 \n\x18\x62ytes_from_source_failed\x18\x0e \x01(\x03\x12*\n\"objects_failed_to_delete_from_sink\x18\x0f \x01(\x03\x12(\n bytes_failed_to_delete_from_sink\x18\x10 \x01(\x03\x12%\n\x1d\x64irectories_found_from_source\x18\x11 \x01(\x03\x12.\n&directories_failed_to_list_from_source\x18\x12 \x01(\x03\x12\x33\n+directories_successfully_listed_from_source\x18\x13 \x01(\x03\x12\'\n\x1fintermediate_objects_cleaned_up\x18\x16 \x01(\x03\x12.\n&intermediate_objects_failed_cleaned_up\x18\x17 \x01(\x03\"\xa5\x03\n\x12NotificationConfig\x12\x19\n\x0cpubsub_topic\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\x0b\x65vent_types\x18\x02 \x03(\x0e\x32\x37.google.storagetransfer.v1.NotificationConfig.EventType\x12X\n\x0epayload_format\x18\x03 \x01(\x0e\x32;.google.storagetransfer.v1.NotificationConfig.PayloadFormatB\x03\xe0\x41\x02\"\x86\x01\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aTRANSFER_OPERATION_SUCCESS\x10\x01\x12\x1d\n\x19TRANSFER_OPERATION_FAILED\x10\x02\x12\x1e\n\x1aTRANSFER_OPERATION_ABORTED\x10\x03\"C\n\rPayloadFormat\x12\x1e\n\x1aPAYLOAD_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x08\n\x04JSON\x10\x02\"\x98\x03\n\rLoggingConfig\x12L\n\x0blog_actions\x18\x01 \x03(\x0e\x32\x37.google.storagetransfer.v1.LoggingConfig.LoggableAction\x12W\n\x11log_action_states\x18\x02 \x03(\x0e\x32<.google.storagetransfer.v1.LoggingConfig.LoggableActionState\x12\'\n\x1f\x65nable_onprem_gcs_transfer_logs\x18\x03 \x01(\x08\"Q\n\x0eLoggableAction\x12\x1f\n\x1bLOGGABLE_ACTION_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46IND\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02\x12\x08\n\x04\x43OPY\x10\x03\"d\n\x13LoggableActionState\x12%\n!LOGGABLE_ACTION_STATE_UNSPECIFIED\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\x0b\n\x07SKIPPED\x10\x03\"\xc4\x05\n\x11TransferOperation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12>\n\rtransfer_spec\x18\x03 \x01(\x0b\x32\'.google.storagetransfer.v1.TransferSpec\x12J\n\x13notification_config\x18\n \x01(\x0b\x32-.google.storagetransfer.v1.NotificationConfig\x12@\n\x0elogging_config\x18\x0c \x01(\x0b\x32(.google.storagetransfer.v1.LoggingConfig\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x06status\x18\x06 \x01(\x0e\x32\x33.google.storagetransfer.v1.TransferOperation.Status\x12=\n\x08\x63ounters\x18\x07 \x01(\x0b\x32+.google.storagetransfer.v1.TransferCounters\x12\x41\n\x10\x65rror_breakdowns\x18\x08 \x03(\x0b\x32\'.google.storagetransfer.v1.ErrorSummary\x12\x19\n\x11transfer_job_name\x18\t \x01(\t\"\x7f\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0b\n\x07SUCCESS\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0b\n\x07\x41\x42ORTED\x10\x05\x12\n\n\x06QUEUED\x10\x06\x12\x0e\n\nSUSPENDING\x10\x07\x42\xec\x01\n#com.google.storagetransfer.v1.protoB\rTransferTypesZMcloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpb\xaa\x02\x1fGoogle.Cloud.StorageTransfer.V1\xca\x02\x1fGoogle\\Cloud\\StorageTransfer\\V1\xea\x02\"Google::Cloud::StorageTransfer::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module StorageTransfer + module V1 + GoogleServiceAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GoogleServiceAccount").msgclass + AwsAccessKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AwsAccessKey").msgclass + AzureCredentials = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AzureCredentials").msgclass + ObjectConditions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ObjectConditions").msgclass + GcsData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GcsData").msgclass + AwsS3Data = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AwsS3Data").msgclass + AzureBlobStorageData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AzureBlobStorageData").msgclass + AzureBlobStorageData::FederatedIdentityConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AzureBlobStorageData.FederatedIdentityConfig").msgclass + HttpData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.HttpData").msgclass + PosixFilesystem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.PosixFilesystem").msgclass + HdfsData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.HdfsData").msgclass + AwsS3CompatibleData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AwsS3CompatibleData").msgclass + S3CompatibleMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata").msgclass + S3CompatibleMetadata::AuthMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod").enummodule + S3CompatibleMetadata::RequestModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata.RequestModel").enummodule + S3CompatibleMetadata::NetworkProtocol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol").enummodule + S3CompatibleMetadata::ListApi = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata.ListApi").enummodule + AgentPool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AgentPool").msgclass + AgentPool::BandwidthLimit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AgentPool.BandwidthLimit").msgclass + AgentPool::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AgentPool.State").enummodule + TransferOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferOptions").msgclass + TransferOptions::OverwriteWhen = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferOptions.OverwriteWhen").enummodule + TransferSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferSpec").msgclass + ReplicationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ReplicationSpec").msgclass + MetadataOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions").msgclass + MetadataOptions::Symlink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.Symlink").enummodule + MetadataOptions::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.Mode").enummodule + MetadataOptions::GID = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.GID").enummodule + MetadataOptions::UID = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.UID").enummodule + MetadataOptions::Acl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.Acl").enummodule + MetadataOptions::StorageClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.StorageClass").enummodule + MetadataOptions::TemporaryHold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.TemporaryHold").enummodule + MetadataOptions::KmsKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.KmsKey").enummodule + MetadataOptions::TimeCreated = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.TimeCreated").enummodule + TransferManifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferManifest").msgclass + Schedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.Schedule").msgclass + EventStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.EventStream").msgclass + TransferJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferJob").msgclass + TransferJob::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferJob.Status").enummodule + ErrorLogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ErrorLogEntry").msgclass + ErrorSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ErrorSummary").msgclass + TransferCounters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferCounters").msgclass + NotificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.NotificationConfig").msgclass + NotificationConfig::EventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.NotificationConfig.EventType").enummodule + NotificationConfig::PayloadFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.NotificationConfig.PayloadFormat").enummodule + LoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.LoggingConfig").msgclass + LoggingConfig::LoggableAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.LoggingConfig.LoggableAction").enummodule + LoggingConfig::LoggableActionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.LoggingConfig.LoggableActionState").enummodule + TransferOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferOperation").msgclass + TransferOperation::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferOperation.Status").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/README.md new file mode 100644 index 000000000000..59ffa00d6020 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Storage Transfer Service V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/rpc/code.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/code.rb new file mode 100644 index 000000000000..8cf36e815510 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/code.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The canonical error codes for gRPC APIs. + # + # + # Sometimes multiple error codes may apply. Services should return + # the most specific error code that applies. For example, prefer + # `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. + # Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. + module Code + # Not an error; returned on success. + # + # HTTP Mapping: 200 OK + OK = 0 + + # The operation was cancelled, typically by the caller. + # + # HTTP Mapping: 499 Client Closed Request + CANCELLED = 1 + + # Unknown error. For example, this error may be returned when + # a `Status` value received from another address space belongs to + # an error space that is not known in this address space. Also + # errors raised by APIs that do not return enough error information + # may be converted to this error. + # + # HTTP Mapping: 500 Internal Server Error + UNKNOWN = 2 + + # The client specified an invalid argument. Note that this differs + # from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + # that are problematic regardless of the state of the system + # (e.g., a malformed file name). + # + # HTTP Mapping: 400 Bad Request + INVALID_ARGUMENT = 3 + + # The deadline expired before the operation could complete. For operations + # that change the state of the system, this error may be returned + # even if the operation has completed successfully. For example, a + # successful response from a server could have been delayed long + # enough for the deadline to expire. + # + # HTTP Mapping: 504 Gateway Timeout + DEADLINE_EXCEEDED = 4 + + # Some requested entity (e.g., file or directory) was not found. + # + # Note to server developers: if a request is denied for an entire class + # of users, such as gradual feature rollout or undocumented allowlist, + # `NOT_FOUND` may be used. If a request is denied for some users within + # a class of users, such as user-based access control, `PERMISSION_DENIED` + # must be used. + # + # HTTP Mapping: 404 Not Found + NOT_FOUND = 5 + + # The entity that a client attempted to create (e.g., file or directory) + # already exists. + # + # HTTP Mapping: 409 Conflict + ALREADY_EXISTS = 6 + + # The caller does not have permission to execute the specified + # operation. `PERMISSION_DENIED` must not be used for rejections + # caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + # instead for those errors). `PERMISSION_DENIED` must not be + # used if the caller can not be identified (use `UNAUTHENTICATED` + # instead for those errors). This error code does not imply the + # request is valid or the requested entity exists or satisfies + # other pre-conditions. + # + # HTTP Mapping: 403 Forbidden + PERMISSION_DENIED = 7 + + # The request does not have valid authentication credentials for the + # operation. + # + # HTTP Mapping: 401 Unauthorized + UNAUTHENTICATED = 16 + + # Some resource has been exhausted, perhaps a per-user quota, or + # perhaps the entire file system is out of space. + # + # HTTP Mapping: 429 Too Many Requests + RESOURCE_EXHAUSTED = 8 + + # The operation was rejected because the system is not in a state + # required for the operation's execution. For example, the directory + # to be deleted is non-empty, an rmdir operation is applied to + # a non-directory, etc. + # + # Service implementors can use the following guidelines to decide + # between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + # (a) Use `UNAVAILABLE` if the client can retry just the failing call. + # (b) Use `ABORTED` if the client should retry at a higher level. For + # example, when a client-specified test-and-set fails, indicating the + # client should restart a read-modify-write sequence. + # (c) Use `FAILED_PRECONDITION` if the client should not retry until + # the system state has been explicitly fixed. For example, if an "rmdir" + # fails because the directory is non-empty, `FAILED_PRECONDITION` + # should be returned since the client should not retry unless + # the files are deleted from the directory. + # + # HTTP Mapping: 400 Bad Request + FAILED_PRECONDITION = 9 + + # The operation was aborted, typically due to a concurrency issue such as + # a sequencer check failure or transaction abort. + # + # See the guidelines above for deciding between `FAILED_PRECONDITION`, + # `ABORTED`, and `UNAVAILABLE`. + # + # HTTP Mapping: 409 Conflict + ABORTED = 10 + + # The operation was attempted past the valid range. E.g., seeking or + # reading past end-of-file. + # + # Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + # be fixed if the system state changes. For example, a 32-bit file + # system will generate `INVALID_ARGUMENT` if asked to read at an + # offset that is not in the range [0,2^32-1], but it will generate + # `OUT_OF_RANGE` if asked to read from an offset past the current + # file size. + # + # There is a fair bit of overlap between `FAILED_PRECONDITION` and + # `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + # error) when it applies so that callers who are iterating through + # a space can easily look for an `OUT_OF_RANGE` error to detect when + # they are done. + # + # HTTP Mapping: 400 Bad Request + OUT_OF_RANGE = 11 + + # The operation is not implemented or is not supported/enabled in this + # service. + # + # HTTP Mapping: 501 Not Implemented + UNIMPLEMENTED = 12 + + # Internal errors. This means that some invariants expected by the + # underlying system have been broken. This error code is reserved + # for serious errors. + # + # HTTP Mapping: 500 Internal Server Error + INTERNAL = 13 + + # The service is currently unavailable. This is most likely a + # transient condition, which can be corrected by retrying with + # a backoff. Note that it is not always safe to retry + # non-idempotent operations. + # + # See the guidelines above for deciding between `FAILED_PRECONDITION`, + # `ABORTED`, and `UNAVAILABLE`. + # + # HTTP Mapping: 503 Service Unavailable + UNAVAILABLE = 14 + + # Unrecoverable data loss or corruption. + # + # HTTP Mapping: 500 Internal Server Error + DATA_LOSS = 15 + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..3c630675d70b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer.rb new file mode 100644 index 000000000000..5cd832360c85 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer.rb @@ -0,0 +1,307 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module StorageTransfer + module V1 + # Request passed to GetGoogleServiceAccount. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud project that the Google service + # account is associated with. + class GetGoogleServiceAccountRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request passed to CreateTransferJob. + # @!attribute [rw] transfer_job + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # Required. The job to create. + class CreateTransferJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request passed to UpdateTransferJob. + # @!attribute [rw] job_name + # @return [::String] + # Required. The name of job to update. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud project that owns the + # job. + # @!attribute [rw] transfer_job + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] + # Required. The job to update. `transferJob` is expected to specify one or + # more of five fields: + # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and + # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. An + # `UpdateTransferJobRequest` that specifies other fields are rejected with + # the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. Updating a + # job status to + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} requires + # `storagetransfer.jobs.delete` permission. + # @!attribute [rw] update_transfer_job_field_mask + # @return [::Google::Protobuf::FieldMask] + # The field mask of the fields in `transferJob` that are to be updated in + # this request. Fields in `transferJob` that can be updated are: + # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, + # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and + # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. To update the + # `transfer_spec` of the job, a complete transfer specification must be + # provided. An incomplete specification missing any required fields is + # rejected with the error + # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. + class UpdateTransferJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request passed to GetTransferJob. + # @!attribute [rw] job_name + # @return [::String] + # Required. The job to get. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud project that owns the + # job. + class GetTransferJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request passed to DeleteTransferJob. + # @!attribute [rw] job_name + # @return [::String] + # Required. The job to delete. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud project that owns the + # job. + class DeleteTransferJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `projectId`, `jobNames`, and `jobStatuses` are query parameters that can + # be specified when listing transfer jobs. + # @!attribute [rw] filter + # @return [::String] + # Required. A list of query parameters specified as JSON text in the form of: + # + # ``` + # { + # "projectId":"my_project_id", + # "jobNames":["jobid1","jobid2",...], + # "jobStatuses":["status1","status2",...], + # "dataBackend":"QUERY_REPLICATION_CONFIGS", + # "sourceBucket":"source-bucket-name", + # "sinkBucket":"sink-bucket-name", + # } + # ``` + # + # The JSON formatting in the example is for display only; provide the + # query parameters without spaces or line breaks. + # + # * `projectId` is required. + # * Since `jobNames` and `jobStatuses` support multiple values, their values + # must be specified with array notation. `jobNames` and `jobStatuses` are + # optional. Valid values are case-insensitive: + # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED} + # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED} + # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} + # * Specify `"dataBackend":"QUERY_REPLICATION_CONFIGS"` to return a list of + # cross-bucket replication jobs. + # * Limit the results to jobs from a particular bucket with `sourceBucket` + # and/or to a particular bucket with `sinkBucket`. + # @!attribute [rw] page_size + # @return [::Integer] + # The list page size. The max allowed value is 256. + # @!attribute [rw] page_token + # @return [::String] + # The list page token. + class ListTransferJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response from ListTransferJobs. + # @!attribute [rw] transfer_jobs + # @return [::Array<::Google::Cloud::StorageTransfer::V1::TransferJob>] + # A list of transfer jobs. + # @!attribute [rw] next_page_token + # @return [::String] + # The list next page token. + class ListTransferJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request passed to PauseTransferOperation. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the transfer operation. + class PauseTransferOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request passed to ResumeTransferOperation. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the transfer operation. + class ResumeTransferOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request passed to RunTransferJob. + # @!attribute [rw] job_name + # @return [::String] + # Required. The name of the transfer job. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud project that owns the transfer + # job. + class RunTransferJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the request passed to CreateAgentPool. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud project that owns the + # agent pool. + # @!attribute [rw] agent_pool + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # Required. The agent pool to create. + # @!attribute [rw] agent_pool_id + # @return [::String] + # Required. The ID of the agent pool to create. + # + # The `agent_pool_id` must meet the following requirements: + # + # * Length of 128 characters or less. + # * Not start with the string `goog`. + # * Start with a lowercase ASCII character, followed by: + # * Zero or more: lowercase Latin alphabet characters, numerals, + # hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + # * One or more numerals or lowercase ASCII characters. + # + # As expressed by the regular expression: + # `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. + class CreateAgentPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the request passed to UpdateAgentPool. + # @!attribute [rw] agent_pool + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] + # Required. The agent pool to update. `agent_pool` is expected to specify + # following fields: + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#name name} + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} + # An `UpdateAgentPoolRequest` with any other fields is rejected + # with the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The [field mask] + # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + # of the fields in `agentPool` to update in this request. + # The following `agentPool` fields can be updated: + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} + # + # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} + class UpdateAgentPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the request passed to GetAgentPool. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the agent pool to get. + class GetAgentPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the request passed to DeleteAgentPool. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the agent pool to delete. + class DeleteAgentPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request passed to ListAgentPools. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud project that owns the job. + # @!attribute [rw] filter + # @return [::String] + # An optional list of query parameters specified as JSON text in the + # form of: + # + # `{"agentPoolNames":["agentpool1","agentpool2",...]}` + # + # Since `agentPoolNames` support multiple values, its values must be + # specified with array notation. When the filter is either empty or not + # provided, the list returns all agent pools for the project. + # @!attribute [rw] page_size + # @return [::Integer] + # The list page size. The max allowed value is `256`. + # @!attribute [rw] page_token + # @return [::String] + # The list page token. + class ListAgentPoolsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response from ListAgentPools. + # @!attribute [rw] agent_pools + # @return [::Array<::Google::Cloud::StorageTransfer::V1::AgentPool>] + # A list of agent pools. + # @!attribute [rw] next_page_token + # @return [::String] + # The list next page token. + class ListAgentPoolsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer_types.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer_types.rb new file mode 100644 index 000000000000..de6dd48638d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer_types.rb @@ -0,0 +1,1534 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module StorageTransfer + module V1 + # Google service account + # @!attribute [rw] account_email + # @return [::String] + # Email address of the service account. + # @!attribute [rw] subject_id + # @return [::String] + # Unique identifier for the service account. + class GoogleServiceAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AWS access key (see + # [AWS Security + # Credentials](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). + # + # For information on our data retention policy for user credentials, see + # [User credentials](/storage-transfer/docs/data-retention#user-credentials). + # @!attribute [rw] access_key_id + # @return [::String] + # Required. AWS access key ID. + # @!attribute [rw] secret_access_key + # @return [::String] + # Required. AWS secret access key. This field is not returned in RPC + # responses. + class AwsAccessKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Azure credentials + # + # For information on our data retention policy for user credentials, see + # [User credentials](/storage-transfer/docs/data-retention#user-credentials). + # @!attribute [rw] sas_token + # @return [::String] + # Required. Azure shared access signature (SAS). + # + # For more information about SAS, see + # [Grant limited access to Azure Storage resources using shared access + # signatures + # (SAS)](https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview). + class AzureCredentials + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Conditions that determine which objects are transferred. Applies only + # to Cloud Data Sources such as S3, Azure, and Cloud Storage. + # + # The "last modification time" refers to the time of the + # last change to the object's content or metadata — specifically, this is + # the `updated` property of Cloud Storage objects, the `LastModified` field + # of S3 objects, and the `Last-Modified` header of Azure blobs. + # + # For S3 objects, the `LastModified` value is the time the object begins + # uploading. If the object meets your "last modification time" criteria, + # but has not finished uploading, the object is not transferred. See + # [Transfer from Amazon S3 to Cloud + # Storage](https://cloud.google.com/storage-transfer/docs/create-transfers/agentless/s3#transfer_options) + # for more information. + # + # Transfers with a {::Google::Cloud::StorageTransfer::V1::PosixFilesystem PosixFilesystem} + # source or destination don't support `ObjectConditions`. + # @!attribute [rw] min_time_elapsed_since_last_modification + # @return [::Google::Protobuf::Duration] + # Ensures that objects are not transferred until a specific minimum time + # has elapsed after the "last modification time". When a + # {::Google::Cloud::StorageTransfer::V1::TransferOperation TransferOperation} begins, + # objects with a "last modification time" are transferred only if the elapsed + # time between the + # {::Google::Cloud::StorageTransfer::V1::TransferOperation#start_time start_time} of the + # `TransferOperation` and the "last modification time" of the object is equal + # to or greater than the value of min_time_elapsed_since_last_modification`. + # Objects that do not have a "last modification time" are also transferred. + # @!attribute [rw] max_time_elapsed_since_last_modification + # @return [::Google::Protobuf::Duration] + # Ensures that objects are not transferred if a specific maximum time + # has elapsed since the "last modification time". + # When a {::Google::Cloud::StorageTransfer::V1::TransferOperation TransferOperation} + # begins, objects with a "last modification time" are transferred only if the + # elapsed time between the + # {::Google::Cloud::StorageTransfer::V1::TransferOperation#start_time start_time} of the + # `TransferOperation`and the "last modification time" of the object + # is less than the value of max_time_elapsed_since_last_modification`. + # Objects that do not have a "last modification time" are also transferred. + # @!attribute [rw] include_prefixes + # @return [::Array<::String>] + # If you specify `include_prefixes`, Storage Transfer Service uses the items + # in the `include_prefixes` array to determine which objects to include in a + # transfer. Objects must start with one of the matching `include_prefixes` + # for inclusion in the transfer. If + # {::Google::Cloud::StorageTransfer::V1::ObjectConditions#exclude_prefixes exclude_prefixes} + # is specified, objects must not start with any of the `exclude_prefixes` + # specified for inclusion in the transfer. + # + # The following are requirements of `include_prefixes`: + # + # * Each include-prefix can contain any sequence of Unicode characters, to + # a max length of 1024 bytes when UTF8-encoded, and must not contain + # Carriage Return or Line Feed characters. Wildcard matching and regular + # expression matching are not supported. + # + # * Each include-prefix must omit the leading slash. For example, to + # include the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, + # specify the include-prefix as `logs/y=2015/requests.gz`. + # + # * None of the include-prefix values can be empty, if specified. + # + # * Each include-prefix must include a distinct portion of the object + # namespace. No include-prefix may be a prefix of another + # include-prefix. + # + # The max size of `include_prefixes` is 1000. + # + # For more information, see [Filtering objects from + # transfers](/storage-transfer/docs/filtering-objects-from-transfers). + # @!attribute [rw] exclude_prefixes + # @return [::Array<::String>] + # If you specify `exclude_prefixes`, Storage Transfer Service uses the items + # in the `exclude_prefixes` array to determine which objects to exclude from + # a transfer. Objects must not start with one of the matching + # `exclude_prefixes` for inclusion in a transfer. + # + # The following are requirements of `exclude_prefixes`: + # + # * Each exclude-prefix can contain any sequence of Unicode characters, to + # a max length of 1024 bytes when UTF8-encoded, and must not contain + # Carriage Return or Line Feed characters. Wildcard matching and regular + # expression matching are not supported. + # + # * Each exclude-prefix must omit the leading slash. For example, to + # exclude the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, + # specify the exclude-prefix as `logs/y=2015/requests.gz`. + # + # * None of the exclude-prefix values can be empty, if specified. + # + # * Each exclude-prefix must exclude a distinct portion of the object + # namespace. No exclude-prefix may be a prefix of another + # exclude-prefix. + # + # * If + # {::Google::Cloud::StorageTransfer::V1::ObjectConditions#include_prefixes include_prefixes} + # is specified, then each exclude-prefix must start with the value of a + # path explicitly included by `include_prefixes`. + # + # The max size of `exclude_prefixes` is 1000. + # + # For more information, see [Filtering objects from + # transfers](/storage-transfer/docs/filtering-objects-from-transfers). + # @!attribute [rw] last_modified_since + # @return [::Google::Protobuf::Timestamp] + # If specified, only objects with a "last modification time" on or after + # this timestamp and objects that don't have a "last modification time" are + # transferred. + # + # The `last_modified_since` and `last_modified_before` fields can be used + # together for chunked data processing. For example, consider a script that + # processes each day's worth of data at a time. For that you'd set each + # of the fields as follows: + # + # * `last_modified_since` to the start of the day + # + # * `last_modified_before` to the end of the day + # @!attribute [rw] last_modified_before + # @return [::Google::Protobuf::Timestamp] + # If specified, only objects with a "last modification time" before this + # timestamp and objects that don't have a "last modification time" are + # transferred. + class ObjectConditions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # In a GcsData resource, an object's name is the Cloud Storage object's + # name and its "last modification time" refers to the object's `updated` + # property of Cloud Storage objects, which changes when the content or the + # metadata of the object is updated. + # @!attribute [rw] bucket_name + # @return [::String] + # Required. Cloud Storage bucket name. Must meet + # [Bucket Name Requirements](/storage/docs/naming#requirements). + # @!attribute [rw] path + # @return [::String] + # Root path to transfer objects. + # + # Must be an empty string or full path name that ends with a '/'. This field + # is treated as an object prefix. As such, it should generally not begin with + # a '/'. + # + # The root path value must meet + # [Object Name Requirements](/storage/docs/naming#objectnames). + # @!attribute [rw] managed_folder_transfer_enabled + # @return [::Boolean] + # Preview. Enables the transfer of managed folders between Cloud Storage + # buckets. Set this option on the gcs_data_source. + # + # If set to true: + # + # - Managed folders in the source bucket are transferred to the + # destination bucket. + # - Managed folders in the destination bucket are overwritten. Other + # OVERWRITE options are not supported. + # + # See + # [Transfer Cloud Storage managed + # folders](/storage-transfer/docs/managed-folders). + class GcsData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An AwsS3Data resource can be a data source, but not a data sink. + # In an AwsS3Data resource, an object's name is the S3 object's key name. + # @!attribute [rw] bucket_name + # @return [::String] + # Required. S3 Bucket name (see + # [Creating a + # bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). + # @!attribute [rw] aws_access_key + # @return [::Google::Cloud::StorageTransfer::V1::AwsAccessKey] + # Input only. AWS access key used to sign the API requests to the AWS S3 + # bucket. Permissions on the bucket must be granted to the access ID of the + # AWS access key. + # + # For information on our data retention policy for user credentials, see + # [User credentials](/storage-transfer/docs/data-retention#user-credentials). + # @!attribute [rw] path + # @return [::String] + # Root path to transfer objects. + # + # Must be an empty string or full path name that ends with a '/'. This field + # is treated as an object prefix. As such, it should generally not begin with + # a '/'. + # @!attribute [rw] role_arn + # @return [::String] + # The Amazon Resource Name (ARN) of the role to support temporary + # credentials via `AssumeRoleWithWebIdentity`. For more information about + # ARNs, see [IAM + # ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns). + # + # When a role ARN is provided, Transfer Service fetches temporary + # credentials for the session using a `AssumeRoleWithWebIdentity` call for + # the provided role using the + # {::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount GoogleServiceAccount} for + # this project. + # @!attribute [rw] cloudfront_domain + # @return [::String] + # Optional. The CloudFront distribution domain name pointing to this bucket, + # to use when fetching. + # + # See + # [Transfer from S3 via + # CloudFront](https://cloud.google.com/storage-transfer/docs/s3-cloudfront) + # for more information. + # + # Format: `https://{id}.cloudfront.net` or any valid custom domain. Must + # begin with `https://`. + # @!attribute [rw] credentials_secret + # @return [::String] + # Optional. The Resource name of a secret in Secret Manager. + # + # AWS credentials must be stored in Secret Manager in JSON format: + # + # { + # "access_key_id": "ACCESS_KEY_ID", + # "secret_access_key": "SECRET_ACCESS_KEY" + # } + # + # {::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount GoogleServiceAccount} must + # be granted `roles/secretmanager.secretAccessor` for the resource. + # + # See [Configure access to a source: Amazon S3] + # (https://cloud.google.com/storage-transfer/docs/source-amazon-s3#secret_manager) + # for more information. + # + # If `credentials_secret` is specified, do not specify + # {::Google::Cloud::StorageTransfer::V1::AwsS3Data#role_arn role_arn} or + # {::Google::Cloud::StorageTransfer::V1::AwsS3Data#aws_access_key aws_access_key}. + # + # Format: `projects/{project_number}/secrets/{secret_name}` + # @!attribute [rw] managed_private_network + # @return [::Boolean] + # Egress bytes over a Google-managed private network. + # This network is shared between other users of Storage Transfer Service. + class AwsS3Data + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An AzureBlobStorageData resource can be a data source, but not a data sink. + # An AzureBlobStorageData resource represents one Azure container. The storage + # account determines the [Azure + # endpoint](https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account#storage-account-endpoints). + # In an AzureBlobStorageData resource, a blobs's name is the [Azure Blob + # Storage blob's key + # name](https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#blob-names). + # @!attribute [rw] storage_account + # @return [::String] + # Required. The name of the Azure Storage account. + # @!attribute [rw] azure_credentials + # @return [::Google::Cloud::StorageTransfer::V1::AzureCredentials] + # Required. Input only. Credentials used to authenticate API requests to + # Azure. + # + # For information on our data retention policy for user credentials, see + # [User credentials](/storage-transfer/docs/data-retention#user-credentials). + # @!attribute [rw] container + # @return [::String] + # Required. The container to transfer from the Azure Storage account. + # @!attribute [rw] path + # @return [::String] + # Root path to transfer objects. + # + # Must be an empty string or full path name that ends with a '/'. This field + # is treated as an object prefix. As such, it should generally not begin with + # a '/'. + # @!attribute [rw] credentials_secret + # @return [::String] + # Optional. The Resource name of a secret in Secret Manager. + # + # The Azure SAS token must be stored in Secret Manager in JSON format: + # + # { + # "sas_token" : "SAS_TOKEN" + # } + # + # {::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount GoogleServiceAccount} must + # be granted `roles/secretmanager.secretAccessor` for the resource. + # + # See [Configure access to a source: Microsoft Azure Blob Storage] + # (https://cloud.google.com/storage-transfer/docs/source-microsoft-azure#secret_manager) + # for more information. + # + # If `credentials_secret` is specified, do not specify + # {::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData#azure_credentials azure_credentials}. + # + # Format: `projects/{project_number}/secrets/{secret_name}` + # @!attribute [rw] federated_identity_config + # @return [::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData::FederatedIdentityConfig] + # Optional. Federated identity config of a user registered Azure application. + # + # If `federated_identity_config` is specified, do not specify + # {::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData#azure_credentials azure_credentials} + # or + # {::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData#credentials_secret credentials_secret}. + class AzureBlobStorageData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The identity of an Azure application through which Storage Transfer Service + # can authenticate requests using Azure workload identity federation. + # + # Storage Transfer Service can issue requests to Azure Storage through + # registered Azure applications, eliminating the need to pass credentials to + # Storage Transfer Service directly. + # + # To configure federated identity, see + # [Configure access to Microsoft Azure + # Storage](https://cloud.google.com/storage-transfer/docs/source-microsoft-azure#option_3_authenticate_using_federated_identity). + # @!attribute [rw] client_id + # @return [::String] + # Required. The client (application) ID of the application with federated + # credentials. + # @!attribute [rw] tenant_id + # @return [::String] + # Required. The tenant (directory) ID of the application with federated + # credentials. + class FederatedIdentityConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # An HttpData resource specifies a list of objects on the web to be + # transferred over HTTP. The information of the objects to be transferred is + # contained in a file referenced by a URL. The first line in the file must be + # `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent + # lines specify the information of the list of objects, one object per list + # entry. Each entry has the following tab-delimited fields: + # + # * **HTTP URL** — The location of the object. + # + # * **Length** — The size of the object in bytes. + # + # * **MD5** — The base64-encoded MD5 hash of the object. + # + # For an example of a valid TSV file, see + # [Transferring data from + # URLs](https://cloud.google.com/storage-transfer/docs/create-url-list). + # + # When transferring data based on a URL list, keep the following in mind: + # + # * When an object located at `http(s)://hostname:port/` is + # transferred to a data sink, the name of the object at the data sink is + # `/`. + # + # * If the specified size of an object does not match the actual size of the + # object fetched, the object is not transferred. + # + # * If the specified MD5 does not match the MD5 computed from the transferred + # bytes, the object transfer fails. + # + # * Ensure that each URL you specify is publicly accessible. For + # example, in Cloud Storage you can + # [share an object publicly] + # (/storage/docs/cloud-console#_sharingdata) and get a link to it. + # + # * Storage Transfer Service obeys `robots.txt` rules and requires the source + # HTTP server to support `Range` requests and to return a `Content-Length` + # header in each response. + # + # * {::Google::Cloud::StorageTransfer::V1::ObjectConditions ObjectConditions} have no + # effect when filtering objects to transfer. + # @!attribute [rw] list_url + # @return [::String] + # Required. The URL that points to the file that stores the object list + # entries. This file must allow public access. The URL is either an + # HTTP/HTTPS address (e.g. `https://example.com/urllist.tsv`) or a Cloud + # Storage path (e.g. `gs://my-bucket/urllist.tsv`). + class HttpData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A POSIX filesystem resource. + # @!attribute [rw] root_directory + # @return [::String] + # Root directory path to the filesystem. + class PosixFilesystem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An HdfsData resource specifies a path within an HDFS entity (e.g. a cluster). + # All cluster-specific settings, such as namenodes and ports, are configured on + # the transfer agents servicing requests, so HdfsData only contains the root + # path to the data in our transfer. + # @!attribute [rw] path + # @return [::String] + # Root path to transfer files. + class HdfsData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An AwsS3CompatibleData resource. + # @!attribute [rw] bucket_name + # @return [::String] + # Required. Specifies the name of the bucket. + # @!attribute [rw] path + # @return [::String] + # Specifies the root path to transfer objects. + # + # Must be an empty string or full path name that ends with a '/'. This + # field is treated as an object prefix. As such, it should generally not + # begin with a '/'. + # @!attribute [rw] endpoint + # @return [::String] + # Required. Specifies the endpoint of the storage service. + # @!attribute [rw] region + # @return [::String] + # Specifies the region to sign requests with. This can be left blank if + # requests should be signed with an empty region. + # @!attribute [rw] s3_metadata + # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata] + # A S3 compatible metadata. + class AwsS3CompatibleData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # S3CompatibleMetadata contains the metadata fields that apply to the basic + # types of S3-compatible data providers. + # @!attribute [rw] auth_method + # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata::AuthMethod] + # Specifies the authentication and authorization method used by the storage + # service. When not specified, Transfer Service will attempt to determine + # right auth method to use. + # @!attribute [rw] request_model + # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata::RequestModel] + # Specifies the API request model used to call the storage service. When not + # specified, the default value of RequestModel + # REQUEST_MODEL_VIRTUAL_HOSTED_STYLE is used. + # @!attribute [rw] protocol + # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata::NetworkProtocol] + # Specifies the network protocol of the agent. When not specified, the + # default value of NetworkProtocol NETWORK_PROTOCOL_HTTPS is used. + # @!attribute [rw] list_api + # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata::ListApi] + # The Listing API to use for discovering objects. When not specified, + # Transfer Service will attempt to determine the right API to use. + class S3CompatibleMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The authentication and authorization method used by the storage service. + module AuthMethod + # AuthMethod is not specified. + AUTH_METHOD_UNSPECIFIED = 0 + + # Auth requests with AWS SigV4. + AUTH_METHOD_AWS_SIGNATURE_V4 = 1 + + # Auth requests with AWS SigV2. + AUTH_METHOD_AWS_SIGNATURE_V2 = 2 + end + + # The request model of the API. + module RequestModel + # RequestModel is not specified. + REQUEST_MODEL_UNSPECIFIED = 0 + + # Perform requests using Virtual Hosted Style. + # Example: https://bucket-name.s3.region.amazonaws.com/key-name + REQUEST_MODEL_VIRTUAL_HOSTED_STYLE = 1 + + # Perform requests using Path Style. + # Example: https://s3.region.amazonaws.com/bucket-name/key-name + REQUEST_MODEL_PATH_STYLE = 2 + end + + # The agent network protocol to access the storage service. + module NetworkProtocol + # NetworkProtocol is not specified. + NETWORK_PROTOCOL_UNSPECIFIED = 0 + + # Perform requests using HTTPS. + NETWORK_PROTOCOL_HTTPS = 1 + + # Not recommended: This sends data in clear-text. This is only + # appropriate within a closed network or for publicly available data. + # Perform requests using HTTP. + NETWORK_PROTOCOL_HTTP = 2 + end + + # The Listing API to use for discovering objects. + module ListApi + # ListApi is not specified. + LIST_API_UNSPECIFIED = 0 + + # Perform listing using ListObjectsV2 API. + LIST_OBJECTS_V2 = 1 + + # Legacy ListObjects API. + LIST_OBJECTS = 2 + end + end + + # Represents an agent pool. + # @!attribute [rw] name + # @return [::String] + # Required. Specifies a unique string that identifies the agent pool. + # + # Format: `projects/{project_id}/agentPools/{agent_pool_id}` + # @!attribute [rw] display_name + # @return [::String] + # Specifies the client-specified AgentPool description. + # @!attribute [r] state + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool::State] + # Output only. Specifies the state of the AgentPool. + # @!attribute [rw] bandwidth_limit + # @return [::Google::Cloud::StorageTransfer::V1::AgentPool::BandwidthLimit] + # Specifies the bandwidth limit details. If this field is unspecified, the + # default value is set as 'No Limit'. + class AgentPool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies a bandwidth limit for an agent pool. + # @!attribute [rw] limit_mbps + # @return [::Integer] + # Bandwidth rate in megabytes per second, distributed across all the agents + # in the pool. + class BandwidthLimit + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of an AgentPool. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # This is an initialization state. During this stage, resources are + # allocated for the AgentPool. + CREATING = 1 + + # Determines that the AgentPool is created for use. At this state, Agents + # can join the AgentPool and participate in the transfer jobs in that pool. + CREATED = 2 + + # Determines that the AgentPool deletion has been initiated, and all the + # resources are scheduled to be cleaned up and freed. + DELETING = 3 + end + end + + # TransferOptions define the actions to be performed on objects in a transfer. + # @!attribute [rw] overwrite_objects_already_existing_in_sink + # @return [::Boolean] + # When to overwrite objects that already exist in the sink. The default is + # that only objects that are different from the source are overwritten. If + # true, all objects in the sink whose name matches an object in the source + # are overwritten with the source object. + # @!attribute [rw] delete_objects_unique_in_sink + # @return [::Boolean] + # Whether objects that exist only in the sink should be deleted. + # + # **Note:** This option and + # {::Google::Cloud::StorageTransfer::V1::TransferOptions#delete_objects_from_source_after_transfer delete_objects_from_source_after_transfer} + # are mutually exclusive. + # @!attribute [rw] delete_objects_from_source_after_transfer + # @return [::Boolean] + # Whether objects should be deleted from the source after they are + # transferred to the sink. + # + # **Note:** This option and + # {::Google::Cloud::StorageTransfer::V1::TransferOptions#delete_objects_unique_in_sink delete_objects_unique_in_sink} + # are mutually exclusive. + # @!attribute [rw] overwrite_when + # @return [::Google::Cloud::StorageTransfer::V1::TransferOptions::OverwriteWhen] + # When to overwrite objects that already exist in the sink. If not set, + # overwrite behavior is determined by + # {::Google::Cloud::StorageTransfer::V1::TransferOptions#overwrite_objects_already_existing_in_sink overwrite_objects_already_existing_in_sink}. + # @!attribute [rw] metadata_options + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions] + # Represents the selected metadata options for a transfer job. + class TransferOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies when to overwrite an object in the sink when an object with + # matching name is found in the source. + module OverwriteWhen + # Overwrite behavior is unspecified. + OVERWRITE_WHEN_UNSPECIFIED = 0 + + # Overwrites destination objects with the source objects, only if the + # objects have the same name but different HTTP ETags or checksum values. + DIFFERENT = 1 + + # Never overwrites a destination object if a source object has the + # same name. In this case, the source object is not transferred. + NEVER = 2 + + # Always overwrite the destination object with the source object, even if + # the HTTP Etags or checksum values are the same. + ALWAYS = 3 + end + end + + # Configuration for running a transfer. + # @!attribute [rw] gcs_data_sink + # @return [::Google::Cloud::StorageTransfer::V1::GcsData] + # A Cloud Storage data sink. + # + # Note: The following fields are mutually exclusive: `gcs_data_sink`, `posix_data_sink`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] posix_data_sink + # @return [::Google::Cloud::StorageTransfer::V1::PosixFilesystem] + # A POSIX Filesystem data sink. + # + # Note: The following fields are mutually exclusive: `posix_data_sink`, `gcs_data_sink`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_data_source + # @return [::Google::Cloud::StorageTransfer::V1::GcsData] + # A Cloud Storage data source. + # + # Note: The following fields are mutually exclusive: `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] aws_s3_data_source + # @return [::Google::Cloud::StorageTransfer::V1::AwsS3Data] + # An AWS S3 data source. + # + # Note: The following fields are mutually exclusive: `aws_s3_data_source`, `gcs_data_source`, `http_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] http_data_source + # @return [::Google::Cloud::StorageTransfer::V1::HttpData] + # An HTTP URL data source. + # + # Note: The following fields are mutually exclusive: `http_data_source`, `gcs_data_source`, `aws_s3_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] posix_data_source + # @return [::Google::Cloud::StorageTransfer::V1::PosixFilesystem] + # A POSIX Filesystem data source. + # + # Note: The following fields are mutually exclusive: `posix_data_source`, `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] azure_blob_storage_data_source + # @return [::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData] + # An Azure Blob Storage data source. + # + # Note: The following fields are mutually exclusive: `azure_blob_storage_data_source`, `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `posix_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] aws_s3_compatible_data_source + # @return [::Google::Cloud::StorageTransfer::V1::AwsS3CompatibleData] + # An AWS S3 compatible data source. + # + # Note: The following fields are mutually exclusive: `aws_s3_compatible_data_source`, `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] hdfs_data_source + # @return [::Google::Cloud::StorageTransfer::V1::HdfsData] + # An HDFS cluster data source. + # + # Note: The following fields are mutually exclusive: `hdfs_data_source`, `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_intermediate_data_location + # @return [::Google::Cloud::StorageTransfer::V1::GcsData] + # For transfers between file systems, specifies a Cloud Storage bucket + # to be used as an intermediate location through which to transfer data. + # + # See [Transfer data between file + # systems](https://cloud.google.com/storage-transfer/docs/file-to-file) for + # more information. + # @!attribute [rw] object_conditions + # @return [::Google::Cloud::StorageTransfer::V1::ObjectConditions] + # Only objects that satisfy these object conditions are included in the set + # of data source and data sink objects. Object conditions based on + # objects' "last modification time" do not exclude objects in a data sink. + # @!attribute [rw] transfer_options + # @return [::Google::Cloud::StorageTransfer::V1::TransferOptions] + # If the option + # {::Google::Cloud::StorageTransfer::V1::TransferOptions#delete_objects_unique_in_sink delete_objects_unique_in_sink} + # is `true` and time-based object conditions such as 'last modification time' + # are specified, the request fails with an + # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} error. + # @!attribute [rw] transfer_manifest + # @return [::Google::Cloud::StorageTransfer::V1::TransferManifest] + # A manifest file provides a list of objects to be transferred from the data + # source. This field points to the location of the manifest file. + # Otherwise, the entire source bucket is used. ObjectConditions still apply. + # @!attribute [rw] source_agent_pool_name + # @return [::String] + # Specifies the agent pool name associated with the posix data source. When + # unspecified, the default name is used. + # @!attribute [rw] sink_agent_pool_name + # @return [::String] + # Specifies the agent pool name associated with the posix data sink. When + # unspecified, the default name is used. + class TransferSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the configuration for a cross-bucket replication job. Cross-bucket + # replication copies new or updated objects from a source Cloud Storage bucket + # to a destination Cloud Storage bucket. Existing objects in the source bucket + # are not copied by a new cross-bucket replication job. + # @!attribute [rw] gcs_data_source + # @return [::Google::Cloud::StorageTransfer::V1::GcsData] + # The Cloud Storage bucket from which to replicate objects. + # @!attribute [rw] gcs_data_sink + # @return [::Google::Cloud::StorageTransfer::V1::GcsData] + # The Cloud Storage bucket to which to replicate objects. + # @!attribute [rw] object_conditions + # @return [::Google::Cloud::StorageTransfer::V1::ObjectConditions] + # Object conditions that determine which objects are transferred. For + # replication jobs, only `include_prefixes` and `exclude_prefixes` are + # supported. + # @!attribute [rw] transfer_options + # @return [::Google::Cloud::StorageTransfer::V1::TransferOptions] + # Specifies the metadata options to be applied during replication. + # Delete options are not supported. If a delete option is specified, the + # request fails with an {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} + # error. + class ReplicationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the metadata options for running a transfer. + # @!attribute [rw] symlink + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::Symlink] + # Specifies how symlinks should be handled by the transfer. By default, + # symlinks are not preserved. Only applicable to transfers involving + # POSIX file systems, and ignored for other transfers. + # @!attribute [rw] mode + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::Mode] + # Specifies how each file's mode attribute should be handled by the transfer. + # By default, mode is not preserved. Only applicable to transfers involving + # POSIX file systems, and ignored for other transfers. + # @!attribute [rw] gid + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::GID] + # Specifies how each file's POSIX group ID (GID) attribute should be handled + # by the transfer. By default, GID is not preserved. Only applicable to + # transfers involving POSIX file systems, and ignored for other transfers. + # @!attribute [rw] uid + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::UID] + # Specifies how each file's POSIX user ID (UID) attribute should be handled + # by the transfer. By default, UID is not preserved. Only applicable to + # transfers involving POSIX file systems, and ignored for other transfers. + # @!attribute [rw] acl + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::Acl] + # Specifies how each object's ACLs should be preserved for transfers between + # Google Cloud Storage buckets. If unspecified, the default behavior is the + # same as ACL_DESTINATION_BUCKET_DEFAULT. + # @!attribute [rw] storage_class + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::StorageClass] + # Specifies the storage class to set on objects being transferred to Google + # Cloud Storage buckets. If unspecified, the default behavior is the same as + # {::Google::Cloud::StorageTransfer::V1::MetadataOptions::StorageClass::STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT}. + # @!attribute [rw] temporary_hold + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::TemporaryHold] + # Specifies how each object's temporary hold status should be preserved for + # transfers between Google Cloud Storage buckets. If unspecified, the + # default behavior is the same as + # {::Google::Cloud::StorageTransfer::V1::MetadataOptions::TemporaryHold::TEMPORARY_HOLD_PRESERVE TEMPORARY_HOLD_PRESERVE}. + # @!attribute [rw] kms_key + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::KmsKey] + # Specifies how each object's Cloud KMS customer-managed encryption key + # (CMEK) is preserved for transfers between Google Cloud Storage buckets. If + # unspecified, the default behavior is the same as + # {::Google::Cloud::StorageTransfer::V1::MetadataOptions::KmsKey::KMS_KEY_DESTINATION_BUCKET_DEFAULT KMS_KEY_DESTINATION_BUCKET_DEFAULT}. + # @!attribute [rw] time_created + # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::TimeCreated] + # Specifies how each object's `timeCreated` metadata is preserved for + # transfers. If unspecified, the default behavior is the same as + # {::Google::Cloud::StorageTransfer::V1::MetadataOptions::TimeCreated::TIME_CREATED_SKIP TIME_CREATED_SKIP}. + # This behavior is supported for transfers to Cloud Storage buckets from + # Cloud Storage, Amazon S3, S3-compatible storage, and Azure sources. + class MetadataOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Whether symlinks should be skipped or preserved during a transfer job. + module Symlink + # Symlink behavior is unspecified. + SYMLINK_UNSPECIFIED = 0 + + # Do not preserve symlinks during a transfer job. + SYMLINK_SKIP = 1 + + # Preserve symlinks during a transfer job. + SYMLINK_PRESERVE = 2 + end + + # Options for handling file mode attribute. + module Mode + # Mode behavior is unspecified. + MODE_UNSPECIFIED = 0 + + # Do not preserve mode during a transfer job. + MODE_SKIP = 1 + + # Preserve mode during a transfer job. + MODE_PRESERVE = 2 + end + + # Options for handling file GID attribute. + module GID + # GID behavior is unspecified. + GID_UNSPECIFIED = 0 + + # Do not preserve GID during a transfer job. + GID_SKIP = 1 + + # Preserve GID during a transfer job. + GID_NUMBER = 2 + end + + # Options for handling file UID attribute. + module UID + # UID behavior is unspecified. + UID_UNSPECIFIED = 0 + + # Do not preserve UID during a transfer job. + UID_SKIP = 1 + + # Preserve UID during a transfer job. + UID_NUMBER = 2 + end + + # Options for handling Cloud Storage object ACLs. + module Acl + # ACL behavior is unspecified. + ACL_UNSPECIFIED = 0 + + # Use the destination bucket's default object ACLS, if applicable. + ACL_DESTINATION_BUCKET_DEFAULT = 1 + + # Preserve the object's original ACLs. This requires the service account + # to have `storage.objects.getIamPolicy` permission for the source object. + # [Uniform bucket-level + # access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) + # must not be enabled on either the source or destination buckets. + ACL_PRESERVE = 2 + end + + # Options for handling Google Cloud Storage object storage class. + module StorageClass + # Storage class behavior is unspecified. + STORAGE_CLASS_UNSPECIFIED = 0 + + # Use the destination bucket's default storage class. + STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT = 1 + + # Preserve the object's original storage class. This is only supported for + # transfers from Google Cloud Storage buckets. REGIONAL and MULTI_REGIONAL + # storage classes will be mapped to STANDARD to ensure they can be written + # to the destination bucket. + STORAGE_CLASS_PRESERVE = 2 + + # Set the storage class to STANDARD. + STORAGE_CLASS_STANDARD = 3 + + # Set the storage class to NEARLINE. + STORAGE_CLASS_NEARLINE = 4 + + # Set the storage class to COLDLINE. + STORAGE_CLASS_COLDLINE = 5 + + # Set the storage class to ARCHIVE. + STORAGE_CLASS_ARCHIVE = 6 + end + + # Options for handling temporary holds for Google Cloud Storage objects. + module TemporaryHold + # Temporary hold behavior is unspecified. + TEMPORARY_HOLD_UNSPECIFIED = 0 + + # Do not set a temporary hold on the destination object. + TEMPORARY_HOLD_SKIP = 1 + + # Preserve the object's original temporary hold status. + TEMPORARY_HOLD_PRESERVE = 2 + end + + # Options for handling the KmsKey setting for Google Cloud Storage objects. + module KmsKey + # KmsKey behavior is unspecified. + KMS_KEY_UNSPECIFIED = 0 + + # Use the destination bucket's default encryption settings. + KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1 + + # Preserve the object's original Cloud KMS customer-managed encryption key + # (CMEK) if present. Objects that do not use a Cloud KMS encryption key + # will be encrypted using the destination bucket's encryption settings. + KMS_KEY_PRESERVE = 2 + end + + # Options for handling `timeCreated` metadata for Google Cloud Storage + # objects. + module TimeCreated + # TimeCreated behavior is unspecified. + TIME_CREATED_UNSPECIFIED = 0 + + # Do not preserve the `timeCreated` metadata from the source object. + TIME_CREATED_SKIP = 1 + + # Preserves the source object's `timeCreated` or `lastModified` metadata in + # the `customTime` field in the destination object. Note that any value + # stored in the source object's `customTime` field will not be propagated + # to the destination object. + TIME_CREATED_PRESERVE_AS_CUSTOM_TIME = 2 + end + end + + # Specifies where the manifest is located. + # @!attribute [rw] location + # @return [::String] + # Specifies the path to the manifest in Cloud Storage. The Google-managed + # service account for the transfer must have `storage.objects.get` + # permission for this object. An example path is + # `gs://bucket_name/path/manifest.csv`. + class TransferManifest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Transfers can be scheduled to recur or to run just once. + # @!attribute [rw] schedule_start_date + # @return [::Google::Type::Date] + # Required. The start date of a transfer. Date boundaries are determined + # relative to UTC time. If `schedule_start_date` and + # {::Google::Cloud::StorageTransfer::V1::Schedule#start_time_of_day start_time_of_day} + # are in the past relative to the job's creation time, the transfer starts + # the day after you schedule the transfer request. + # + # **Note:** When starting jobs at or near midnight UTC it is possible that + # a job starts later than expected. For example, if you send an outbound + # request on June 1 one millisecond prior to midnight UTC and the Storage + # Transfer Service server receives the request on June 2, then it creates + # a TransferJob with `schedule_start_date` set to June 2 and a + # `start_time_of_day` set to midnight UTC. The first scheduled + # {::Google::Cloud::StorageTransfer::V1::TransferOperation TransferOperation} takes + # place on June 3 at midnight UTC. + # @!attribute [rw] schedule_end_date + # @return [::Google::Type::Date] + # The last day a transfer runs. Date boundaries are determined relative to + # UTC time. A job runs once per 24 hours within the following guidelines: + # + # * If `schedule_end_date` and + # {::Google::Cloud::StorageTransfer::V1::Schedule#schedule_start_date schedule_start_date} + # are the same and in + # the future relative to UTC, the transfer is executed only one time. + # * If `schedule_end_date` is later than `schedule_start_date` and + # `schedule_end_date` is in the future relative to UTC, the job runs each + # day at + # {::Google::Cloud::StorageTransfer::V1::Schedule#start_time_of_day start_time_of_day} + # through `schedule_end_date`. + # @!attribute [rw] start_time_of_day + # @return [::Google::Type::TimeOfDay] + # The time in UTC that a transfer job is scheduled to run. Transfers may + # start later than this time. + # + # If `start_time_of_day` is not specified: + # + # * One-time transfers run immediately. + # * Recurring transfers run immediately, and each day at midnight UTC, + # through + # {::Google::Cloud::StorageTransfer::V1::Schedule#schedule_end_date schedule_end_date}. + # + # If `start_time_of_day` is specified: + # + # * One-time transfers run at the specified time. + # * Recurring transfers run at the specified time each day, through + # `schedule_end_date`. + # @!attribute [rw] end_time_of_day + # @return [::Google::Type::TimeOfDay] + # The time in UTC that no further transfer operations are scheduled. Combined + # with + # {::Google::Cloud::StorageTransfer::V1::Schedule#schedule_end_date schedule_end_date}, + # `end_time_of_day` specifies the end date and time for starting new transfer + # operations. This field must be greater than or equal to the timestamp + # corresponding to the combination of + # {::Google::Cloud::StorageTransfer::V1::Schedule#schedule_start_date schedule_start_date} + # and + # {::Google::Cloud::StorageTransfer::V1::Schedule#start_time_of_day start_time_of_day}, + # and is subject to the following: + # + # * If `end_time_of_day` is not set and `schedule_end_date` is set, then + # a default value of `23:59:59` is used for `end_time_of_day`. + # + # * If `end_time_of_day` is set and `schedule_end_date` is not set, then + # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} is returned. + # @!attribute [rw] repeat_interval + # @return [::Google::Protobuf::Duration] + # Interval between the start of each scheduled TransferOperation. If + # unspecified, the default value is 24 hours. This value may not be less than + # 1 hour. + class Schedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the Event-driven transfer options. Event-driven transfers listen to + # an event stream to transfer updated files. + # @!attribute [rw] name + # @return [::String] + # Required. Specifies a unique name of the resource such as AWS SQS + # ARN in the form 'arn:aws:sqs:region:account_id:queue_name', + # or Pub/Sub subscription resource name in the form + # 'projects/\\{project}/subscriptions/\\{sub}'. + # @!attribute [rw] event_stream_start_time + # @return [::Google::Protobuf::Timestamp] + # Specifies the date and time that Storage Transfer Service starts + # listening for events from this stream. If no start time is specified or + # start time is in the past, Storage Transfer Service starts listening + # immediately. + # @!attribute [rw] event_stream_expiration_time + # @return [::Google::Protobuf::Timestamp] + # Specifies the data and time at which Storage Transfer Service stops + # listening for events from this stream. After this time, any transfers in + # progress will complete, but no new transfers are initiated. + class EventStream + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This resource represents the configuration of a transfer job that runs + # periodically. + # @!attribute [rw] name + # @return [::String] + # A unique name (within the transfer project) assigned when the job is + # created. If this field is empty in a CreateTransferJobRequest, Storage + # Transfer Service assigns a unique name. Otherwise, the specified name + # is used as the unique name for this job. + # + # If the specified name is in use by a job, the creation request fails with + # an {::Google::Rpc::Code::ALREADY_EXISTS ALREADY_EXISTS} error. + # + # This name must start with `"transferJobs/"` prefix and end with a letter or + # a number, and should be no more than 128 characters. For transfers + # involving PosixFilesystem, this name must start with `transferJobs/OPI` + # specifically. For all other transfer types, this name must not start with + # `transferJobs/OPI`. + # + # Non-PosixFilesystem example: + # `"transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$"` + # + # PosixFilesystem example: + # `"transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$"` + # + # Applications must not rely on the enforcement of naming requirements + # involving OPI. + # + # Invalid job names fail with an + # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} error. + # @!attribute [rw] description + # @return [::String] + # A description provided by the user for the job. Its max length is 1024 + # bytes when Unicode-encoded. + # @!attribute [rw] project_id + # @return [::String] + # The ID of the Google Cloud project that owns the job. + # @!attribute [rw] service_account + # @return [::String] + # Optional. The user-managed service account to which to delegate service + # agent permissions. You can grant Cloud Storage bucket permissions to this + # service account instead of to the Transfer Service service agent. + # + # Format is + # `projects/-/serviceAccounts/ACCOUNT_EMAIL_OR_UNIQUEID` + # + # Either the service account email + # (`SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com`) or the unique + # ID (`123456789012345678901`) are accepted in the string. The `-` + # wildcard character is required; replacing it with a project ID is invalid. + # + # See + # https://cloud.google.com//storage-transfer/docs/delegate-service-agent-permissions + # for required permissions. + # @!attribute [rw] transfer_spec + # @return [::Google::Cloud::StorageTransfer::V1::TransferSpec] + # Transfer specification. + # @!attribute [rw] replication_spec + # @return [::Google::Cloud::StorageTransfer::V1::ReplicationSpec] + # Replication specification. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::StorageTransfer::V1::NotificationConfig] + # Notification configuration. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::StorageTransfer::V1::LoggingConfig] + # Logging configuration. + # @!attribute [rw] schedule + # @return [::Google::Cloud::StorageTransfer::V1::Schedule] + # Specifies schedule for the transfer job. + # This is an optional field. When the field is not set, the job never + # executes a transfer, unless you invoke RunTransferJob or update the job to + # have a non-empty schedule. + # @!attribute [rw] event_stream + # @return [::Google::Cloud::StorageTransfer::V1::EventStream] + # Specifies the event stream for the transfer job for event-driven transfers. + # When EventStream is specified, the Schedule fields are ignored. + # @!attribute [rw] status + # @return [::Google::Cloud::StorageTransfer::V1::TransferJob::Status] + # Status of the job. This value MUST be specified for + # `CreateTransferJobRequests`. + # + # **Note:** The effect of the new job status takes place during a subsequent + # job run. For example, if you change the job status from + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED} to + # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}, and an + # operation spawned by the transfer is running, the status change would not + # affect the current operation. + # @!attribute [r] creation_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the transfer job was created. + # @!attribute [r] last_modification_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the transfer job was last modified. + # @!attribute [r] deletion_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the transfer job was deleted. + # @!attribute [rw] latest_operation_name + # @return [::String] + # The name of the most recently started TransferOperation of this JobConfig. + # Present if a TransferOperation has been created for this JobConfig. + class TransferJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of the transfer job. + module Status + # Zero is an illegal value. + STATUS_UNSPECIFIED = 0 + + # New transfers are performed based on the schedule. + ENABLED = 1 + + # New transfers are not scheduled. + DISABLED = 2 + + # This is a soft delete state. After a transfer job is set to this + # state, the job and all the transfer executions are subject to + # garbage collection. Transfer jobs become eligible for garbage collection + # 30 days after their status is set to `DELETED`. + DELETED = 3 + end + end + + # An entry describing an error that has occurred. + # @!attribute [rw] url + # @return [::String] + # Required. A URL that refers to the target (a data source, a data sink, + # or an object) with which the error is associated. + # @!attribute [rw] error_details + # @return [::Array<::String>] + # A list of messages that carry the error details. + class ErrorLogEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A summary of errors by error code, plus a count and sample error log + # entries. + # @!attribute [rw] error_code + # @return [::Google::Rpc::Code] + # Required. + # @!attribute [rw] error_count + # @return [::Integer] + # Required. Count of this type of error. + # @!attribute [rw] error_log_entries + # @return [::Array<::Google::Cloud::StorageTransfer::V1::ErrorLogEntry>] + # Error samples. + # + # At most 5 error log entries are recorded for a given + # error code for a single transfer operation. + class ErrorSummary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A collection of counters that report the progress of a transfer operation. + # @!attribute [rw] objects_found_from_source + # @return [::Integer] + # Objects found in the data source that are scheduled to be transferred, + # excluding any that are filtered based on object conditions or skipped due + # to sync. + # @!attribute [rw] bytes_found_from_source + # @return [::Integer] + # Bytes found in the data source that are scheduled to be transferred, + # excluding any that are filtered based on object conditions or skipped due + # to sync. + # @!attribute [rw] objects_found_only_from_sink + # @return [::Integer] + # Objects found only in the data sink that are scheduled to be deleted. + # @!attribute [rw] bytes_found_only_from_sink + # @return [::Integer] + # Bytes found only in the data sink that are scheduled to be deleted. + # @!attribute [rw] objects_from_source_skipped_by_sync + # @return [::Integer] + # Objects in the data source that are not transferred because they already + # exist in the data sink. + # @!attribute [rw] bytes_from_source_skipped_by_sync + # @return [::Integer] + # Bytes in the data source that are not transferred because they already + # exist in the data sink. + # @!attribute [rw] objects_copied_to_sink + # @return [::Integer] + # Objects that are copied to the data sink. + # @!attribute [rw] bytes_copied_to_sink + # @return [::Integer] + # Bytes that are copied to the data sink. + # @!attribute [rw] objects_deleted_from_source + # @return [::Integer] + # Objects that are deleted from the data source. + # @!attribute [rw] bytes_deleted_from_source + # @return [::Integer] + # Bytes that are deleted from the data source. + # @!attribute [rw] objects_deleted_from_sink + # @return [::Integer] + # Objects that are deleted from the data sink. + # @!attribute [rw] bytes_deleted_from_sink + # @return [::Integer] + # Bytes that are deleted from the data sink. + # @!attribute [rw] objects_from_source_failed + # @return [::Integer] + # Objects in the data source that failed to be transferred or that failed + # to be deleted after being transferred. + # @!attribute [rw] bytes_from_source_failed + # @return [::Integer] + # Bytes in the data source that failed to be transferred or that failed to + # be deleted after being transferred. + # @!attribute [rw] objects_failed_to_delete_from_sink + # @return [::Integer] + # Objects that failed to be deleted from the data sink. + # @!attribute [rw] bytes_failed_to_delete_from_sink + # @return [::Integer] + # Bytes that failed to be deleted from the data sink. + # @!attribute [rw] directories_found_from_source + # @return [::Integer] + # For transfers involving PosixFilesystem only. + # + # Number of directories found while listing. For example, if the root + # directory of the transfer is `base/` and there are two other directories, + # `a/` and `b/` under this directory, the count after listing `base/`, + # `base/a/` and `base/b/` is 3. + # @!attribute [rw] directories_failed_to_list_from_source + # @return [::Integer] + # For transfers involving PosixFilesystem only. + # + # Number of listing failures for each directory found at the source. + # Potential failures when listing a directory include permission failure or + # block failure. If listing a directory fails, no files in the directory are + # transferred. + # @!attribute [rw] directories_successfully_listed_from_source + # @return [::Integer] + # For transfers involving PosixFilesystem only. + # + # Number of successful listings for each directory found at the source. + # @!attribute [rw] intermediate_objects_cleaned_up + # @return [::Integer] + # Number of successfully cleaned up intermediate objects. + # @!attribute [rw] intermediate_objects_failed_cleaned_up + # @return [::Integer] + # Number of intermediate objects failed cleaned up. + class TransferCounters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification to configure notifications published to Pub/Sub. + # Notifications are published to the customer-provided topic using the + # following `PubsubMessage.attributes`: + # + # * `"eventType"`: one of the + # {::Google::Cloud::StorageTransfer::V1::NotificationConfig::EventType EventType} values + # * `"payloadFormat"`: one of the + # {::Google::Cloud::StorageTransfer::V1::NotificationConfig::PayloadFormat PayloadFormat} + # values + # * `"projectId"`: the + # {::Google::Cloud::StorageTransfer::V1::TransferOperation#project_id project_id} of the + # `TransferOperation` + # * `"transferJobName"`: the + # {::Google::Cloud::StorageTransfer::V1::TransferOperation#transfer_job_name transfer_job_name} + # of the `TransferOperation` + # * `"transferOperationName"`: the + # {::Google::Cloud::StorageTransfer::V1::TransferOperation#name name} of the + # `TransferOperation` + # + # The `PubsubMessage.data` contains a + # {::Google::Cloud::StorageTransfer::V1::TransferOperation TransferOperation} resource + # formatted according to the specified `PayloadFormat`. + # @!attribute [rw] pubsub_topic + # @return [::String] + # Required. The `Topic.name` of the Pub/Sub topic to which to publish + # notifications. Must be of the format: `projects/{project}/topics/{topic}`. + # Not matching this format results in an + # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} error. + # @!attribute [rw] event_types + # @return [::Array<::Google::Cloud::StorageTransfer::V1::NotificationConfig::EventType>] + # Event types for which a notification is desired. If empty, send + # notifications for all event types. + # @!attribute [rw] payload_format + # @return [::Google::Cloud::StorageTransfer::V1::NotificationConfig::PayloadFormat] + # Required. The desired format of the notification message payloads. + class NotificationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum for specifying event types for which notifications are to be + # published. + # + # Additional event types may be added in the future. Clients should either + # safely ignore unrecognized event types or explicitly specify which event + # types they are prepared to accept. + module EventType + # Illegal value, to avoid allowing a default. + EVENT_TYPE_UNSPECIFIED = 0 + + # `TransferOperation` completed with status + # {::Google::Cloud::StorageTransfer::V1::TransferOperation::Status::SUCCESS SUCCESS}. + TRANSFER_OPERATION_SUCCESS = 1 + + # `TransferOperation` completed with status + # {::Google::Cloud::StorageTransfer::V1::TransferOperation::Status::FAILED FAILED}. + TRANSFER_OPERATION_FAILED = 2 + + # `TransferOperation` completed with status + # {::Google::Cloud::StorageTransfer::V1::TransferOperation::Status::ABORTED ABORTED}. + TRANSFER_OPERATION_ABORTED = 3 + end + + # Enum for specifying the format of a notification message's payload. + module PayloadFormat + # Illegal value, to avoid allowing a default. + PAYLOAD_FORMAT_UNSPECIFIED = 0 + + # No payload is included with the notification. + NONE = 1 + + # `TransferOperation` is [formatted as a JSON + # response](https://developers.google.com/protocol-buffers/docs/proto3#json), + # in application/json. + JSON = 2 + end + end + + # Specifies the logging behavior for transfer operations. + # + # Logs can be sent to Cloud Logging for all transfer types. See + # [Read transfer + # logs](https://cloud.google.com/storage-transfer/docs/read-transfer-logs) for + # details. + # @!attribute [rw] log_actions + # @return [::Array<::Google::Cloud::StorageTransfer::V1::LoggingConfig::LoggableAction>] + # Specifies the actions to be logged. If empty, no logs are generated. + # @!attribute [rw] log_action_states + # @return [::Array<::Google::Cloud::StorageTransfer::V1::LoggingConfig::LoggableActionState>] + # States in which `log_actions` are logged. If empty, no logs are generated. + # @!attribute [rw] enable_onprem_gcs_transfer_logs + # @return [::Boolean] + # For PosixFilesystem transfers, enables + # [file system transfer + # logs](https://cloud.google.com/storage-transfer/docs/on-prem-transfer-log-format) + # instead of, or in addition to, Cloud Logging. + # + # This option ignores [LoggableAction] and [LoggableActionState]. If these + # are set, Cloud Logging will also be enabled for this transfer. + class LoggingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Loggable actions. + module LoggableAction + # Default value. This value is unused. + LOGGABLE_ACTION_UNSPECIFIED = 0 + + # Listing objects in a bucket. + FIND = 1 + + # Deleting objects at the source or the destination. + DELETE = 2 + + # Copying objects to the destination. + COPY = 3 + end + + # Loggable action states. + module LoggableActionState + # Default value. This value is unused. + LOGGABLE_ACTION_STATE_UNSPECIFIED = 0 + + # `LoggableAction` completed successfully. `SUCCEEDED` actions are + # logged as [INFO][google.logging.type.LogSeverity.INFO]. + SUCCEEDED = 1 + + # `LoggableAction` terminated in an error state. `FAILED` actions are + # logged as [ERROR][google.logging.type.LogSeverity.ERROR]. + FAILED = 2 + + # The `COPY` action was skipped for this file. Only supported for + # agent-based transfers. `SKIPPED` actions are + # logged as [INFO][google.logging.type.LogSeverity.INFO]. + SKIPPED = 3 + end + end + + # A description of the execution of a transfer. + # @!attribute [rw] name + # @return [::String] + # A globally unique ID assigned by the system. + # @!attribute [rw] project_id + # @return [::String] + # The ID of the Google Cloud project that owns the operation. + # @!attribute [rw] transfer_spec + # @return [::Google::Cloud::StorageTransfer::V1::TransferSpec] + # Transfer specification. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::StorageTransfer::V1::NotificationConfig] + # Notification configuration. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::StorageTransfer::V1::LoggingConfig] + # Cloud Logging configuration. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start time of this transfer execution. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End time of this transfer execution. + # @!attribute [rw] status + # @return [::Google::Cloud::StorageTransfer::V1::TransferOperation::Status] + # Status of the transfer operation. + # @!attribute [rw] counters + # @return [::Google::Cloud::StorageTransfer::V1::TransferCounters] + # Information about the progress of the transfer operation. + # @!attribute [rw] error_breakdowns + # @return [::Array<::Google::Cloud::StorageTransfer::V1::ErrorSummary>] + # Summarizes errors encountered with sample error log entries. + # @!attribute [rw] transfer_job_name + # @return [::String] + # The name of the transfer job that triggers this transfer operation. + class TransferOperation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of a TransferOperation. + module Status + # Zero is an illegal value. + STATUS_UNSPECIFIED = 0 + + # In progress. + IN_PROGRESS = 1 + + # Paused. + PAUSED = 2 + + # Completed successfully. + SUCCESS = 3 + + # Terminated due to an unrecoverable failure. + FAILED = 4 + + # Aborted by the user. + ABORTED = 5 + + # Temporarily delayed by the system. No user action is required. + QUEUED = 6 + + # The operation is suspending and draining the ongoing work to completion. + SUSPENDING = 7 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/date.rb new file mode 100644 index 000000000000..14ec426522d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/date.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a whole or partial calendar date, such as a birthday. The time of + # day and time zone are either specified elsewhere or are insignificant. The + # date is relative to the Gregorian Calendar. This can represent one of the + # following: + # + # * A full date, with non-zero year, month, and day values + # * A month and day value, with a zero year, such as an anniversary + # * A year on its own, with zero month and day values + # * A year and month value, with a zero day, such as a credit card expiration + # date + # + # Related types are {::Google::Type::TimeOfDay google.type.TimeOfDay} and + # `google.protobuf.Timestamp`. + # @!attribute [rw] year + # @return [::Integer] + # Year of the date. Must be from 1 to 9999, or 0 to specify a date without + # a year. + # @!attribute [rw] month + # @return [::Integer] + # Month of a year. Must be from 1 to 12, or 0 to specify a year without a + # month and day. + # @!attribute [rw] day + # @return [::Integer] + # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + # to specify a year by itself or a year and month where the day isn't + # significant. + class Date + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..b0c888c8c14a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/Gemfile new file mode 100644 index 000000000000..4586300ebeee --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1", path: "../" +else + gem "google-cloud-storage_transfer-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-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json new file mode 100644 index 000000000000..371b234ad0e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json @@ -0,0 +1,575 @@ +{ + "client_library": { + "name": "google-cloud-storage_transfer-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.storagetransfer.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_sync", + "title": "Snippet for the get_google_service_account call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_google_service_account.", + "file": "storage_transfer_service/get_google_service_account.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_google_service_account", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_google_service_account", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "GetGoogleServiceAccount", + "full_name": "google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccount", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_sync", + "title": "Snippet for the create_transfer_job call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_transfer_job.", + "file": "storage_transfer_service/create_transfer_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_transfer_job", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_transfer_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageTransfer::V1::TransferJob", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "CreateTransferJob", + "full_name": "google.storagetransfer.v1.StorageTransferService.CreateTransferJob", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_sync", + "title": "Snippet for the update_transfer_job call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_transfer_job.", + "file": "storage_transfer_service/update_transfer_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_transfer_job", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_transfer_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageTransfer::V1::TransferJob", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "UpdateTransferJob", + "full_name": "google.storagetransfer.v1.StorageTransferService.UpdateTransferJob", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_GetTransferJob_sync", + "title": "Snippet for the get_transfer_job call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_transfer_job.", + "file": "storage_transfer_service/get_transfer_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_transfer_job", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_transfer_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageTransfer::V1::TransferJob", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "GetTransferJob", + "full_name": "google.storagetransfer.v1.StorageTransferService.GetTransferJob", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_sync", + "title": "Snippet for the list_transfer_jobs call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_transfer_jobs.", + "file": "storage_transfer_service/list_transfer_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_transfer_jobs", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_transfer_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "ListTransferJobs", + "full_name": "google.storagetransfer.v1.StorageTransferService.ListTransferJobs", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_sync", + "title": "Snippet for the pause_transfer_operation call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#pause_transfer_operation.", + "file": "storage_transfer_service/pause_transfer_operation.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_transfer_operation", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#pause_transfer_operation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "PauseTransferOperation", + "full_name": "google.storagetransfer.v1.StorageTransferService.PauseTransferOperation", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_sync", + "title": "Snippet for the resume_transfer_operation call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#resume_transfer_operation.", + "file": "storage_transfer_service/resume_transfer_operation.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_transfer_operation", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#resume_transfer_operation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "ResumeTransferOperation", + "full_name": "google.storagetransfer.v1.StorageTransferService.ResumeTransferOperation", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_RunTransferJob_sync", + "title": "Snippet for the run_transfer_job call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#run_transfer_job.", + "file": "storage_transfer_service/run_transfer_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_transfer_job", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#run_transfer_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "RunTransferJob", + "full_name": "google.storagetransfer.v1.StorageTransferService.RunTransferJob", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_sync", + "title": "Snippet for the delete_transfer_job call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_transfer_job.", + "file": "storage_transfer_service/delete_transfer_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_transfer_job", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_transfer_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "DeleteTransferJob", + "full_name": "google.storagetransfer.v1.StorageTransferService.DeleteTransferJob", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_sync", + "title": "Snippet for the create_agent_pool call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_agent_pool.", + "file": "storage_transfer_service/create_agent_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_agent_pool", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_agent_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageTransfer::V1::AgentPool", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "CreateAgentPool", + "full_name": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_sync", + "title": "Snippet for the update_agent_pool call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_agent_pool.", + "file": "storage_transfer_service/update_agent_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_agent_pool", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_agent_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageTransfer::V1::AgentPool", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "UpdateAgentPool", + "full_name": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_GetAgentPool_sync", + "title": "Snippet for the get_agent_pool call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_agent_pool.", + "file": "storage_transfer_service/get_agent_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_agent_pool", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_agent_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageTransfer::V1::AgentPool", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "GetAgentPool", + "full_name": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_ListAgentPools_sync", + "title": "Snippet for the list_agent_pools call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_agent_pools.", + "file": "storage_transfer_service/list_agent_pools.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_agent_pools", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_agent_pools", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "ListAgentPools", + "full_name": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_sync", + "title": "Snippet for the delete_agent_pool call in the StorageTransferService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_agent_pool.", + "file": "storage_transfer_service/delete_agent_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_agent_pool", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_agent_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageTransferService::Client", + "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" + }, + "method": { + "short_name": "DeleteAgentPool", + "full_name": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", + "service": { + "short_name": "StorageTransferService", + "full_name": "google.storagetransfer.v1.StorageTransferService" + } + } + }, + "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-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb new file mode 100644 index 000000000000..a718fbde6964 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the create_agent_pool call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_agent_pool. +# +def create_agent_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new + + # Call the create_agent_pool method. + result = client.create_agent_pool request + + # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb new file mode 100644 index 000000000000..be68bb1fbb6f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the create_transfer_job call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_transfer_job. +# +def create_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new + + # Call the create_transfer_job method. + result = client.create_transfer_job request + + # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb new file mode 100644 index 000000000000..511403d58f9d --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the delete_agent_pool call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_agent_pool. +# +def delete_agent_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new + + # Call the delete_agent_pool method. + result = client.delete_agent_pool request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb new file mode 100644 index 000000000000..1eb7926153c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the delete_transfer_job call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_transfer_job. +# +def delete_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new + + # Call the delete_transfer_job method. + result = client.delete_transfer_job request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb new file mode 100644 index 000000000000..cb60143fa519 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_GetAgentPool_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the get_agent_pool call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_agent_pool. +# +def get_agent_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new + + # Call the get_agent_pool method. + result = client.get_agent_pool request + + # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_GetAgentPool_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb new file mode 100644 index 000000000000..692ef121dfc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the get_google_service_account call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_google_service_account. +# +def get_google_service_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new + + # Call the get_google_service_account method. + result = client.get_google_service_account request + + # The returned object is of type Google::Cloud::StorageTransfer::V1::GoogleServiceAccount. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb new file mode 100644 index 000000000000..ef2d71f7e2e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_GetTransferJob_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the get_transfer_job call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_transfer_job. +# +def get_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new + + # Call the get_transfer_job method. + result = client.get_transfer_job request + + # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_GetTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb new file mode 100644 index 000000000000..0714d9ecbc44 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_ListAgentPools_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the list_agent_pools call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_agent_pools. +# +def list_agent_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new + + # Call the list_agent_pools method. + result = client.list_agent_pools request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::StorageTransfer::V1::AgentPool. + p item + end +end +# [END storagetransfer_v1_generated_StorageTransferService_ListAgentPools_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb new file mode 100644 index 000000000000..d6ed5c46c7dd --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the list_transfer_jobs call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_transfer_jobs. +# +def list_transfer_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new + + # Call the list_transfer_jobs method. + result = client.list_transfer_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::StorageTransfer::V1::TransferJob. + p item + end +end +# [END storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb new file mode 100644 index 000000000000..ef2b482e14c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the pause_transfer_operation call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#pause_transfer_operation. +# +def pause_transfer_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new + + # Call the pause_transfer_operation method. + result = client.pause_transfer_operation request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb new file mode 100644 index 000000000000..53c764c67766 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the resume_transfer_operation call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#resume_transfer_operation. +# +def resume_transfer_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new + + # Call the resume_transfer_operation method. + result = client.resume_transfer_operation request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb new file mode 100644 index 000000000000..7e8443bfd8b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_RunTransferJob_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the run_transfer_job call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#run_transfer_job. +# +def run_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new + + # Call the run_transfer_job method. + result = client.run_transfer_job request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END storagetransfer_v1_generated_StorageTransferService_RunTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb new file mode 100644 index 000000000000..3b33a6568070 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the update_agent_pool call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_agent_pool. +# +def update_agent_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new + + # Call the update_agent_pool method. + result = client.update_agent_pool request + + # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb new file mode 100644 index 000000000000..1cf11d53d478 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_sync] +require "google/cloud/storage_transfer/v1" + +## +# Snippet for the update_transfer_job call in the StorageTransferService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_transfer_job. +# +def update_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new + + # Call the update_transfer_job method. + result = client.update_transfer_job request + + # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + p result +end +# [END storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb new file mode 100644 index 000000000000..42e52c1a7b8b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_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/storagetransfer/v1/transfer_pb" +require "google/storagetransfer/v1/transfer_services_pb" +require "google/cloud/storage_transfer/v1/storage_transfer_service" + +class ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb new file mode 100644 index 000000000000..fbad881f657f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_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/storage_transfer/v1/storage_transfer_service" + +class ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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_agent_pools_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_pools_path project_id: "value0", agent_pool_id: "value1" + assert_equal "projects/value0/agentPools/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb new file mode 100644 index 000000000000..46ab1ebfdbd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb @@ -0,0 +1,869 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/storagetransfer/v1/transfer_pb" +require "google/cloud/storage_transfer/v1/storage_transfer_service/rest" + + +class ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_google_service_account + # Create test objects. + client_result = ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + + get_google_service_account_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_get_google_service_account_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_google_service_account_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_google_service_account({ project_id: project_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_google_service_account project_id: project_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_google_service_account ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new(project_id: project_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_google_service_account({ project_id: project_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_google_service_account(::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new(project_id: project_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_google_service_account_client_stub.call_count + end + end + end + + def test_create_transfer_job + # Create test objects. + client_result = ::Google::Cloud::StorageTransfer::V1::TransferJob.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + transfer_job = {} + + create_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_create_transfer_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_transfer_job({ transfer_job: transfer_job }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_transfer_job transfer_job: transfer_job do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_transfer_job ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new(transfer_job: transfer_job) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_transfer_job({ transfer_job: transfer_job }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_transfer_job(::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new(transfer_job: transfer_job), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_transfer_job_client_stub.call_count + end + end + end + + def test_update_transfer_job + # Create test objects. + client_result = ::Google::Cloud::StorageTransfer::V1::TransferJob.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job_name = "hello world" + project_id = "hello world" + transfer_job = {} + update_transfer_job_field_mask = {} + + update_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_update_transfer_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_transfer_job({ job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_transfer_job job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_transfer_job ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new(job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_transfer_job({ job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_transfer_job(::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new(job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_transfer_job_client_stub.call_count + end + end + end + + def test_get_transfer_job + # Create test objects. + client_result = ::Google::Cloud::StorageTransfer::V1::TransferJob.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job_name = "hello world" + project_id = "hello world" + + get_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_get_transfer_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_transfer_job({ job_name: job_name, project_id: project_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_transfer_job job_name: job_name, project_id: project_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_transfer_job ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new(job_name: job_name, project_id: project_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_transfer_job({ job_name: job_name, project_id: project_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_transfer_job(::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new(job_name: job_name, project_id: project_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_transfer_job_client_stub.call_count + end + end + end + + def test_list_transfer_jobs + # Create test objects. + client_result = ::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_transfer_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_list_transfer_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_transfer_jobs_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_transfer_jobs({ 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.list_transfer_jobs 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.list_transfer_jobs ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new(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.list_transfer_jobs({ 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.list_transfer_jobs(::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new(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, list_transfer_jobs_client_stub.call_count + end + end + end + + def test_pause_transfer_operation + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_transfer_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_pause_transfer_operation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_transfer_operation_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_transfer_operation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_transfer_operation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_transfer_operation ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_transfer_operation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.pause_transfer_operation(::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, pause_transfer_operation_client_stub.call_count + end + end + end + + def test_resume_transfer_operation + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_transfer_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_resume_transfer_operation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_transfer_operation_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_transfer_operation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_transfer_operation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_transfer_operation ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_transfer_operation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resume_transfer_operation(::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resume_transfer_operation_client_stub.call_count + end + end + end + + def test_run_transfer_job + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job_name = "hello world" + project_id = "hello world" + + run_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_run_transfer_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_transfer_job({ job_name: job_name, project_id: project_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_transfer_job job_name: job_name, project_id: project_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_transfer_job ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new(job_name: job_name, project_id: project_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_transfer_job({ job_name: job_name, project_id: project_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_transfer_job(::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new(job_name: job_name, project_id: project_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_transfer_job_client_stub.call_count + end + end + end + + def test_delete_transfer_job + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job_name = "hello world" + project_id = "hello world" + + delete_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_delete_transfer_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_transfer_job({ job_name: job_name, project_id: project_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_transfer_job job_name: job_name, project_id: project_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_transfer_job ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new(job_name: job_name, project_id: project_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_transfer_job({ job_name: job_name, project_id: project_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_transfer_job(::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new(job_name: job_name, project_id: project_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_transfer_job_client_stub.call_count + end + end + end + + def test_create_agent_pool + # Create test objects. + client_result = ::Google::Cloud::StorageTransfer::V1::AgentPool.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + agent_pool = {} + agent_pool_id = "hello world" + + create_agent_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_create_agent_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_agent_pool_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_agent_pool({ project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_agent_pool project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_agent_pool ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new(project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_agent_pool({ project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_agent_pool(::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new(project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_agent_pool_client_stub.call_count + end + end + end + + def test_update_agent_pool + # Create test objects. + client_result = ::Google::Cloud::StorageTransfer::V1::AgentPool.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + agent_pool = {} + update_mask = {} + + update_agent_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_update_agent_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_agent_pool_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_agent_pool({ agent_pool: agent_pool, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_agent_pool agent_pool: agent_pool, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_agent_pool ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new(agent_pool: agent_pool, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_agent_pool({ agent_pool: agent_pool, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_agent_pool(::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new(agent_pool: agent_pool, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_agent_pool_client_stub.call_count + end + end + end + + def test_get_agent_pool + # Create test objects. + client_result = ::Google::Cloud::StorageTransfer::V1::AgentPool.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_agent_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_get_agent_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_agent_pool_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_agent_pool({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_agent_pool name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_agent_pool ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_agent_pool({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_agent_pool(::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_agent_pool_client_stub.call_count + end + end + end + + def test_list_agent_pools + # Create test objects. + client_result = ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_agent_pools_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_list_agent_pools_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_agent_pools_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_agent_pools({ project_id: project_id, 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.list_agent_pools project_id: project_id, 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.list_agent_pools ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new(project_id: project_id, 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.list_agent_pools({ project_id: project_id, 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.list_agent_pools(::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new(project_id: project_id, 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, list_agent_pools_client_stub.call_count + end + end + end + + def test_delete_agent_pool + # 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_agent_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_delete_agent_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_agent_pool_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_agent_pool({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_agent_pool name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_agent_pool ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_agent_pool({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_agent_pool(::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_agent_pool_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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb new file mode 100644 index 000000000000..90e08871647b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb @@ -0,0 +1,973 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/storagetransfer/v1/transfer_pb" +require "google/cloud/storage_transfer/v1/storage_transfer_service" + +class ::Google::Cloud::StorageTransfer::V1::StorageTransferService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_google_service_account + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount.new + grpc_operation = GRPC::ActiveCall::Operation.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_id = "hello world" + + get_google_service_account_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_google_service_account, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, request + assert_equal "hello world", request["project_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_google_service_account_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_google_service_account({ project_id: project_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_google_service_account project_id: project_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_google_service_account ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new(project_id: project_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_google_service_account({ project_id: project_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_google_service_account(::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new(project_id: project_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_google_service_account_client_stub.call_rpc_count + end + end + + def test_create_transfer_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageTransfer::V1::TransferJob.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + transfer_job = {} + + create_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_transfer_job, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageTransfer::V1::TransferJob), request["transfer_job"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_transfer_job({ transfer_job: transfer_job }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_transfer_job transfer_job: transfer_job do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_transfer_job ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new(transfer_job: transfer_job) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_transfer_job({ transfer_job: transfer_job }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_transfer_job(::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new(transfer_job: transfer_job), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_transfer_job_client_stub.call_rpc_count + end + end + + def test_update_transfer_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageTransfer::V1::TransferJob.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + job_name = "hello world" + project_id = "hello world" + transfer_job = {} + update_transfer_job_field_mask = {} + + update_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_transfer_job, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, request + assert_equal "hello world", request["job_name"] + assert_equal "hello world", request["project_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageTransfer::V1::TransferJob), request["transfer_job"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_transfer_job_field_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_transfer_job({ job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_transfer_job job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_transfer_job ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new(job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_transfer_job({ job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_transfer_job(::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new(job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_transfer_job_client_stub.call_rpc_count + end + end + + def test_get_transfer_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageTransfer::V1::TransferJob.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + job_name = "hello world" + project_id = "hello world" + + get_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_transfer_job, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, request + assert_equal "hello world", request["job_name"] + assert_equal "hello world", request["project_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_transfer_job({ job_name: job_name, project_id: project_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_transfer_job job_name: job_name, project_id: project_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_transfer_job ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new(job_name: job_name, project_id: project_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_transfer_job({ job_name: job_name, project_id: project_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_transfer_job(::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new(job_name: job_name, project_id: project_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_transfer_job_client_stub.call_rpc_count + end + end + + def test_list_transfer_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_transfer_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_transfer_jobs, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, request + 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, list_transfer_jobs_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_transfer_jobs({ 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.list_transfer_jobs 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.list_transfer_jobs ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new(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.list_transfer_jobs({ 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.list_transfer_jobs(::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new(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, list_transfer_jobs_client_stub.call_rpc_count + end + end + + def test_pause_transfer_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" + + pause_transfer_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_transfer_operation, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_transfer_operation_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_transfer_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_transfer_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_transfer_operation ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_transfer_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.pause_transfer_operation(::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, pause_transfer_operation_client_stub.call_rpc_count + end + end + + def test_resume_transfer_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" + + resume_transfer_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_transfer_operation, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_transfer_operation_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_transfer_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_transfer_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_transfer_operation ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_transfer_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.resume_transfer_operation(::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, resume_transfer_operation_client_stub.call_rpc_count + end + end + + def test_run_transfer_job + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + job_name = "hello world" + project_id = "hello world" + + run_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_transfer_job, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, request + assert_equal "hello world", request["job_name"] + assert_equal "hello world", request["project_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_transfer_job({ job_name: job_name, project_id: project_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.run_transfer_job job_name: job_name, project_id: project_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.run_transfer_job ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new(job_name: job_name, project_id: project_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.run_transfer_job({ job_name: job_name, project_id: project_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.run_transfer_job(::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new(job_name: job_name, project_id: project_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, run_transfer_job_client_stub.call_rpc_count + end + end + + def test_delete_transfer_job + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + job_name = "hello world" + project_id = "hello world" + + delete_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_transfer_job, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest, request + assert_equal "hello world", request["job_name"] + assert_equal "hello world", request["project_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_transfer_job_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_transfer_job({ job_name: job_name, project_id: project_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_transfer_job job_name: job_name, project_id: project_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_transfer_job ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new(job_name: job_name, project_id: project_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_transfer_job({ job_name: job_name, project_id: project_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_transfer_job(::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new(job_name: job_name, project_id: project_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_transfer_job_client_stub.call_rpc_count + end + end + + def test_create_agent_pool + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageTransfer::V1::AgentPool.new + grpc_operation = GRPC::ActiveCall::Operation.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_id = "hello world" + agent_pool = {} + agent_pool_id = "hello world" + + create_agent_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_agent_pool, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest, request + assert_equal "hello world", request["project_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageTransfer::V1::AgentPool), request["agent_pool"] + assert_equal "hello world", request["agent_pool_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_agent_pool_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_agent_pool({ project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_agent_pool project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_agent_pool ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new(project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_agent_pool({ project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_agent_pool(::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new(project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_agent_pool_client_stub.call_rpc_count + end + end + + def test_update_agent_pool + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageTransfer::V1::AgentPool.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + agent_pool = {} + update_mask = {} + + update_agent_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_agent_pool, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageTransfer::V1::AgentPool), request["agent_pool"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_agent_pool_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_agent_pool({ agent_pool: agent_pool, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_agent_pool agent_pool: agent_pool, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_agent_pool ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new(agent_pool: agent_pool, 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_agent_pool({ agent_pool: agent_pool, 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_agent_pool(::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new(agent_pool: agent_pool, 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_agent_pool_client_stub.call_rpc_count + end + end + + def test_get_agent_pool + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageTransfer::V1::AgentPool.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_agent_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_agent_pool, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_agent_pool_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_agent_pool({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_agent_pool name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_agent_pool ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_agent_pool({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_agent_pool(::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_agent_pool_client_stub.call_rpc_count + end + end + + def test_list_agent_pools + # Create GRPC objects. + grpc_response = ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_id = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_agent_pools_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_agent_pools, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest, request + assert_equal "hello world", request["project_id"] + 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, list_agent_pools_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_agent_pools({ project_id: project_id, 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.list_agent_pools project_id: project_id, 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.list_agent_pools ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new(project_id: project_id, 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.list_agent_pools({ project_id: project_id, 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.list_agent_pools(::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new(project_id: project_id, 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, list_agent_pools_client_stub.call_rpc_count + end + end + + def test_delete_agent_pool + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_agent_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_agent_pool, name + assert_kind_of ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_agent_pool_client_stub do + # Create client + client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_agent_pool({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_agent_pool name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_agent_pool ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_agent_pool({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_agent_pool(::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new(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_agent_pool_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/helper.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage_transfer-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-support-v2/.gitignore b/owl-bot-staging/google-cloud-support-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-support-v2/.repo-metadata.json new file mode 100644 index 000000000000..45909623163b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "cloudsupport.googleapis.com", + "api_shortname": "cloudsupport", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest", + "distribution_name": "google-cloud-support-v2", + "is_cloud": true, + "language": "ruby", + "name": "cloudsupport", + "name_pretty": "Google Cloud Support V2 API", + "product_documentation": "https://cloud.google.com/support/docs/reference/support-api", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Manages Google Cloud technical support cases for Customer Care support offerings. Note that google-cloud-support-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-support instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/support/docs/reference/support-api", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-support-v2/.rubocop.yml b/owl-bot-staging/google-cloud-support-v2/.rubocop.yml new file mode 100644 index 000000000000..5a0822d3f7fc --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-support-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-support-v2.rb" diff --git a/owl-bot-staging/google-cloud-support-v2/.toys.rb b/owl-bot-staging/google-cloud-support-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2/.yardopts b/owl-bot-staging/google-cloud-support-v2/.yardopts new file mode 100644 index 000000000000..ecd96483ad7d --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Google Cloud Support 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-support-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-support-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..f0b98d5c4ee4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-support-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-support-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/support/v2" + +client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/support/v2" + +::Google::Cloud::Support::V2::CaseAttachmentService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Support::V2::CaseAttachmentService::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-support-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/support/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Support::V2::CaseAttachmentService::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-support-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-support-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-support-v2/Gemfile b/owl-bot-staging/google-cloud-support-v2/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-support-v2/LICENSE.md b/owl-bot-staging/google-cloud-support-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2/README.md b/owl-bot-staging/google-cloud-support-v2/README.md new file mode 100644 index 000000000000..a95e292a84b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Google Cloud Support V2 API + +Manages Google Cloud technical support cases for Customer Care support offerings. + +Manages Google Cloud technical support cases for Customer Care support offerings. + +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 Support V2 API. Most users should consider using +the main client gem, +[google-cloud-support](https://rubygems.org/gems/google-cloud-support). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-support-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/cloudsupport.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/support/v2" + +client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new +request = ::Google::Cloud::Support::V2::ListAttachmentsRequest.new # (request fields as keyword arguments...) +response = client.list_attachments request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/support/docs/reference/support-api) +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/support/v2" +require "logger" + +client = ::Google::Cloud::Support::V2::CaseAttachmentService::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-support`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-support-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-support`. +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-support-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-support-v2/Rakefile b/owl-bot-staging/google-cloud-support-v2/Rakefile new file mode 100644 index 000000000000..dc5bafbc41cf --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2 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/support/v2/case_attachment_service/credentials" + ::Google::Cloud::Support::V2::CaseAttachmentService::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-support-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-support-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-support-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-support-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-support-v2" + header "google-cloud-support-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-support-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-support-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-support-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-support-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-support-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-support-v2/gapic_metadata.json new file mode 100644 index 000000000000..f357ef041882 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/gapic_metadata.json @@ -0,0 +1,91 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.support.v2", + "libraryPackage": "::Google::Cloud::Support::V2", + "services": { + "CaseAttachmentService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Support::V2::CaseAttachmentService::Client", + "rpcs": { + "ListAttachments": { + "methods": [ + "list_attachments" + ] + } + } + } + } + }, + "CaseService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Support::V2::CaseService::Client", + "rpcs": { + "GetCase": { + "methods": [ + "get_case" + ] + }, + "ListCases": { + "methods": [ + "list_cases" + ] + }, + "SearchCases": { + "methods": [ + "search_cases" + ] + }, + "CreateCase": { + "methods": [ + "create_case" + ] + }, + "UpdateCase": { + "methods": [ + "update_case" + ] + }, + "EscalateCase": { + "methods": [ + "escalate_case" + ] + }, + "CloseCase": { + "methods": [ + "close_case" + ] + }, + "SearchCaseClassifications": { + "methods": [ + "search_case_classifications" + ] + } + } + } + } + }, + "CommentService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Support::V2::CommentService::Client", + "rpcs": { + "ListComments": { + "methods": [ + "list_comments" + ] + }, + "CreateComment": { + "methods": [ + "create_comment" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support-v2/google-cloud-support-v2.gemspec b/owl-bot-staging/google-cloud-support-v2/google-cloud-support-v2.gemspec new file mode 100644 index 000000000000..1269fcd23887 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/google-cloud-support-v2.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/support/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-support-v2" + gem.version = Google::Cloud::Support::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Manages Google Cloud technical support cases for Customer Care support offerings. Note that google-cloud-support-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-support instead. See the readme for more details." + gem.summary = "Manages Google Cloud technical support cases for Customer Care support offerings." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google-cloud-support-v2.rb b/owl-bot-staging/google-cloud-support-v2/lib/google-cloud-support-v2.rb new file mode 100644 index 000000000000..622f07997b34 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google-cloud-support-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/support/v2" diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2.rb new file mode 100644 index 000000000000..ee50b139824f --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/support/v2/case_attachment_service" +require "google/cloud/support/v2/case_service" +require "google/cloud/support/v2/comment_service" +require "google/cloud/support/v2/version" + +module Google + module Cloud + module Support + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/support/v2" + # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new + # + module V2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/support/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/actor_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/actor_pb.rb new file mode 100644 index 000000000000..8f6f1bfef27f --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/actor_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2/actor.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n#google/cloud/support/v2/actor.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\"d\n\x05\x41\x63tor\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x11\n\x05\x65mail\x18\x02 \x01(\tB\x02\x18\x01\x12\x1b\n\x0egoogle_support\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12\x15\n\x08username\x18\x05 \x01(\tB\x03\xe0\x41\x03\x42\xb3\x01\n\x1b\x63om.google.cloud.support.v2B\nActorProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2 + Actor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Actor").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_pb.rb new file mode 100644 index 000000000000..c0b946752509 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2/attachment.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/support/v2/actor_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/cloud/support/v2/attachment.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/support/v2/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x84\x03\n\nAttachment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\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\x07\x63reator\x18\x03 \x01(\x0b\x32\x1e.google.cloud.support.v2.ActorB\x03\xe0\x41\x03\x12\x10\n\x08\x66ilename\x18\x04 \x01(\t\x12\x16\n\tmime_type\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03:\xb0\x01\xea\x41\xac\x01\n&cloudsupport.googleapis.com/Attachment\x12\x45organizations/{organization}/cases/{case}/attachments/{attachment_id}\x12;projects/{project}/cases/{case}/attachments/{attachment_id}B\xb8\x01\n\x1b\x63om.google.cloud.support.v2B\x0f\x41ttachmentProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2 + Attachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Attachment").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_pb.rb new file mode 100644 index 000000000000..03ee8f0dc82d --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2/attachment_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/support/v2/attachment_pb' + + +descriptor_data = "\n0google/cloud/support/v2/attachment_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/support/v2/attachment.proto\"y\n\x16ListAttachmentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"l\n\x17ListAttachmentsResponse\x12\x38\n\x0b\x61ttachments\x18\x01 \x03(\x0b\x32#.google.cloud.support.v2.Attachment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xd1\x02\n\x15\x43\x61seAttachmentService\x12\xe6\x01\n\x0fListAttachments\x12/.google.cloud.support.v2.ListAttachmentsRequest\x1a\x30.google.cloud.support.v2.ListAttachmentsResponse\"p\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x61\x12+/v2/{parent=projects/*/cases/*}/attachmentsZ2\x12\x30/v2/{parent=organizations/*/cases/*}/attachments\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbf\x01\n\x1b\x63om.google.cloud.support.v2B\x16\x41ttachmentServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2 + ListAttachmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListAttachmentsRequest").msgclass + ListAttachmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListAttachmentsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_services_pb.rb new file mode 100644 index 000000000000..4b76cbce1e0c --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_services_pb.rb @@ -0,0 +1,45 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/support/v2/attachment_service.proto for package 'Google.Cloud.Support.V2' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/support/v2/attachment_service_pb' + +module Google + module Cloud + module Support + module V2 + module CaseAttachmentService + # A service to manage file attachments for Google Cloud support cases. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.support.v2.CaseAttachmentService' + + # List all the attachments associated with a support case. + rpc :ListAttachments, ::Google::Cloud::Support::V2::ListAttachmentsRequest, ::Google::Cloud::Support::V2::ListAttachmentsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service.rb new file mode 100644 index 000000000000..b15fabbaa7bb --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_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/support/v2/version" + +require "google/cloud/support/v2/case_attachment_service/credentials" +require "google/cloud/support/v2/case_attachment_service/paths" +require "google/cloud/support/v2/case_attachment_service/client" + +module Google + module Cloud + module Support + module V2 + ## + # A service to manage file attachments for Google Cloud support cases. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/support/v2/case_attachment_service" + # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new + # + module CaseAttachmentService + end + end + end + end +end + +helper_path = ::File.join __dir__, "case_attachment_service", "helpers.rb" +require "google/cloud/support/v2/case_attachment_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/client.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/client.rb new file mode 100644 index 000000000000..7e377c01b267 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/client.rb @@ -0,0 +1,497 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/support/v2/attachment_service_pb" + +module Google + module Cloud + module Support + module V2 + module CaseAttachmentService + ## + # Client for the CaseAttachmentService service. + # + # A service to manage file attachments for Google Cloud support cases. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :case_attachment_service_stub + + ## + # Configure the CaseAttachmentService Client class. + # + # See {::Google::Cloud::Support::V2::CaseAttachmentService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CaseAttachmentService clients + # ::Google::Cloud::Support::V2::CaseAttachmentService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Support", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_attachments.timeout = 60.0 + default_config.rpcs.list_attachments.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 CaseAttachmentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Support::V2::CaseAttachmentService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @case_attachment_service_stub.universe_domain + end + + ## + # Create a new CaseAttachmentService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CaseAttachmentService 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/support/v2/attachment_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 + + @case_attachment_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Support::V2::CaseAttachmentService::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 + ) + + @case_attachment_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 + @case_attachment_service_stub.logger + end + + # Service calls + + ## + # List all the attachments associated with a support case. + # + # @overload list_attachments(request, options = nil) + # Pass arguments to `list_attachments` via a request object, either of type + # {::Google::Cloud::Support::V2::ListAttachmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::ListAttachmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_attachments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_attachments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 case for which attachments should be listed. + # @param page_size [::Integer] + # The maximum number of attachments fetched with each request. + # + # If not provided, the default is 10. The maximum page size that will be + # returned is 100. + # + # The size of each page can be smaller than the requested page size and can + # include zero. For example, you could request 100 attachments on one page, + # receive 0, and then on the next page, receive 90. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Attachment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Attachment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CaseAttachmentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::ListAttachmentsRequest.new + # + # # Call the list_attachments method. + # result = client.list_attachments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2::Attachment. + # p item + # end + # + def list_attachments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListAttachmentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_attachments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_attachments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_attachments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_attachment_service_stub.call_rpc :list_attachments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @case_attachment_service_stub, :list_attachments, request, response, 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 CaseAttachmentService API. + # + # This class represents the configuration for CaseAttachmentService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2::CaseAttachmentService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_attachments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2::CaseAttachmentService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_attachments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_attachments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Support::V2::CaseAttachmentService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CaseAttachmentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_attachments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_attachments + + # @private + def initialize parent_rpcs = nil + list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments + @list_attachments = ::Gapic::Config::Method.new list_attachments_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/credentials.rb new file mode 100644 index 000000000000..580b6657fd60 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/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 Support + module V2 + module CaseAttachmentService + # Credentials for the CaseAttachmentService 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-support-v2/lib/google/cloud/support/v2/case_attachment_service/paths.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/paths.rb new file mode 100644 index 000000000000..145e0085399c --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/paths.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2 + module CaseAttachmentService + # Path helper methods for the CaseAttachmentService API. + module Paths + ## + # Create a fully-qualified Case resource string. + # + # @overload case_path(organization:, case:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}` + # + # @param organization [String] + # @param case [String] + # + # @overload case_path(project:, case:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}` + # + # @param project [String] + # @param case [String] + # + # @return [::String] + def case_path **args + resources = { + "case:organization" => (proc do |organization:, case:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}" + end), + "case:project" => (proc do |project:, case:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}" + 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-support-v2/lib/google/cloud/support/v2/case_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_pb.rb new file mode 100644 index 000000000000..9e9e18a721b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2/case.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/support/v2/actor_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\"google/cloud/support/v2/case.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/support/v2/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6\x06\n\x04\x43\x61se\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x43\n\x0e\x63lassification\x18\x04 \x01(\x0b\x32+.google.cloud.support.v2.CaseClassification\x12\x11\n\ttime_zone\x18\x08 \x01(\t\x12\"\n\x1asubscriber_email_addresses\x18\t \x03(\t\x12\x37\n\x05state\x18\x0c \x01(\x0e\x32#.google.cloud.support.v2.Case.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12/\n\x07\x63reator\x18\x0f \x01(\x0b\x32\x1e.google.cloud.support.v2.Actor\x12\x15\n\rcontact_email\x18# \x01(\t\x12\x11\n\tescalated\x18\x11 \x01(\x08\x12\x11\n\ttest_case\x18\x13 \x01(\x08\x12\x15\n\rlanguage_code\x18\x17 \x01(\t\x12\x38\n\x08priority\x18 \x01(\x0e\x32&.google.cloud.support.v2.Case.Priority\"\x7f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x1e\n\x1aIN_PROGRESS_GOOGLE_SUPPORT\x10\x02\x12\x13\n\x0f\x41\x43TION_REQUIRED\x10\x03\x12\x15\n\x11SOLUTION_PROVIDED\x10\x04\x12\n\n\x06\x43LOSED\x10\x05\"L\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x06\n\x02P0\x10\x01\x12\x06\n\x02P1\x10\x02\x12\x06\n\x02P2\x10\x03\x12\x06\n\x02P3\x10\x04\x12\x06\n\x02P4\x10\x05:q\xea\x41n\n cloudsupport.googleapis.com/Case\x12)organizations/{organization}/cases/{case}\x12\x1fprojects/{project}/cases/{case}\"6\n\x12\x43\x61seClassification\x12\n\n\x02id\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\tB\xb2\x01\n\x1b\x63om.google.cloud.support.v2B\tCaseProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2 + Case = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Case").msgclass + Case::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Case.State").enummodule + Case::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Case.Priority").enummodule + CaseClassification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CaseClassification").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service.rb new file mode 100644 index 000000000000..f77ef0cfc926 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_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/support/v2/version" + +require "google/cloud/support/v2/case_service/credentials" +require "google/cloud/support/v2/case_service/paths" +require "google/cloud/support/v2/case_service/client" + +module Google + module Cloud + module Support + module V2 + ## + # A service to manage Google Cloud support cases. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/support/v2/case_service" + # client = ::Google::Cloud::Support::V2::CaseService::Client.new + # + module CaseService + end + end + end + end +end + +helper_path = ::File.join __dir__, "case_service", "helpers.rb" +require "google/cloud/support/v2/case_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/client.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/client.rb new file mode 100644 index 000000000000..2d53752a256a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/client.rb @@ -0,0 +1,1264 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/support/v2/case_service_pb" + +module Google + module Cloud + module Support + module V2 + module CaseService + ## + # Client for the CaseService service. + # + # A service to manage Google Cloud support cases. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :case_service_stub + + ## + # Configure the CaseService Client class. + # + # See {::Google::Cloud::Support::V2::CaseService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CaseService clients + # ::Google::Cloud::Support::V2::CaseService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Support", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_case.timeout = 60.0 + default_config.rpcs.get_case.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_cases.timeout = 60.0 + default_config.rpcs.list_cases.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_cases.timeout = 60.0 + default_config.rpcs.search_cases.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_case.timeout = 60.0 + + default_config.rpcs.update_case.timeout = 60.0 + + default_config.rpcs.escalate_case.timeout = 60.0 + + default_config.rpcs.close_case.timeout = 60.0 + + default_config.rpcs.search_case_classifications.timeout = 60.0 + default_config.rpcs.search_case_classifications.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 CaseService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Support::V2::CaseService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @case_service_stub.universe_domain + end + + ## + # Create a new CaseService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Support::V2::CaseService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CaseService 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/support/v2/case_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 + + @case_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Support::V2::CaseService::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 + ) + + @case_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 + @case_service_stub.logger + end + + # Service calls + + ## + # Retrieve a case. + # + # @overload get_case(request, options = nil) + # Pass arguments to `get_case` via a request object, either of type + # {::Google::Cloud::Support::V2::GetCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::GetCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_case(name: nil) + # Pass arguments to `get_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full name of a case to be retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::GetCaseRequest.new + # + # # Call the get_case method. + # result = client.get_case request + # + # # The returned object is of type Google::Cloud::Support::V2::Case. + # p result + # + def get_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::GetCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :get_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve all cases under a parent, but not its children. + # + # For example, listing cases under an organization only returns the cases + # that are directly parented by that organization. To retrieve cases + # under an organization and its projects, use `cases.search`. + # + # @overload list_cases(request, options = nil) + # Pass arguments to `list_cases` via a request object, either of type + # {::Google::Cloud::Support::V2::ListCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::ListCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_cases(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 a parent to list cases under. + # @param filter [::String] + # An expression used to filter cases. + # + # If it's an empty string, then no filtering happens. Otherwise, the endpoint + # returns the cases that match the filter. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # EXAMPLES: + # + # - `state=CLOSED` + # - `state=OPEN AND creator.email="tester@example.com"` + # - `state=OPEN AND (priority=P0 OR priority=P1)` + # @param page_size [::Integer] + # The maximum number of cases fetched with each request. Defaults to 10. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::ListCasesRequest.new + # + # # Call the list_cases method. + # result = client.list_cases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2::Case. + # p item + # end + # + def list_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListCasesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_cases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :list_cases, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @case_service_stub, :list_cases, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Search for cases using a query. + # + # @overload search_cases(request, options = nil) + # Pass arguments to `search_cases` via a request object, either of type + # {::Google::Cloud::Support::V2::SearchCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::SearchCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cases(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # The name of the parent resource to search for cases under. + # @param query [::String] + # An expression used to filter cases. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `organization`: An organization name in the form + # `organizations/`. + # - `project`: A project name in the form `projects/`. + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # You must specify either `organization` or `project`. + # + # To search across `displayName`, `description`, and comments, use a global + # restriction with no keyword or operator. For example, `"my search"`. + # + # To search only cases updated after a certain date, use `update_time` + # restricted with that particular date, time, and timezone in ISO datetime + # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + # `update_time` only supports the greater than operator (`>`). + # + # Examples: + # + # - `organization="organizations/123456789"` + # - `project="projects/my-project-id"` + # - `project="projects/123456789"` + # - `organization="organizations/123456789" AND state=CLOSED` + # - `project="projects/my-project-id" AND creator.email="tester@example.com"` + # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + # @param page_size [::Integer] + # The maximum number of cases fetched with each request. The default page + # size is 10. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::SearchCasesRequest.new + # + # # Call the search_cases method. + # result = client.search_cases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2::Case. + # p item + # end + # + def search_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::SearchCasesRequest + + # Converts hash and nil to 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_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_cases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :search_cases, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_cases, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new case and associate it with a parent. + # + # It must have the following fields set: `display_name`, `description`, + # `classification`, and `priority`. If you're just testing the API and don't + # want to route your case to an agent, set `testCase=true`. + # + # @overload create_case(request, options = nil) + # Pass arguments to `create_case` via a request object, either of type + # {::Google::Cloud::Support::V2::CreateCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::CreateCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_case(parent: nil, case: nil) + # Pass arguments to `create_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent under which the case should be created. + # @param case [::Google::Cloud::Support::V2::Case, ::Hash] + # Required. The case to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::CreateCaseRequest.new + # + # # Call the create_case method. + # result = client.create_case request + # + # # The returned object is of type Google::Cloud::Support::V2::Case. + # p result + # + def create_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CreateCaseRequest + + # Converts hash and nil to 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_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :create_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a case. Only some fields can be updated. + # + # @overload update_case(request, options = nil) + # Pass arguments to `update_case` via a request object, either of type + # {::Google::Cloud::Support::V2::UpdateCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::UpdateCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_case(case: nil, update_mask: nil) + # Pass arguments to `update_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param case [::Google::Cloud::Support::V2::Case, ::Hash] + # Required. The case to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A list of attributes of the case that should be updated. Supported values + # are `priority`, `display_name`, and `subscriber_email_addresses`. If no + # fields are specified, all supported fields are updated. + # + # Be careful - if you do not provide a field mask, then you might + # accidentally clear some fields. For example, if you leave the field mask + # empty and do not provide a value for `subscriber_email_addresses`, then + # `subscriber_email_addresses` is updated to empty. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::UpdateCaseRequest.new + # + # # Call the update_case method. + # result = client.update_case request + # + # # The returned object is of type Google::Cloud::Support::V2::Case. + # p result + # + def update_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::UpdateCaseRequest + + # Converts hash and nil to 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_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.case&.name + header_params["case.name"] = request.case.name + end + + request_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_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :update_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Escalate a case, starting the Google Cloud Support escalation management + # process. + # + # This operation is only available for some support services. Go to + # https://cloud.google.com/support and look for 'Technical support + # escalations' in the feature list to find out which ones let you + # do that. + # + # @overload escalate_case(request, options = nil) + # Pass arguments to `escalate_case` via a request object, either of type + # {::Google::Cloud::Support::V2::EscalateCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::EscalateCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload escalate_case(name: nil, escalation: nil) + # Pass arguments to `escalate_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 case to be escalated. + # @param escalation [::Google::Cloud::Support::V2::Escalation, ::Hash] + # The escalation information to be sent with the escalation request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::EscalateCaseRequest.new + # + # # Call the escalate_case method. + # result = client.escalate_case request + # + # # The returned object is of type Google::Cloud::Support::V2::Case. + # p result + # + def escalate_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::EscalateCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.escalate_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.escalate_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.escalate_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :escalate_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Close a case. + # + # @overload close_case(request, options = nil) + # Pass arguments to `close_case` via a request object, either of type + # {::Google::Cloud::Support::V2::CloseCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::CloseCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload close_case(name: nil) + # Pass arguments to `close_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 case to close. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::CloseCaseRequest.new + # + # # Call the close_case method. + # result = client.close_case request + # + # # The returned object is of type Google::Cloud::Support::V2::Case. + # p result + # + def close_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CloseCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.close_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.close_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.close_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :close_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve valid classifications to use when creating a support case. + # + # Classifications are hierarchical. Each classification is a string + # containing all levels of the hierarchy separated by `" > "`. For example, + # `"Technical Issue > Compute > Compute Engine"`. + # + # Classification IDs returned by this endpoint are valid for at least six + # months. When a classification is deactivated, this endpoint immediately + # stops returning it. After six months, `case.create` requests using the + # classification will fail. + # + # @overload search_case_classifications(request, options = nil) + # Pass arguments to `search_case_classifications` via a request object, either of type + # {::Google::Cloud::Support::V2::SearchCaseClassificationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::SearchCaseClassificationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_case_classifications(query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_case_classifications` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param query [::String] + # An expression used to filter case classifications. + # + # If it's an empty string, then no filtering happens. Otherwise, case + # classifications will be returned that match the filter. + # @param page_size [::Integer] + # The maximum number of classifications fetched with each request. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new + # + # # Call the search_case_classifications method. + # result = client.search_case_classifications request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2::CaseClassification. + # p item + # end + # + def search_case_classifications request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::SearchCaseClassificationsRequest + + # Converts hash and nil to 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_case_classifications.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_case_classifications.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_case_classifications.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :search_case_classifications, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_case_classifications, request, response, 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 CaseService API. + # + # This class represents the configuration for CaseService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2::CaseService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_case to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2::CaseService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_case.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_case.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Support::V2::CaseService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CaseService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_case` + # @return [::Gapic::Config::Method] + # + attr_reader :get_case + ## + # RPC-specific configuration for `list_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_cases + ## + # RPC-specific configuration for `search_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :search_cases + ## + # RPC-specific configuration for `create_case` + # @return [::Gapic::Config::Method] + # + attr_reader :create_case + ## + # RPC-specific configuration for `update_case` + # @return [::Gapic::Config::Method] + # + attr_reader :update_case + ## + # RPC-specific configuration for `escalate_case` + # @return [::Gapic::Config::Method] + # + attr_reader :escalate_case + ## + # RPC-specific configuration for `close_case` + # @return [::Gapic::Config::Method] + # + attr_reader :close_case + ## + # RPC-specific configuration for `search_case_classifications` + # @return [::Gapic::Config::Method] + # + attr_reader :search_case_classifications + + # @private + def initialize parent_rpcs = nil + get_case_config = parent_rpcs.get_case if parent_rpcs.respond_to? :get_case + @get_case = ::Gapic::Config::Method.new get_case_config + list_cases_config = parent_rpcs.list_cases if parent_rpcs.respond_to? :list_cases + @list_cases = ::Gapic::Config::Method.new list_cases_config + search_cases_config = parent_rpcs.search_cases if parent_rpcs.respond_to? :search_cases + @search_cases = ::Gapic::Config::Method.new search_cases_config + create_case_config = parent_rpcs.create_case if parent_rpcs.respond_to? :create_case + @create_case = ::Gapic::Config::Method.new create_case_config + update_case_config = parent_rpcs.update_case if parent_rpcs.respond_to? :update_case + @update_case = ::Gapic::Config::Method.new update_case_config + escalate_case_config = parent_rpcs.escalate_case if parent_rpcs.respond_to? :escalate_case + @escalate_case = ::Gapic::Config::Method.new escalate_case_config + close_case_config = parent_rpcs.close_case if parent_rpcs.respond_to? :close_case + @close_case = ::Gapic::Config::Method.new close_case_config + search_case_classifications_config = parent_rpcs.search_case_classifications if parent_rpcs.respond_to? :search_case_classifications + @search_case_classifications = ::Gapic::Config::Method.new search_case_classifications_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/credentials.rb new file mode 100644 index 000000000000..244a84668482 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/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 Support + module V2 + module CaseService + # Credentials for the CaseService 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-support-v2/lib/google/cloud/support/v2/case_service/paths.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/paths.rb new file mode 100644 index 000000000000..da8eb12016cf --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/paths.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2 + module CaseService + # Path helper methods for the CaseService API. + module Paths + ## + # Create a fully-qualified Case resource string. + # + # @overload case_path(organization:, case:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}` + # + # @param organization [String] + # @param case [String] + # + # @overload case_path(project:, case:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}` + # + # @param project [String] + # @param case [String] + # + # @return [::String] + def case_path **args + resources = { + "case:organization" => (proc do |organization:, case:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}" + end), + "case:project" => (proc do |project:, case:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Organization resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}` + # + # @param organization [String] + # + # @return [::String] + def organization_path organization: + "organizations/#{organization}" + end + + ## + # Create a fully-qualified 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-support-v2/lib/google/cloud/support/v2/case_service_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_pb.rb new file mode 100644 index 000000000000..2b7cc3c1a52b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_pb.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2/case_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/support/v2/case_pb' +require 'google/cloud/support/v2/escalation_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n*google/cloud/support/v2/case_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/support/v2/case.proto\x1a(google/cloud/support/v2/escalation.proto\x1a google/protobuf/field_mask.proto\"H\n\x0eGetCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\"\x7f\n\x11\x43reateCaseRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 cloudsupport.googleapis.com/Case\x12\x30\n\x04\x63\x61se\x18\x02 \x01(\x0b\x32\x1d.google.cloud.support.v2.CaseB\x03\xe0\x41\x02\"\x83\x01\n\x10ListCasesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 cloudsupport.googleapis.com/Case\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"Z\n\x11ListCasesResponse\x12,\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32\x1d.google.cloud.support.v2.Case\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Z\n\x12SearchCasesRequest\x12\x0e\n\x06parent\x18\x04 \x01(\t\x12\r\n\x05query\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\\\n\x13SearchCasesResponse\x12,\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32\x1d.google.cloud.support.v2.Case\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x86\x01\n\x13\x45scalateCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x37\n\nescalation\x18\x02 \x01(\x0b\x32#.google.cloud.support.v2.Escalation\"v\n\x11UpdateCaseRequest\x12\x30\n\x04\x63\x61se\x18\x01 \x01(\x0b\x32\x1d.google.cloud.support.v2.CaseB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"J\n\x10\x43loseCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\"X\n SearchCaseClassificationsRequest\x12\r\n\x05query\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x87\x01\n!SearchCaseClassificationsResponse\x12I\n\x14\x63\x61se_classifications\x18\x01 \x03(\x0b\x32+.google.cloud.support.v2.CaseClassification\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xcf\x0c\n\x0b\x43\x61seService\x12\xa5\x01\n\x07GetCase\x12\'.google.cloud.support.v2.GetCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\x12\x1d/v2/{name=projects/*/cases/*}Z$\x12\"/v2/{name=organizations/*/cases/*}\x12\xb8\x01\n\tListCases\x12).google.cloud.support.v2.ListCasesRequest\x1a*.google.cloud.support.v2.ListCasesResponse\"T\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x45\x12\x1d/v2/{parent=projects/*}/casesZ$\x12\"/v2/{parent=organizations/*}/cases\x12\xc3\x01\n\x0bSearchCases\x12+.google.cloud.support.v2.SearchCasesRequest\x1a,.google.cloud.support.v2.SearchCasesResponse\"Y\x82\xd3\xe4\x93\x02S\x12$/v2/{parent=projects/*}/cases:searchZ+\x12)/v2/{parent=organizations/*}/cases:search\x12\xbe\x01\n\nCreateCase\x12*.google.cloud.support.v2.CreateCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"e\xda\x41\x0bparent,case\x82\xd3\xe4\x93\x02Q\"\x1d/v2/{parent=projects/*}/cases:\x04\x63\x61seZ*\"\"/v2/{parent=organizations/*}/cases:\x04\x63\x61se\x12\xcd\x01\n\nUpdateCase\x12*.google.cloud.support.v2.UpdateCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"t\xda\x41\x10\x63\x61se,update_mask\x82\xd3\xe4\x93\x02[2\"/v2/{case.name=projects/*/cases/*}:\x04\x63\x61seZ/2\'/v2/{case.name=organizations/*/cases/*}:\x04\x63\x61se\x12\xc0\x01\n\x0c\x45scalateCase\x12,.google.cloud.support.v2.EscalateCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"c\x82\xd3\xe4\x93\x02]\"&/v2/{name=projects/*/cases/*}:escalate:\x01*Z0\"+/v2/{name=organizations/*/cases/*}:escalate:\x01*\x12\xb4\x01\n\tCloseCase\x12).google.cloud.support.v2.CloseCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"]\x82\xd3\xe4\x93\x02W\"#/v2/{name=projects/*/cases/*}:close:\x01*Z-\"(/v2/{name=organizations/*/cases/*}:close:\x01*\x12\xba\x01\n\x19SearchCaseClassifications\x12\x39.google.cloud.support.v2.SearchCaseClassificationsRequest\x1a:.google.cloud.support.v2.SearchCaseClassificationsResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/v2/caseClassifications:search\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb9\x01\n\x1b\x63om.google.cloud.support.v2B\x10\x43\x61seServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2 + GetCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.GetCaseRequest").msgclass + CreateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CreateCaseRequest").msgclass + ListCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCasesRequest").msgclass + ListCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCasesResponse").msgclass + SearchCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.SearchCasesRequest").msgclass + SearchCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.SearchCasesResponse").msgclass + EscalateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.EscalateCaseRequest").msgclass + UpdateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.UpdateCaseRequest").msgclass + CloseCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CloseCaseRequest").msgclass + SearchCaseClassificationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.SearchCaseClassificationsRequest").msgclass + SearchCaseClassificationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.SearchCaseClassificationsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_services_pb.rb new file mode 100644 index 000000000000..0b249ccd8e55 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_services_pb.rb @@ -0,0 +1,82 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/support/v2/case_service.proto for package 'Google.Cloud.Support.V2' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/support/v2/case_service_pb' + +module Google + module Cloud + module Support + module V2 + module CaseService + # A service to manage Google Cloud support cases. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.support.v2.CaseService' + + # Retrieve a case. + rpc :GetCase, ::Google::Cloud::Support::V2::GetCaseRequest, ::Google::Cloud::Support::V2::Case + # Retrieve all cases under a parent, but not its children. + # + # For example, listing cases under an organization only returns the cases + # that are directly parented by that organization. To retrieve cases + # under an organization and its projects, use `cases.search`. + rpc :ListCases, ::Google::Cloud::Support::V2::ListCasesRequest, ::Google::Cloud::Support::V2::ListCasesResponse + # Search for cases using a query. + rpc :SearchCases, ::Google::Cloud::Support::V2::SearchCasesRequest, ::Google::Cloud::Support::V2::SearchCasesResponse + # Create a new case and associate it with a parent. + # + # It must have the following fields set: `display_name`, `description`, + # `classification`, and `priority`. If you're just testing the API and don't + # want to route your case to an agent, set `testCase=true`. + rpc :CreateCase, ::Google::Cloud::Support::V2::CreateCaseRequest, ::Google::Cloud::Support::V2::Case + # Update a case. Only some fields can be updated. + rpc :UpdateCase, ::Google::Cloud::Support::V2::UpdateCaseRequest, ::Google::Cloud::Support::V2::Case + # Escalate a case, starting the Google Cloud Support escalation management + # process. + # + # This operation is only available for some support services. Go to + # https://cloud.google.com/support and look for 'Technical support + # escalations' in the feature list to find out which ones let you + # do that. + rpc :EscalateCase, ::Google::Cloud::Support::V2::EscalateCaseRequest, ::Google::Cloud::Support::V2::Case + # Close a case. + rpc :CloseCase, ::Google::Cloud::Support::V2::CloseCaseRequest, ::Google::Cloud::Support::V2::Case + # Retrieve valid classifications to use when creating a support case. + # + # Classifications are hierarchical. Each classification is a string + # containing all levels of the hierarchy separated by `" > "`. For example, + # `"Technical Issue > Compute > Compute Engine"`. + # + # Classification IDs returned by this endpoint are valid for at least six + # months. When a classification is deactivated, this endpoint immediately + # stops returning it. After six months, `case.create` requests using the + # classification will fail. + rpc :SearchCaseClassifications, ::Google::Cloud::Support::V2::SearchCaseClassificationsRequest, ::Google::Cloud::Support::V2::SearchCaseClassificationsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_pb.rb new file mode 100644 index 000000000000..d4ba7d9084c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2/comment.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/support/v2/actor_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n%google/cloud/support/v2/comment.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/support/v2/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd7\x02\n\x07\x43omment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x07\x63reator\x18\x03 \x01(\x0b\x32\x1e.google.cloud.support.v2.ActorB\x03\xe0\x41\x03\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\x1e\n\x0fplain_text_body\x18\x05 \x01(\tB\x05\x18\x01\xe0\x41\x03:\x9b\x01\xea\x41\x97\x01\n#cloudsupport.googleapis.com/Comment\x12] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Comment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CommentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::ListCommentsRequest.new + # + # # Call the list_comments method. + # result = client.list_comments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2::Comment. + # p item + # end + # + def list_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListCommentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_comments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_comments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @comment_service_stub.call_rpc :list_comments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @comment_service_stub, :list_comments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Add a new comment to a case. + # + # The comment must have the following fields set: `body`. + # + # @overload create_comment(request, options = nil) + # Pass arguments to `create_comment` via a request object, either of type + # {::Google::Cloud::Support::V2::CreateCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2::CreateCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_comment(parent: nil, comment: nil) + # Pass arguments to `create_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the case to which the comment should be added. + # @param comment [::Google::Cloud::Support::V2::Comment, ::Hash] + # Required. The comment to be added. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2::Comment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2::Comment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2::CommentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2::CreateCommentRequest.new + # + # # Call the create_comment method. + # result = client.create_comment request + # + # # The returned object is of type Google::Cloud::Support::V2::Comment. + # p result + # + def create_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CreateCommentRequest + + # Converts hash and nil to 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_comment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @comment_service_stub.call_rpc :create_comment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CommentService API. + # + # This class represents the configuration for CommentService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2::CommentService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_comments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2::CommentService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_comments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_comments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Support::V2::CommentService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CommentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_comments + ## + # RPC-specific configuration for `create_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_comment + + # @private + def initialize parent_rpcs = nil + list_comments_config = parent_rpcs.list_comments if parent_rpcs.respond_to? :list_comments + @list_comments = ::Gapic::Config::Method.new list_comments_config + create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment + @create_comment = ::Gapic::Config::Method.new create_comment_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/credentials.rb new file mode 100644 index 000000000000..ed38892036e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/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 Support + module V2 + module CommentService + # Credentials for the CommentService 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-support-v2/lib/google/cloud/support/v2/comment_service/paths.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/paths.rb new file mode 100644 index 000000000000..abbe1eeac559 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/paths.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! + + +module Google + module Cloud + module Support + module V2 + module CommentService + # Path helper methods for the CommentService API. + module Paths + ## + # Create a fully-qualified Case resource string. + # + # @overload case_path(organization:, case:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}` + # + # @param organization [String] + # @param case [String] + # + # @overload case_path(project:, case:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}` + # + # @param project [String] + # @param case [String] + # + # @return [::String] + def case_path **args + resources = { + "case:organization" => (proc do |organization:, case:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}" + end), + "case:project" => (proc do |project:, case:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}" + 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 Comment resource string. + # + # @overload comment_path(organization:, case:, comment:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}/comments/{comment}` + # + # @param organization [String] + # @param case [String] + # @param comment [String] + # + # @overload comment_path(project:, case:, comment:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}/comments/{comment}` + # + # @param project [String] + # @param case [String] + # @param comment [String] + # + # @return [::String] + def comment_path **args + resources = { + "case:comment:organization" => (proc do |organization:, case:, comment:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}/comments/#{comment}" + end), + "case:comment:project" => (proc do |project:, case:, comment:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}/comments/#{comment}" + 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-support-v2/lib/google/cloud/support/v2/comment_service_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_pb.rb new file mode 100644 index 000000000000..771570302466 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2/comment_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/support/v2/comment_pb' + + +descriptor_data = "\n-google/cloud/support/v2/comment_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/support/v2/comment.proto\"v\n\x13ListCommentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"c\n\x14ListCommentsResponse\x12\x32\n\x08\x63omments\x18\x01 \x03(\x0b\x32 .google.cloud.support.v2.Comment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x88\x01\n\x14\x43reateCommentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x36\n\x07\x63omment\x18\x02 \x01(\x0b\x32 .google.cloud.support.v2.CommentB\x03\xe0\x41\x02\x32\xa5\x04\n\x0e\x43ommentService\x12\xd7\x01\n\x0cListComments\x12,.google.cloud.support.v2.ListCommentsRequest\x1a-.google.cloud.support.v2.ListCommentsResponse\"j\xda\x41\x06parent\x82\xd3\xe4\x93\x02[\x12(/v2/{parent=projects/*/cases/*}/commentsZ/\x12-/v2/{parent=organizations/*/cases/*}/comments\x12\xe7\x01\n\rCreateComment\x12-.google.cloud.support.v2.CreateCommentRequest\x1a .google.cloud.support.v2.Comment\"\x84\x01\xda\x41\x0eparent,comment\x82\xd3\xe4\x93\x02m\"(/v2/{parent=projects/*/cases/*}/comments:\x07\x63ommentZ8\"-/v2/{parent=organizations/*/cases/*}/comments:\x07\x63omment\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbc\x01\n\x1b\x63om.google.cloud.support.v2B\x13\x43ommentServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2 + ListCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCommentsRequest").msgclass + ListCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCommentsResponse").msgclass + CreateCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CreateCommentRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_services_pb.rb new file mode 100644 index 000000000000..d615c07c5af3 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/support/v2/comment_service.proto for package 'Google.Cloud.Support.V2' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/support/v2/comment_service_pb' + +module Google + module Cloud + module Support + module V2 + module CommentService + # A service to manage comments on cases. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.support.v2.CommentService' + + # List all the comments associated with a case. + rpc :ListComments, ::Google::Cloud::Support::V2::ListCommentsRequest, ::Google::Cloud::Support::V2::ListCommentsResponse + # Add a new comment to a case. + # + # The comment must have the following fields set: `body`. + rpc :CreateComment, ::Google::Cloud::Support::V2::CreateCommentRequest, ::Google::Cloud::Support::V2::Comment + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/escalation_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/escalation_pb.rb new file mode 100644 index 000000000000..9cb0c3ecaff6 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/escalation_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2/escalation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n(google/cloud/support/v2/escalation.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\"\xce\x01\n\nEscalation\x12?\n\x06reason\x18\x04 \x01(\x0e\x32*.google.cloud.support.v2.Escalation.ReasonB\x03\xe0\x41\x02\x12\x1a\n\rjustification\x18\x05 \x01(\tB\x03\xe0\x41\x02\"c\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x13\n\x0fRESOLUTION_TIME\x10\x01\x12\x17\n\x13TECHNICAL_EXPERTISE\x10\x02\x12\x13\n\x0f\x42USINESS_IMPACT\x10\x03\x42\xb8\x01\n\x1b\x63om.google.cloud.support.v2B\x0f\x45scalationProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2 + Escalation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Escalation").msgclass + Escalation::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Escalation.Reason").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/version.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/version.rb new file mode 100644 index 000000000000..770b6ddbfa98 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/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 Support + module V2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-support-v2/proto_docs/README.md new file mode 100644 index 000000000000..f0b44daa43c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Google Cloud Support 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-support-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/cloud/support/v2/actor.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/actor.rb new file mode 100644 index 000000000000..060fa58e361b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/actor.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! + + +module Google + module Cloud + module Support + module V2 + # An Actor represents an entity that performed an action. For example, an actor + # could be a user who posted a comment on a support case, a user who + # uploaded an attachment, or a service account that created a support case. + # @!attribute [rw] display_name + # @return [::String] + # The name to display for the actor. If not provided, it is inferred from + # credentials supplied during case creation. When an email is provided, a + # display name must also be provided. This will be obfuscated if the user + # is a Google Support agent. + # @!attribute [rw] email + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # The email address of the actor. If not provided, it is inferred from the + # credentials supplied during case creation. When a name is provided, an + # email must also be provided. If the user is a Google Support agent, this is + # obfuscated. + # + # This field is deprecated. Use `username` instead. + # @!attribute [r] google_support + # @return [::Boolean] + # Output only. Whether the actor is a Google support actor. + # @!attribute [r] username + # @return [::String] + # Output only. The username of the actor. It may look like an email or other + # format provided by the identity provider. If not provided, it is inferred + # from the credentials supplied. When a name is provided, a username must + # also be provided. If the user is a Google Support agent, this will not be + # set. + class Actor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment.rb new file mode 100644 index 000000000000..3c5c4b415a91 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2 + # An Attachment contains metadata about a file that was uploaded to a + # case - it is NOT a file itself. That being said, the name of an Attachment + # object can be used to download its accompanying file through the + # `media.download` endpoint. + # + # While attachments can be uploaded in the console at the + # same time as a comment, they're associated on a "case" level, not a + # "comment" level. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the attachment. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the attachment was created. + # @!attribute [r] creator + # @return [::Google::Cloud::Support::V2::Actor] + # Output only. The user who uploaded the attachment. Note, the name and email + # will be obfuscated if the attachment was uploaded by Google support. + # @!attribute [rw] filename + # @return [::String] + # The filename of the attachment (e.g. `"graph.jpg"`). + # @!attribute [r] mime_type + # @return [::String] + # Output only. The MIME type of the attachment (e.g. text/plain). + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. The size of the attachment in bytes. + class Attachment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment_service.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment_service.rb new file mode 100644 index 000000000000..f9b6c90d997d --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment_service.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 Support + module V2 + # The request message for the ListAttachments endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the case for which attachments should be listed. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of attachments fetched with each request. + # + # If not provided, the default is 10. The maximum page size that will be + # returned is 100. + # + # The size of each page can be smaller than the requested page size and can + # include zero. For example, you could request 100 attachments on one page, + # receive 0, and then on the next page, receive 90. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + class ListAttachmentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for the ListAttachments endpoint. + # @!attribute [rw] attachments + # @return [::Array<::Google::Cloud::Support::V2::Attachment>] + # The list of attachments associated with a case. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the `page_token` + # field of subsequent `cases.attachments.list` requests. If unspecified, + # there are no more results to retrieve. + class ListAttachmentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case.rb new file mode 100644 index 000000000000..28de7f2b7bb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case.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 Support + module V2 + # A Case is an object that contains the details of a support case. It + # contains fields for the time it was created, its priority, its + # classification, and more. Cases can also have comments and attachments that + # get added over time. + # + # A case is parented by a Google Cloud organization or project. + # + # Organizations are identified by a number, so the name of a case parented by + # an organization would look like this: + # + # ``` + # organizations/123/cases/456 + # ``` + # + # Projects have two unique identifiers, an ID and a number, and they look like + # this: + # + # ``` + # projects/abc/cases/456 + # ``` + # + # ``` + # projects/123/cases/456 + # ``` + # + # You can use either of them when calling the API. To learn more + # about project identifiers, see [AIP-2510](https://google.aip.dev/cloud/2510). + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for the case. + # @!attribute [rw] display_name + # @return [::String] + # The short summary of the issue reported in this case. + # @!attribute [rw] description + # @return [::String] + # A broad description of the issue. + # @!attribute [rw] classification + # @return [::Google::Cloud::Support::V2::CaseClassification] + # The issue classification applicable to this case. + # @!attribute [rw] time_zone + # @return [::String] + # The timezone of the user who created the support case. + # It should be in a format IANA recognizes: https://www.iana.org/time-zones. + # There is no additional validation done by the API. + # @!attribute [rw] subscriber_email_addresses + # @return [::Array<::String>] + # The email addresses to receive updates on this case. + # @!attribute [r] state + # @return [::Google::Cloud::Support::V2::Case::State] + # Output only. The current status of the support case. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this case was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this case was last updated. + # @!attribute [rw] creator + # @return [::Google::Cloud::Support::V2::Actor] + # The user who created the case. + # + # Note: The name and email will be obfuscated if the case was created by + # Google Support. + # @!attribute [rw] contact_email + # @return [::String] + # A user-supplied email address to send case update notifications for. This + # should only be used in BYOID flows, where we cannot infer the user's email + # address directly from their EUCs. + # @!attribute [rw] escalated + # @return [::Boolean] + # Whether the case is currently escalated. + # @!attribute [rw] test_case + # @return [::Boolean] + # Whether this case was created for internal API testing and should not be + # acted on by the support team. + # @!attribute [rw] language_code + # @return [::String] + # The language the user has requested to receive support in. This should be a + # BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). + # If no language or an unsupported language is specified, this field defaults + # to English (en). + # + # Language selection during case creation may affect your available support + # options. For a list of supported languages and their support working hours, + # see: https://cloud.google.com/support/docs/language-working-hours + # @!attribute [rw] priority + # @return [::Google::Cloud::Support::V2::Case::Priority] + # The priority of this case. + class Case + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of a support case. + module State + # Case is in an unknown state. + STATE_UNSPECIFIED = 0 + + # The case has been created but no one is assigned to work on it yet. + NEW = 1 + + # The case is currently being handled by Google support. + IN_PROGRESS_GOOGLE_SUPPORT = 2 + + # Google is waiting for a response. + ACTION_REQUIRED = 3 + + # A solution has been offered for the case, but it isn't yet closed. + SOLUTION_PROVIDED = 4 + + # The case has been resolved. + CLOSED = 5 + end + + # The case Priority. P0 is most urgent and P4 the least. + module Priority + # Priority is undefined or has not been set yet. + PRIORITY_UNSPECIFIED = 0 + + # Extreme impact on a production service. Service is hard down. + P0 = 1 + + # Critical impact on a production service. Service is currently unusable. + P1 = 2 + + # Severe impact on a production service. Service is usable but greatly + # impaired. + P2 = 3 + + # Medium impact on a production service. Service is available, but + # moderately impaired. + P3 = 4 + + # General questions or minor issues. Production service is fully + # available. + P4 = 5 + end + end + + # A Case Classification represents the topic that a case is about. It's very + # important to use accurate classifications, because they're + # used to route your cases to specialists who can help you. + # + # A classification always has an ID that is its unique identifier. + # A valid ID is required when creating a case. + # @!attribute [rw] id + # @return [::String] + # The unique ID for a classification. Must be specified for case creation. + # + # To retrieve valid classification IDs for case creation, use + # `caseClassifications.search`. + # + # Classification IDs returned by `caseClassifications.search` are guaranteed + # to be valid for at least 6 months. If a given classification is + # deactiveated, it will immediately stop being returned. After 6 months, + # `case.create` requests using the classification ID will fail. + # @!attribute [rw] display_name + # @return [::String] + # A display name for the classification. + # + # The display name is not static and can change. To uniquely and consistently + # identify classifications, use the `CaseClassification.id` field. + class CaseClassification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case_service.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case_service.rb new file mode 100644 index 000000000000..cbca116de661 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case_service.rb @@ -0,0 +1,238 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2 + # The request message for the GetCase endpoint. + # @!attribute [rw] name + # @return [::String] + # Required. The full name of a case to be retrieved. + class GetCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the CreateCase endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent under which the case should be created. + # @!attribute [rw] case + # @return [::Google::Cloud::Support::V2::Case] + # Required. The case to be created. + class CreateCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the ListCases endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of a parent to list cases under. + # @!attribute [rw] filter + # @return [::String] + # An expression used to filter cases. + # + # If it's an empty string, then no filtering happens. Otherwise, the endpoint + # returns the cases that match the filter. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # EXAMPLES: + # + # - `state=CLOSED` + # - `state=OPEN AND creator.email="tester@example.com"` + # - `state=OPEN AND (priority=P0 OR priority=P1)` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of cases fetched with each request. Defaults to 10. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + class ListCasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for the ListCases endpoint. + # @!attribute [rw] cases + # @return [::Array<::Google::Cloud::Support::V2::Case>] + # The list of cases associated with the parent after any + # filters have been applied. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the `page_token` + # field of subsequent `cases.list` requests. If unspecified, there are no + # more results to retrieve. + class ListCasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the SearchCases endpoint. + # @!attribute [rw] parent + # @return [::String] + # The name of the parent resource to search for cases under. + # @!attribute [rw] query + # @return [::String] + # An expression used to filter cases. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `organization`: An organization name in the form + # `organizations/`. + # - `project`: A project name in the form `projects/`. + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # You must specify either `organization` or `project`. + # + # To search across `displayName`, `description`, and comments, use a global + # restriction with no keyword or operator. For example, `"my search"`. + # + # To search only cases updated after a certain date, use `update_time` + # restricted with that particular date, time, and timezone in ISO datetime + # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + # `update_time` only supports the greater than operator (`>`). + # + # Examples: + # + # - `organization="organizations/123456789"` + # - `project="projects/my-project-id"` + # - `project="projects/123456789"` + # - `organization="organizations/123456789" AND state=CLOSED` + # - `project="projects/my-project-id" AND creator.email="tester@example.com"` + # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of cases fetched with each request. The default page + # size is 10. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + class SearchCasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for the SearchCases endpoint. + # @!attribute [rw] cases + # @return [::Array<::Google::Cloud::Support::V2::Case>] + # The list of cases associated with the parent after any + # filters have been applied. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the + # `page_token` field of subsequent `cases.search` requests. If unspecified, + # there are no more results to retrieve. + class SearchCasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the EscalateCase endpoint. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the case to be escalated. + # @!attribute [rw] escalation + # @return [::Google::Cloud::Support::V2::Escalation] + # The escalation information to be sent with the escalation request. + class EscalateCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the UpdateCase endpoint + # @!attribute [rw] case + # @return [::Google::Cloud::Support::V2::Case] + # Required. The case to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A list of attributes of the case that should be updated. Supported values + # are `priority`, `display_name`, and `subscriber_email_addresses`. If no + # fields are specified, all supported fields are updated. + # + # Be careful - if you do not provide a field mask, then you might + # accidentally clear some fields. For example, if you leave the field mask + # empty and do not provide a value for `subscriber_email_addresses`, then + # `subscriber_email_addresses` is updated to empty. + class UpdateCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the CloseCase endpoint. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the case to close. + class CloseCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the SearchCaseClassifications endpoint. + # @!attribute [rw] query + # @return [::String] + # An expression used to filter case classifications. + # + # If it's an empty string, then no filtering happens. Otherwise, case + # classifications will be returned that match the filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of classifications fetched with each request. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + class SearchCaseClassificationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for SearchCaseClassifications endpoint. + # @!attribute [rw] case_classifications + # @return [::Array<::Google::Cloud::Support::V2::CaseClassification>] + # The classifications retrieved. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the `page_token` + # field of subsequent `caseClassifications.list` requests. If unspecified, + # there are no more results to retrieve. + class SearchCaseClassificationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment.rb new file mode 100644 index 000000000000..13196465f608 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2 + # A comment associated with a support case. + # + # Case comments are the primary way for Google Support to communicate with a + # user who has opened a case. When a user responds to Google Support, the + # user's responses also appear as comments. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the comment. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the comment was created. + # @!attribute [r] creator + # @return [::Google::Cloud::Support::V2::Actor] + # Output only. The user or Google Support agent who created the comment. + # @!attribute [rw] body + # @return [::String] + # The full comment body. + # + # Maximum of 12800 characters. + # @!attribute [r] plain_text_body + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Output only. DEPRECATED. DO NOT USE. + # + # A duplicate of the `body` field. + # + # This field is only present for legacy reasons. + class Comment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment_service.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment_service.rb new file mode 100644 index 000000000000..4c60007a828b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment_service.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2 + # The request message for the ListComments endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the case for which to list comments. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of comments to fetch. Defaults to 10. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is returned. + class ListCommentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for the ListComments endpoint. + # @!attribute [rw] comments + # @return [::Array<::Google::Cloud::Support::V2::Comment>] + # List of the comments associated with the case. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the `page_token` + # field of subsequent `cases.comments.list` requests. If unspecified, there + # are no more results to retrieve. + class ListCommentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the CreateComment endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the case to which the comment should be added. + # @!attribute [rw] comment + # @return [::Google::Cloud::Support::V2::Comment] + # Required. The comment to be added. + class CreateCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/escalation.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/escalation.rb new file mode 100644 index 000000000000..58f5e6bef053 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/escalation.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2 + # An escalation of a support case. + # @!attribute [rw] reason + # @return [::Google::Cloud::Support::V2::Escalation::Reason] + # Required. The reason why the Case is being escalated. + # @!attribute [rw] justification + # @return [::String] + # Required. A free text description to accompany the `reason` field above. + # Provides additional context on why the case is being escalated. + class Escalation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enum detailing the possible reasons a case may be escalated. + module Reason + # The escalation reason is in an unknown state or has not been specified. + REASON_UNSPECIFIED = 0 + + # The case is taking too long to resolve. + RESOLUTION_TIME = 1 + + # The support agent does not have the expertise required to successfully + # resolve the issue. + TECHNICAL_EXPERTISE = 2 + + # The issue is having a significant business impact. + BUSINESS_IMPACT = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-support-v2/snippets/Gemfile new file mode 100644 index 000000000000..92a51fab661b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-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-support-v2", path: "../" +else + gem "google-cloud-support-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-support-v2/snippets/case_attachment_service/list_attachments.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_attachment_service/list_attachments.rb new file mode 100644 index 000000000000..e1c0245885c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/case_attachment_service/list_attachments.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 cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_sync] +require "google/cloud/support/v2" + +## +# Snippet for the list_attachments call in the CaseAttachmentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CaseAttachmentService::Client#list_attachments. +# +def list_attachments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CaseAttachmentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::ListAttachmentsRequest.new + + # Call the list_attachments method. + result = client.list_attachments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2::Attachment. + p item + end +end +# [END cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/close_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/close_case.rb new file mode 100644 index 000000000000..ae0b3bf209b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/close_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2_generated_CaseService_CloseCase_sync] +require "google/cloud/support/v2" + +## +# Snippet for the close_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CaseService::Client#close_case. +# +def close_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::CloseCaseRequest.new + + # Call the close_case method. + result = client.close_case request + + # The returned object is of type Google::Cloud::Support::V2::Case. + p result +end +# [END cloudsupport_v2_generated_CaseService_CloseCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/create_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/create_case.rb new file mode 100644 index 000000000000..baf321e8aa51 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/create_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2_generated_CaseService_CreateCase_sync] +require "google/cloud/support/v2" + +## +# Snippet for the create_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CaseService::Client#create_case. +# +def create_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::CreateCaseRequest.new + + # Call the create_case method. + result = client.create_case request + + # The returned object is of type Google::Cloud::Support::V2::Case. + p result +end +# [END cloudsupport_v2_generated_CaseService_CreateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/escalate_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/escalate_case.rb new file mode 100644 index 000000000000..1bc21d02b003 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/escalate_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2_generated_CaseService_EscalateCase_sync] +require "google/cloud/support/v2" + +## +# Snippet for the escalate_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CaseService::Client#escalate_case. +# +def escalate_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::EscalateCaseRequest.new + + # Call the escalate_case method. + result = client.escalate_case request + + # The returned object is of type Google::Cloud::Support::V2::Case. + p result +end +# [END cloudsupport_v2_generated_CaseService_EscalateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/get_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/get_case.rb new file mode 100644 index 000000000000..54ec20712e4d --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/get_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2_generated_CaseService_GetCase_sync] +require "google/cloud/support/v2" + +## +# Snippet for the get_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CaseService::Client#get_case. +# +def get_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::GetCaseRequest.new + + # Call the get_case method. + result = client.get_case request + + # The returned object is of type Google::Cloud::Support::V2::Case. + p result +end +# [END cloudsupport_v2_generated_CaseService_GetCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/list_cases.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/list_cases.rb new file mode 100644 index 000000000000..7bb33c377b63 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/list_cases.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 cloudsupport_v2_generated_CaseService_ListCases_sync] +require "google/cloud/support/v2" + +## +# Snippet for the list_cases call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CaseService::Client#list_cases. +# +def list_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::ListCasesRequest.new + + # Call the list_cases method. + result = client.list_cases request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2::Case. + p item + end +end +# [END cloudsupport_v2_generated_CaseService_ListCases_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_case_classifications.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_case_classifications.rb new file mode 100644 index 000000000000..d8efef380e35 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_case_classifications.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 cloudsupport_v2_generated_CaseService_SearchCaseClassifications_sync] +require "google/cloud/support/v2" + +## +# Snippet for the search_case_classifications call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CaseService::Client#search_case_classifications. +# +def search_case_classifications + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new + + # Call the search_case_classifications method. + result = client.search_case_classifications request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2::CaseClassification. + p item + end +end +# [END cloudsupport_v2_generated_CaseService_SearchCaseClassifications_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_cases.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_cases.rb new file mode 100644 index 000000000000..48a49399a4d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_cases.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 cloudsupport_v2_generated_CaseService_SearchCases_sync] +require "google/cloud/support/v2" + +## +# Snippet for the search_cases call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CaseService::Client#search_cases. +# +def search_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::SearchCasesRequest.new + + # Call the search_cases method. + result = client.search_cases request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2::Case. + p item + end +end +# [END cloudsupport_v2_generated_CaseService_SearchCases_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/update_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/update_case.rb new file mode 100644 index 000000000000..e7add57657b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/update_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2_generated_CaseService_UpdateCase_sync] +require "google/cloud/support/v2" + +## +# Snippet for the update_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CaseService::Client#update_case. +# +def update_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::UpdateCaseRequest.new + + # Call the update_case method. + result = client.update_case request + + # The returned object is of type Google::Cloud::Support::V2::Case. + p result +end +# [END cloudsupport_v2_generated_CaseService_UpdateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/create_comment.rb b/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/create_comment.rb new file mode 100644 index 000000000000..1638273dd227 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/create_comment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2_generated_CommentService_CreateComment_sync] +require "google/cloud/support/v2" + +## +# Snippet for the create_comment call in the CommentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CommentService::Client#create_comment. +# +def create_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CommentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::CreateCommentRequest.new + + # Call the create_comment method. + result = client.create_comment request + + # The returned object is of type Google::Cloud::Support::V2::Comment. + p result +end +# [END cloudsupport_v2_generated_CommentService_CreateComment_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/list_comments.rb b/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/list_comments.rb new file mode 100644 index 000000000000..6d0c3cd56994 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/list_comments.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2_generated_CommentService_ListComments_sync] +require "google/cloud/support/v2" + +## +# Snippet for the list_comments call in the CommentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2::CommentService::Client#list_comments. +# +def list_comments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2::CommentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2::ListCommentsRequest.new + + # Call the list_comments method. + result = client.list_comments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2::Comment. + p item + end +end +# [END cloudsupport_v2_generated_CommentService_ListComments_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/snippet_metadata_google.cloud.support.v2.json b/owl-bot-staging/google-cloud-support-v2/snippets/snippet_metadata_google.cloud.support.v2.json new file mode 100644 index 000000000000..59cd6bfc8a14 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/snippets/snippet_metadata_google.cloud.support.v2.json @@ -0,0 +1,455 @@ +{ + "client_library": { + "name": "google-cloud-support-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.support.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_sync", + "title": "Snippet for the list_attachments call in the CaseAttachmentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseAttachmentService::Client#list_attachments.", + "file": "case_attachment_service/list_attachments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_attachments", + "full_name": "::Google::Cloud::Support::V2::CaseAttachmentService::Client#list_attachments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::ListAttachmentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::ListAttachmentsResponse", + "client": { + "short_name": "CaseAttachmentService::Client", + "full_name": "::Google::Cloud::Support::V2::CaseAttachmentService::Client" + }, + "method": { + "short_name": "ListAttachments", + "full_name": "google.cloud.support.v2.CaseAttachmentService.ListAttachments", + "service": { + "short_name": "CaseAttachmentService", + "full_name": "google.cloud.support.v2.CaseAttachmentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CaseService_GetCase_sync", + "title": "Snippet for the get_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#get_case.", + "file": "case_service/get_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_case", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client#get_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::GetCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client" + }, + "method": { + "short_name": "GetCase", + "full_name": "google.cloud.support.v2.CaseService.GetCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CaseService_ListCases_sync", + "title": "Snippet for the list_cases call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#list_cases.", + "file": "case_service/list_cases.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_cases", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client#list_cases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::ListCasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::ListCasesResponse", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client" + }, + "method": { + "short_name": "ListCases", + "full_name": "google.cloud.support.v2.CaseService.ListCases", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CaseService_SearchCases_sync", + "title": "Snippet for the search_cases call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#search_cases.", + "file": "case_service/search_cases.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_cases", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client#search_cases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::SearchCasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::SearchCasesResponse", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client" + }, + "method": { + "short_name": "SearchCases", + "full_name": "google.cloud.support.v2.CaseService.SearchCases", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CaseService_CreateCase_sync", + "title": "Snippet for the create_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#create_case.", + "file": "case_service/create_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_case", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client#create_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::CreateCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client" + }, + "method": { + "short_name": "CreateCase", + "full_name": "google.cloud.support.v2.CaseService.CreateCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CaseService_UpdateCase_sync", + "title": "Snippet for the update_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#update_case.", + "file": "case_service/update_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_case", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client#update_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::UpdateCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client" + }, + "method": { + "short_name": "UpdateCase", + "full_name": "google.cloud.support.v2.CaseService.UpdateCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CaseService_EscalateCase_sync", + "title": "Snippet for the escalate_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#escalate_case.", + "file": "case_service/escalate_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "escalate_case", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client#escalate_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::EscalateCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client" + }, + "method": { + "short_name": "EscalateCase", + "full_name": "google.cloud.support.v2.CaseService.EscalateCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CaseService_CloseCase_sync", + "title": "Snippet for the close_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#close_case.", + "file": "case_service/close_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "close_case", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client#close_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::CloseCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client" + }, + "method": { + "short_name": "CloseCase", + "full_name": "google.cloud.support.v2.CaseService.CloseCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CaseService_SearchCaseClassifications_sync", + "title": "Snippet for the search_case_classifications call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#search_case_classifications.", + "file": "case_service/search_case_classifications.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_case_classifications", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client#search_case_classifications", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::SearchCaseClassificationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::SearchCaseClassificationsResponse", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2::CaseService::Client" + }, + "method": { + "short_name": "SearchCaseClassifications", + "full_name": "google.cloud.support.v2.CaseService.SearchCaseClassifications", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CommentService_ListComments_sync", + "title": "Snippet for the list_comments call in the CommentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CommentService::Client#list_comments.", + "file": "comment_service/list_comments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_comments", + "full_name": "::Google::Cloud::Support::V2::CommentService::Client#list_comments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::ListCommentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::ListCommentsResponse", + "client": { + "short_name": "CommentService::Client", + "full_name": "::Google::Cloud::Support::V2::CommentService::Client" + }, + "method": { + "short_name": "ListComments", + "full_name": "google.cloud.support.v2.CommentService.ListComments", + "service": { + "short_name": "CommentService", + "full_name": "google.cloud.support.v2.CommentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2_generated_CommentService_CreateComment_sync", + "title": "Snippet for the create_comment call in the CommentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CommentService::Client#create_comment.", + "file": "comment_service/create_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_comment", + "full_name": "::Google::Cloud::Support::V2::CommentService::Client#create_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2::CreateCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2::Comment", + "client": { + "short_name": "CommentService::Client", + "full_name": "::Google::Cloud::Support::V2::CommentService::Client" + }, + "method": { + "short_name": "CreateComment", + "full_name": "google.cloud.support.v2.CommentService.CreateComment", + "service": { + "short_name": "CommentService", + "full_name": "google.cloud.support.v2.CommentService" + } + } + }, + "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-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb new file mode 100644 index 000000000000..cd9ca5b77a48 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2/case_attachment_service" + +class ::Google::Cloud::Support::V2::CaseAttachmentService::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_case_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.case_path organization: "value0", case: "value1" + assert_equal "organizations/value0/cases/value1", path + + path = client.case_path project: "value0", case: "value1" + assert_equal "projects/value0/cases/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb new file mode 100644 index 000000000000..440b94b3230a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_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/cloud/support/v2/attachment_service_pb" +require "google/cloud/support/v2/case_attachment_service" + +class ::Google::Cloud::Support::V2::CaseAttachmentService::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_attachments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::ListAttachmentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_attachments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_attachments, name + assert_kind_of ::Google::Cloud::Support::V2::ListAttachmentsRequest, 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_attachments_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_attachments({ parent: parent, page_size: page_size, page_token: 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_attachments parent: parent, page_size: page_size, page_token: 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_attachments ::Google::Cloud::Support::V2::ListAttachmentsRequest.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_attachments({ parent: parent, page_size: page_size, page_token: page_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_attachments(::Google::Cloud::Support::V2::ListAttachmentsRequest.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_attachments_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2::CaseAttachmentService::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::Support::V2::CaseAttachmentService::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::Support::V2::CaseAttachmentService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Support::V2::CaseAttachmentService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb new file mode 100644 index 000000000000..026b2a358c1c --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2/case_service" + +class ::Google::Cloud::Support::V2::CaseService::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_case_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.case_path organization: "value0", case: "value1" + assert_equal "organizations/value0/cases/value1", path + + path = client.case_path project: "value0", case: "value1" + assert_equal "projects/value0/cases/value1", path + end + end + + def test_organization_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_path organization: "value0" + assert_equal "organizations/value0", 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::Support::V2::CaseService::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-support-v2/test/google/cloud/support/v2/case_service_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb new file mode 100644 index 000000000000..9535315ce943 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb @@ -0,0 +1,605 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2/case_service_pb" +require "google/cloud/support/v2/case_service" + +class ::Google::Cloud::Support::V2::CaseService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_case, name + assert_kind_of ::Google::Cloud::Support::V2::GetCaseRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_case({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_case name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_case ::Google::Cloud::Support::V2::GetCaseRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_case({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_case(::Google::Cloud::Support::V2::GetCaseRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_case_client_stub.call_rpc_count + end + end + + def test_list_cases + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::ListCasesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_cases, name + assert_kind_of ::Google::Cloud::Support::V2::ListCasesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_cases_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_cases({ parent: parent, 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.list_cases parent: parent, 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.list_cases ::Google::Cloud::Support::V2::ListCasesRequest.new(parent: parent, 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.list_cases({ parent: parent, 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.list_cases(::Google::Cloud::Support::V2::ListCasesRequest.new(parent: parent, 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, list_cases_client_stub.call_rpc_count + end + end + + def test_search_cases + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::SearchCasesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_cases, name + assert_kind_of ::Google::Cloud::Support::V2::SearchCasesRequest, request + assert_equal "hello world", request["parent"] + 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_cases_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_cases({ parent: parent, 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_cases parent: parent, 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_cases ::Google::Cloud::Support::V2::SearchCasesRequest.new(parent: parent, 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_cases({ parent: parent, 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_cases(::Google::Cloud::Support::V2::SearchCasesRequest.new(parent: parent, 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_cases_client_stub.call_rpc_count + end + end + + def test_create_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + case_param = {} + + create_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_case, name + assert_kind_of ::Google::Cloud::Support::V2::CreateCaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2::Case), request["case"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_case({ parent: parent, case: case_param }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_case parent: parent, case: case_param do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_case ::Google::Cloud::Support::V2::CreateCaseRequest.new(parent: parent, case: case_param) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_case({ parent: parent, case: case_param }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_case(::Google::Cloud::Support::V2::CreateCaseRequest.new(parent: parent, case: case_param), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_case_client_stub.call_rpc_count + end + end + + def test_update_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + case_param = {} + update_mask = {} + + update_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_case, name + assert_kind_of ::Google::Cloud::Support::V2::UpdateCaseRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2::Case), request["case"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_case({ case: case_param, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_case case: case_param, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_case ::Google::Cloud::Support::V2::UpdateCaseRequest.new(case: case_param, 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_case({ case: case_param, 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_case(::Google::Cloud::Support::V2::UpdateCaseRequest.new(case: case_param, 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_case_client_stub.call_rpc_count + end + end + + def test_escalate_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + escalation = {} + + escalate_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :escalate_case, name + assert_kind_of ::Google::Cloud::Support::V2::EscalateCaseRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2::Escalation), request["escalation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, escalate_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.escalate_case({ name: name, escalation: escalation }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.escalate_case name: name, escalation: escalation do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.escalate_case ::Google::Cloud::Support::V2::EscalateCaseRequest.new(name: name, escalation: escalation) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.escalate_case({ name: name, escalation: escalation }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.escalate_case(::Google::Cloud::Support::V2::EscalateCaseRequest.new(name: name, escalation: escalation), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, escalate_case_client_stub.call_rpc_count + end + end + + def test_close_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + close_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :close_case, name + assert_kind_of ::Google::Cloud::Support::V2::CloseCaseRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, close_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.close_case({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.close_case name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.close_case ::Google::Cloud::Support::V2::CloseCaseRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.close_case({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.close_case(::Google::Cloud::Support::V2::CloseCaseRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, close_case_client_stub.call_rpc_count + end + end + + def test_search_case_classifications + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::SearchCaseClassificationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_case_classifications_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_case_classifications, name + assert_kind_of ::Google::Cloud::Support::V2::SearchCaseClassificationsRequest, request + 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_case_classifications_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_case_classifications({ 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_case_classifications 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_case_classifications ::Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new(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_case_classifications({ 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_case_classifications(::Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new(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_case_classifications_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2::CaseService::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::Support::V2::CaseService::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::Support::V2::CaseService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Support::V2::CaseService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb new file mode 100644 index 000000000000..450f7d03ec69 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2/comment_service" + +class ::Google::Cloud::Support::V2::CommentService::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_case_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.case_path organization: "value0", case: "value1" + assert_equal "organizations/value0/cases/value1", path + + path = client.case_path project: "value0", case: "value1" + assert_equal "projects/value0/cases/value1", path + end + end + + def test_comment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.comment_path organization: "value0", case: "value1", comment: "value2" + assert_equal "organizations/value0/cases/value1/comments/value2", path + + path = client.comment_path project: "value0", case: "value1", comment: "value2" + assert_equal "projects/value0/cases/value1/comments/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb new file mode 100644 index 000000000000..9be457b5eb11 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2/comment_service_pb" +require "google/cloud/support/v2/comment_service" + +class ::Google::Cloud::Support::V2::CommentService::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_comments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::ListCommentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_comments, name + assert_kind_of ::Google::Cloud::Support::V2::ListCommentsRequest, 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_comments_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_comments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_comments parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_comments ::Google::Cloud::Support::V2::ListCommentsRequest.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_comments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_comments(::Google::Cloud::Support::V2::ListCommentsRequest.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_comments_client_stub.call_rpc_count + end + end + + def test_create_comment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2::Comment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + comment = {} + + create_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_comment, name + assert_kind_of ::Google::Cloud::Support::V2::CreateCommentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2::Comment), request["comment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_comment_client_stub do + # Create client + client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_comment({ parent: parent, comment: comment }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_comment parent: parent, comment: comment do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_comment ::Google::Cloud::Support::V2::CreateCommentRequest.new(parent: parent, comment: comment) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_comment({ parent: parent, comment: comment }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_comment(::Google::Cloud::Support::V2::CreateCommentRequest.new(parent: parent, comment: comment), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_comment_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Support::V2::CommentService::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::Support::V2::CommentService::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::Support::V2::CommentService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Support::V2::CommentService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2/test/helper.rb b/owl-bot-staging/google-cloud-support-v2/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-support-v2beta/.gitignore b/owl-bot-staging/google-cloud-support-v2beta/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/.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-support-v2beta/.repo-metadata.json b/owl-bot-staging/google-cloud-support-v2beta/.repo-metadata.json new file mode 100644 index 000000000000..0f3f042ac11a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "cloudsupport.googleapis.com", + "api_shortname": "cloudsupport", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest", + "distribution_name": "google-cloud-support-v2beta", + "is_cloud": true, + "language": "ruby", + "name": "cloudsupport", + "name_pretty": "Google Cloud Support V2BETA API", + "product_documentation": "https://cloud.google.com/support/docs/reference/support-api", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Manages Google Cloud technical support cases for Customer Care support offerings. Note that google-cloud-support-v2beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-support instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/support/docs/reference/support-api", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-support-v2beta/.rubocop.yml b/owl-bot-staging/google-cloud-support-v2beta/.rubocop.yml new file mode 100644 index 000000000000..d73c43a5cd40 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-support-v2beta.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-support-v2beta.rb" diff --git a/owl-bot-staging/google-cloud-support-v2beta/.toys.rb b/owl-bot-staging/google-cloud-support-v2beta/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/.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-support-v2beta/.yardopts b/owl-bot-staging/google-cloud-support-v2beta/.yardopts new file mode 100644 index 000000000000..1fedee129067 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Google Cloud Support V2BETA 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-support-v2beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-support-v2beta/AUTHENTICATION.md new file mode 100644 index 000000000000..770c4a0708c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-support-v2beta 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-support-v2beta 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/support/v2beta" + +client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/support/v2beta" + +::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::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-support-v2beta +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/support/v2beta" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::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-support-v2beta/CHANGELOG.md b/owl-bot-staging/google-cloud-support-v2beta/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-support-v2beta/Gemfile b/owl-bot-staging/google-cloud-support-v2beta/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-support-v2beta/LICENSE.md b/owl-bot-staging/google-cloud-support-v2beta/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/README.md b/owl-bot-staging/google-cloud-support-v2beta/README.md new file mode 100644 index 000000000000..3df8b2fc0c45 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Google Cloud Support V2BETA API + +Manages Google Cloud technical support cases for Customer Care support offerings. + +Manages Google Cloud technical support cases for Customer Care support offerings. + +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 Support V2BETA API. Most users should consider using +the main client gem, +[google-cloud-support](https://rubygems.org/gems/google-cloud-support). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-support-v2beta +``` + +## 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/cloudsupport.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/support/v2beta" + +client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new +request = ::Google::Cloud::Support::V2beta::ListAttachmentsRequest.new # (request fields as keyword arguments...) +response = client.list_attachments request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/support/docs/reference/support-api) +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/support/v2beta" +require "logger" + +client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::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-support`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-support-v2beta`. +_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-support`. +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-support-v2beta`. + +### 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-support-v2beta/Rakefile b/owl-bot-staging/google-cloud-support-v2beta/Rakefile new file mode 100644 index 000000000000..1b495941debf --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta 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/support/v2beta/case_attachment_service/credentials" + ::Google::Cloud::Support::V2beta::CaseAttachmentService::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-support-v2beta 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-support-v2beta 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-support-v2beta 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-support-v2beta gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-support-v2beta" + header "google-cloud-support-v2beta rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-support-v2beta yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-support-v2beta 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-support-v2beta 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-support-v2beta 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-support-v2beta/gapic_metadata.json b/owl-bot-staging/google-cloud-support-v2beta/gapic_metadata.json new file mode 100644 index 000000000000..f0433f8ac593 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/gapic_metadata.json @@ -0,0 +1,115 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.support.v2beta", + "libraryPackage": "::Google::Cloud::Support::V2beta", + "services": { + "CaseAttachmentService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client", + "rpcs": { + "ListAttachments": { + "methods": [ + "list_attachments" + ] + }, + "GetAttachment": { + "methods": [ + "get_attachment" + ] + } + } + } + } + }, + "CaseService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Support::V2beta::CaseService::Client", + "rpcs": { + "GetCase": { + "methods": [ + "get_case" + ] + }, + "ListCases": { + "methods": [ + "list_cases" + ] + }, + "SearchCases": { + "methods": [ + "search_cases" + ] + }, + "CreateCase": { + "methods": [ + "create_case" + ] + }, + "UpdateCase": { + "methods": [ + "update_case" + ] + }, + "EscalateCase": { + "methods": [ + "escalate_case" + ] + }, + "CloseCase": { + "methods": [ + "close_case" + ] + }, + "SearchCaseClassifications": { + "methods": [ + "search_case_classifications" + ] + } + } + } + } + }, + "CommentService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Support::V2beta::CommentService::Client", + "rpcs": { + "ListComments": { + "methods": [ + "list_comments" + ] + }, + "CreateComment": { + "methods": [ + "create_comment" + ] + }, + "GetComment": { + "methods": [ + "get_comment" + ] + } + } + } + } + }, + "FeedService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Support::V2beta::FeedService::Client", + "rpcs": { + "ShowFeed": { + "methods": [ + "show_feed" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support-v2beta/google-cloud-support-v2beta.gemspec b/owl-bot-staging/google-cloud-support-v2beta/google-cloud-support-v2beta.gemspec new file mode 100644 index 000000000000..ecf5b134ae69 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/google-cloud-support-v2beta.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/support/v2beta/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-support-v2beta" + gem.version = Google::Cloud::Support::V2beta::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Manages Google Cloud technical support cases for Customer Care support offerings. Note that google-cloud-support-v2beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-support instead. See the readme for more details." + gem.summary = "Manages Google Cloud technical support cases for Customer Care support offerings." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google-cloud-support-v2beta.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google-cloud-support-v2beta.rb new file mode 100644 index 000000000000..c57d878c0330 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google-cloud-support-v2beta.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/support/v2beta" diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta.rb new file mode 100644 index 000000000000..ee84d3390c47 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta.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/support/v2beta/case_attachment_service" +require "google/cloud/support/v2beta/case_service" +require "google/cloud/support/v2beta/comment_service" +require "google/cloud/support/v2beta/feed_service" +require "google/cloud/support/v2beta/version" + +module Google + module Cloud + module Support + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/support/v2beta" + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/support/v2beta" + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new + # + module V2beta + end + end + end +end + +helper_path = ::File.join __dir__, "v2beta", "_helpers.rb" +require "google/cloud/support/v2beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/actor_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/actor_pb.rb new file mode 100644 index 000000000000..fc1549e39390 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/actor_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/actor.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n\'google/cloud/support/v2beta/actor.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\"d\n\x05\x41\x63tor\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x11\n\x05\x65mail\x18\x02 \x01(\tB\x02\x18\x01\x12\x1b\n\x0egoogle_support\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12\x15\n\x08username\x18\x05 \x01(\tB\x03\xe0\x41\x03\x42\xc7\x01\n\x1f\x63om.google.cloud.support.v2betaB\nActorProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + Actor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Actor").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_pb.rb new file mode 100644 index 000000000000..187e268326bf --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/attachment.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/support/v2beta/actor_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/support/v2beta/attachment.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x88\x03\n\nAttachment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x07\x63reator\x18\x03 \x01(\x0b\x32\".google.cloud.support.v2beta.ActorB\x03\xe0\x41\x03\x12\x10\n\x08\x66ilename\x18\x04 \x01(\t\x12\x16\n\tmime_type\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03:\xb0\x01\xea\x41\xac\x01\n&cloudsupport.googleapis.com/Attachment\x12\x45organizations/{organization}/cases/{case}/attachments/{attachment_id}\x12;projects/{project}/cases/{case}/attachments/{attachment_id}B\xcc\x01\n\x1f\x63om.google.cloud.support.v2betaB\x0f\x41ttachmentProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + Attachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Attachment").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_pb.rb new file mode 100644 index 000000000000..25161e508ca8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/attachment_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/support/v2beta/attachment_pb' + + +descriptor_data = "\n4google/cloud/support/v2beta/attachment_service.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/support/v2beta/attachment.proto\"y\n\x16ListAttachmentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"T\n\x14GetAttachmentRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&cloudsupport.googleapis.com/Attachment\"p\n\x17ListAttachmentsResponse\x12<\n\x0b\x61ttachments\x18\x01 \x03(\x0b\x32\'.google.cloud.support.v2beta.Attachment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x88\x04\n\x15\x43\x61seAttachmentService\x12\xf6\x01\n\x0fListAttachments\x12\x33.google.cloud.support.v2beta.ListAttachmentsRequest\x1a\x34.google.cloud.support.v2beta.ListAttachmentsResponse\"x\xda\x41\x06parent\x82\xd3\xe4\x93\x02i\x12//v2beta/{parent=projects/*/cases/*}/attachmentsZ6\x12\x34/v2beta/{parent=organizations/*/cases/*}/attachments\x12\xa4\x01\n\rGetAttachment\x12\x31.google.cloud.support.v2beta.GetAttachmentRequest\x1a\'.google.cloud.support.v2beta.Attachment\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v2beta/{name=*/*/cases/*/attachments/*}\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd3\x01\n\x1f\x63om.google.cloud.support.v2betaB\x16\x41ttachmentServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + ListAttachmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListAttachmentsRequest").msgclass + GetAttachmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.GetAttachmentRequest").msgclass + ListAttachmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListAttachmentsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb new file mode 100644 index 000000000000..e40538c6e912 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/support/v2beta/attachment_service.proto for package 'Google.Cloud.Support.V2beta' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/support/v2beta/attachment_service_pb' + +module Google + module Cloud + module Support + module V2beta + module CaseAttachmentService + # A service to manage file attachments for Google Cloud support cases. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.support.v2beta.CaseAttachmentService' + + # List all the attachments associated with a support case. + rpc :ListAttachments, ::Google::Cloud::Support::V2beta::ListAttachmentsRequest, ::Google::Cloud::Support::V2beta::ListAttachmentsResponse + # Retrieve an attachment. + rpc :GetAttachment, ::Google::Cloud::Support::V2beta::GetAttachmentRequest, ::Google::Cloud::Support::V2beta::Attachment + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service.rb new file mode 100644 index 000000000000..0f8335bbffd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_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/support/v2beta/version" + +require "google/cloud/support/v2beta/case_attachment_service/credentials" +require "google/cloud/support/v2beta/case_attachment_service/paths" +require "google/cloud/support/v2beta/case_attachment_service/client" +require "google/cloud/support/v2beta/case_attachment_service/rest" + +module Google + module Cloud + module Support + module V2beta + ## + # A service to manage file attachments for Google Cloud support cases. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/support/v2beta/case_attachment_service" + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/support/v2beta/case_attachment_service/rest" + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new + # + module CaseAttachmentService + end + end + end + end +end + +helper_path = ::File.join __dir__, "case_attachment_service", "helpers.rb" +require "google/cloud/support/v2beta/case_attachment_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/client.rb new file mode 100644 index 000000000000..6c1f17317bb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/support/v2beta/attachment_service_pb" + +module Google + module Cloud + module Support + module V2beta + module CaseAttachmentService + ## + # Client for the CaseAttachmentService service. + # + # A service to manage file attachments for Google Cloud support cases. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :case_attachment_service_stub + + ## + # Configure the CaseAttachmentService Client class. + # + # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CaseAttachmentService clients + # ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Support", "V2beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_attachments.timeout = 60.0 + default_config.rpcs.list_attachments.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 CaseAttachmentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @case_attachment_service_stub.universe_domain + end + + ## + # Create a new CaseAttachmentService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CaseAttachmentService 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/support/v2beta/attachment_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 + + @case_attachment_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Support::V2beta::CaseAttachmentService::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 + ) + + @case_attachment_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 + @case_attachment_service_stub.logger + end + + # Service calls + + ## + # List all the attachments associated with a support case. + # + # @overload list_attachments(request, options = nil) + # Pass arguments to `list_attachments` via a request object, either of type + # {::Google::Cloud::Support::V2beta::ListAttachmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::ListAttachmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_attachments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_attachments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 case for which attachments should be listed. + # @param page_size [::Integer] + # The maximum number of attachments fetched with each request. + # + # If not provided, the default is 10. The maximum page size that will be + # returned is 100. + # + # The size of each page can be smaller than the requested page size and can + # include zero. For example, you could request 100 attachments on one page, + # receive 0, and then on the next page, receive 90. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::ListAttachmentsRequest.new + # + # # Call the list_attachments method. + # result = client.list_attachments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::Attachment. + # p item + # end + # + def list_attachments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListAttachmentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_attachments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_attachments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_attachments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_attachment_service_stub.call_rpc :list_attachments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @case_attachment_service_stub, :list_attachments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve an attachment. + # + # @overload get_attachment(request, options = nil) + # Pass arguments to `get_attachment` via a request object, either of type + # {::Google::Cloud::Support::V2beta::GetAttachmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::GetAttachmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_attachment(name: nil) + # Pass arguments to `get_attachment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 attachment to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2beta::Attachment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2beta::Attachment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::GetAttachmentRequest.new + # + # # Call the get_attachment method. + # result = client.get_attachment request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Attachment. + # p result + # + def get_attachment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetAttachmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_attachment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_attachment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_attachment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_attachment_service_stub.call_rpc :get_attachment, request, 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 CaseAttachmentService API. + # + # This class represents the configuration for CaseAttachmentService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2beta::CaseAttachmentService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_attachments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_attachments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_attachments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Support::V2beta::CaseAttachmentService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CaseAttachmentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_attachments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_attachments + ## + # RPC-specific configuration for `get_attachment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_attachment + + # @private + def initialize parent_rpcs = nil + list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments + @list_attachments = ::Gapic::Config::Method.new list_attachments_config + get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment + @get_attachment = ::Gapic::Config::Method.new get_attachment_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/credentials.rb new file mode 100644 index 000000000000..0987e86d29a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/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 Support + module V2beta + module CaseAttachmentService + # Credentials for the CaseAttachmentService 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-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/paths.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/paths.rb new file mode 100644 index 000000000000..0b3f043eed9c --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/paths.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! + + +module Google + module Cloud + module Support + module V2beta + module CaseAttachmentService + # Path helper methods for the CaseAttachmentService API. + module Paths + ## + # Create a fully-qualified Attachment resource string. + # + # @overload attachment_path(organization:, case:, attachment_id:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}/attachments/{attachment_id}` + # + # @param organization [String] + # @param case [String] + # @param attachment_id [String] + # + # @overload attachment_path(project:, case:, attachment_id:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}/attachments/{attachment_id}` + # + # @param project [String] + # @param case [String] + # @param attachment_id [String] + # + # @return [::String] + def attachment_path **args + resources = { + "attachment_id:case:organization" => (proc do |organization:, case:, attachment_id:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}/attachments/#{attachment_id}" + end), + "attachment_id:case:project" => (proc do |project:, case:, attachment_id:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}/attachments/#{attachment_id}" + 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 Case resource string. + # + # @overload case_path(organization:, case:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}` + # + # @param organization [String] + # @param case [String] + # + # @overload case_path(project:, case:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}` + # + # @param project [String] + # @param case [String] + # + # @return [::String] + def case_path **args + resources = { + "case:organization" => (proc do |organization:, case:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}" + end), + "case:project" => (proc do |project:, case:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}" + 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-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest.rb new file mode 100644 index 000000000000..78b37c71bd8b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_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/support/v2beta/version" + +require "google/cloud/support/v2beta/case_attachment_service/credentials" +require "google/cloud/support/v2beta/case_attachment_service/paths" +require "google/cloud/support/v2beta/case_attachment_service/rest/client" + +module Google + module Cloud + module Support + module V2beta + ## + # A service to manage file attachments for Google Cloud support cases. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/support/v2beta/case_attachment_service/rest" + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new + # + module CaseAttachmentService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/support/v2beta/case_attachment_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb new file mode 100644 index 000000000000..2da77557559d --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb @@ -0,0 +1,532 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/support/v2beta/attachment_service_pb" +require "google/cloud/support/v2beta/case_attachment_service/rest/service_stub" + +module Google + module Cloud + module Support + module V2beta + module CaseAttachmentService + module Rest + ## + # REST client for the CaseAttachmentService service. + # + # A service to manage file attachments for Google Cloud support cases. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :case_attachment_service_stub + + ## + # Configure the CaseAttachmentService Client class. + # + # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CaseAttachmentService clients + # ::Google::Cloud::Support::V2beta::CaseAttachmentService::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", "Support", "V2beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_attachments.timeout = 60.0 + default_config.rpcs.list_attachments.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 CaseAttachmentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::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 + @case_attachment_service_stub.universe_domain + end + + ## + # Create a new CaseAttachmentService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CaseAttachmentService 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 + + @case_attachment_service_stub = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @case_attachment_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 + @case_attachment_service_stub.logger + end + + # Service calls + + ## + # List all the attachments associated with a support case. + # + # @overload list_attachments(request, options = nil) + # Pass arguments to `list_attachments` via a request object, either of type + # {::Google::Cloud::Support::V2beta::ListAttachmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::ListAttachmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_attachments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_attachments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 case for which attachments should be listed. + # @param page_size [::Integer] + # The maximum number of attachments fetched with each request. + # + # If not provided, the default is 10. The maximum page size that will be + # returned is 100. + # + # The size of each page can be smaller than the requested page size and can + # include zero. For example, you could request 100 attachments on one page, + # receive 0, and then on the next page, receive 90. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::ListAttachmentsRequest.new + # + # # Call the list_attachments method. + # result = client.list_attachments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::Attachment. + # p item + # end + # + def list_attachments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListAttachmentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_attachments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_attachments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_attachments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_attachment_service_stub.list_attachments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @case_attachment_service_stub, :list_attachments, "attachments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve an attachment. + # + # @overload get_attachment(request, options = nil) + # Pass arguments to `get_attachment` via a request object, either of type + # {::Google::Cloud::Support::V2beta::GetAttachmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::GetAttachmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_attachment(name: nil) + # Pass arguments to `get_attachment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 attachment to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Attachment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Attachment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::GetAttachmentRequest.new + # + # # Call the get_attachment method. + # result = client.get_attachment request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Attachment. + # p result + # + def get_attachment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetAttachmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_attachment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_attachment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_attachment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_attachment_service_stub.get_attachment request, 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 CaseAttachmentService REST API. + # + # This class represents the configuration for CaseAttachmentService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_attachments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_attachments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_attachments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CaseAttachmentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_attachments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_attachments + ## + # RPC-specific configuration for `get_attachment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_attachment + + # @private + def initialize parent_rpcs = nil + list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments + @list_attachments = ::Gapic::Config::Method.new list_attachments_config + get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment + @get_attachment = ::Gapic::Config::Method.new get_attachment_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb new file mode 100644 index 000000000000..390917e1e045 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/support/v2beta/attachment_service_pb" + +module Google + module Cloud + module Support + module V2beta + module CaseAttachmentService + module Rest + ## + # REST service stub for the CaseAttachmentService 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_attachments REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::ListAttachmentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::ListAttachmentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::ListAttachmentsResponse] + # A result object deserialized from the server's reply + def list_attachments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_attachments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_attachments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::ListAttachmentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_attachment REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::GetAttachmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Attachment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Attachment] + # A result object deserialized from the server's reply + def get_attachment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_attachment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_attachment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::Attachment.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_attachments REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::ListAttachmentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_attachments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}/attachments", + matches: [ + ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}/attachments", + matches: [ + ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_attachment REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::GetAttachmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_attachment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{name}", + matches: [ + ["name", %r{^[^/]+/[^/]+/cases/[^/]+/attachments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_pb.rb new file mode 100644 index 000000000000..f3e615f1d303 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_pb.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/case.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/support/v2beta/actor_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/cloud/support/v2beta/case.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf6\x06\n\x04\x43\x61se\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12G\n\x0e\x63lassification\x18\x04 \x01(\x0b\x32/.google.cloud.support.v2beta.CaseClassification\x12\x11\n\ttime_zone\x18\x08 \x01(\t\x12\"\n\x1asubscriber_email_addresses\x18\t \x03(\t\x12;\n\x05state\x18\x0c \x01(\x0e\x32\'.google.cloud.support.v2beta.Case.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\x07\x63reator\x18\x0f \x01(\x0b\x32\".google.cloud.support.v2beta.Actor\x12\x15\n\rcontact_email\x18# \x01(\t\x12\x11\n\tescalated\x18\x11 \x01(\x08\x12\x11\n\ttest_case\x18\x13 \x01(\x08\x12\x15\n\rlanguage_code\x18\x17 \x01(\t\x12<\n\x08priority\x18 \x01(\x0e\x32*.google.cloud.support.v2beta.Case.Priority\"\x7f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x1e\n\x1aIN_PROGRESS_GOOGLE_SUPPORT\x10\x02\x12\x13\n\x0f\x41\x43TION_REQUIRED\x10\x03\x12\x15\n\x11SOLUTION_PROVIDED\x10\x04\x12\n\n\x06\x43LOSED\x10\x05\"L\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x06\n\x02P0\x10\x01\x12\x06\n\x02P1\x10\x02\x12\x06\n\x02P2\x10\x03\x12\x06\n\x02P3\x10\x04\x12\x06\n\x02P4\x10\x05:q\xea\x41n\n cloudsupport.googleapis.com/Case\x12)organizations/{organization}/cases/{case}\x12\x1fprojects/{project}/cases/{case}\"m\n\x12\x43\x61seClassification\x12\n\n\x02id\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12\x35\n\x07product\x18\n \x01(\x0b\x32$.google.cloud.support.v2beta.Product\"I\n\x07Product\x12>\n\x0cproduct_line\x18\x01 \x01(\x0e\x32(.google.cloud.support.v2beta.ProductLine*N\n\x0bProductLine\x12\x1c\n\x18PRODUCT_LINE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGOOGLE_CLOUD\x10\x01\x12\x0f\n\x0bGOOGLE_MAPS\x10\x02\x42\xc6\x01\n\x1f\x63om.google.cloud.support.v2betaB\tCaseProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + Case = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Case").msgclass + Case::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Case.State").enummodule + Case::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Case.Priority").enummodule + CaseClassification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.CaseClassification").msgclass + Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Product").msgclass + ProductLine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ProductLine").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service.rb new file mode 100644 index 000000000000..7d78746c547f --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_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/support/v2beta/version" + +require "google/cloud/support/v2beta/case_service/credentials" +require "google/cloud/support/v2beta/case_service/paths" +require "google/cloud/support/v2beta/case_service/client" +require "google/cloud/support/v2beta/case_service/rest" + +module Google + module Cloud + module Support + module V2beta + ## + # A service to manage Google Cloud support cases. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/support/v2beta/case_service" + # client = ::Google::Cloud::Support::V2beta::CaseService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/support/v2beta/case_service/rest" + # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + module CaseService + end + end + end + end +end + +helper_path = ::File.join __dir__, "case_service", "helpers.rb" +require "google/cloud/support/v2beta/case_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/client.rb new file mode 100644 index 000000000000..9086f4923d07 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/client.rb @@ -0,0 +1,1269 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/support/v2beta/case_service_pb" + +module Google + module Cloud + module Support + module V2beta + module CaseService + ## + # Client for the CaseService service. + # + # A service to manage Google Cloud support cases. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :case_service_stub + + ## + # Configure the CaseService Client class. + # + # See {::Google::Cloud::Support::V2beta::CaseService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CaseService clients + # ::Google::Cloud::Support::V2beta::CaseService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Support", "V2beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_case.timeout = 60.0 + default_config.rpcs.get_case.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_cases.timeout = 60.0 + default_config.rpcs.list_cases.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_cases.timeout = 60.0 + default_config.rpcs.search_cases.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_case.timeout = 60.0 + + default_config.rpcs.update_case.timeout = 60.0 + + default_config.rpcs.escalate_case.timeout = 60.0 + + default_config.rpcs.close_case.timeout = 60.0 + + default_config.rpcs.search_case_classifications.timeout = 60.0 + default_config.rpcs.search_case_classifications.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 CaseService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Support::V2beta::CaseService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @case_service_stub.universe_domain + end + + ## + # Create a new CaseService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Support::V2beta::CaseService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CaseService 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/support/v2beta/case_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 + + @case_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Support::V2beta::CaseService::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 + ) + + @case_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 + @case_service_stub.logger + end + + # Service calls + + ## + # Retrieve a case. + # + # @overload get_case(request, options = nil) + # Pass arguments to `get_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::GetCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::GetCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_case(name: nil) + # Pass arguments to `get_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full name of a case to be retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::GetCaseRequest.new + # + # # Call the get_case method. + # result = client.get_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def get_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :get_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve all cases under a parent, but not its children. + # + # For example, listing cases under an organization only returns the cases + # that are directly parented by that organization. To retrieve cases + # under an organization and its projects, use `cases.search`. + # + # @overload list_cases(request, options = nil) + # Pass arguments to `list_cases` via a request object, either of type + # {::Google::Cloud::Support::V2beta::ListCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::ListCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_cases(parent: nil, filter: nil, page_size: nil, page_token: nil, product_line: nil) + # Pass arguments to `list_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 a parent to list cases under. + # @param filter [::String] + # An expression used to filter cases. + # + # If it's an empty string, then no filtering happens. Otherwise, the endpoint + # returns the cases that match the filter. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # EXAMPLES: + # + # - `state=CLOSED` + # - `state=OPEN AND creator.email="tester@example.com"` + # - `state=OPEN AND (priority=P0 OR priority=P1)` + # @param page_size [::Integer] + # The maximum number of cases fetched with each request. Defaults to 10. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # @param product_line [::Google::Cloud::Support::V2beta::ProductLine] + # The product line to request cases for. If unspecified, only + # Google Cloud cases will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::ListCasesRequest.new + # + # # Call the list_cases method. + # result = client.list_cases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::Case. + # p item + # end + # + def list_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCasesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_cases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :list_cases, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @case_service_stub, :list_cases, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Search for cases using a query. + # + # @overload search_cases(request, options = nil) + # Pass arguments to `search_cases` via a request object, either of type + # {::Google::Cloud::Support::V2beta::SearchCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::SearchCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cases(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # The name of the parent resource to search for cases under. + # @param query [::String] + # An expression used to filter cases. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `organization`: An organization name in the form + # `organizations/`. + # - `project`: A project name in the form `projects/`. + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # You must specify either `organization` or `project`. + # + # To search across `displayName`, `description`, and comments, use a global + # restriction with no keyword or operator. For example, `"my search"`. + # + # To search only cases updated after a certain date, use `update_time` + # restricted with that particular date, time, and timezone in ISO datetime + # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + # `update_time` only supports the greater than operator (`>`). + # + # Examples: + # + # - `organization="organizations/123456789"` + # - `project="projects/my-project-id"` + # - `project="projects/123456789"` + # - `organization="organizations/123456789" AND state=CLOSED` + # - `project="projects/my-project-id" AND creator.email="tester@example.com"` + # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + # @param page_size [::Integer] + # The maximum number of cases fetched with each request. The default page + # size is 10. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::SearchCasesRequest.new + # + # # Call the search_cases method. + # result = client.search_cases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::Case. + # p item + # end + # + def search_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::SearchCasesRequest + + # Converts hash and nil to 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_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_cases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :search_cases, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_cases, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new case and associate it with a parent. + # + # It must have the following fields set: `display_name`, `description`, + # `classification`, and `priority`. If you're just testing the API and don't + # want to route your case to an agent, set `testCase=true`. + # + # @overload create_case(request, options = nil) + # Pass arguments to `create_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::CreateCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::CreateCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_case(parent: nil, case: nil) + # Pass arguments to `create_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent under which the case should be created. + # @param case [::Google::Cloud::Support::V2beta::Case, ::Hash] + # Required. The case to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::CreateCaseRequest.new + # + # # Call the create_case method. + # result = client.create_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def create_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCaseRequest + + # Converts hash and nil to 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_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :create_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a case. Only some fields can be updated. + # + # @overload update_case(request, options = nil) + # Pass arguments to `update_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::UpdateCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::UpdateCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_case(case: nil, update_mask: nil) + # Pass arguments to `update_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param case [::Google::Cloud::Support::V2beta::Case, ::Hash] + # Required. The case to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A list of attributes of the case that should be updated. Supported values + # are `priority`, `display_name`, and `subscriber_email_addresses`. If no + # fields are specified, all supported fields are updated. + # + # Be careful - if you do not provide a field mask, then you might + # accidentally clear some fields. For example, if you leave the field mask + # empty and do not provide a value for `subscriber_email_addresses`, then + # `subscriber_email_addresses` is updated to empty. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::UpdateCaseRequest.new + # + # # Call the update_case method. + # result = client.update_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def update_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::UpdateCaseRequest + + # Converts hash and nil to 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_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.case&.name + header_params["case.name"] = request.case.name + end + + request_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_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :update_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Escalate a case, starting the Google Cloud Support escalation management + # process. + # + # This operation is only available for some support services. Go to + # https://cloud.google.com/support and look for 'Technical support + # escalations' in the feature list to find out which ones let you + # do that. + # + # @overload escalate_case(request, options = nil) + # Pass arguments to `escalate_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::EscalateCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::EscalateCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload escalate_case(name: nil, escalation: nil) + # Pass arguments to `escalate_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 case to be escalated. + # @param escalation [::Google::Cloud::Support::V2beta::Escalation, ::Hash] + # The escalation information to be sent with the escalation request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::EscalateCaseRequest.new + # + # # Call the escalate_case method. + # result = client.escalate_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def escalate_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::EscalateCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.escalate_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.escalate_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.escalate_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :escalate_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Close a case. + # + # @overload close_case(request, options = nil) + # Pass arguments to `close_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::CloseCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::CloseCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload close_case(name: nil) + # Pass arguments to `close_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 case to close. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::CloseCaseRequest.new + # + # # Call the close_case method. + # result = client.close_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def close_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CloseCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.close_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.close_case.timeout, + metadata: metadata, + retry_policy: @config.rpcs.close_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :close_case, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve valid classifications to use when creating a support case. + # + # Classifications are hierarchical. Each classification is a string + # containing all levels of the hierarchy separated by `" > "`. For example, + # `"Technical Issue > Compute > Compute Engine"`. + # + # Classification IDs returned by this endpoint are valid for at least six + # months. When a classification is deactivated, this endpoint immediately + # stops returning it. After six months, `case.create` requests using the + # classification will fail. + # + # @overload search_case_classifications(request, options = nil) + # Pass arguments to `search_case_classifications` via a request object, either of type + # {::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_case_classifications(query: nil, page_size: nil, page_token: nil, product: nil) + # Pass arguments to `search_case_classifications` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param query [::String] + # An expression used to filter case classifications. + # + # If it's an empty string, then no filtering happens. Otherwise, case + # classifications will be returned that match the filter. + # @param page_size [::Integer] + # The maximum number of classifications fetched with each request. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # @param product [::Google::Cloud::Support::V2beta::Product, ::Hash] + # Optional. The product to return case classifications for. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::CaseClassification>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::CaseClassification>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new + # + # # Call the search_case_classifications method. + # result = client.search_case_classifications request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::CaseClassification. + # p item + # end + # + def search_case_classifications request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest + + # Converts hash and nil to 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_case_classifications.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_case_classifications.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_case_classifications.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.call_rpc :search_case_classifications, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_case_classifications, request, response, 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 CaseService API. + # + # This class represents the configuration for CaseService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2beta::CaseService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_case to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2beta::CaseService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_case.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_case.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Support::V2beta::CaseService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CaseService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_case` + # @return [::Gapic::Config::Method] + # + attr_reader :get_case + ## + # RPC-specific configuration for `list_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_cases + ## + # RPC-specific configuration for `search_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :search_cases + ## + # RPC-specific configuration for `create_case` + # @return [::Gapic::Config::Method] + # + attr_reader :create_case + ## + # RPC-specific configuration for `update_case` + # @return [::Gapic::Config::Method] + # + attr_reader :update_case + ## + # RPC-specific configuration for `escalate_case` + # @return [::Gapic::Config::Method] + # + attr_reader :escalate_case + ## + # RPC-specific configuration for `close_case` + # @return [::Gapic::Config::Method] + # + attr_reader :close_case + ## + # RPC-specific configuration for `search_case_classifications` + # @return [::Gapic::Config::Method] + # + attr_reader :search_case_classifications + + # @private + def initialize parent_rpcs = nil + get_case_config = parent_rpcs.get_case if parent_rpcs.respond_to? :get_case + @get_case = ::Gapic::Config::Method.new get_case_config + list_cases_config = parent_rpcs.list_cases if parent_rpcs.respond_to? :list_cases + @list_cases = ::Gapic::Config::Method.new list_cases_config + search_cases_config = parent_rpcs.search_cases if parent_rpcs.respond_to? :search_cases + @search_cases = ::Gapic::Config::Method.new search_cases_config + create_case_config = parent_rpcs.create_case if parent_rpcs.respond_to? :create_case + @create_case = ::Gapic::Config::Method.new create_case_config + update_case_config = parent_rpcs.update_case if parent_rpcs.respond_to? :update_case + @update_case = ::Gapic::Config::Method.new update_case_config + escalate_case_config = parent_rpcs.escalate_case if parent_rpcs.respond_to? :escalate_case + @escalate_case = ::Gapic::Config::Method.new escalate_case_config + close_case_config = parent_rpcs.close_case if parent_rpcs.respond_to? :close_case + @close_case = ::Gapic::Config::Method.new close_case_config + search_case_classifications_config = parent_rpcs.search_case_classifications if parent_rpcs.respond_to? :search_case_classifications + @search_case_classifications = ::Gapic::Config::Method.new search_case_classifications_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/credentials.rb new file mode 100644 index 000000000000..b2075374e3a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/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 Support + module V2beta + module CaseService + # Credentials for the CaseService 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-support-v2beta/lib/google/cloud/support/v2beta/case_service/paths.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/paths.rb new file mode 100644 index 000000000000..c56e32fd9485 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/paths.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + module CaseService + # Path helper methods for the CaseService API. + module Paths + ## + # Create a fully-qualified Case resource string. + # + # @overload case_path(organization:, case:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}` + # + # @param organization [String] + # @param case [String] + # + # @overload case_path(project:, case:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}` + # + # @param project [String] + # @param case [String] + # + # @return [::String] + def case_path **args + resources = { + "case:organization" => (proc do |organization:, case:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}" + end), + "case:project" => (proc do |project:, case:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Organization resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}` + # + # @param organization [String] + # + # @return [::String] + def organization_path organization: + "organizations/#{organization}" + end + + ## + # Create a fully-qualified 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-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest.rb new file mode 100644 index 000000000000..f1beada166f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_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/support/v2beta/version" + +require "google/cloud/support/v2beta/case_service/credentials" +require "google/cloud/support/v2beta/case_service/paths" +require "google/cloud/support/v2beta/case_service/rest/client" + +module Google + module Cloud + module Support + module V2beta + ## + # A service to manage Google Cloud support cases. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/support/v2beta/case_service/rest" + # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + module CaseService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/support/v2beta/case_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/client.rb new file mode 100644 index 000000000000..837123546be5 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/client.rb @@ -0,0 +1,1178 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/support/v2beta/case_service_pb" +require "google/cloud/support/v2beta/case_service/rest/service_stub" + +module Google + module Cloud + module Support + module V2beta + module CaseService + module Rest + ## + # REST client for the CaseService service. + # + # A service to manage Google Cloud support cases. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :case_service_stub + + ## + # Configure the CaseService Client class. + # + # See {::Google::Cloud::Support::V2beta::CaseService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CaseService clients + # ::Google::Cloud::Support::V2beta::CaseService::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", "Support", "V2beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.get_case.timeout = 60.0 + default_config.rpcs.get_case.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_cases.timeout = 60.0 + default_config.rpcs.list_cases.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_cases.timeout = 60.0 + default_config.rpcs.search_cases.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_case.timeout = 60.0 + + default_config.rpcs.update_case.timeout = 60.0 + + default_config.rpcs.escalate_case.timeout = 60.0 + + default_config.rpcs.close_case.timeout = 60.0 + + default_config.rpcs.search_case_classifications.timeout = 60.0 + default_config.rpcs.search_case_classifications.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 CaseService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Support::V2beta::CaseService::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 + @case_service_stub.universe_domain + end + + ## + # Create a new CaseService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CaseService 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 + + @case_service_stub = ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @case_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 + @case_service_stub.logger + end + + # Service calls + + ## + # Retrieve a case. + # + # @overload get_case(request, options = nil) + # Pass arguments to `get_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::GetCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::GetCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_case(name: nil) + # Pass arguments to `get_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full name of a case to be retrieved. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::GetCaseRequest.new + # + # # Call the get_case method. + # result = client.get_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def get_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_case.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.get_case request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve all cases under a parent, but not its children. + # + # For example, listing cases under an organization only returns the cases + # that are directly parented by that organization. To retrieve cases + # under an organization and its projects, use `cases.search`. + # + # @overload list_cases(request, options = nil) + # Pass arguments to `list_cases` via a request object, either of type + # {::Google::Cloud::Support::V2beta::ListCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::ListCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_cases(parent: nil, filter: nil, page_size: nil, page_token: nil, product_line: nil) + # Pass arguments to `list_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 a parent to list cases under. + # @param filter [::String] + # An expression used to filter cases. + # + # If it's an empty string, then no filtering happens. Otherwise, the endpoint + # returns the cases that match the filter. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # EXAMPLES: + # + # - `state=CLOSED` + # - `state=OPEN AND creator.email="tester@example.com"` + # - `state=OPEN AND (priority=P0 OR priority=P1)` + # @param page_size [::Integer] + # The maximum number of cases fetched with each request. Defaults to 10. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # @param product_line [::Google::Cloud::Support::V2beta::ProductLine] + # The product line to request cases for. If unspecified, only + # Google Cloud cases will be returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::ListCasesRequest.new + # + # # Call the list_cases method. + # result = client.list_cases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::Case. + # p item + # end + # + def list_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCasesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_cases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.list_cases request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @case_service_stub, :list_cases, "cases", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Search for cases using a query. + # + # @overload search_cases(request, options = nil) + # Pass arguments to `search_cases` via a request object, either of type + # {::Google::Cloud::Support::V2beta::SearchCasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::SearchCasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cases(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_cases` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # The name of the parent resource to search for cases under. + # @param query [::String] + # An expression used to filter cases. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `organization`: An organization name in the form + # `organizations/`. + # - `project`: A project name in the form `projects/`. + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # You must specify either `organization` or `project`. + # + # To search across `displayName`, `description`, and comments, use a global + # restriction with no keyword or operator. For example, `"my search"`. + # + # To search only cases updated after a certain date, use `update_time` + # restricted with that particular date, time, and timezone in ISO datetime + # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + # `update_time` only supports the greater than operator (`>`). + # + # Examples: + # + # - `organization="organizations/123456789"` + # - `project="projects/my-project-id"` + # - `project="projects/123456789"` + # - `organization="organizations/123456789" AND state=CLOSED` + # - `project="projects/my-project-id" AND creator.email="tester@example.com"` + # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + # @param page_size [::Integer] + # The maximum number of cases fetched with each request. The default page + # size is 10. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::SearchCasesRequest.new + # + # # Call the search_cases method. + # result = client.search_cases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::Case. + # p item + # end + # + def search_cases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::SearchCasesRequest + + # Converts hash and nil to an 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_cases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_cases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_cases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.search_cases request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @case_service_stub, :search_cases, "cases", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Create a new case and associate it with a parent. + # + # It must have the following fields set: `display_name`, `description`, + # `classification`, and `priority`. If you're just testing the API and don't + # want to route your case to an agent, set `testCase=true`. + # + # @overload create_case(request, options = nil) + # Pass arguments to `create_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::CreateCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::CreateCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_case(parent: nil, case: nil) + # Pass arguments to `create_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent under which the case should be created. + # @param case [::Google::Cloud::Support::V2beta::Case, ::Hash] + # Required. The case to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::CreateCaseRequest.new + # + # # Call the create_case method. + # result = client.create_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def create_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCaseRequest + + # Converts hash and nil to an 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_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_case.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.create_case request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a case. Only some fields can be updated. + # + # @overload update_case(request, options = nil) + # Pass arguments to `update_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::UpdateCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::UpdateCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_case(case: nil, update_mask: nil) + # Pass arguments to `update_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param case [::Google::Cloud::Support::V2beta::Case, ::Hash] + # Required. The case to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A list of attributes of the case that should be updated. Supported values + # are `priority`, `display_name`, and `subscriber_email_addresses`. If no + # fields are specified, all supported fields are updated. + # + # Be careful - if you do not provide a field mask, then you might + # accidentally clear some fields. For example, if you leave the field mask + # empty and do not provide a value for `subscriber_email_addresses`, then + # `subscriber_email_addresses` is updated to empty. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::UpdateCaseRequest.new + # + # # Call the update_case method. + # result = client.update_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def update_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::UpdateCaseRequest + + # Converts hash and nil to an 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_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_case.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.update_case request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Escalate a case, starting the Google Cloud Support escalation management + # process. + # + # This operation is only available for some support services. Go to + # https://cloud.google.com/support and look for 'Technical support + # escalations' in the feature list to find out which ones let you + # do that. + # + # @overload escalate_case(request, options = nil) + # Pass arguments to `escalate_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::EscalateCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::EscalateCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload escalate_case(name: nil, escalation: nil) + # Pass arguments to `escalate_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 case to be escalated. + # @param escalation [::Google::Cloud::Support::V2beta::Escalation, ::Hash] + # The escalation information to be sent with the escalation request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::EscalateCaseRequest.new + # + # # Call the escalate_case method. + # result = client.escalate_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def escalate_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::EscalateCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.escalate_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.escalate_case.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.escalate_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.escalate_case request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Close a case. + # + # @overload close_case(request, options = nil) + # Pass arguments to `close_case` via a request object, either of type + # {::Google::Cloud::Support::V2beta::CloseCaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::CloseCaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload close_case(name: nil) + # Pass arguments to `close_case` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 case to close. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::CloseCaseRequest.new + # + # # Call the close_case method. + # result = client.close_case request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Case. + # p result + # + def close_case request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CloseCaseRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.close_case.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.close_case.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.close_case.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.close_case request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve valid classifications to use when creating a support case. + # + # Classifications are hierarchical. Each classification is a string + # containing all levels of the hierarchy separated by `" > "`. For example, + # `"Technical Issue > Compute > Compute Engine"`. + # + # Classification IDs returned by this endpoint are valid for at least six + # months. When a classification is deactivated, this endpoint immediately + # stops returning it. After six months, `case.create` requests using the + # classification will fail. + # + # @overload search_case_classifications(request, options = nil) + # Pass arguments to `search_case_classifications` via a request object, either of type + # {::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_case_classifications(query: nil, page_size: nil, page_token: nil, product: nil) + # Pass arguments to `search_case_classifications` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param query [::String] + # An expression used to filter case classifications. + # + # If it's an empty string, then no filtering happens. Otherwise, case + # classifications will be returned that match the filter. + # @param page_size [::Integer] + # The maximum number of classifications fetched with each request. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # @param product [::Google::Cloud::Support::V2beta::Product, ::Hash] + # Optional. The product to return case classifications for. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::CaseClassification>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::CaseClassification>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new + # + # # Call the search_case_classifications method. + # result = client.search_case_classifications request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::CaseClassification. + # p item + # end + # + def search_case_classifications request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest + + # Converts hash and nil to an 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_case_classifications.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_case_classifications.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_case_classifications.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @case_service_stub.search_case_classifications request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @case_service_stub, :search_case_classifications, "case_classifications", request, result, 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 CaseService REST API. + # + # This class represents the configuration for CaseService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2beta::CaseService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_case to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_case.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_case.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CaseService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_case` + # @return [::Gapic::Config::Method] + # + attr_reader :get_case + ## + # RPC-specific configuration for `list_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_cases + ## + # RPC-specific configuration for `search_cases` + # @return [::Gapic::Config::Method] + # + attr_reader :search_cases + ## + # RPC-specific configuration for `create_case` + # @return [::Gapic::Config::Method] + # + attr_reader :create_case + ## + # RPC-specific configuration for `update_case` + # @return [::Gapic::Config::Method] + # + attr_reader :update_case + ## + # RPC-specific configuration for `escalate_case` + # @return [::Gapic::Config::Method] + # + attr_reader :escalate_case + ## + # RPC-specific configuration for `close_case` + # @return [::Gapic::Config::Method] + # + attr_reader :close_case + ## + # RPC-specific configuration for `search_case_classifications` + # @return [::Gapic::Config::Method] + # + attr_reader :search_case_classifications + + # @private + def initialize parent_rpcs = nil + get_case_config = parent_rpcs.get_case if parent_rpcs.respond_to? :get_case + @get_case = ::Gapic::Config::Method.new get_case_config + list_cases_config = parent_rpcs.list_cases if parent_rpcs.respond_to? :list_cases + @list_cases = ::Gapic::Config::Method.new list_cases_config + search_cases_config = parent_rpcs.search_cases if parent_rpcs.respond_to? :search_cases + @search_cases = ::Gapic::Config::Method.new search_cases_config + create_case_config = parent_rpcs.create_case if parent_rpcs.respond_to? :create_case + @create_case = ::Gapic::Config::Method.new create_case_config + update_case_config = parent_rpcs.update_case if parent_rpcs.respond_to? :update_case + @update_case = ::Gapic::Config::Method.new update_case_config + escalate_case_config = parent_rpcs.escalate_case if parent_rpcs.respond_to? :escalate_case + @escalate_case = ::Gapic::Config::Method.new escalate_case_config + close_case_config = parent_rpcs.close_case if parent_rpcs.respond_to? :close_case + @close_case = ::Gapic::Config::Method.new close_case_config + search_case_classifications_config = parent_rpcs.search_case_classifications if parent_rpcs.respond_to? :search_case_classifications + @search_case_classifications = ::Gapic::Config::Method.new search_case_classifications_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb new file mode 100644 index 000000000000..92b4270ff509 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb @@ -0,0 +1,624 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/support/v2beta/case_service_pb" + +module Google + module Cloud + module Support + module V2beta + module CaseService + module Rest + ## + # REST service stub for the CaseService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::GetCaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # A result object deserialized from the server's reply + def get_case request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_case_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_case", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::Case.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_cases REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::ListCasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::ListCasesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::ListCasesResponse] + # A result object deserialized from the server's reply + def list_cases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_cases_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_cases", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::ListCasesResponse.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_cases REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::SearchCasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::SearchCasesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::SearchCasesResponse] + # A result object deserialized from the server's reply + def search_cases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_cases_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_cases", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::SearchCasesResponse.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_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::CreateCaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # A result object deserialized from the server's reply + def create_case request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_case_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_case", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::Case.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_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::UpdateCaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # A result object deserialized from the server's reply + def update_case request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_case_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_case", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::Case.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the escalate_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::EscalateCaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # A result object deserialized from the server's reply + def escalate_case request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_escalate_case_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "escalate_case", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::Case.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the close_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::CloseCaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Case] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Case] + # A result object deserialized from the server's reply + def close_case request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_close_case_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "close_case", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::Case.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_case_classifications REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse] + # A result object deserialized from the server's reply + def search_case_classifications request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_case_classifications_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_case_classifications", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::GetCaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_case_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/cases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_cases REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::ListCasesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_cases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}/cases", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}/cases", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_cases REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::SearchCasesRequest] + # 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_cases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}/cases:search", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}/cases:search", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::CreateCaseRequest] + # 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_case_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta/{parent}/cases", + body: "case", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2beta/{parent}/cases", + body: "case", + matches: [ + ["parent", %r{^organizations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::UpdateCaseRequest] + # 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_case_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2beta/{case.name}", + body: "case", + matches: [ + ["case.name", %r{^projects/[^/]+/cases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2beta/{case.name}", + body: "case", + matches: [ + ["case.name", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the escalate_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::EscalateCaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_escalate_case_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta/{name}:escalate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/cases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2beta/{name}:escalate", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the close_case REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::CloseCaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_close_case_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta/{name}:close", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/cases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2beta/{name}:close", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_case_classifications REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest] + # 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_case_classifications_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/caseClassifications:search", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_pb.rb new file mode 100644 index 000000000000..a3fc1c8be09f --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_pb.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/case_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/support/v2beta/case_pb' +require 'google/cloud/support/v2beta/escalation_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n.google/cloud/support/v2beta/case_service.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/support/v2beta/case.proto\x1a,google/cloud/support/v2beta/escalation.proto\x1a google/protobuf/field_mask.proto\"H\n\x0eGetCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\"\x83\x01\n\x11\x43reateCaseRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 cloudsupport.googleapis.com/Case\x12\x34\n\x04\x63\x61se\x18\x02 \x01(\x0b\x32!.google.cloud.support.v2beta.CaseB\x03\xe0\x41\x02\"\xd9\x01\n\x10ListCasesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 cloudsupport.googleapis.com/Case\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\x12\x43\n\x0cproduct_line\x18\x08 \x01(\x0e\x32(.google.cloud.support.v2beta.ProductLineH\x00\x88\x01\x01\x42\x0f\n\r_product_line\"^\n\x11ListCasesResponse\x12\x30\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32!.google.cloud.support.v2beta.Case\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Z\n\x12SearchCasesRequest\x12\x0e\n\x06parent\x18\x04 \x01(\t\x12\r\n\x05query\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"`\n\x13SearchCasesResponse\x12\x30\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32!.google.cloud.support.v2beta.Case\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8a\x01\n\x13\x45scalateCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12;\n\nescalation\x18\x02 \x01(\x0b\x32\'.google.cloud.support.v2beta.Escalation\"z\n\x11UpdateCaseRequest\x12\x34\n\x04\x63\x61se\x18\x01 \x01(\x0b\x32!.google.cloud.support.v2beta.CaseB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"J\n\x10\x43loseCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\"\x94\x01\n SearchCaseClassificationsRequest\x12\r\n\x05query\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12:\n\x07product\x18\x07 \x01(\x0b\x32$.google.cloud.support.v2beta.ProductB\x03\xe0\x41\x01\"\x8b\x01\n!SearchCaseClassificationsResponse\x12M\n\x14\x63\x61se_classifications\x18\x01 \x03(\x0b\x32/.google.cloud.support.v2beta.CaseClassification\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xcb\r\n\x0b\x43\x61seService\x12\xb5\x01\n\x07GetCase\x12+.google.cloud.support.v2beta.GetCaseRequest\x1a!.google.cloud.support.v2beta.Case\"Z\xda\x41\x04name\x82\xd3\xe4\x93\x02M\x12!/v2beta/{name=projects/*/cases/*}Z(\x12&/v2beta/{name=organizations/*/cases/*}\x12\xc8\x01\n\tListCases\x12-.google.cloud.support.v2beta.ListCasesRequest\x1a..google.cloud.support.v2beta.ListCasesResponse\"\\\xda\x41\x06parent\x82\xd3\xe4\x93\x02M\x12!/v2beta/{parent=projects/*}/casesZ(\x12&/v2beta/{parent=organizations/*}/cases\x12\xd3\x01\n\x0bSearchCases\x12/.google.cloud.support.v2beta.SearchCasesRequest\x1a\x30.google.cloud.support.v2beta.SearchCasesResponse\"a\x82\xd3\xe4\x93\x02[\x12(/v2beta/{parent=projects/*}/cases:searchZ/\x12-/v2beta/{parent=organizations/*}/cases:search\x12\xce\x01\n\nCreateCase\x12..google.cloud.support.v2beta.CreateCaseRequest\x1a!.google.cloud.support.v2beta.Case\"m\xda\x41\x0bparent,case\x82\xd3\xe4\x93\x02Y\"!/v2beta/{parent=projects/*}/cases:\x04\x63\x61seZ.\"&/v2beta/{parent=organizations/*}/cases:\x04\x63\x61se\x12\xdd\x01\n\nUpdateCase\x12..google.cloud.support.v2beta.UpdateCaseRequest\x1a!.google.cloud.support.v2beta.Case\"|\xda\x41\x10\x63\x61se,update_mask\x82\xd3\xe4\x93\x02\x63\x32&/v2beta/{case.name=projects/*/cases/*}:\x04\x63\x61seZ32+/v2beta/{case.name=organizations/*/cases/*}:\x04\x63\x61se\x12\xd0\x01\n\x0c\x45scalateCase\x12\x30.google.cloud.support.v2beta.EscalateCaseRequest\x1a!.google.cloud.support.v2beta.Case\"k\x82\xd3\xe4\x93\x02\x65\"*/v2beta/{name=projects/*/cases/*}:escalate:\x01*Z4\"//v2beta/{name=organizations/*/cases/*}:escalate:\x01*\x12\xc4\x01\n\tCloseCase\x12-.google.cloud.support.v2beta.CloseCaseRequest\x1a!.google.cloud.support.v2beta.Case\"e\x82\xd3\xe4\x93\x02_\"\'/v2beta/{name=projects/*/cases/*}:close:\x01*Z1\",/v2beta/{name=organizations/*/cases/*}:close:\x01*\x12\xc6\x01\n\x19SearchCaseClassifications\x12=.google.cloud.support.v2beta.SearchCaseClassificationsRequest\x1a>.google.cloud.support.v2beta.SearchCaseClassificationsResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v2beta/caseClassifications:search\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcd\x01\n\x1f\x63om.google.cloud.support.v2betaB\x10\x43\x61seServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + GetCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.GetCaseRequest").msgclass + CreateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.CreateCaseRequest").msgclass + ListCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListCasesRequest").msgclass + ListCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListCasesResponse").msgclass + SearchCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.SearchCasesRequest").msgclass + SearchCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.SearchCasesResponse").msgclass + EscalateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.EscalateCaseRequest").msgclass + UpdateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.UpdateCaseRequest").msgclass + CloseCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.CloseCaseRequest").msgclass + SearchCaseClassificationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.SearchCaseClassificationsRequest").msgclass + SearchCaseClassificationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.SearchCaseClassificationsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_services_pb.rb new file mode 100644 index 000000000000..9fa9f81f611b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_services_pb.rb @@ -0,0 +1,82 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/support/v2beta/case_service.proto for package 'Google.Cloud.Support.V2beta' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/support/v2beta/case_service_pb' + +module Google + module Cloud + module Support + module V2beta + module CaseService + # A service to manage Google Cloud support cases. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.support.v2beta.CaseService' + + # Retrieve a case. + rpc :GetCase, ::Google::Cloud::Support::V2beta::GetCaseRequest, ::Google::Cloud::Support::V2beta::Case + # Retrieve all cases under a parent, but not its children. + # + # For example, listing cases under an organization only returns the cases + # that are directly parented by that organization. To retrieve cases + # under an organization and its projects, use `cases.search`. + rpc :ListCases, ::Google::Cloud::Support::V2beta::ListCasesRequest, ::Google::Cloud::Support::V2beta::ListCasesResponse + # Search for cases using a query. + rpc :SearchCases, ::Google::Cloud::Support::V2beta::SearchCasesRequest, ::Google::Cloud::Support::V2beta::SearchCasesResponse + # Create a new case and associate it with a parent. + # + # It must have the following fields set: `display_name`, `description`, + # `classification`, and `priority`. If you're just testing the API and don't + # want to route your case to an agent, set `testCase=true`. + rpc :CreateCase, ::Google::Cloud::Support::V2beta::CreateCaseRequest, ::Google::Cloud::Support::V2beta::Case + # Update a case. Only some fields can be updated. + rpc :UpdateCase, ::Google::Cloud::Support::V2beta::UpdateCaseRequest, ::Google::Cloud::Support::V2beta::Case + # Escalate a case, starting the Google Cloud Support escalation management + # process. + # + # This operation is only available for some support services. Go to + # https://cloud.google.com/support and look for 'Technical support + # escalations' in the feature list to find out which ones let you + # do that. + rpc :EscalateCase, ::Google::Cloud::Support::V2beta::EscalateCaseRequest, ::Google::Cloud::Support::V2beta::Case + # Close a case. + rpc :CloseCase, ::Google::Cloud::Support::V2beta::CloseCaseRequest, ::Google::Cloud::Support::V2beta::Case + # Retrieve valid classifications to use when creating a support case. + # + # Classifications are hierarchical. Each classification is a string + # containing all levels of the hierarchy separated by `" > "`. For example, + # `"Technical Issue > Compute > Compute Engine"`. + # + # Classification IDs returned by this endpoint are valid for at least six + # months. When a classification is deactivated, this endpoint immediately + # stops returning it. After six months, `case.create` requests using the + # classification will fail. + rpc :SearchCaseClassifications, ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest, ::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_pb.rb new file mode 100644 index 000000000000..82890699705e --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/comment.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/support/v2beta/actor_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n)google/cloud/support/v2beta/comment.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdb\x02\n\x07\x43omment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x07\x63reator\x18\x03 \x01(\x0b\x32\".google.cloud.support.v2beta.ActorB\x03\xe0\x41\x03\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\x1e\n\x0fplain_text_body\x18\x05 \x01(\tB\x05\x18\x01\xe0\x41\x03:\x9b\x01\xea\x41\x97\x01\n#cloudsupport.googleapis.com/Comment\x12] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CommentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::ListCommentsRequest.new + # + # # Call the list_comments method. + # result = client.list_comments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::Comment. + # p item + # end + # + def list_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCommentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_comments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_comments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @comment_service_stub.call_rpc :list_comments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @comment_service_stub, :list_comments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Add a new comment to a case. + # + # The comment must have the following fields set: `body`. + # + # @overload create_comment(request, options = nil) + # Pass arguments to `create_comment` via a request object, either of type + # {::Google::Cloud::Support::V2beta::CreateCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::CreateCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_comment(parent: nil, comment: nil) + # Pass arguments to `create_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the case to which the comment should be added. + # @param comment [::Google::Cloud::Support::V2beta::Comment, ::Hash] + # Required. The comment to be added. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2beta::Comment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2beta::Comment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CommentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::CreateCommentRequest.new + # + # # Call the create_comment method. + # result = client.create_comment request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Comment. + # p result + # + def create_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCommentRequest + + # Converts hash and nil to 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_comment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @comment_service_stub.call_rpc :create_comment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve a comment. + # + # @overload get_comment(request, options = nil) + # Pass arguments to `get_comment` via a request object, either of type + # {::Google::Cloud::Support::V2beta::GetCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::GetCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_comment(name: nil) + # Pass arguments to `get_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the comment to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Support::V2beta::Comment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Support::V2beta::Comment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CommentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::GetCommentRequest.new + # + # # Call the get_comment method. + # result = client.get_comment request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Comment. + # p result + # + def get_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetCommentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_comment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_comment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @comment_service_stub.call_rpc :get_comment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CommentService API. + # + # This class represents the configuration for CommentService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2beta::CommentService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_comments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2beta::CommentService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_comments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_comments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Support::V2beta::CommentService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CommentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_comments + ## + # RPC-specific configuration for `create_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_comment + ## + # RPC-specific configuration for `get_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_comment + + # @private + def initialize parent_rpcs = nil + list_comments_config = parent_rpcs.list_comments if parent_rpcs.respond_to? :list_comments + @list_comments = ::Gapic::Config::Method.new list_comments_config + create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment + @create_comment = ::Gapic::Config::Method.new create_comment_config + get_comment_config = parent_rpcs.get_comment if parent_rpcs.respond_to? :get_comment + @get_comment = ::Gapic::Config::Method.new get_comment_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/credentials.rb new file mode 100644 index 000000000000..31a79f1800d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/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 Support + module V2beta + module CommentService + # Credentials for the CommentService 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-support-v2beta/lib/google/cloud/support/v2beta/comment_service/paths.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/paths.rb new file mode 100644 index 000000000000..f82bc4f11f8c --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/paths.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! + + +module Google + module Cloud + module Support + module V2beta + module CommentService + # Path helper methods for the CommentService API. + module Paths + ## + # Create a fully-qualified Case resource string. + # + # @overload case_path(organization:, case:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}` + # + # @param organization [String] + # @param case [String] + # + # @overload case_path(project:, case:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}` + # + # @param project [String] + # @param case [String] + # + # @return [::String] + def case_path **args + resources = { + "case:organization" => (proc do |organization:, case:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}" + end), + "case:project" => (proc do |project:, case:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}" + 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 Comment resource string. + # + # @overload comment_path(organization:, case:, comment:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}/comments/{comment}` + # + # @param organization [String] + # @param case [String] + # @param comment [String] + # + # @overload comment_path(project:, case:, comment:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}/comments/{comment}` + # + # @param project [String] + # @param case [String] + # @param comment [String] + # + # @return [::String] + def comment_path **args + resources = { + "case:comment:organization" => (proc do |organization:, case:, comment:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}/comments/#{comment}" + end), + "case:comment:project" => (proc do |project:, case:, comment:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}/comments/#{comment}" + 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-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest.rb new file mode 100644 index 000000000000..15455343c273 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_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/support/v2beta/version" + +require "google/cloud/support/v2beta/comment_service/credentials" +require "google/cloud/support/v2beta/comment_service/paths" +require "google/cloud/support/v2beta/comment_service/rest/client" + +module Google + module Cloud + module Support + module V2beta + ## + # A service to manage comments on cases. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/support/v2beta/comment_service/rest" + # client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new + # + module CommentService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/support/v2beta/comment_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/client.rb new file mode 100644 index 000000000000..7bf24d29d1a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/client.rb @@ -0,0 +1,616 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/support/v2beta/comment_service_pb" +require "google/cloud/support/v2beta/comment_service/rest/service_stub" + +module Google + module Cloud + module Support + module V2beta + module CommentService + module Rest + ## + # REST client for the CommentService service. + # + # A service to manage comments on cases. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :comment_service_stub + + ## + # Configure the CommentService Client class. + # + # See {::Google::Cloud::Support::V2beta::CommentService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CommentService clients + # ::Google::Cloud::Support::V2beta::CommentService::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", "Support", "V2beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_comments.timeout = 60.0 + default_config.rpcs.list_comments.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_comment.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CommentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Support::V2beta::CommentService::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 + @comment_service_stub.universe_domain + end + + ## + # Create a new CommentService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CommentService 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 + + @comment_service_stub = ::Google::Cloud::Support::V2beta::CommentService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @comment_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 + @comment_service_stub.logger + end + + # Service calls + + ## + # List all the comments associated with a case. + # + # @overload list_comments(request, options = nil) + # Pass arguments to `list_comments` via a request object, either of type + # {::Google::Cloud::Support::V2beta::ListCommentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::ListCommentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_comments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_comments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the case for which to list comments. + # @param page_size [::Integer] + # The maximum number of comments to fetch. Defaults to 10. + # @param page_token [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CommentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::ListCommentsRequest.new + # + # # Call the list_comments method. + # result = client.list_comments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::Comment. + # p item + # end + # + def list_comments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCommentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_comments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_comments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_comments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @comment_service_stub.list_comments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @comment_service_stub, :list_comments, "comments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Add a new comment to a case. + # + # The comment must have the following fields set: `body`. + # + # @overload create_comment(request, options = nil) + # Pass arguments to `create_comment` via a request object, either of type + # {::Google::Cloud::Support::V2beta::CreateCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::CreateCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_comment(parent: nil, comment: nil) + # Pass arguments to `create_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the case to which the comment should be added. + # @param comment [::Google::Cloud::Support::V2beta::Comment, ::Hash] + # Required. The comment to be added. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Comment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Comment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CommentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::CreateCommentRequest.new + # + # # Call the create_comment method. + # result = client.create_comment request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Comment. + # p result + # + def create_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCommentRequest + + # Converts hash and nil to an 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_comment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @comment_service_stub.create_comment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieve a comment. + # + # @overload get_comment(request, options = nil) + # Pass arguments to `get_comment` via a request object, either of type + # {::Google::Cloud::Support::V2beta::GetCommentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::GetCommentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_comment(name: nil) + # Pass arguments to `get_comment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the comment to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Comment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Comment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::CommentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::GetCommentRequest.new + # + # # Call the get_comment method. + # result = client.get_comment request + # + # # The returned object is of type Google::Cloud::Support::V2beta::Comment. + # p result + # + def get_comment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetCommentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_comment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_comment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_comment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @comment_service_stub.get_comment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CommentService REST API. + # + # This class represents the configuration for CommentService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2beta::CommentService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_comments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_comments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_comments.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CommentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_comments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_comments + ## + # RPC-specific configuration for `create_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_comment + ## + # RPC-specific configuration for `get_comment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_comment + + # @private + def initialize parent_rpcs = nil + list_comments_config = parent_rpcs.list_comments if parent_rpcs.respond_to? :list_comments + @list_comments = ::Gapic::Config::Method.new list_comments_config + create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment + @create_comment = ::Gapic::Config::Method.new create_comment_config + get_comment_config = parent_rpcs.get_comment if parent_rpcs.respond_to? :get_comment + @get_comment = ::Gapic::Config::Method.new get_comment_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb new file mode 100644 index 000000000000..f23ddfc6a74b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb @@ -0,0 +1,280 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/support/v2beta/comment_service_pb" + +module Google + module Cloud + module Support + module V2beta + module CommentService + module Rest + ## + # REST service stub for the CommentService 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_comments REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::ListCommentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::ListCommentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::ListCommentsResponse] + # A result object deserialized from the server's reply + def list_comments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_comments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_comments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::ListCommentsResponse.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_comment REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::CreateCommentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Comment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Comment] + # A result object deserialized from the server's reply + def create_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_comment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_comment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::Comment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_comment REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::GetCommentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::Comment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::Comment] + # A result object deserialized from the server's reply + def get_comment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_comment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_comment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::Comment.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_comments REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::ListCommentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_comments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}/comments", + matches: [ + ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}/comments", + matches: [ + ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_comment REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::CreateCommentRequest] + # 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_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta/{parent}/comments", + body: "comment", + matches: [ + ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2beta/{parent}/comments", + body: "comment", + matches: [ + ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_comment REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::GetCommentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_comment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{name}", + matches: [ + ["name", %r{^[^/]+/[^/]+/cases/[^/]+/comments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_pb.rb new file mode 100644 index 000000000000..f7eb35a04a9a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/comment_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/support/v2beta/comment_pb' + + +descriptor_data = "\n1google/cloud/support/v2beta/comment_service.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/support/v2beta/comment.proto\"v\n\x13ListCommentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"g\n\x14ListCommentsResponse\x12\x36\n\x08\x63omments\x18\x01 \x03(\x0b\x32$.google.cloud.support.v2beta.Comment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8c\x01\n\x14\x43reateCommentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12:\n\x07\x63omment\x18\x02 \x01(\x0b\x32$.google.cloud.support.v2beta.CommentB\x03\xe0\x41\x02\"N\n\x11GetCommentRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#cloudsupport.googleapis.com/Comment2\xe0\x05\n\x0e\x43ommentService\x12\xe7\x01\n\x0cListComments\x12\x30.google.cloud.support.v2beta.ListCommentsRequest\x1a\x31.google.cloud.support.v2beta.ListCommentsResponse\"r\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x63\x12,/v2beta/{parent=projects/*/cases/*}/commentsZ3\x12\x31/v2beta/{parent=organizations/*/cases/*}/comments\x12\xf7\x01\n\rCreateComment\x12\x31.google.cloud.support.v2beta.CreateCommentRequest\x1a$.google.cloud.support.v2beta.Comment\"\x8c\x01\xda\x41\x0eparent,comment\x82\xd3\xe4\x93\x02u\",/v2beta/{parent=projects/*/cases/*}/comments:\x07\x63ommentZ<\"1/v2beta/{parent=organizations/*/cases/*}/comments:\x07\x63omment\x12\x98\x01\n\nGetComment\x12..google.cloud.support.v2beta.GetCommentRequest\x1a$.google.cloud.support.v2beta.Comment\"4\xda\x41\x04name\x82\xd3\xe4\x93\x02\'\x12%/v2beta/{name=*/*/cases/*/comments/*}\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd0\x01\n\x1f\x63om.google.cloud.support.v2betaB\x13\x43ommentServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + ListCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListCommentsRequest").msgclass + ListCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListCommentsResponse").msgclass + CreateCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.CreateCommentRequest").msgclass + GetCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.GetCommentRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_services_pb.rb new file mode 100644 index 000000000000..a15bd0317801 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/support/v2beta/comment_service.proto for package 'Google.Cloud.Support.V2beta' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/support/v2beta/comment_service_pb' + +module Google + module Cloud + module Support + module V2beta + module CommentService + # A service to manage comments on cases. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.support.v2beta.CommentService' + + # List all the comments associated with a case. + rpc :ListComments, ::Google::Cloud::Support::V2beta::ListCommentsRequest, ::Google::Cloud::Support::V2beta::ListCommentsResponse + # Add a new comment to a case. + # + # The comment must have the following fields set: `body`. + rpc :CreateComment, ::Google::Cloud::Support::V2beta::CreateCommentRequest, ::Google::Cloud::Support::V2beta::Comment + # Retrieve a comment. + rpc :GetComment, ::Google::Cloud::Support::V2beta::GetCommentRequest, ::Google::Cloud::Support::V2beta::Comment + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/content_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/content_pb.rb new file mode 100644 index 000000000000..5cd0bef42e12 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/content_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/content.proto + +require 'google/protobuf' + + +descriptor_data = "\n)google/cloud/support/v2beta/content.proto\x12\x1bgoogle.cloud.support.v2beta\"!\n\x0bTextContent\x12\x12\n\nplain_text\x18\x01 \x01(\tB\xc9\x01\n\x1f\x63om.google.cloud.support.v2betaB\x0c\x43ontentProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + TextContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.TextContent").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/email_message_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/email_message_pb.rb new file mode 100644 index 000000000000..bda054d8c8c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/email_message_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/email_message.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/support/v2beta/actor_pb' +require 'google/cloud/support/v2beta/content_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/support/v2beta/email_message.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a)google/cloud/support/v2beta/content.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x89\x04\n\x0c\x45mailMessage\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\x36\n\x05\x61\x63tor\x18\x03 \x01(\x0b\x32\".google.cloud.support.v2beta.ActorB\x03\xe0\x41\x03\x12\x14\n\x07subject\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12&\n\x19recipient_email_addresses\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12\x1f\n\x12\x63\x63_email_addresses\x18\x06 \x03(\tB\x03\xe0\x41\x03\x12\x43\n\x0c\x62ody_content\x18\x08 \x01(\x0b\x32(.google.cloud.support.v2beta.TextContentB\x03\xe0\x41\x03:\xd3\x01\xea\x41\xcf\x01\n(cloudsupport.googleapis.com/EmailMessage\x12=projects/{project}/cases/{case}/emailMessages/{email_message}\x12Gorganizations/{organization}/cases/{case}/emailMessages/{email_message}*\remailMessages2\x0c\x65mailMessageB\xce\x01\n\x1f\x63om.google.cloud.support.v2betaB\x11\x45mailMessageProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + EmailMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.EmailMessage").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/escalation_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/escalation_pb.rb new file mode 100644 index 000000000000..5b660f6c34e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/escalation_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/escalation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n,google/cloud/support/v2beta/escalation.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\"\xd2\x01\n\nEscalation\x12\x43\n\x06reason\x18\x04 \x01(\x0e\x32..google.cloud.support.v2beta.Escalation.ReasonB\x03\xe0\x41\x02\x12\x1a\n\rjustification\x18\x05 \x01(\tB\x03\xe0\x41\x02\"c\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x13\n\x0fRESOLUTION_TIME\x10\x01\x12\x17\n\x13TECHNICAL_EXPERTISE\x10\x02\x12\x13\n\x0f\x42USINESS_IMPACT\x10\x03\x42\xcc\x01\n\x1f\x63om.google.cloud.support.v2betaB\x0f\x45scalationProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + Escalation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Escalation").msgclass + Escalation::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Escalation.Reason").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_item_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_item_pb.rb new file mode 100644 index 000000000000..e34a06b8285d --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_item_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/feed_item.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/support/v2beta/attachment_pb' +require 'google/cloud/support/v2beta/comment_pb' +require 'google/cloud/support/v2beta/email_message_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n+google/cloud/support/v2beta/feed_item.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/support/v2beta/attachment.proto\x1a)google/cloud/support/v2beta/comment.proto\x1a/google/cloud/support/v2beta/email_message.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6\x02\n\x08\x46\x65\x65\x64Item\x12<\n\x07\x63omment\x18\x64 \x01(\x0b\x32$.google.cloud.support.v2beta.CommentB\x03\xe0\x41\x03H\x00\x12\x42\n\nattachment\x18\x65 \x01(\x0b\x32\'.google.cloud.support.v2beta.AttachmentB\x03\xe0\x41\x03H\x00\x12G\n\remail_message\x18\x66 \x01(\x0b\x32).google.cloud.support.v2beta.EmailMessageB\x03\xe0\x41\x03H\x00\x12J\n\x12\x64\x65leted_attachment\x18g \x01(\x0b\x32\'.google.cloud.support.v2beta.AttachmentB\x03\xe0\x41\x03H\x00\x12\x33\n\nevent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x0e\n\x0c\x65vent_objectB\xca\x01\n\x1f\x63om.google.cloud.support.v2betaB\rFeedItemProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + FeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.FeedItem").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service.rb new file mode 100644 index 000000000000..0429e129474d --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_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/support/v2beta/version" + +require "google/cloud/support/v2beta/feed_service/credentials" +require "google/cloud/support/v2beta/feed_service/paths" +require "google/cloud/support/v2beta/feed_service/client" +require "google/cloud/support/v2beta/feed_service/rest" + +module Google + module Cloud + module Support + module V2beta + ## + # A service to view case feed items. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/support/v2beta/feed_service" + # client = ::Google::Cloud::Support::V2beta::FeedService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/support/v2beta/feed_service/rest" + # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new + # + module FeedService + end + end + end + end +end + +helper_path = ::File.join __dir__, "feed_service", "helpers.rb" +require "google/cloud/support/v2beta/feed_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/client.rb new file mode 100644 index 000000000000..1b4e29f724e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/client.rb @@ -0,0 +1,499 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/support/v2beta/feed_service_pb" + +module Google + module Cloud + module Support + module V2beta + module FeedService + ## + # Client for the FeedService service. + # + # A service to view case feed items. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feed_service_stub + + ## + # Configure the FeedService Client class. + # + # See {::Google::Cloud::Support::V2beta::FeedService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeedService clients + # ::Google::Cloud::Support::V2beta::FeedService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Support", "V2beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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.show_feed.timeout = 60.0 + default_config.rpcs.show_feed.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 FeedService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Support::V2beta::FeedService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @feed_service_stub.universe_domain + end + + ## + # Create a new FeedService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Support::V2beta::FeedService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Support::V2beta::FeedService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeedService 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/support/v2beta/feed_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 + + @feed_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Support::V2beta::FeedService::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 + ) + + @feed_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 + @feed_service_stub.logger + end + + # Service calls + + ## + # Show items in the feed of this case, including case emails, + # attachments, and comments. + # + # @overload show_feed(request, options = nil) + # Pass arguments to `show_feed` via a request object, either of type + # {::Google::Cloud::Support::V2beta::ShowFeedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::ShowFeedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload show_feed(parent: nil, order_by: nil, page_size: nil, page_token: nil) + # Pass arguments to `show_feed` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the case for which feed items should be + # listed. + # @param order_by [::String] + # Optional. Field to order feed items by, followed by `asc` or `desc` + # postfix. The only valid field is + # `creation_time`. This list is case-insensitive, default sorting order is + # ascending, and the redundant space characters are insignificant. + # + # Example: `creation_time desc` + # @param page_size [::Integer] + # Optional. The maximum number of feed items fetched with each request. + # @param page_token [::String] + # Optional. A token identifying the page of results to return. If + # unspecified, it retrieves the first page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::FeedItem>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::FeedItem>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::FeedService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::ShowFeedRequest.new + # + # # Call the show_feed method. + # result = client.show_feed request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::FeedItem. + # p item + # end + # + def show_feed request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ShowFeedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.show_feed.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.show_feed.timeout, + metadata: metadata, + retry_policy: @config.rpcs.show_feed.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feed_service_stub.call_rpc :show_feed, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @feed_service_stub, :show_feed, request, response, 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 FeedService API. + # + # This class represents the configuration for FeedService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2beta::FeedService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # show_feed to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2beta::FeedService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.show_feed.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2beta::FeedService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.show_feed.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Support::V2beta::FeedService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the FeedService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `show_feed` + # @return [::Gapic::Config::Method] + # + attr_reader :show_feed + + # @private + def initialize parent_rpcs = nil + show_feed_config = parent_rpcs.show_feed if parent_rpcs.respond_to? :show_feed + @show_feed = ::Gapic::Config::Method.new show_feed_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/credentials.rb new file mode 100644 index 000000000000..9e492496d8a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/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 Support + module V2beta + module FeedService + # Credentials for the FeedService 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-support-v2beta/lib/google/cloud/support/v2beta/feed_service/paths.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/paths.rb new file mode 100644 index 000000000000..52cad904cef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/paths.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + module FeedService + # Path helper methods for the FeedService API. + module Paths + ## + # Create a fully-qualified Case resource string. + # + # @overload case_path(organization:, case:) + # The resource will be in the following format: + # + # `organizations/{organization}/cases/{case}` + # + # @param organization [String] + # @param case [String] + # + # @overload case_path(project:, case:) + # The resource will be in the following format: + # + # `projects/{project}/cases/{case}` + # + # @param project [String] + # @param case [String] + # + # @return [::String] + def case_path **args + resources = { + "case:organization" => (proc do |organization:, case:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/cases/#{binding.local_variable_get :case}" + end), + "case:project" => (proc do |project:, case:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/cases/#{binding.local_variable_get :case}" + 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-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest.rb new file mode 100644 index 000000000000..0c9dce322c55 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_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/support/v2beta/version" + +require "google/cloud/support/v2beta/feed_service/credentials" +require "google/cloud/support/v2beta/feed_service/paths" +require "google/cloud/support/v2beta/feed_service/rest/client" + +module Google + module Cloud + module Support + module V2beta + ## + # A service to view case feed items. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/support/v2beta/feed_service/rest" + # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new + # + module FeedService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/support/v2beta/feed_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/client.rb new file mode 100644 index 000000000000..bc99077c1181 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/client.rb @@ -0,0 +1,449 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/support/v2beta/feed_service_pb" +require "google/cloud/support/v2beta/feed_service/rest/service_stub" + +module Google + module Cloud + module Support + module V2beta + module FeedService + module Rest + ## + # REST client for the FeedService service. + # + # A service to view case feed items. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :feed_service_stub + + ## + # Configure the FeedService Client class. + # + # See {::Google::Cloud::Support::V2beta::FeedService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all FeedService clients + # ::Google::Cloud::Support::V2beta::FeedService::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", "Support", "V2beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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.show_feed.timeout = 60.0 + default_config.rpcs.show_feed.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 FeedService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Support::V2beta::FeedService::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 + @feed_service_stub.universe_domain + end + + ## + # Create a new FeedService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the FeedService 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 + + @feed_service_stub = ::Google::Cloud::Support::V2beta::FeedService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @feed_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 + @feed_service_stub.logger + end + + # Service calls + + ## + # Show items in the feed of this case, including case emails, + # attachments, and comments. + # + # @overload show_feed(request, options = nil) + # Pass arguments to `show_feed` via a request object, either of type + # {::Google::Cloud::Support::V2beta::ShowFeedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Support::V2beta::ShowFeedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload show_feed(parent: nil, order_by: nil, page_size: nil, page_token: nil) + # Pass arguments to `show_feed` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the case for which feed items should be + # listed. + # @param order_by [::String] + # Optional. Field to order feed items by, followed by `asc` or `desc` + # postfix. The only valid field is + # `creation_time`. This list is case-insensitive, default sorting order is + # ascending, and the redundant space characters are insignificant. + # + # Example: `creation_time desc` + # @param page_size [::Integer] + # Optional. The maximum number of feed items fetched with each request. + # @param page_token [::String] + # Optional. A token identifying the page of results to return. If + # unspecified, it retrieves the first page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::FeedItem>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::FeedItem>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/support/v2beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Support::V2beta::FeedService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Support::V2beta::ShowFeedRequest.new + # + # # Call the show_feed method. + # result = client.show_feed request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Support::V2beta::FeedItem. + # p item + # end + # + def show_feed request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ShowFeedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.show_feed.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Support::V2beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.show_feed.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.show_feed.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @feed_service_stub.show_feed request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @feed_service_stub, :show_feed, "feed_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 + + ## + # Configuration class for the FeedService REST API. + # + # This class represents the configuration for FeedService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Support::V2beta::FeedService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # show_feed to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.show_feed.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.show_feed.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the FeedService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `show_feed` + # @return [::Gapic::Config::Method] + # + attr_reader :show_feed + + # @private + def initialize parent_rpcs = nil + show_feed_config = parent_rpcs.show_feed if parent_rpcs.respond_to? :show_feed + @show_feed = ::Gapic::Config::Method.new show_feed_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb new file mode 100644 index 000000000000..d267a53b43d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/support/v2beta/feed_service_pb" + +module Google + module Cloud + module Support + module V2beta + module FeedService + module Rest + ## + # REST service stub for the FeedService 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 show_feed REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::ShowFeedRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Support::V2beta::ShowFeedResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Support::V2beta::ShowFeedResponse] + # A result object deserialized from the server's reply + def show_feed request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_show_feed_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "show_feed", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Support::V2beta::ShowFeedResponse.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 show_feed REST call + # + # @param request_pb [::Google::Cloud::Support::V2beta::ShowFeedRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_show_feed_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}:showFeed", + matches: [ + ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2beta/{parent}:showFeed", + matches: [ + ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_pb.rb new file mode 100644 index 000000000000..205586a189ef --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/support/v2beta/feed_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/support/v2beta/feed_item_pb' + + +descriptor_data = "\n.google/cloud/support/v2beta/feed_service.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/support/v2beta/feed_item.proto\"\x93\x01\n\x0fShowFeedRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x15\n\x08order_by\x18\x02 \x01(\tB\x03\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\"f\n\x10ShowFeedResponse\x12\x39\n\nfeed_items\x18\x01 \x03(\x0b\x32%.google.cloud.support.v2beta.FeedItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xbc\x02\n\x0b\x46\x65\x65\x64Service\x12\xdb\x01\n\x08ShowFeed\x12,.google.cloud.support.v2beta.ShowFeedRequest\x1a-.google.cloud.support.v2beta.ShowFeedResponse\"r\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x63\x12,/v2beta/{parent=projects/*/cases/*}:showFeedZ3\x12\x31/v2beta/{parent=organizations/*/cases/*}:showFeed\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcd\x01\n\x1f\x63om.google.cloud.support.v2betaB\x10\x46\x65\x65\x64ServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Support + module V2beta + ShowFeedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ShowFeedRequest").msgclass + ShowFeedResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ShowFeedResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_services_pb.rb new file mode 100644 index 000000000000..3f9bbd080798 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_services_pb.rb @@ -0,0 +1,46 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/support/v2beta/feed_service.proto for package 'Google.Cloud.Support.V2beta' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/support/v2beta/feed_service_pb' + +module Google + module Cloud + module Support + module V2beta + module FeedService + # A service to view case feed items. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.support.v2beta.FeedService' + + # Show items in the feed of this case, including case emails, + # attachments, and comments. + rpc :ShowFeed, ::Google::Cloud::Support::V2beta::ShowFeedRequest, ::Google::Cloud::Support::V2beta::ShowFeedResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/rest.rb new file mode 100644 index 000000000000..cb15b281dfb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/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/support/v2beta/case_attachment_service/rest" +require "google/cloud/support/v2beta/case_service/rest" +require "google/cloud/support/v2beta/comment_service/rest" +require "google/cloud/support/v2beta/feed_service/rest" +require "google/cloud/support/v2beta/version" + +module Google + module Cloud + module Support + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/support/v2beta/rest" + # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new + # + module V2beta + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/version.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/version.rb new file mode 100644 index 000000000000..8b242f65e38f --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/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 Support + module V2beta + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/README.md b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/README.md new file mode 100644 index 000000000000..228a12952fed --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/README.md @@ -0,0 +1,4 @@ +# Google Cloud Support V2BETA 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-support-v2beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/cloud/support/v2beta/actor.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/actor.rb new file mode 100644 index 000000000000..b45ea6fc9ae8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/actor.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! + + +module Google + module Cloud + module Support + module V2beta + # An Actor represents an entity that performed an action. For example, an actor + # could be a user who posted a comment on a support case, a user who + # uploaded an attachment, or a service account that created a support case. + # @!attribute [rw] display_name + # @return [::String] + # The name to display for the actor. If not provided, it is inferred from + # credentials supplied during case creation. When an email is provided, a + # display name must also be provided. This will be obfuscated if the user + # is a Google Support agent. + # @!attribute [rw] email + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # The email address of the actor. If not provided, it is inferred from the + # credentials supplied during case creation. When a name is provided, an + # email must also be provided. If the user is a Google Support agent, this is + # obfuscated. + # + # This field is deprecated. Use `username` instead. + # @!attribute [r] google_support + # @return [::Boolean] + # Output only. Whether the actor is a Google support actor. + # @!attribute [r] username + # @return [::String] + # Output only. The username of the actor. It may look like an email or other + # format provided by the identity provider. If not provided, it is inferred + # from the credentials supplied. When a name is provided, a username must + # also be provided. If the user is a Google Support agent, this will not be + # set. + class Actor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment.rb new file mode 100644 index 000000000000..adb9de8f353f --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + # An Attachment contains metadata about a file that was uploaded to a + # case - it is NOT a file itself. That being said, the name of an Attachment + # object can be used to download its accompanying file through the + # `media.download` endpoint. + # + # While attachments can be uploaded in the console at the + # same time as a comment, they're associated on a "case" level, not a + # "comment" level. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the attachment. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the attachment was created. + # @!attribute [r] creator + # @return [::Google::Cloud::Support::V2beta::Actor] + # Output only. The user who uploaded the attachment. Note, the name and email + # will be obfuscated if the attachment was uploaded by Google support. + # @!attribute [rw] filename + # @return [::String] + # The filename of the attachment (e.g. `"graph.jpg"`). + # @!attribute [r] mime_type + # @return [::String] + # Output only. The MIME type of the attachment (e.g. text/plain). + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. The size of the attachment in bytes. + class Attachment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment_service.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment_service.rb new file mode 100644 index 000000000000..cf9ec587b9cb --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment_service.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + # The request message for the ListAttachments endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the case for which attachments should be listed. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of attachments fetched with each request. + # + # If not provided, the default is 10. The maximum page size that will be + # returned is 100. + # + # The size of each page can be smaller than the requested page size and can + # include zero. For example, you could request 100 attachments on one page, + # receive 0, and then on the next page, receive 90. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + class ListAttachmentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for getting an attachment. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the attachment to get. + class GetAttachmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for the ListAttachments endpoint. + # @!attribute [rw] attachments + # @return [::Array<::Google::Cloud::Support::V2beta::Attachment>] + # The list of attachments associated with a case. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the `page_token` + # field of subsequent `cases.attachments.list` requests. If unspecified, + # there are no more results to retrieve. + class ListAttachmentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case.rb new file mode 100644 index 000000000000..c5adc8946ab1 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case.rb @@ -0,0 +1,215 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + # A Case is an object that contains the details of a support case. It + # contains fields for the time it was created, its priority, its + # classification, and more. Cases can also have comments and attachments that + # get added over time. + # + # A case is parented by a Google Cloud organization or project. + # + # Organizations are identified by a number, so the name of a case parented by + # an organization would look like this: + # + # ``` + # organizations/123/cases/456 + # ``` + # + # Projects have two unique identifiers, an ID and a number, and they look like + # this: + # + # ``` + # projects/abc/cases/456 + # ``` + # + # ``` + # projects/123/cases/456 + # ``` + # + # You can use either of them when calling the API. To learn more + # about project identifiers, see [AIP-2510](https://google.aip.dev/cloud/2510). + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for the case. + # @!attribute [rw] display_name + # @return [::String] + # The short summary of the issue reported in this case. + # @!attribute [rw] description + # @return [::String] + # A broad description of the issue. + # @!attribute [rw] classification + # @return [::Google::Cloud::Support::V2beta::CaseClassification] + # The issue classification applicable to this case. + # @!attribute [rw] time_zone + # @return [::String] + # The timezone of the user who created the support case. + # It should be in a format IANA recognizes: https://www.iana.org/time-zones. + # There is no additional validation done by the API. + # @!attribute [rw] subscriber_email_addresses + # @return [::Array<::String>] + # The email addresses to receive updates on this case. + # @!attribute [r] state + # @return [::Google::Cloud::Support::V2beta::Case::State] + # Output only. The current status of the support case. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this case was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this case was last updated. + # @!attribute [rw] creator + # @return [::Google::Cloud::Support::V2beta::Actor] + # The user who created the case. + # + # Note: The name and email will be obfuscated if the case was created by + # Google Support. + # @!attribute [rw] contact_email + # @return [::String] + # A user-supplied email address to send case update notifications for. This + # should only be used in BYOID flows, where we cannot infer the user's email + # address directly from their EUCs. + # @!attribute [rw] escalated + # @return [::Boolean] + # Whether the case is currently escalated. + # @!attribute [rw] test_case + # @return [::Boolean] + # Whether this case was created for internal API testing and should not be + # acted on by the support team. + # @!attribute [rw] language_code + # @return [::String] + # The language the user has requested to receive support in. This should be a + # BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). + # If no language or an unsupported language is specified, this field defaults + # to English (en). + # + # Language selection during case creation may affect your available support + # options. For a list of supported languages and their support working hours, + # see: https://cloud.google.com/support/docs/language-working-hours + # @!attribute [rw] priority + # @return [::Google::Cloud::Support::V2beta::Case::Priority] + # The priority of this case. + class Case + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of a support case. + module State + # Case is in an unknown state. + STATE_UNSPECIFIED = 0 + + # The case has been created but no one is assigned to work on it yet. + NEW = 1 + + # The case is currently being handled by Google support. + IN_PROGRESS_GOOGLE_SUPPORT = 2 + + # Google is waiting for a response. + ACTION_REQUIRED = 3 + + # A solution has been offered for the case, but it isn't yet closed. + SOLUTION_PROVIDED = 4 + + # The case has been resolved. + CLOSED = 5 + end + + # The case Priority. P0 is most urgent and P4 the least. + module Priority + # Priority is undefined or has not been set yet. + PRIORITY_UNSPECIFIED = 0 + + # Extreme impact on a production service. Service is hard down. + P0 = 1 + + # Critical impact on a production service. Service is currently unusable. + P1 = 2 + + # Severe impact on a production service. Service is usable but greatly + # impaired. + P2 = 3 + + # Medium impact on a production service. Service is available, but + # moderately impaired. + P3 = 4 + + # General questions or minor issues. Production service is fully + # available. + P4 = 5 + end + end + + # A Case Classification represents the topic that a case is about. It's very + # important to use accurate classifications, because they're + # used to route your cases to specialists who can help you. + # + # A classification always has an ID that is its unique identifier. + # A valid ID is required when creating a case. + # @!attribute [rw] id + # @return [::String] + # The unique ID for a classification. Must be specified for case creation. + # + # To retrieve valid classification IDs for case creation, use + # `caseClassifications.search`. + # + # Classification IDs returned by `caseClassifications.search` are guaranteed + # to be valid for at least 6 months. If a given classification is + # deactiveated, it will immediately stop being returned. After 6 months, + # `case.create` requests using the classification ID will fail. + # @!attribute [rw] display_name + # @return [::String] + # A display name for the classification. + # + # The display name is not static and can change. To uniquely and consistently + # identify classifications, use the `CaseClassification.id` field. + # @!attribute [rw] product + # @return [::Google::Cloud::Support::V2beta::Product] + # The full product the classification corresponds to. + class CaseClassification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The product a case may be associated with. + # @!attribute [rw] product_line + # @return [::Google::Cloud::Support::V2beta::ProductLine] + # The product line of the Product. + class Product + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The product line a support case may be associated with. + module ProductLine + # Unknown product type. + PRODUCT_LINE_UNSPECIFIED = 0 + + # Google Cloud + GOOGLE_CLOUD = 1 + + # Google Maps + GOOGLE_MAPS = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case_service.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case_service.rb new file mode 100644 index 000000000000..5b0a67b0e526 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case_service.rb @@ -0,0 +1,245 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + # The request message for the GetCase endpoint. + # @!attribute [rw] name + # @return [::String] + # Required. The full name of a case to be retrieved. + class GetCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the CreateCase endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent under which the case should be created. + # @!attribute [rw] case + # @return [::Google::Cloud::Support::V2beta::Case] + # Required. The case to be created. + class CreateCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the ListCases endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of a parent to list cases under. + # @!attribute [rw] filter + # @return [::String] + # An expression used to filter cases. + # + # If it's an empty string, then no filtering happens. Otherwise, the endpoint + # returns the cases that match the filter. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # EXAMPLES: + # + # - `state=CLOSED` + # - `state=OPEN AND creator.email="tester@example.com"` + # - `state=OPEN AND (priority=P0 OR priority=P1)` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of cases fetched with each request. Defaults to 10. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # @!attribute [rw] product_line + # @return [::Google::Cloud::Support::V2beta::ProductLine] + # The product line to request cases for. If unspecified, only + # Google Cloud cases will be returned. + class ListCasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for the ListCases endpoint. + # @!attribute [rw] cases + # @return [::Array<::Google::Cloud::Support::V2beta::Case>] + # The list of cases associated with the parent after any + # filters have been applied. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the `page_token` + # field of subsequent `cases.list` requests. If unspecified, there are no + # more results to retrieve. + class ListCasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the SearchCases endpoint. + # @!attribute [rw] parent + # @return [::String] + # The name of the parent resource to search for cases under. + # @!attribute [rw] query + # @return [::String] + # An expression used to filter cases. + # + # Expressions use the following fields separated by `AND` and specified with + # `=`: + # + # - `organization`: An organization name in the form + # `organizations/`. + # - `project`: A project name in the form `projects/`. + # - `state`: Can be `OPEN` or `CLOSED`. + # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + # can specify multiple values for priority using the `OR` operator. For + # example, `priority=P1 OR priority=P2`. + # - `creator.email`: The email address of the case creator. + # + # You must specify either `organization` or `project`. + # + # To search across `displayName`, `description`, and comments, use a global + # restriction with no keyword or operator. For example, `"my search"`. + # + # To search only cases updated after a certain date, use `update_time` + # restricted with that particular date, time, and timezone in ISO datetime + # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + # `update_time` only supports the greater than operator (`>`). + # + # Examples: + # + # - `organization="organizations/123456789"` + # - `project="projects/my-project-id"` + # - `project="projects/123456789"` + # - `organization="organizations/123456789" AND state=CLOSED` + # - `project="projects/my-project-id" AND creator.email="tester@example.com"` + # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of cases fetched with each request. The default page + # size is 10. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + class SearchCasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for the SearchCases endpoint. + # @!attribute [rw] cases + # @return [::Array<::Google::Cloud::Support::V2beta::Case>] + # The list of cases associated with the parent after any + # filters have been applied. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the + # `page_token` field of subsequent `cases.search` requests. If unspecified, + # there are no more results to retrieve. + class SearchCasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the EscalateCase endpoint. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the case to be escalated. + # @!attribute [rw] escalation + # @return [::Google::Cloud::Support::V2beta::Escalation] + # The escalation information to be sent with the escalation request. + class EscalateCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the UpdateCase endpoint + # @!attribute [rw] case + # @return [::Google::Cloud::Support::V2beta::Case] + # Required. The case to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A list of attributes of the case that should be updated. Supported values + # are `priority`, `display_name`, and `subscriber_email_addresses`. If no + # fields are specified, all supported fields are updated. + # + # Be careful - if you do not provide a field mask, then you might + # accidentally clear some fields. For example, if you leave the field mask + # empty and do not provide a value for `subscriber_email_addresses`, then + # `subscriber_email_addresses` is updated to empty. + class UpdateCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the CloseCase endpoint. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the case to close. + class CloseCaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the SearchCaseClassifications endpoint. + # @!attribute [rw] query + # @return [::String] + # An expression used to filter case classifications. + # + # If it's an empty string, then no filtering happens. Otherwise, case + # classifications will be returned that match the filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of classifications fetched with each request. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is retrieved. + # @!attribute [rw] product + # @return [::Google::Cloud::Support::V2beta::Product] + # Optional. The product to return case classifications for. + class SearchCaseClassificationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for SearchCaseClassifications endpoint. + # @!attribute [rw] case_classifications + # @return [::Array<::Google::Cloud::Support::V2beta::CaseClassification>] + # The classifications retrieved. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the `page_token` + # field of subsequent `caseClassifications.list` requests. If unspecified, + # there are no more results to retrieve. + class SearchCaseClassificationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment.rb new file mode 100644 index 000000000000..81f686cfe082 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + # A comment associated with a support case. + # + # Case comments are the primary way for Google Support to communicate with a + # user who has opened a case. When a user responds to Google Support, the + # user's responses also appear as comments. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the comment. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the comment was created. + # @!attribute [r] creator + # @return [::Google::Cloud::Support::V2beta::Actor] + # Output only. The user or Google Support agent who created the comment. + # @!attribute [rw] body + # @return [::String] + # The full comment body. + # + # Maximum of 12800 characters. + # @!attribute [r] plain_text_body + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Output only. DEPRECATED. DO NOT USE. + # + # A duplicate of the `body` field. + # + # This field is only present for legacy reasons. + class Comment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment_service.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment_service.rb new file mode 100644 index 000000000000..f2742c33f65d --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment_service.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 Support + module V2beta + # The request message for the ListComments endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the case for which to list comments. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of comments to fetch. Defaults to 10. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. If unspecified, the + # first page is returned. + class ListCommentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for the ListComments endpoint. + # @!attribute [rw] comments + # @return [::Array<::Google::Cloud::Support::V2beta::Comment>] + # List of the comments associated with the case. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Set this in the `page_token` + # field of subsequent `cases.comments.list` requests. If unspecified, there + # are no more results to retrieve. + class ListCommentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the CreateComment endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the case to which the comment should be added. + # @!attribute [rw] comment + # @return [::Google::Cloud::Support::V2beta::Comment] + # Required. The comment to be added. + class CreateCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the GetComment endpoint. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the comment to retrieve. + class GetCommentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/content.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/content.rb new file mode 100644 index 000000000000..528eecc925bd --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/content.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + # Stores text attached to a support object. + # @!attribute [rw] plain_text + # @return [::String] + # Content in this field should be rendered and interpreted as-is. + class TextContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/email_message.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/email_message.rb new file mode 100644 index 000000000000..66d6775bf201 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/email_message.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + # An email associated with a support case. + # @!attribute [rw] name + # @return [::String] + # Identifier. Resource name for the email message. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this email message object was created. + # @!attribute [r] actor + # @return [::Google::Cloud::Support::V2beta::Actor] + # Output only. The user or Google Support agent that created this email + # message. This is inferred from the headers on the email message. + # @!attribute [r] subject + # @return [::String] + # Output only. Subject of the email. + # @!attribute [r] recipient_email_addresses + # @return [::Array<::String>] + # Output only. Email addresses the email was sent to. + # @!attribute [r] cc_email_addresses + # @return [::Array<::String>] + # Output only. Email addresses CCed on the email. + # @!attribute [r] body_content + # @return [::Google::Cloud::Support::V2beta::TextContent] + # Output only. The full email message body. A best-effort attempt is made to + # remove extraneous reply threads. + class EmailMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/escalation.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/escalation.rb new file mode 100644 index 000000000000..8c67ca0742eb --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/escalation.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + # An escalation of a support case. + # @!attribute [rw] reason + # @return [::Google::Cloud::Support::V2beta::Escalation::Reason] + # Required. The reason why the Case is being escalated. + # @!attribute [rw] justification + # @return [::String] + # Required. A free text description to accompany the `reason` field above. + # Provides additional context on why the case is being escalated. + class Escalation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enum detailing the possible reasons a case may be escalated. + module Reason + # The escalation reason is in an unknown state or has not been specified. + REASON_UNSPECIFIED = 0 + + # The case is taking too long to resolve. + RESOLUTION_TIME = 1 + + # The support agent does not have the expertise required to successfully + # resolve the issue. + TECHNICAL_EXPERTISE = 2 + + # The issue is having a significant business impact. + BUSINESS_IMPACT = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_item.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_item.rb new file mode 100644 index 000000000000..d0b449b4bb1e --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_item.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 Support + module V2beta + # A feed item associated with a support case. + # @!attribute [r] comment + # @return [::Google::Cloud::Support::V2beta::Comment] + # Output only. A comment added to the case. + # + # Note: The following fields are mutually exclusive: `comment`, `attachment`, `email_message`, `deleted_attachment`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] attachment + # @return [::Google::Cloud::Support::V2beta::Attachment] + # Output only. An attachment attached to the case. + # + # Note: The following fields are mutually exclusive: `attachment`, `comment`, `email_message`, `deleted_attachment`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] email_message + # @return [::Google::Cloud::Support::V2beta::EmailMessage] + # Output only. An email message received in reply to the case. + # + # Note: The following fields are mutually exclusive: `email_message`, `comment`, `attachment`, `deleted_attachment`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] deleted_attachment + # @return [::Google::Cloud::Support::V2beta::Attachment] + # Output only. A deleted attachment that used to be associated with the + # support case. + # + # Note: The following fields are mutually exclusive: `deleted_attachment`, `comment`, `attachment`, `email_message`. 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. Time corresponding to the event of this item. + class FeedItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_service.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_service.rb new file mode 100644 index 000000000000..d0628e30279c --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_service.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Support + module V2beta + # The request message for the ShowFeed endpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the case for which feed items should be + # listed. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Field to order feed items by, followed by `asc` or `desc` + # postfix. The only valid field is + # `creation_time`. This list is case-insensitive, default sorting order is + # ascending, and the redundant space characters are insignificant. + # + # Example: `creation_time desc` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of feed items fetched with each request. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying the page of results to return. If + # unspecified, it retrieves the first page. + class ShowFeedRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for the ShowFeed endpoint. + # @!attribute [rw] feed_items + # @return [::Array<::Google::Cloud::Support::V2beta::FeedItem>] + # The list of feed items associated with the given Case. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. This should be set in the + # `page_token` field of subsequent `ShowFeedRequests`. + # If unspecified, there are no more results to retrieve. + class ShowFeedResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/snippets/Gemfile b/owl-bot-staging/google-cloud-support-v2beta/snippets/Gemfile new file mode 100644 index 000000000000..e1812bac7937 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta", path: "../" +else + gem "google-cloud-support-v2beta" +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-support-v2beta/snippets/case_attachment_service/get_attachment.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/get_attachment.rb new file mode 100644 index 000000000000..817c8bc8ee34 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/get_attachment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the get_attachment call in the CaseAttachmentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseAttachmentService::Client#get_attachment. +# +def get_attachment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::GetAttachmentRequest.new + + # Call the get_attachment method. + result = client.get_attachment request + + # The returned object is of type Google::Cloud::Support::V2beta::Attachment. + p result +end +# [END cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/list_attachments.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/list_attachments.rb new file mode 100644 index 000000000000..a8197899de9a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/list_attachments.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 cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the list_attachments call in the CaseAttachmentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseAttachmentService::Client#list_attachments. +# +def list_attachments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::ListAttachmentsRequest.new + + # Call the list_attachments method. + result = client.list_attachments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2beta::Attachment. + p item + end +end +# [END cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/close_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/close_case.rb new file mode 100644 index 000000000000..df3698362b77 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/close_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2beta_generated_CaseService_CloseCase_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the close_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseService::Client#close_case. +# +def close_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::CloseCaseRequest.new + + # Call the close_case method. + result = client.close_case request + + # The returned object is of type Google::Cloud::Support::V2beta::Case. + p result +end +# [END cloudsupport_v2beta_generated_CaseService_CloseCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/create_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/create_case.rb new file mode 100644 index 000000000000..dd6452cd2104 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/create_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2beta_generated_CaseService_CreateCase_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the create_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseService::Client#create_case. +# +def create_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::CreateCaseRequest.new + + # Call the create_case method. + result = client.create_case request + + # The returned object is of type Google::Cloud::Support::V2beta::Case. + p result +end +# [END cloudsupport_v2beta_generated_CaseService_CreateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/escalate_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/escalate_case.rb new file mode 100644 index 000000000000..8ab2f5e01a80 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/escalate_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2beta_generated_CaseService_EscalateCase_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the escalate_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseService::Client#escalate_case. +# +def escalate_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::EscalateCaseRequest.new + + # Call the escalate_case method. + result = client.escalate_case request + + # The returned object is of type Google::Cloud::Support::V2beta::Case. + p result +end +# [END cloudsupport_v2beta_generated_CaseService_EscalateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/get_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/get_case.rb new file mode 100644 index 000000000000..d427183e1b53 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/get_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2beta_generated_CaseService_GetCase_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the get_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseService::Client#get_case. +# +def get_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::GetCaseRequest.new + + # Call the get_case method. + result = client.get_case request + + # The returned object is of type Google::Cloud::Support::V2beta::Case. + p result +end +# [END cloudsupport_v2beta_generated_CaseService_GetCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/list_cases.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/list_cases.rb new file mode 100644 index 000000000000..924fd42eb5cc --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/list_cases.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 cloudsupport_v2beta_generated_CaseService_ListCases_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the list_cases call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseService::Client#list_cases. +# +def list_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::ListCasesRequest.new + + # Call the list_cases method. + result = client.list_cases request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2beta::Case. + p item + end +end +# [END cloudsupport_v2beta_generated_CaseService_ListCases_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_case_classifications.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_case_classifications.rb new file mode 100644 index 000000000000..113460bea7e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_case_classifications.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 cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the search_case_classifications call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseService::Client#search_case_classifications. +# +def search_case_classifications + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new + + # Call the search_case_classifications method. + result = client.search_case_classifications request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2beta::CaseClassification. + p item + end +end +# [END cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_cases.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_cases.rb new file mode 100644 index 000000000000..2aeb60496c74 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_cases.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 cloudsupport_v2beta_generated_CaseService_SearchCases_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the search_cases call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseService::Client#search_cases. +# +def search_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::SearchCasesRequest.new + + # Call the search_cases method. + result = client.search_cases request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2beta::Case. + p item + end +end +# [END cloudsupport_v2beta_generated_CaseService_SearchCases_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/update_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/update_case.rb new file mode 100644 index 000000000000..42cb75413921 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/update_case.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2beta_generated_CaseService_UpdateCase_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the update_case call in the CaseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CaseService::Client#update_case. +# +def update_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CaseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::UpdateCaseRequest.new + + # Call the update_case method. + result = client.update_case request + + # The returned object is of type Google::Cloud::Support::V2beta::Case. + p result +end +# [END cloudsupport_v2beta_generated_CaseService_UpdateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/create_comment.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/create_comment.rb new file mode 100644 index 000000000000..111763a0cd80 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/create_comment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2beta_generated_CommentService_CreateComment_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the create_comment call in the CommentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CommentService::Client#create_comment. +# +def create_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CommentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::CreateCommentRequest.new + + # Call the create_comment method. + result = client.create_comment request + + # The returned object is of type Google::Cloud::Support::V2beta::Comment. + p result +end +# [END cloudsupport_v2beta_generated_CommentService_CreateComment_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/get_comment.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/get_comment.rb new file mode 100644 index 000000000000..40c25b1d4c91 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/get_comment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2beta_generated_CommentService_GetComment_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the get_comment call in the CommentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CommentService::Client#get_comment. +# +def get_comment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CommentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::GetCommentRequest.new + + # Call the get_comment method. + result = client.get_comment request + + # The returned object is of type Google::Cloud::Support::V2beta::Comment. + p result +end +# [END cloudsupport_v2beta_generated_CommentService_GetComment_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/list_comments.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/list_comments.rb new file mode 100644 index 000000000000..6a6ca196fdcd --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/list_comments.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudsupport_v2beta_generated_CommentService_ListComments_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the list_comments call in the CommentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::CommentService::Client#list_comments. +# +def list_comments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::CommentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::ListCommentsRequest.new + + # Call the list_comments method. + result = client.list_comments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2beta::Comment. + p item + end +end +# [END cloudsupport_v2beta_generated_CommentService_ListComments_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/feed_service/show_feed.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/feed_service/show_feed.rb new file mode 100644 index 000000000000..c67f13d8ae2b --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/feed_service/show_feed.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 cloudsupport_v2beta_generated_FeedService_ShowFeed_sync] +require "google/cloud/support/v2beta" + +## +# Snippet for the show_feed call in the FeedService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Support::V2beta::FeedService::Client#show_feed. +# +def show_feed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Support::V2beta::FeedService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Support::V2beta::ShowFeedRequest.new + + # Call the show_feed method. + result = client.show_feed request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Support::V2beta::FeedItem. + p item + end +end +# [END cloudsupport_v2beta_generated_FeedService_ShowFeed_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/snippet_metadata_google.cloud.support.v2beta.json b/owl-bot-staging/google-cloud-support-v2beta/snippets/snippet_metadata_google.cloud.support.v2beta.json new file mode 100644 index 000000000000..fd428e9168a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/snippets/snippet_metadata_google.cloud.support.v2beta.json @@ -0,0 +1,575 @@ +{ + "client_library": { + "name": "google-cloud-support-v2beta", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.support.v2beta", + "version": "v2beta" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_sync", + "title": "Snippet for the list_attachments call in the CaseAttachmentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseAttachmentService::Client#list_attachments.", + "file": "case_attachment_service/list_attachments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_attachments", + "full_name": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client#list_attachments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::ListAttachmentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::ListAttachmentsResponse", + "client": { + "short_name": "CaseAttachmentService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client" + }, + "method": { + "short_name": "ListAttachments", + "full_name": "google.cloud.support.v2beta.CaseAttachmentService.ListAttachments", + "service": { + "short_name": "CaseAttachmentService", + "full_name": "google.cloud.support.v2beta.CaseAttachmentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_sync", + "title": "Snippet for the get_attachment call in the CaseAttachmentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseAttachmentService::Client#get_attachment.", + "file": "case_attachment_service/get_attachment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_attachment", + "full_name": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client#get_attachment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::GetAttachmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::Attachment", + "client": { + "short_name": "CaseAttachmentService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client" + }, + "method": { + "short_name": "GetAttachment", + "full_name": "google.cloud.support.v2beta.CaseAttachmentService.GetAttachment", + "service": { + "short_name": "CaseAttachmentService", + "full_name": "google.cloud.support.v2beta.CaseAttachmentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CaseService_GetCase_sync", + "title": "Snippet for the get_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#get_case.", + "file": "case_service/get_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_case", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#get_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::GetCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" + }, + "method": { + "short_name": "GetCase", + "full_name": "google.cloud.support.v2beta.CaseService.GetCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2beta.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CaseService_ListCases_sync", + "title": "Snippet for the list_cases call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#list_cases.", + "file": "case_service/list_cases.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_cases", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#list_cases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::ListCasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::ListCasesResponse", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" + }, + "method": { + "short_name": "ListCases", + "full_name": "google.cloud.support.v2beta.CaseService.ListCases", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2beta.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CaseService_SearchCases_sync", + "title": "Snippet for the search_cases call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#search_cases.", + "file": "case_service/search_cases.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_cases", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#search_cases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::SearchCasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::SearchCasesResponse", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" + }, + "method": { + "short_name": "SearchCases", + "full_name": "google.cloud.support.v2beta.CaseService.SearchCases", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2beta.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CaseService_CreateCase_sync", + "title": "Snippet for the create_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#create_case.", + "file": "case_service/create_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_case", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#create_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::CreateCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" + }, + "method": { + "short_name": "CreateCase", + "full_name": "google.cloud.support.v2beta.CaseService.CreateCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2beta.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CaseService_UpdateCase_sync", + "title": "Snippet for the update_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#update_case.", + "file": "case_service/update_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_case", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#update_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::UpdateCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" + }, + "method": { + "short_name": "UpdateCase", + "full_name": "google.cloud.support.v2beta.CaseService.UpdateCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2beta.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CaseService_EscalateCase_sync", + "title": "Snippet for the escalate_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#escalate_case.", + "file": "case_service/escalate_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "escalate_case", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#escalate_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::EscalateCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" + }, + "method": { + "short_name": "EscalateCase", + "full_name": "google.cloud.support.v2beta.CaseService.EscalateCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2beta.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CaseService_CloseCase_sync", + "title": "Snippet for the close_case call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#close_case.", + "file": "case_service/close_case.rb", + "language": "RUBY", + "client_method": { + "short_name": "close_case", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#close_case", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::CloseCaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::Case", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" + }, + "method": { + "short_name": "CloseCase", + "full_name": "google.cloud.support.v2beta.CaseService.CloseCase", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2beta.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_sync", + "title": "Snippet for the search_case_classifications call in the CaseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#search_case_classifications.", + "file": "case_service/search_case_classifications.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_case_classifications", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#search_case_classifications", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse", + "client": { + "short_name": "CaseService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" + }, + "method": { + "short_name": "SearchCaseClassifications", + "full_name": "google.cloud.support.v2beta.CaseService.SearchCaseClassifications", + "service": { + "short_name": "CaseService", + "full_name": "google.cloud.support.v2beta.CaseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CommentService_ListComments_sync", + "title": "Snippet for the list_comments call in the CommentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CommentService::Client#list_comments.", + "file": "comment_service/list_comments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_comments", + "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client#list_comments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::ListCommentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::ListCommentsResponse", + "client": { + "short_name": "CommentService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client" + }, + "method": { + "short_name": "ListComments", + "full_name": "google.cloud.support.v2beta.CommentService.ListComments", + "service": { + "short_name": "CommentService", + "full_name": "google.cloud.support.v2beta.CommentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CommentService_CreateComment_sync", + "title": "Snippet for the create_comment call in the CommentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CommentService::Client#create_comment.", + "file": "comment_service/create_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_comment", + "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client#create_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::CreateCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::Comment", + "client": { + "short_name": "CommentService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client" + }, + "method": { + "short_name": "CreateComment", + "full_name": "google.cloud.support.v2beta.CommentService.CreateComment", + "service": { + "short_name": "CommentService", + "full_name": "google.cloud.support.v2beta.CommentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_CommentService_GetComment_sync", + "title": "Snippet for the get_comment call in the CommentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CommentService::Client#get_comment.", + "file": "comment_service/get_comment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_comment", + "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client#get_comment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::GetCommentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::Comment", + "client": { + "short_name": "CommentService::Client", + "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client" + }, + "method": { + "short_name": "GetComment", + "full_name": "google.cloud.support.v2beta.CommentService.GetComment", + "service": { + "short_name": "CommentService", + "full_name": "google.cloud.support.v2beta.CommentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudsupport_v2beta_generated_FeedService_ShowFeed_sync", + "title": "Snippet for the show_feed call in the FeedService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::FeedService::Client#show_feed.", + "file": "feed_service/show_feed.rb", + "language": "RUBY", + "client_method": { + "short_name": "show_feed", + "full_name": "::Google::Cloud::Support::V2beta::FeedService::Client#show_feed", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Support::V2beta::ShowFeedRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Support::V2beta::ShowFeedResponse", + "client": { + "short_name": "FeedService::Client", + "full_name": "::Google::Cloud::Support::V2beta::FeedService::Client" + }, + "method": { + "short_name": "ShowFeed", + "full_name": "google.cloud.support.v2beta.FeedService.ShowFeed", + "service": { + "short_name": "FeedService", + "full_name": "google.cloud.support.v2beta.FeedService" + } + } + }, + "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-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_paths_test.rb new file mode 100644 index 000000000000..f4d4f4902887 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2beta/case_attachment_service" + +class ::Google::Cloud::Support::V2beta::CaseAttachmentService::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_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::Support::V2beta::CaseAttachmentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.attachment_path organization: "value0", case: "value1", attachment_id: "value2" + assert_equal "organizations/value0/cases/value1/attachments/value2", path + + path = client.attachment_path project: "value0", case: "value1", attachment_id: "value2" + assert_equal "projects/value0/cases/value1/attachments/value2", path + end + end + + def test_case_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.case_path organization: "value0", case: "value1" + assert_equal "organizations/value0/cases/value1", path + + path = client.case_path project: "value0", case: "value1" + assert_equal "projects/value0/cases/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_rest_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_rest_test.rb new file mode 100644 index 000000000000..70430a5f3e1a --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_rest_test.rb @@ -0,0 +1,209 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/support/v2beta/attachment_service_pb" +require "google/cloud/support/v2beta/case_attachment_service/rest" + + +class ::Google::Cloud::Support::V2beta::CaseAttachmentService::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_attachments + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::ListAttachmentsResponse.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_attachments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::ServiceStub.stub :transcode_list_attachments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_attachments_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_attachments({ 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_attachments 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_attachments ::Google::Cloud::Support::V2beta::ListAttachmentsRequest.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_attachments({ 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_attachments(::Google::Cloud::Support::V2beta::ListAttachmentsRequest.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_attachments_client_stub.call_count + end + end + end + + def test_get_attachment + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::Attachment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_attachment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::ServiceStub.stub :transcode_get_attachment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_attachment_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_attachment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_attachment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_attachment ::Google::Cloud::Support::V2beta::GetAttachmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_attachment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_attachment(::Google::Cloud::Support::V2beta::GetAttachmentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_attachment_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::Support::V2beta::CaseAttachmentService::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::Support::V2beta::CaseAttachmentService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_test.rb new file mode 100644 index 000000000000..c1df673ec0a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_test.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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2beta/attachment_service_pb" +require "google/cloud/support/v2beta/case_attachment_service" + +class ::Google::Cloud::Support::V2beta::CaseAttachmentService::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_attachments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::ListAttachmentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_attachments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_attachments, name + assert_kind_of ::Google::Cloud::Support::V2beta::ListAttachmentsRequest, 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_attachments_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_attachments({ parent: parent, page_size: page_size, page_token: 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_attachments parent: parent, page_size: page_size, page_token: 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_attachments ::Google::Cloud::Support::V2beta::ListAttachmentsRequest.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_attachments({ parent: parent, page_size: page_size, page_token: page_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_attachments(::Google::Cloud::Support::V2beta::ListAttachmentsRequest.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_attachments_client_stub.call_rpc_count + end + end + + def test_get_attachment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::Attachment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_attachment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_attachment, name + assert_kind_of ::Google::Cloud::Support::V2beta::GetAttachmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_attachment_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_attachment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_attachment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_attachment ::Google::Cloud::Support::V2beta::GetAttachmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_attachment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_attachment(::Google::Cloud::Support::V2beta::GetAttachmentRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_attachment_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2beta::CaseAttachmentService::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::Support::V2beta::CaseAttachmentService::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::Support::V2beta::CaseAttachmentService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_paths_test.rb new file mode 100644 index 000000000000..6ec114696076 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_paths_test.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2beta/case_service" + +class ::Google::Cloud::Support::V2beta::CaseService::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_case_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.case_path organization: "value0", case: "value1" + assert_equal "organizations/value0/cases/value1", path + + path = client.case_path project: "value0", case: "value1" + assert_equal "projects/value0/cases/value1", path + end + end + + def test_organization_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_path organization: "value0" + assert_equal "organizations/value0", 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::Support::V2beta::CaseService::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-support-v2beta/test/google/cloud/support/v2beta/case_service_rest_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_rest_test.rb new file mode 100644 index 000000000000..078eb2569b47 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_rest_test.rb @@ -0,0 +1,544 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/support/v2beta/case_service_pb" +require "google/cloud/support/v2beta/case_service/rest" + + +class ::Google::Cloud::Support::V2beta::CaseService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_case + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::Case.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_get_case_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_case({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_case name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_case ::Google::Cloud::Support::V2beta::GetCaseRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_case({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_case(::Google::Cloud::Support::V2beta::GetCaseRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_case_client_stub.call_count + end + end + end + + def test_list_cases + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::ListCasesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + product_line = :PRODUCT_LINE_UNSPECIFIED + + list_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_list_cases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_cases_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_cases({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_cases parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_cases ::Google::Cloud::Support::V2beta::ListCasesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_cases({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_cases(::Google::Cloud::Support::V2beta::ListCasesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_cases_client_stub.call_count + end + end + end + + def test_search_cases + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::SearchCasesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_search_cases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_cases_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_cases({ parent: parent, 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_cases parent: parent, 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_cases ::Google::Cloud::Support::V2beta::SearchCasesRequest.new(parent: parent, 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_cases({ parent: parent, 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_cases(::Google::Cloud::Support::V2beta::SearchCasesRequest.new(parent: parent, 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_cases_client_stub.call_count + end + end + end + + def test_create_case + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::Case.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + case_param = {} + + create_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_create_case_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_case({ parent: parent, case: case_param }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_case parent: parent, case: case_param do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_case ::Google::Cloud::Support::V2beta::CreateCaseRequest.new(parent: parent, case: case_param) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_case({ parent: parent, case: case_param }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_case(::Google::Cloud::Support::V2beta::CreateCaseRequest.new(parent: parent, case: case_param), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_case_client_stub.call_count + end + end + end + + def test_update_case + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::Case.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + case_param = {} + update_mask = {} + + update_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_update_case_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_case({ case: case_param, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_case case: case_param, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_case ::Google::Cloud::Support::V2beta::UpdateCaseRequest.new(case: case_param, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_case({ case: case_param, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_case(::Google::Cloud::Support::V2beta::UpdateCaseRequest.new(case: case_param, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_case_client_stub.call_count + end + end + end + + def test_escalate_case + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::Case.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + escalation = {} + + escalate_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_escalate_case_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, escalate_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.escalate_case({ name: name, escalation: escalation }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.escalate_case name: name, escalation: escalation do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.escalate_case ::Google::Cloud::Support::V2beta::EscalateCaseRequest.new(name: name, escalation: escalation) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.escalate_case({ name: name, escalation: escalation }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.escalate_case(::Google::Cloud::Support::V2beta::EscalateCaseRequest.new(name: name, escalation: escalation), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, escalate_case_client_stub.call_count + end + end + end + + def test_close_case + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::Case.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + close_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_close_case_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, close_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.close_case({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.close_case name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.close_case ::Google::Cloud::Support::V2beta::CloseCaseRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.close_case({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.close_case(::Google::Cloud::Support::V2beta::CloseCaseRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, close_case_client_stub.call_count + end + end + end + + def test_search_case_classifications + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + query = "hello world" + page_size = 42 + page_token = "hello world" + product = {} + + search_case_classifications_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_search_case_classifications_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_case_classifications_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_case_classifications({ query: query, page_size: page_size, page_token: page_token, product: product }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_case_classifications query: query, page_size: page_size, page_token: page_token, product: product do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_case_classifications ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new(query: query, page_size: page_size, page_token: page_token, product: product) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_case_classifications({ query: query, page_size: page_size, page_token: page_token, product: product }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_case_classifications(::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new(query: query, page_size: page_size, page_token: page_token, product: product), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_case_classifications_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::Support::V2beta::CaseService::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::Support::V2beta::CaseService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_test.rb new file mode 100644 index 000000000000..802a838a7562 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_test.rb @@ -0,0 +1,610 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2beta/case_service_pb" +require "google/cloud/support/v2beta/case_service" + +class ::Google::Cloud::Support::V2beta::CaseService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_case, name + assert_kind_of ::Google::Cloud::Support::V2beta::GetCaseRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_case({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_case name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_case ::Google::Cloud::Support::V2beta::GetCaseRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_case({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_case(::Google::Cloud::Support::V2beta::GetCaseRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_case_client_stub.call_rpc_count + end + end + + def test_list_cases + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::ListCasesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + product_line = :PRODUCT_LINE_UNSPECIFIED + + list_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_cases, name + assert_kind_of ::Google::Cloud::Support::V2beta::ListCasesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :PRODUCT_LINE_UNSPECIFIED, request["product_line"] + assert request.has_product_line? + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_cases_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_cases({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_cases parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_cases ::Google::Cloud::Support::V2beta::ListCasesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_cases({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_cases(::Google::Cloud::Support::V2beta::ListCasesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_cases_client_stub.call_rpc_count + end + end + + def test_search_cases + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::SearchCasesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_cases, name + assert_kind_of ::Google::Cloud::Support::V2beta::SearchCasesRequest, request + assert_equal "hello world", request["parent"] + 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_cases_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_cases({ parent: parent, 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_cases parent: parent, 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_cases ::Google::Cloud::Support::V2beta::SearchCasesRequest.new(parent: parent, 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_cases({ parent: parent, 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_cases(::Google::Cloud::Support::V2beta::SearchCasesRequest.new(parent: parent, 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_cases_client_stub.call_rpc_count + end + end + + def test_create_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + case_param = {} + + create_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_case, name + assert_kind_of ::Google::Cloud::Support::V2beta::CreateCaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Case), request["case"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_case({ parent: parent, case: case_param }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_case parent: parent, case: case_param do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_case ::Google::Cloud::Support::V2beta::CreateCaseRequest.new(parent: parent, case: case_param) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_case({ parent: parent, case: case_param }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_case(::Google::Cloud::Support::V2beta::CreateCaseRequest.new(parent: parent, case: case_param), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_case_client_stub.call_rpc_count + end + end + + def test_update_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + case_param = {} + update_mask = {} + + update_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_case, name + assert_kind_of ::Google::Cloud::Support::V2beta::UpdateCaseRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Case), request["case"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_case({ case: case_param, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_case case: case_param, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_case ::Google::Cloud::Support::V2beta::UpdateCaseRequest.new(case: case_param, 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_case({ case: case_param, 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_case(::Google::Cloud::Support::V2beta::UpdateCaseRequest.new(case: case_param, 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_case_client_stub.call_rpc_count + end + end + + def test_escalate_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + escalation = {} + + escalate_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :escalate_case, name + assert_kind_of ::Google::Cloud::Support::V2beta::EscalateCaseRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Escalation), request["escalation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, escalate_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.escalate_case({ name: name, escalation: escalation }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.escalate_case name: name, escalation: escalation do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.escalate_case ::Google::Cloud::Support::V2beta::EscalateCaseRequest.new(name: name, escalation: escalation) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.escalate_case({ name: name, escalation: escalation }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.escalate_case(::Google::Cloud::Support::V2beta::EscalateCaseRequest.new(name: name, escalation: escalation), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, escalate_case_client_stub.call_rpc_count + end + end + + def test_close_case + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::Case.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + close_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :close_case, name + assert_kind_of ::Google::Cloud::Support::V2beta::CloseCaseRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, close_case_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.close_case({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.close_case name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.close_case ::Google::Cloud::Support::V2beta::CloseCaseRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.close_case({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.close_case(::Google::Cloud::Support::V2beta::CloseCaseRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, close_case_client_stub.call_rpc_count + end + end + + def test_search_case_classifications + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + query = "hello world" + page_size = 42 + page_token = "hello world" + product = {} + + search_case_classifications_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_case_classifications, name + assert_kind_of ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest, request + assert_equal "hello world", request["query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Product), request["product"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_case_classifications_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_case_classifications({ query: query, page_size: page_size, page_token: page_token, product: product }) do |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_case_classifications query: query, page_size: page_size, page_token: page_token, product: product do |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_case_classifications ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new(query: query, page_size: page_size, page_token: page_token, product: product) do |response, operation| + 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_case_classifications({ query: query, page_size: page_size, page_token: page_token, product: product }, grpc_options) do |response, operation| + 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_case_classifications(::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new(query: query, page_size: page_size, page_token: page_token, product: product), grpc_options) do |response, operation| + 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_case_classifications_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2beta::CaseService::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::Support::V2beta::CaseService::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::Support::V2beta::CaseService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Support::V2beta::CaseService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_paths_test.rb new file mode 100644 index 000000000000..53f649553204 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2beta/comment_service" + +class ::Google::Cloud::Support::V2beta::CommentService::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_case_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.case_path organization: "value0", case: "value1" + assert_equal "organizations/value0/cases/value1", path + + path = client.case_path project: "value0", case: "value1" + assert_equal "projects/value0/cases/value1", path + end + end + + def test_comment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.comment_path organization: "value0", case: "value1", comment: "value2" + assert_equal "organizations/value0/cases/value1/comments/value2", path + + path = client.comment_path project: "value0", case: "value1", comment: "value2" + assert_equal "projects/value0/cases/value1/comments/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_rest_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_rest_test.rb new file mode 100644 index 000000000000..066199206353 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_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/support/v2beta/comment_service_pb" +require "google/cloud/support/v2beta/comment_service/rest" + + +class ::Google::Cloud::Support::V2beta::CommentService::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_comments + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::ListCommentsResponse.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_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CommentService::Rest::ServiceStub.stub :transcode_list_comments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_comments_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_comments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_comments parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_comments ::Google::Cloud::Support::V2beta::ListCommentsRequest.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_comments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_comments(::Google::Cloud::Support::V2beta::ListCommentsRequest.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_comments_client_stub.call_count + end + end + end + + def test_create_comment + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::Comment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + comment = {} + + create_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CommentService::Rest::ServiceStub.stub :transcode_create_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_comment_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_comment({ parent: parent, comment: comment }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_comment parent: parent, comment: comment do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_comment ::Google::Cloud::Support::V2beta::CreateCommentRequest.new(parent: parent, comment: comment) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_comment({ parent: parent, comment: comment }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_comment(::Google::Cloud::Support::V2beta::CreateCommentRequest.new(parent: parent, comment: comment), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_comment_client_stub.call_count + end + end + end + + def test_get_comment + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::Comment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::CommentService::Rest::ServiceStub.stub :transcode_get_comment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_comment_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_comment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_comment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_comment ::Google::Cloud::Support::V2beta::GetCommentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_comment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_comment(::Google::Cloud::Support::V2beta::GetCommentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_comment_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Support::V2beta::CommentService::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::Support::V2beta::CommentService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_test.rb new file mode 100644 index 000000000000..4de1a4b5418d --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_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/support/v2beta/comment_service_pb" +require "google/cloud/support/v2beta/comment_service" + +class ::Google::Cloud::Support::V2beta::CommentService::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_comments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::ListCommentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_comments, name + assert_kind_of ::Google::Cloud::Support::V2beta::ListCommentsRequest, 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_comments_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_comments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_comments parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_comments ::Google::Cloud::Support::V2beta::ListCommentsRequest.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_comments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_comments(::Google::Cloud::Support::V2beta::ListCommentsRequest.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_comments_client_stub.call_rpc_count + end + end + + def test_create_comment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::Comment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + comment = {} + + create_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_comment, name + assert_kind_of ::Google::Cloud::Support::V2beta::CreateCommentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Comment), request["comment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_comment_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_comment({ parent: parent, comment: comment }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_comment parent: parent, comment: comment do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_comment ::Google::Cloud::Support::V2beta::CreateCommentRequest.new(parent: parent, comment: comment) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_comment({ parent: parent, comment: comment }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_comment(::Google::Cloud::Support::V2beta::CreateCommentRequest.new(parent: parent, comment: comment), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_comment_client_stub.call_rpc_count + end + end + + def test_get_comment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::Comment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_comment, name + assert_kind_of ::Google::Cloud::Support::V2beta::GetCommentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_comment_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_comment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_comment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_comment ::Google::Cloud::Support::V2beta::GetCommentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_comment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_comment(::Google::Cloud::Support::V2beta::GetCommentRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_comment_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Support::V2beta::CommentService::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::Support::V2beta::CommentService::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::Support::V2beta::CommentService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Support::V2beta::CommentService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_paths_test.rb new file mode 100644 index 000000000000..9f8927700ffe --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_paths_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2beta/feed_service" + +class ::Google::Cloud::Support::V2beta::FeedService::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_case_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Support::V2beta::FeedService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.case_path organization: "value0", case: "value1" + assert_equal "organizations/value0/cases/value1", path + + path = client.case_path project: "value0", case: "value1" + assert_equal "projects/value0/cases/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_rest_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_rest_test.rb new file mode 100644 index 000000000000..2f9c2dd76ae8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_rest_test.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 "helper" +require "gapic/rest" +require "google/cloud/support/v2beta/feed_service_pb" +require "google/cloud/support/v2beta/feed_service/rest" + + +class ::Google::Cloud::Support::V2beta::FeedService::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_show_feed + # Create test objects. + client_result = ::Google::Cloud::Support::V2beta::ShowFeedResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + order_by = "hello world" + page_size = 42 + page_token = "hello world" + + show_feed_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Support::V2beta::FeedService::Rest::ServiceStub.stub :transcode_show_feed_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, show_feed_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.show_feed({ parent: parent, order_by: order_by, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.show_feed parent: parent, order_by: order_by, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.show_feed ::Google::Cloud::Support::V2beta::ShowFeedRequest.new(parent: parent, order_by: order_by, 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.show_feed({ parent: parent, order_by: order_by, 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.show_feed(::Google::Cloud::Support::V2beta::ShowFeedRequest.new(parent: parent, order_by: order_by, 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, show_feed_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::Support::V2beta::FeedService::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::Support::V2beta::FeedService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_test.rb new file mode 100644 index 000000000000..157da6ac9ba3 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_test.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/support/v2beta/feed_service_pb" +require "google/cloud/support/v2beta/feed_service" + +class ::Google::Cloud::Support::V2beta::FeedService::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_show_feed + # Create GRPC objects. + grpc_response = ::Google::Cloud::Support::V2beta::ShowFeedResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + order_by = "hello world" + page_size = 42 + page_token = "hello world" + + show_feed_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :show_feed, name + assert_kind_of ::Google::Cloud::Support::V2beta::ShowFeedRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["order_by"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, show_feed_client_stub do + # Create client + client = ::Google::Cloud::Support::V2beta::FeedService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.show_feed({ parent: parent, order_by: order_by, page_size: page_size, page_token: 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.show_feed parent: parent, order_by: order_by, page_size: page_size, page_token: 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.show_feed ::Google::Cloud::Support::V2beta::ShowFeedRequest.new(parent: parent, order_by: order_by, page_size: page_size, page_token: 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.show_feed({ parent: parent, order_by: order_by, page_size: page_size, page_token: page_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.show_feed(::Google::Cloud::Support::V2beta::ShowFeedRequest.new(parent: parent, order_by: order_by, page_size: page_size, page_token: page_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, show_feed_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2beta::FeedService::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::Support::V2beta::FeedService::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::Support::V2beta::FeedService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Support::V2beta::FeedService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/helper.rb b/owl-bot-staging/google-cloud-support-v2beta/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-support-v2beta/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-talent-v4/.gitignore b/owl-bot-staging/google-cloud-talent-v4/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.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-talent-v4/.repo-metadata.json b/owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json new file mode 100644 index 000000000000..2798805ded2c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "jobs.googleapis.com", + "api_shortname": "jobs", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest", + "distribution_name": "google-cloud-talent-v4", + "is_cloud": true, + "language": "ruby", + "name": "jobs", + "name_pretty": "Cloud Talent Solution V4 API", + "product_documentation": "https://cloud.google.com/solutions/talent-solution", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TALENT", + "ruby-cloud-product-url": "https://cloud.google.com/solutions/talent-solution", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml b/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml new file mode 100644 index 000000000000..bd272e76c0ea --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-talent-v4.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-talent-v4.rb" diff --git a/owl-bot-staging/google-cloud-talent-v4/.toys.rb b/owl-bot-staging/google-cloud-talent-v4/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.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-talent-v4/.yardopts b/owl-bot-staging/google-cloud-talent-v4/.yardopts new file mode 100644 index 000000000000..5c7f550fa4ae --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Talent Solution V4 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-talent-v4/AUTHENTICATION.md b/owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md new file mode 100644 index 000000000000..3ee7d3b9820d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-talent-v4 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-talent-v4 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/talent/v4" + +client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/talent/v4" + +::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Talent::V4::CompanyService::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-talent-v4 +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/talent/v4" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Talent::V4::CompanyService::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-talent-v4/CHANGELOG.md b/owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-talent-v4/Gemfile b/owl-bot-staging/google-cloud-talent-v4/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-talent-v4/LICENSE.md b/owl-bot-staging/google-cloud-talent-v4/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/README.md b/owl-bot-staging/google-cloud-talent-v4/README.md new file mode 100644 index 000000000000..dcd4f76bc132 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Talent Solution V4 API + +Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. + +Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. + +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 Talent Solution V4 API. Most users should consider using +the main client gem, +[google-cloud-talent](https://rubygems.org/gems/google-cloud-talent). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-talent-v4 +``` + +## 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/jobs.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/talent/v4" + +client = ::Google::Cloud::Talent::V4::CompanyService::Client.new +request = ::Google::Cloud::Talent::V4::CreateCompanyRequest.new # (request fields as keyword arguments...) +response = client.create_company request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/solutions/talent-solution) +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/talent/v4" +require "logger" + +client = ::Google::Cloud::Talent::V4::CompanyService::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-talent`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-talent-v4`. +_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-talent`. +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-talent-v4`. + +### 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-talent-v4/Rakefile b/owl-bot-staging/google-cloud-talent-v4/Rakefile new file mode 100644 index 000000000000..e241f71a45d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TALENT_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TALENT_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TALENT_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 TALENT_TEST_PROJECT=test123 TALENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/talent/v4/company_service/credentials" + ::Google::Cloud::Talent::V4::CompanyService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TALENT_PROJECT"] = project + ENV["TALENT_TEST_PROJECT"] = project + ENV["TALENT_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-talent-v4 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-talent-v4 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-talent-v4 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-talent-v4 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-talent-v4" + header "google-cloud-talent-v4 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-talent-v4 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-talent-v4 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-talent-v4 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-talent-v4 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-talent-v4/gapic_metadata.json b/owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json new file mode 100644 index 000000000000..12740756819f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json @@ -0,0 +1,164 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.talent.v4", + "libraryPackage": "::Google::Cloud::Talent::V4", + "services": { + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::CompanyService::Client", + "rpcs": { + "CreateCompany": { + "methods": [ + "create_company" + ] + }, + "GetCompany": { + "methods": [ + "get_company" + ] + }, + "UpdateCompany": { + "methods": [ + "update_company" + ] + }, + "DeleteCompany": { + "methods": [ + "delete_company" + ] + }, + "ListCompanies": { + "methods": [ + "list_companies" + ] + } + } + } + } + }, + "Completion": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::Completion::Client", + "rpcs": { + "CompleteQuery": { + "methods": [ + "complete_query" + ] + } + } + } + } + }, + "EventService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::EventService::Client", + "rpcs": { + "CreateClientEvent": { + "methods": [ + "create_client_event" + ] + } + } + } + } + }, + "JobService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::JobService::Client", + "rpcs": { + "CreateJob": { + "methods": [ + "create_job" + ] + }, + "BatchCreateJobs": { + "methods": [ + "batch_create_jobs" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "UpdateJob": { + "methods": [ + "update_job" + ] + }, + "BatchUpdateJobs": { + "methods": [ + "batch_update_jobs" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + }, + "BatchDeleteJobs": { + "methods": [ + "batch_delete_jobs" + ] + }, + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "SearchJobs": { + "methods": [ + "search_jobs" + ] + }, + "SearchJobsForAlert": { + "methods": [ + "search_jobs_for_alert" + ] + } + } + } + } + }, + "TenantService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::TenantService::Client", + "rpcs": { + "CreateTenant": { + "methods": [ + "create_tenant" + ] + }, + "GetTenant": { + "methods": [ + "get_tenant" + ] + }, + "UpdateTenant": { + "methods": [ + "update_tenant" + ] + }, + "DeleteTenant": { + "methods": [ + "delete_tenant" + ] + }, + "ListTenants": { + "methods": [ + "list_tenants" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec b/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec new file mode 100644 index 000000000000..5049db4d8c44 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/talent/v4/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-talent-v4" + gem.version = Google::Cloud::Talent::V4::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details." + gem.summary = "Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb new file mode 100644 index 000000000000..c715c2e0b79a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.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/talent/v4" diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb new file mode 100644 index 000000000000..35c2c38a0397 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.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 "google/cloud/talent/v4/company_service" +require "google/cloud/talent/v4/completion" +require "google/cloud/talent/v4/event_service" +require "google/cloud/talent/v4/job_service" +require "google/cloud/talent/v4/tenant_service" +require "google/cloud/talent/v4/version" + +module Google + module Cloud + module Talent + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/talent/v4" + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/talent/v4" + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + module V4 + end + end + end +end + +helper_path = ::File.join __dir__, "v4", "_helpers.rb" +require "google/cloud/talent/v4/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb new file mode 100644 index 000000000000..a5e32d18e6ca --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' +require 'google/type/latlng_pb' +require 'google/type/money_pb' +require 'google/type/postal_address_pb' + + +descriptor_data = "\n#google/cloud/talent/v4/common.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x18google/type/latlng.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\"n\n\x0eTimestampRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb2\x03\n\x08Location\x12\x44\n\rlocation_type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.Location.LocationType\x12\x32\n\x0epostal_address\x18\x02 \x01(\x0b\x32\x1a.google.type.PostalAddress\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x14\n\x0cradius_miles\x18\x04 \x01(\x01\"\xef\x01\n\x0cLocationType\x12\x1d\n\x19LOCATION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43OUNTRY\x10\x01\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x02\x12\x1b\n\x17SUB_ADMINISTRATIVE_AREA\x10\x03\x12\x0c\n\x08LOCALITY\x10\x04\x12\x0f\n\x0bPOSTAL_CODE\x10\x05\x12\x10\n\x0cSUB_LOCALITY\x10\x06\x12\x12\n\x0eSUB_LOCALITY_1\x10\x07\x12\x12\n\x0eSUB_LOCALITY_2\x10\x08\x12\x10\n\x0cNEIGHBORHOOD\x10\t\x12\x12\n\x0eSTREET_ADDRESS\x10\n\"\x9a\x01\n\x0fRequestMetadata\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x12\n\nsession_id\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x19\n\x11\x61llow_missing_ids\x18\x04 \x01(\x08\x12\x37\n\x0b\x64\x65vice_info\x18\x05 \x01(\x0b\x32\".google.cloud.talent.v4.DeviceInfo\"&\n\x10ResponseMetadata\x12\x12\n\nrequest_id\x18\x01 \x01(\t\"\xca\x01\n\nDeviceInfo\x12\x42\n\x0b\x64\x65vice_type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.DeviceInfo.DeviceType\x12\n\n\x02id\x18\x02 \x01(\t\"l\n\nDeviceType\x12\x1b\n\x17\x44\x45VICE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x0e\n\nMOBILE_WEB\x10\x02\x12\x0b\n\x07\x41NDROID\x10\x03\x12\x07\n\x03IOS\x10\x04\x12\x07\n\x03\x42OT\x10\x05\x12\t\n\x05OTHER\x10\x06\"m\n\x0f\x43ustomAttribute\x12\x15\n\rstring_values\x18\x01 \x03(\t\x12\x13\n\x0blong_values\x18\x02 \x03(\x03\x12\x12\n\nfilterable\x18\x03 \x01(\x08\x12\x1a\n\x12keyword_searchable\x18\x04 \x01(\x08\"W\n\x12SpellingCorrection\x12\x11\n\tcorrected\x18\x01 \x01(\x08\x12\x16\n\x0e\x63orrected_text\x18\x02 \x01(\t\x12\x16\n\x0e\x63orrected_html\x18\x03 \x01(\t\"\x88\t\n\x10\x43ompensationInfo\x12K\n\x07\x65ntries\x18\x01 \x03(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationEntry\x12k\n\"annualized_base_compensation_range\x18\x02 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x12l\n#annualized_total_compensation_range\x18\x03 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x1a\x83\x03\n\x11\x43ompensationEntry\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationType\x12G\n\x04unit\x18\x02 \x01(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationUnit\x12$\n\x06\x61mount\x18\x03 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12K\n\x05range\x18\x04 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12=\n\x17\x65xpected_units_per_year\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValueB\x15\n\x13\x63ompensation_amount\x1ao\n\x11\x43ompensationRange\x12,\n\x10max_compensation\x18\x02 \x01(\x0b\x32\x12.google.type.Money\x12,\n\x10min_compensation\x18\x01 \x01(\x0b\x32\x12.google.type.Money\"\xb5\x01\n\x10\x43ompensationType\x12!\n\x1d\x43OMPENSATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42\x41SE\x10\x01\x12\t\n\x05\x42ONUS\x10\x02\x12\x11\n\rSIGNING_BONUS\x10\x03\x12\n\n\x06\x45QUITY\x10\x04\x12\x12\n\x0ePROFIT_SHARING\x10\x05\x12\x0f\n\x0b\x43OMMISSIONS\x10\x06\x12\x08\n\x04TIPS\x10\x07\x12\x1b\n\x17OTHER_COMPENSATION_TYPE\x10\x08\"\x9c\x01\n\x10\x43ompensationUnit\x12!\n\x1d\x43OMPENSATION_UNIT_UNSPECIFIED\x10\x00\x12\n\n\x06HOURLY\x10\x01\x12\t\n\x05\x44\x41ILY\x10\x02\x12\n\n\x06WEEKLY\x10\x03\x12\x0b\n\x07MONTHLY\x10\x04\x12\n\n\x06YEARLY\x10\x05\x12\x0c\n\x08ONE_TIME\x10\x06\x12\x1b\n\x17OTHER_COMPENSATION_UNIT\x10\x07\"\xc7\x03\n\x16\x42\x61tchOperationMetadata\x12\x43\n\x05state\x18\x01 \x01(\x0e\x32\x34.google.cloud.talent.v4.BatchOperationMetadata.State\x12\x19\n\x11state_description\x18\x02 \x01(\t\x12\x15\n\rsuccess_count\x18\x03 \x01(\x05\x12\x15\n\rfailure_count\x18\x04 \x01(\x05\x12\x13\n\x0btotal_count\x18\x05 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"z\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06*y\n\x0b\x43ompanySize\x12\x1c\n\x18\x43OMPANY_SIZE_UNSPECIFIED\x10\x00\x12\x08\n\x04MINI\x10\x01\x12\t\n\x05SMALL\x10\x02\x12\x0b\n\x07SMEDIUM\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x07\n\x03\x42IG\x10\x05\x12\n\n\x06\x42IGGER\x10\x06\x12\t\n\x05GIANT\x10\x07*\xe2\x01\n\nJobBenefit\x12\x1b\n\x17JOB_BENEFIT_UNSPECIFIED\x10\x00\x12\x0e\n\nCHILD_CARE\x10\x01\x12\n\n\x06\x44\x45NTAL\x10\x02\x12\x14\n\x10\x44OMESTIC_PARTNER\x10\x03\x12\x12\n\x0e\x46LEXIBLE_HOURS\x10\x04\x12\x0b\n\x07MEDICAL\x10\x05\x12\x12\n\x0eLIFE_INSURANCE\x10\x06\x12\x12\n\x0ePARENTAL_LEAVE\x10\x07\x12\x13\n\x0fRETIREMENT_PLAN\x10\x08\x12\r\n\tSICK_DAYS\x10\t\x12\x0c\n\x08VACATION\x10\n\x12\n\n\x06VISION\x10\x0b*\x8e\x02\n\nDegreeType\x12\x1b\n\x17\x44\x45GREE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11PRIMARY_EDUCATION\x10\x01\x12\x1d\n\x19LOWER_SECONDARY_EDUCATION\x10\x02\x12\x1d\n\x19UPPER_SECONDARY_EDUCATION\x10\x03\x12\x1c\n\x18\x41\x44ULT_REMEDIAL_EDUCATION\x10\x04\x12\x1c\n\x18\x41SSOCIATES_OR_EQUIVALENT\x10\x05\x12\x1b\n\x17\x42\x41\x43HELORS_OR_EQUIVALENT\x10\x06\x12\x19\n\x15MASTERS_OR_EQUIVALENT\x10\x07\x12\x1a\n\x16\x44OCTORAL_OR_EQUIVALENT\x10\x08*\xdc\x01\n\x0e\x45mploymentType\x12\x1f\n\x1b\x45MPLOYMENT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFULL_TIME\x10\x01\x12\r\n\tPART_TIME\x10\x02\x12\x0e\n\nCONTRACTOR\x10\x03\x12\x14\n\x10\x43ONTRACT_TO_HIRE\x10\x04\x12\r\n\tTEMPORARY\x10\x05\x12\n\n\x06INTERN\x10\x06\x12\r\n\tVOLUNTEER\x10\x07\x12\x0c\n\x08PER_DIEM\x10\x08\x12\x12\n\x0e\x46LY_IN_FLY_OUT\x10\t\x12\x19\n\x15OTHER_EMPLOYMENT_TYPE\x10\n*q\n\x08JobLevel\x12\x19\n\x15JOB_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x45NTRY_LEVEL\x10\x01\x12\x0f\n\x0b\x45XPERIENCED\x10\x02\x12\x0b\n\x07MANAGER\x10\x03\x12\x0c\n\x08\x44IRECTOR\x10\x04\x12\r\n\tEXECUTIVE\x10\x05*\xba\x06\n\x0bJobCategory\x12\x1c\n\x18JOB_CATEGORY_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x41\x43\x43OUNTING_AND_FINANCE\x10\x01\x12\x1d\n\x19\x41\x44MINISTRATIVE_AND_OFFICE\x10\x02\x12\x1d\n\x19\x41\x44VERTISING_AND_MARKETING\x10\x03\x12\x0f\n\x0b\x41NIMAL_CARE\x10\x04\x12\x1a\n\x16\x41RT_FASHION_AND_DESIGN\x10\x05\x12\x17\n\x13\x42USINESS_OPERATIONS\x10\x06\x12\x1b\n\x17\x43LEANING_AND_FACILITIES\x10\x07\x12\x13\n\x0f\x43OMPUTER_AND_IT\x10\x08\x12\x10\n\x0c\x43ONSTRUCTION\x10\t\x12\x14\n\x10\x43USTOMER_SERVICE\x10\n\x12\r\n\tEDUCATION\x10\x0b\x12\x1c\n\x18\x45NTERTAINMENT_AND_TRAVEL\x10\x0c\x12\x18\n\x14\x46\x41RMING_AND_OUTDOORS\x10\r\x12\x0e\n\nHEALTHCARE\x10\x0e\x12\x13\n\x0fHUMAN_RESOURCES\x10\x0f\x12\'\n#INSTALLATION_MAINTENANCE_AND_REPAIR\x10\x10\x12\t\n\x05LEGAL\x10\x11\x12\x0e\n\nMANAGEMENT\x10\x12\x12\x1f\n\x1bMANUFACTURING_AND_WAREHOUSE\x10\x13\x12$\n MEDIA_COMMUNICATIONS_AND_WRITING\x10\x14\x12\x16\n\x12OIL_GAS_AND_MINING\x10\x15\x12\x1e\n\x1aPERSONAL_CARE_AND_SERVICES\x10\x16\x12\x17\n\x13PROTECTIVE_SERVICES\x10\x17\x12\x0f\n\x0bREAL_ESTATE\x10\x18\x12\x1e\n\x1aRESTAURANT_AND_HOSPITALITY\x10\x19\x12\x14\n\x10SALES_AND_RETAIL\x10\x1a\x12\x1b\n\x17SCIENCE_AND_ENGINEERING\x10\x1b\x12\"\n\x1eSOCIAL_SERVICES_AND_NON_PROFIT\x10\x1c\x12!\n\x1dSPORTS_FITNESS_AND_RECREATION\x10\x1d\x12 \n\x1cTRANSPORTATION_AND_LOGISTICS\x10\x1e*e\n\rPostingRegion\x12\x1e\n\x1aPOSTING_REGION_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x01\x12\n\n\x06NATION\x10\x02\x12\x0f\n\x0bTELECOMMUTE\x10\x03*n\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x41\x43\x43OUNT_ONLY\x10\x01\x12\x16\n\x12SHARED_WITH_GOOGLE\x10\x02\x12\x16\n\x12SHARED_WITH_PUBLIC\x10\x03\x1a\x02\x18\x01*q\n\x10HtmlSanitization\x12!\n\x1dHTML_SANITIZATION_UNSPECIFIED\x10\x00\x12\x1e\n\x1aHTML_SANITIZATION_DISABLED\x10\x01\x12\x1a\n\x16SIMPLE_FORMATTING_ONLY\x10\x02*{\n\rCommuteMethod\x12\x1e\n\x1a\x43OMMUTE_METHOD_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44RIVING\x10\x01\x12\x0b\n\x07TRANSIT\x10\x02\x12\x0b\n\x07WALKING\x10\x03\x12\x0b\n\x07\x43YCLING\x10\x04\x12\x16\n\x12TRANSIT_ACCESSIBLE\x10\x05\x42\x65\n\x1a\x63om.google.cloud.talent.v4B\x0b\x43ommonProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + TimestampRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.TimestampRange").msgclass + Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Location").msgclass + Location::LocationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Location.LocationType").enummodule + RequestMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.RequestMetadata").msgclass + ResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ResponseMetadata").msgclass + DeviceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeviceInfo").msgclass + DeviceInfo::DeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeviceInfo.DeviceType").enummodule + CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CustomAttribute").msgclass + SpellingCorrection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SpellingCorrection").msgclass + CompensationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo").msgclass + CompensationInfo::CompensationEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationEntry").msgclass + CompensationInfo::CompensationRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationRange").msgclass + CompensationInfo::CompensationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationType").enummodule + CompensationInfo::CompensationUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationUnit").enummodule + BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchOperationMetadata").msgclass + BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchOperationMetadata.State").enummodule + CompanySize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompanySize").enummodule + JobBenefit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobBenefit").enummodule + DegreeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DegreeType").enummodule + EmploymentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.EmploymentType").enummodule + JobLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobLevel").enummodule + JobCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobCategory").enummodule + PostingRegion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.PostingRegion").enummodule + Visibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Visibility").enummodule + HtmlSanitization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HtmlSanitization").enummodule + CommuteMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteMethod").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb new file mode 100644 index 000000000000..db5dbb35870f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/company.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/talent/v4/common_pb' + + +descriptor_data = "\n$google/cloud/talent/v4/company.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\"\xc8\x04\n\x07\x43ompany\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x65xternal_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x04size\x18\x04 \x01(\x0e\x32#.google.cloud.talent.v4.CompanySize\x12\x1c\n\x14headquarters_address\x18\x05 \x01(\t\x12\x15\n\rhiring_agency\x18\x06 \x01(\x08\x12\x10\n\x08\x65\x65o_text\x18\x07 \x01(\t\x12\x13\n\x0bwebsite_uri\x18\x08 \x01(\t\x12\x17\n\x0f\x63\x61reer_site_uri\x18\t \x01(\t\x12\x11\n\timage_uri\x18\n \x01(\t\x12\x34\n(keyword_searchable_job_custom_attributes\x18\x0b \x03(\tB\x02\x18\x01\x12\x46\n\x0c\x64\x65rived_info\x18\x0c \x01(\x0b\x32+.google.cloud.talent.v4.Company.DerivedInfoB\x03\xe0\x41\x03\x12\x16\n\tsuspended\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x1aN\n\x0b\x44\x65rivedInfo\x12?\n\x15headquarters_location\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4.Location:Y\xea\x41V\n\x1bjobs.googleapis.com/Company\x12\x37projects/{project}/tenants/{tenant}/companies/{company}Bf\n\x1a\x63om.google.cloud.talent.v4B\x0c\x43ompanyProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + Company = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Company").msgclass + Company::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Company.DerivedInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb new file mode 100644 index 000000000000..948f3a46bcd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_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/talent/v4/version" + +require "google/cloud/talent/v4/company_service/credentials" +require "google/cloud/talent/v4/company_service/paths" +require "google/cloud/talent/v4/company_service/client" +require "google/cloud/talent/v4/company_service/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service that handles company management, including CRUD and enumeration. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/company_service" + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/company_service/rest" + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + module CompanyService + end + end + end + end +end + +helper_path = ::File.join __dir__, "company_service", "helpers.rb" +require "google/cloud/talent/v4/company_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb new file mode 100644 index 000000000000..174536c919cc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb @@ -0,0 +1,909 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/company_service_pb" + +module Google + module Cloud + module Talent + module V4 + module CompanyService + ## + # Client for the CompanyService service. + # + # A service that handles company management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :company_service_stub + + ## + # Configure the CompanyService Client class. + # + # See {::Google::Cloud::Talent::V4::CompanyService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompanyService clients + # ::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_company.timeout = 30.0 + + default_config.rpcs.get_company.timeout = 30.0 + default_config.rpcs.get_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_company.timeout = 30.0 + + default_config.rpcs.delete_company.timeout = 30.0 + default_config.rpcs.delete_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_companies.timeout = 30.0 + default_config.rpcs.list_companies.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompanyService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::CompanyService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @company_service_stub.universe_domain + end + + ## + # Create a new CompanyService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompanyService 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/talent/v4/company_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 + + @company_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::CompanyService::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 + ) + + @company_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 + @company_service_stub.logger + end + + # Service calls + + ## + # Creates a new company entity. + # + # @overload create_company(request, options = nil) + # Pass arguments to `create_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_company(parent: nil, company: nil) + # Pass arguments to `create_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] + # Required. The company to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateCompanyRequest.new + # + # # Call the create_company method. + # result = client.create_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def create_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateCompanyRequest + + # Converts hash and nil to 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_company.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :create_company, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified company. + # + # @overload get_company(request, options = nil) + # Pass arguments to `get_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_company(name: nil) + # Pass arguments to `get_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the company to be retrieved. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/api-test-project/tenants/foo/companies/bar". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetCompanyRequest.new + # + # # Call the get_company method. + # result = client.get_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def get_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetCompanyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_company.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :get_company, request, 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 specified company. + # + # @overload update_company(request, options = nil) + # Pass arguments to `update_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_company(company: nil, update_mask: nil) + # Pass arguments to `update_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] + # Required. The company resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the company fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Company Company} are + # supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new + # + # # Call the update_company method. + # result = client.update_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def update_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateCompanyRequest + + # Converts hash and nil to 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_company.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.company&.name + header_params["company.name"] = request.company.name + end + + request_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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :update_company, request, 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 specified company. + # Prerequisite: The company has no jobs associated with it. + # + # @overload delete_company(request, options = nil) + # Pass arguments to `delete_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_company(name: nil) + # Pass arguments to `delete_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the company to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new + # + # # Call the delete_company method. + # result = client.delete_company request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteCompanyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_company.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :delete_company, request, 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 companies associated with the project. + # + # @overload list_companies(request, options = nil) + # Pass arguments to `list_companies` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListCompaniesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) + # Pass arguments to `list_companies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of companies to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @param require_open_jobs [::Boolean] + # Set to true if the companies requested must have open jobs. + # + # Defaults to false. + # + # If true, at most + # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of + # companies are fetched, among which only those with open jobs are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListCompaniesRequest.new + # + # # Call the list_companies method. + # result = client.list_companies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Talent::V4::Company. + # p item + # end + # + def list_companies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListCompaniesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_companies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_companies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_companies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :list_companies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @company_service_stub, :list_companies, request, response, 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 CompanyService API. + # + # This class represents the configuration for CompanyService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::CompanyService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_company to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Talent::V4::CompanyService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CompanyService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_company` + # @return [::Gapic::Config::Method] + # + attr_reader :create_company + ## + # RPC-specific configuration for `get_company` + # @return [::Gapic::Config::Method] + # + attr_reader :get_company + ## + # RPC-specific configuration for `update_company` + # @return [::Gapic::Config::Method] + # + attr_reader :update_company + ## + # RPC-specific configuration for `delete_company` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_company + ## + # RPC-specific configuration for `list_companies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_companies + + # @private + def initialize parent_rpcs = nil + create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company + @create_company = ::Gapic::Config::Method.new create_company_config + get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company + @get_company = ::Gapic::Config::Method.new get_company_config + update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company + @update_company = ::Gapic::Config::Method.new update_company_config + delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company + @delete_company = ::Gapic::Config::Method.new delete_company_config + list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies + @list_companies = ::Gapic::Config::Method.new list_companies_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb new file mode 100644 index 000000000000..6cb90fd7eecb --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Talent + module V4 + module CompanyService + # Credentials for the CompanyService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb new file mode 100644 index 000000000000..c4a717b39ab8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + module CompanyService + # Path helper methods for the CompanyService API. + module Paths + ## + # Create a fully-qualified Company resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/companies/{company}` + # + # @param project [String] + # @param tenant [String] + # @param company [String] + # + # @return [::String] + def company_path project:, tenant:, company: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/companies/#{company}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb new file mode 100644 index 000000000000..3c513e88db2d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_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/talent/v4/version" + +require "google/cloud/talent/v4/company_service/credentials" +require "google/cloud/talent/v4/company_service/paths" +require "google/cloud/talent/v4/company_service/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service that handles company management, including CRUD and enumeration. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/company_service/rest" + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + module CompanyService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/company_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb new file mode 100644 index 000000000000..f1d3ac698682 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb @@ -0,0 +1,831 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/company_service_pb" +require "google/cloud/talent/v4/company_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module CompanyService + module Rest + ## + # REST client for the CompanyService service. + # + # A service that handles company management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :company_service_stub + + ## + # Configure the CompanyService Client class. + # + # See {::Google::Cloud::Talent::V4::CompanyService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompanyService clients + # ::Google::Cloud::Talent::V4::CompanyService::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", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_company.timeout = 30.0 + + default_config.rpcs.get_company.timeout = 30.0 + default_config.rpcs.get_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_company.timeout = 30.0 + + default_config.rpcs.delete_company.timeout = 30.0 + default_config.rpcs.delete_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_companies.timeout = 30.0 + default_config.rpcs.list_companies.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompanyService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::CompanyService::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 + @company_service_stub.universe_domain + end + + ## + # Create a new CompanyService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompanyService 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 + + @company_service_stub = ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @company_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 + @company_service_stub.logger + end + + # Service calls + + ## + # Creates a new company entity. + # + # @overload create_company(request, options = nil) + # Pass arguments to `create_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_company(parent: nil, company: nil) + # Pass arguments to `create_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] + # Required. The company to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateCompanyRequest.new + # + # # Call the create_company method. + # result = client.create_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def create_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateCompanyRequest + + # Converts hash and nil to an 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_company.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.create_company request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified company. + # + # @overload get_company(request, options = nil) + # Pass arguments to `get_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_company(name: nil) + # Pass arguments to `get_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the company to be retrieved. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/api-test-project/tenants/foo/companies/bar". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetCompanyRequest.new + # + # # Call the get_company method. + # result = client.get_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def get_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetCompanyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_company.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.get_company request, 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 specified company. + # + # @overload update_company(request, options = nil) + # Pass arguments to `update_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_company(company: nil, update_mask: nil) + # Pass arguments to `update_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] + # Required. The company resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the company fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Company Company} are + # supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new + # + # # Call the update_company method. + # result = client.update_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def update_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateCompanyRequest + + # Converts hash and nil to an 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_company.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.update_company request, 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 specified company. + # Prerequisite: The company has no jobs associated with it. + # + # @overload delete_company(request, options = nil) + # Pass arguments to `delete_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_company(name: nil) + # Pass arguments to `delete_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the company to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new + # + # # Call the delete_company method. + # result = client.delete_company request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteCompanyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_company.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.delete_company request, 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 companies associated with the project. + # + # @overload list_companies(request, options = nil) + # Pass arguments to `list_companies` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListCompaniesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) + # Pass arguments to `list_companies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of companies to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @param require_open_jobs [::Boolean] + # Set to true if the companies requested must have open jobs. + # + # Defaults to false. + # + # If true, at most + # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of + # companies are fetched, among which only those with open jobs are returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListCompaniesRequest.new + # + # # Call the list_companies method. + # result = client.list_companies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Talent::V4::Company. + # p item + # end + # + def list_companies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListCompaniesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_companies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_companies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_companies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.list_companies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @company_service_stub, :list_companies, "companies", request, result, 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 CompanyService REST API. + # + # This class represents the configuration for CompanyService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::CompanyService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_company to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CompanyService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_company` + # @return [::Gapic::Config::Method] + # + attr_reader :create_company + ## + # RPC-specific configuration for `get_company` + # @return [::Gapic::Config::Method] + # + attr_reader :get_company + ## + # RPC-specific configuration for `update_company` + # @return [::Gapic::Config::Method] + # + attr_reader :update_company + ## + # RPC-specific configuration for `delete_company` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_company + ## + # RPC-specific configuration for `list_companies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_companies + + # @private + def initialize parent_rpcs = nil + create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company + @create_company = ::Gapic::Config::Method.new create_company_config + get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company + @get_company = ::Gapic::Config::Method.new get_company_config + update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company + @update_company = ::Gapic::Config::Method.new update_company_config + delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company + @delete_company = ::Gapic::Config::Method.new delete_company_config + list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies + @list_companies = ::Gapic::Config::Method.new list_companies_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb new file mode 100644 index 000000000000..c890988eb823 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/talent/v4/company_service_pb" + +module Google + module Cloud + module Talent + module V4 + module CompanyService + module Rest + ## + # REST service stub for the CompanyService 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_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateCompanyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # A result object deserialized from the server's reply + def create_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_company_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetCompanyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # A result object deserialized from the server's reply + def get_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_company_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Company.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_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateCompanyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # A result object deserialized from the server's reply + def update_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_company_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteCompanyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_company_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_companies REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListCompaniesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::ListCompaniesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::ListCompaniesResponse] + # A result object deserialized from the server's reply + def list_companies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_companies_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_companies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.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_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/companies", + body: "company", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetCompanyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v4/{company.name}", + body: "company", + matches: [ + ["company.name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteCompanyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_companies REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListCompaniesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_companies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{parent}/companies", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb new file mode 100644 index 000000000000..f07901a1adfe --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/company_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/talent/v4/common_pb' +require 'google/cloud/talent/v4/company_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n,google/cloud/talent/v4/company_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a$google/cloud/talent/v4/company.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x81\x01\n\x14\x43reateCompanyRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x35\n\x07\x63ompany\x18\x02 \x01(\x0b\x32\x1f.google.cloud.talent.v4.CompanyB\x03\xe0\x41\x02\"F\n\x11GetCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"~\n\x14UpdateCompanyRequest\x12\x35\n\x07\x63ompany\x18\x01 \x01(\x0b\x32\x1f.google.cloud.talent.v4.CompanyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"I\n\x14\x44\x65leteCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"\x8c\x01\n\x14ListCompaniesRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x19\n\x11require_open_jobs\x18\x04 \x01(\x08\"\xa0\x01\n\x15ListCompaniesResponse\x12\x32\n\tcompanies\x18\x01 \x03(\x0b\x32\x1f.google.cloud.talent.v4.Company\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata2\xc3\x07\n\x0e\x43ompanyService\x12\xad\x01\n\rCreateCompany\x12,.google.cloud.talent.v4.CreateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"M\xda\x41\x0eparent,company\x82\xd3\xe4\x93\x02\x36\"+/v4/{parent=projects/*/tenants/*}/companies:\x07\x63ompany\x12\x94\x01\n\nGetCompany\x12).google.cloud.talent.v4.GetCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v4/{name=projects/*/tenants/*/companies/*}\x12\xba\x01\n\rUpdateCompany\x12,.google.cloud.talent.v4.UpdateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"Z\xda\x41\x13\x63ompany,update_mask\x82\xd3\xe4\x93\x02>23/v4/{company.name=projects/*/tenants/*/companies/*}:\x07\x63ompany\x12\x91\x01\n\rDeleteCompany\x12,.google.cloud.talent.v4.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v4/{name=projects/*/tenants/*/companies/*}\x12\xaa\x01\n\rListCompanies\x12,.google.cloud.talent.v4.ListCompaniesRequest\x1a-.google.cloud.talent.v4.ListCompaniesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v4/{parent=projects/*/tenants/*}/companies\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBm\n\x1a\x63om.google.cloud.talent.v4B\x13\x43ompanyServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + CreateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateCompanyRequest").msgclass + GetCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetCompanyRequest").msgclass + UpdateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateCompanyRequest").msgclass + DeleteCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteCompanyRequest").msgclass + ListCompaniesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListCompaniesRequest").msgclass + ListCompaniesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListCompaniesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb new file mode 100644 index 000000000000..970558173e7b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb @@ -0,0 +1,54 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/company_service.proto for package 'google.cloud.talent.v4' +# 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/talent/v4/company_service_pb' + +module Google + module Cloud + module Talent + module V4 + module CompanyService + # A service that handles company management, including CRUD and enumeration. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.CompanyService' + + # Creates a new company entity. + rpc :CreateCompany, ::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Google::Cloud::Talent::V4::Company + # Retrieves specified company. + rpc :GetCompany, ::Google::Cloud::Talent::V4::GetCompanyRequest, ::Google::Cloud::Talent::V4::Company + # Updates specified company. + rpc :UpdateCompany, ::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Google::Cloud::Talent::V4::Company + # Deletes specified company. + # Prerequisite: The company has no jobs associated with it. + rpc :DeleteCompany, ::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Google::Protobuf::Empty + # Lists all companies associated with the project. + rpc :ListCompanies, ::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Google::Cloud::Talent::V4::ListCompaniesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb new file mode 100644 index 000000000000..b6fa3c5a86bc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.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/talent/v4/version" + +require "google/cloud/talent/v4/completion/credentials" +require "google/cloud/talent/v4/completion/paths" +require "google/cloud/talent/v4/completion/client" +require "google/cloud/talent/v4/completion/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles auto completion. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/completion" + # client = ::Google::Cloud::Talent::V4::Completion::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/completion/rest" + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new + # + module Completion + end + end + end + end +end + +helper_path = ::File.join __dir__, "completion", "helpers.rb" +require "google/cloud/talent/v4/completion/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb new file mode 100644 index 000000000000..94005a2e169b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb @@ -0,0 +1,510 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/completion_service_pb" + +module Google + module Cloud + module Talent + module V4 + module Completion + ## + # Client for the Completion service. + # + # A service handles auto completion. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_stub + + ## + # Configure the Completion Client class. + # + # See {::Google::Cloud::Talent::V4::Completion::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Completion clients + # ::Google::Cloud::Talent::V4::Completion::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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.complete_query.timeout = 30.0 + default_config.rpcs.complete_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Completion Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::Completion::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @completion_stub.universe_domain + end + + ## + # Create a new Completion client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::Completion::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Completion 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/talent/v4/completion_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @completion_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::Completion::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @completion_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 + @completion_stub.logger + end + + # Service calls + + ## + # Completes the specified prefix with keyword suggestions. + # Intended for use by a job search auto-complete search box. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::Talent::V4::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload complete_query(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::String] + # Required. Resource name of tenant the completion is performed within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param query [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @param language_codes [::Array<::String>] + # The list of languages of the query. This is + # the BCP-47 language code, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # The maximum number of allowed characters is 255. + # @param page_size [::Integer] + # Required. Completion result count. + # + # The maximum allowed page size is 10. + # @param company [::String] + # If provided, restricts completion to specified company. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @param scope [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] + # The scope of the completion. The defaults is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. + # @param type [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] + # The completion topic. The default is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::Completion::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CompleteQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.complete_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.tenant + header_params["tenant"] = request.tenant + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.complete_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_stub.call_rpc :complete_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Completion API. + # + # This class represents the configuration for Completion, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::Completion::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::Completion::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Completion API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb new file mode 100644 index 000000000000..7cd296fec044 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Talent + module V4 + module Completion + # Credentials for the Completion API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb new file mode 100644 index 000000000000..76d8a7f968e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + module Completion + # Path helper methods for the Completion API. + module Paths + ## + # Create a fully-qualified Company resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/companies/{company}` + # + # @param project [String] + # @param tenant [String] + # @param company [String] + # + # @return [::String] + def company_path project:, tenant:, company: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/companies/#{company}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb new file mode 100644 index 000000000000..20ebc6431f70 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/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/talent/v4/version" + +require "google/cloud/talent/v4/completion/credentials" +require "google/cloud/talent/v4/completion/paths" +require "google/cloud/talent/v4/completion/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles auto completion. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/completion/rest" + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new + # + module Completion + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/completion/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb new file mode 100644 index 000000000000..8d92314466de --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb @@ -0,0 +1,460 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/completion_service_pb" +require "google/cloud/talent/v4/completion/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module Completion + module Rest + ## + # REST client for the Completion service. + # + # A service handles auto completion. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_stub + + ## + # Configure the Completion Client class. + # + # See {::Google::Cloud::Talent::V4::Completion::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Completion clients + # ::Google::Cloud::Talent::V4::Completion::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", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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.complete_query.timeout = 30.0 + default_config.rpcs.complete_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Completion Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::Completion::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @completion_stub.universe_domain + end + + ## + # Create a new Completion REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Completion 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 + + @completion_stub = ::Google::Cloud::Talent::V4::Completion::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @completion_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 + @completion_stub.logger + end + + # Service calls + + ## + # Completes the specified prefix with keyword suggestions. + # Intended for use by a job search auto-complete search box. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::Talent::V4::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload complete_query(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::String] + # Required. Resource name of tenant the completion is performed within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param query [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @param language_codes [::Array<::String>] + # The list of languages of the query. This is + # the BCP-47 language code, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # The maximum number of allowed characters is 255. + # @param page_size [::Integer] + # Required. Completion result count. + # + # The maximum allowed page size is 10. + # @param company [::String] + # If provided, restricts completion to specified company. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @param scope [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] + # The scope of the completion. The defaults is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. + # @param type [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] + # The completion topic. The default is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::Completion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CompleteQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.complete_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.complete_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_stub.complete_query request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Completion REST API. + # + # This class represents the configuration for Completion REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::Completion::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::Completion::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Completion API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb new file mode 100644 index 000000000000..05cfeeb2676d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/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/cloud/talent/v4/completion_service_pb" + +module Google + module Cloud + module Talent + module V4 + module Completion + module Rest + ## + # REST service stub for the Completion service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the complete_query REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CompleteQueryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # A result object deserialized from the server's reply + def complete_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "complete_query", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the complete_query REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CompleteQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_complete_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{tenant}:completeQuery", + matches: [ + ["tenant", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb new file mode 100644 index 000000000000..104ea071ee7a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/completion_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/talent/v4/common_pb' + + +descriptor_data = "\n/google/cloud/talent/v4/completion_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\"\x88\x04\n\x14\x43ompleteQueryRequest\x12\x32\n\x06tenant\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x31\n\x07\x63ompany\x18\x05 \x01(\tB \xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12K\n\x05scope\x18\x06 \x01(\x0e\x32<.google.cloud.talent.v4.CompleteQueryRequest.CompletionScope\x12I\n\x04type\x18\x07 \x01(\x0e\x32;.google.cloud.talent.v4.CompleteQueryRequest.CompletionType\"K\n\x0f\x43ompletionScope\x12 \n\x1c\x43OMPLETION_SCOPE_UNSPECIFIED\x10\x00\x12\n\n\x06TENANT\x10\x01\x12\n\n\x06PUBLIC\x10\x02\"`\n\x0e\x43ompletionType\x12\x1f\n\x1b\x43OMPLETION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tJOB_TITLE\x10\x01\x12\x10\n\x0c\x43OMPANY_NAME\x10\x02\x12\x0c\n\x08\x43OMBINED\x10\x03\"\xb6\x02\n\x15\x43ompleteQueryResponse\x12Z\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32>.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult\x12:\n\x08metadata\x18\x02 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\x1a\x84\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12I\n\x04type\x18\x02 \x01(\x0e\x32;.google.cloud.talent.v4.CompleteQueryRequest.CompletionType\x12\x11\n\timage_uri\x18\x03 \x01(\t2\xa2\x02\n\nCompletion\x12\xa5\x01\n\rCompleteQuery\x12,.google.cloud.talent.v4.CompleteQueryRequest\x1a-.google.cloud.talent.v4.CompleteQueryResponse\"7\x82\xd3\xe4\x93\x02\x31\x12//v4/{tenant=projects/*/tenants/*}:completeQuery\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBp\n\x1a\x63om.google.cloud.talent.v4B\x16\x43ompletionServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest").msgclass + CompleteQueryRequest::CompletionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionScope").enummodule + CompleteQueryRequest::CompletionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionType").enummodule + CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse").msgclass + CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse.CompletionResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb new file mode 100644 index 000000000000..ee3e95861429 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb @@ -0,0 +1,46 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/completion_service.proto for package 'google.cloud.talent.v4' +# 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/talent/v4/completion_service_pb' + +module Google + module Cloud + module Talent + module V4 + module Completion + # A service handles auto completion. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.Completion' + + # Completes the specified prefix with keyword suggestions. + # Intended for use by a job search auto-complete search box. + rpc :CompleteQuery, ::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Google::Cloud::Talent::V4::CompleteQueryResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb new file mode 100644 index 000000000000..e5ba296b8334 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/event.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\"google/cloud/talent/v4/event.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc3\x01\n\x0b\x43lientEvent\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x15\n\x08\x65vent_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x35\n\tjob_event\x18\x05 \x01(\x0b\x32 .google.cloud.talent.v4.JobEventH\x00\x12\x13\n\x0b\x65vent_notes\x18\t \x01(\tB\x07\n\x05\x65vent\"\xe0\x03\n\x08JobEvent\x12@\n\x04type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.JobEvent.JobEventTypeB\x03\xe0\x41\x02\x12\x11\n\x04jobs\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xfe\x02\n\x0cJobEventType\x12\x1e\n\x1aJOB_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nIMPRESSION\x10\x01\x12\x08\n\x04VIEW\x10\x02\x12\x11\n\rVIEW_REDIRECT\x10\x03\x12\x15\n\x11\x41PPLICATION_START\x10\x04\x12\x16\n\x12\x41PPLICATION_FINISH\x10\x05\x12 \n\x1c\x41PPLICATION_QUICK_SUBMISSION\x10\x06\x12\x18\n\x14\x41PPLICATION_REDIRECT\x10\x07\x12!\n\x1d\x41PPLICATION_START_FROM_SEARCH\x10\x08\x12$\n APPLICATION_REDIRECT_FROM_SEARCH\x10\t\x12\x1e\n\x1a\x41PPLICATION_COMPANY_SUBMIT\x10\n\x12\x0c\n\x08\x42OOKMARK\x10\x0b\x12\x10\n\x0cNOTIFICATION\x10\x0c\x12\t\n\x05HIRED\x10\r\x12\x0b\n\x07SENT_CV\x10\x0e\x12\x15\n\x11INTERVIEW_GRANTED\x10\x0f\x42\x64\n\x1a\x63om.google.cloud.talent.v4B\nEventProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + ClientEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ClientEvent").msgclass + JobEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent").msgclass + JobEvent::JobEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent.JobEventType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb new file mode 100644 index 000000000000..3eae631b03f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_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/talent/v4/version" + +require "google/cloud/talent/v4/event_service/credentials" +require "google/cloud/talent/v4/event_service/paths" +require "google/cloud/talent/v4/event_service/client" +require "google/cloud/talent/v4/event_service/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles client event report. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/event_service" + # client = ::Google::Cloud::Talent::V4::EventService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/event_service/rest" + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new + # + module EventService + end + end + end + end +end + +helper_path = ::File.join __dir__, "event_service", "helpers.rb" +require "google/cloud/talent/v4/event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb new file mode 100644 index 000000000000..caae115348d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb @@ -0,0 +1,488 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/event_service_pb" + +module Google + module Cloud + module Talent + module V4 + module EventService + ## + # Client for the EventService service. + # + # A service handles client event report. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :event_service_stub + + ## + # Configure the EventService Client class. + # + # See {::Google::Cloud::Talent::V4::EventService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EventService clients + # ::Google::Cloud::Talent::V4::EventService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_client_event.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EventService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::EventService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @event_service_stub.universe_domain + end + + ## + # Create a new EventService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::EventService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EventService 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/talent/v4/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 + + @event_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::EventService::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 + ) + + @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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @event_service_stub.logger + end + + # Service calls + + ## + # Report events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. You may inspect the created events in + # [self service + # tools](https://console.cloud.google.com/talent-solution/overview). + # [Learn + # more](https://cloud.google.com/talent-solution/docs/management-tools) + # about self service tools. + # + # @overload create_client_event(request, options = nil) + # Pass arguments to `create_client_event` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateClientEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_client_event(parent: nil, client_event: nil) + # Pass arguments to `create_client_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. Resource name of the tenant under which the event is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash] + # Required. Events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::ClientEvent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::ClientEvent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::EventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateClientEventRequest.new + # + # # Call the create_client_event method. + # result = client.create_client_event request + # + # # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. + # p result + # + def create_client_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateClientEventRequest + + # Converts hash and nil to 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_client_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::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_client_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_client_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @event_service_stub.call_rpc :create_client_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 + + ## + # Configuration class for the EventService API. + # + # This class represents the configuration for EventService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::EventService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_client_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::EventService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_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::Talent::V4::EventService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the EventService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_client_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_client_event + + # @private + def initialize parent_rpcs = nil + create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event + @create_client_event = ::Gapic::Config::Method.new create_client_event_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb new file mode 100644 index 000000000000..3909062c4684 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Talent + module V4 + module EventService + # Credentials for the EventService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb new file mode 100644 index 000000000000..bdb45a8600a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + module EventService + # Path helper methods for the EventService API. + module Paths + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb new file mode 100644 index 000000000000..b3d12ce1a69a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_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/talent/v4/version" + +require "google/cloud/talent/v4/event_service/credentials" +require "google/cloud/talent/v4/event_service/paths" +require "google/cloud/talent/v4/event_service/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles client event report. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/event_service/rest" + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new + # + module EventService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb new file mode 100644 index 000000000000..43bd04679cc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/event_service_pb" +require "google/cloud/talent/v4/event_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module EventService + module Rest + ## + # REST client for the EventService service. + # + # A service handles client event report. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :event_service_stub + + ## + # Configure the EventService Client class. + # + # See {::Google::Cloud::Talent::V4::EventService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EventService clients + # ::Google::Cloud::Talent::V4::EventService::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", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_client_event.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EventService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::EventService::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 + @event_service_stub.universe_domain + end + + ## + # Create a new EventService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EventService 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 + + @event_service_stub = ::Google::Cloud::Talent::V4::EventService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @event_service_stub.logger + end + + # Service calls + + ## + # Report events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. You may inspect the created events in + # [self service + # tools](https://console.cloud.google.com/talent-solution/overview). + # [Learn + # more](https://cloud.google.com/talent-solution/docs/management-tools) + # about self service tools. + # + # @overload create_client_event(request, options = nil) + # Pass arguments to `create_client_event` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateClientEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_client_event(parent: nil, client_event: nil) + # Pass arguments to `create_client_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. Resource name of the tenant under which the event is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash] + # Required. Events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::ClientEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::ClientEvent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::EventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateClientEventRequest.new + # + # # Call the create_client_event method. + # result = client.create_client_event request + # + # # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. + # p result + # + def create_client_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateClientEventRequest + + # Converts hash and nil to an 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_client_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::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_client_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_client_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @event_service_stub.create_client_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 + + ## + # Configuration class for the EventService REST API. + # + # This class represents the configuration for EventService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::EventService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_client_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::EventService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_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 = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the EventService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_client_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_client_event + + # @private + def initialize parent_rpcs = nil + create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event + @create_client_event = ::Gapic::Config::Method.new create_client_event_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb new file mode 100644 index 000000000000..1df84a12be19 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_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/talent/v4/event_service_pb" + +module Google + module Cloud + module Talent + module V4 + module EventService + module Rest + ## + # REST service stub for the EventService 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_client_event REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateClientEventRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::ClientEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::ClientEvent] + # A result object deserialized from the server's reply + def create_client_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_client_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: "create_client_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ClientEvent.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_client_event REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateClientEventRequest] + # 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_client_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/clientEvents", + body: "client_event", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb new file mode 100644 index 000000000000..3dc11df6acc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/event_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/talent/v4/event_pb' + + +descriptor_data = "\n*google/cloud/talent/v4/event_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/talent/v4/event.proto\"\x8e\x01\n\x18\x43reateClientEventRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12>\n\x0c\x63lient_event\x18\x02 \x01(\x0b\x32#.google.cloud.talent.v4.ClientEventB\x03\xe0\x41\x02\x32\xc5\x02\n\x0c\x45ventService\x12\xc6\x01\n\x11\x43reateClientEvent\x12\x30.google.cloud.talent.v4.CreateClientEventRequest\x1a#.google.cloud.talent.v4.ClientEvent\"Z\xda\x41\x13parent,client_event\x82\xd3\xe4\x93\x02>\"./v4/{parent=projects/*/tenants/*}/clientEvents:\x0c\x63lient_event\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBk\n\x1a\x63om.google.cloud.talent.v4B\x11\x45ventServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + CreateClientEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateClientEventRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb new file mode 100644 index 000000000000..4e21dbe2ff0e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/event_service.proto for package 'google.cloud.talent.v4' +# 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/talent/v4/event_service_pb' + +module Google + module Cloud + module Talent + module V4 + module EventService + # A service handles client event report. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.EventService' + + # Report events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. You may inspect the created events in + # [self service + # tools](https://console.cloud.google.com/talent-solution/overview). + # [Learn + # more](https://cloud.google.com/talent-solution/docs/management-tools) + # about self service tools. + rpc :CreateClientEvent, ::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Google::Cloud::Talent::V4::ClientEvent + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb new file mode 100644 index 000000000000..ee2d69c6b204 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/filters.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/talent/v4/common_pb' +require 'google/protobuf/duration_pb' +require 'google/type/latlng_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n$google/cloud/talent/v4/filters.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/cloud/talent/v4/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x18google/type/latlng.proto\x1a\x1bgoogle/type/timeofday.proto\"\xe2\x04\n\x08JobQuery\x12\r\n\x05query\x18\x01 \x01(\t\x12\x1b\n\x13query_language_code\x18\x0e \x01(\t\x12\x11\n\tcompanies\x18\x02 \x03(\t\x12@\n\x10location_filters\x18\x03 \x03(\x0b\x32&.google.cloud.talent.v4.LocationFilter\x12;\n\x0ejob_categories\x18\x04 \x03(\x0e\x32#.google.cloud.talent.v4.JobCategory\x12=\n\x0e\x63ommute_filter\x18\x05 \x01(\x0b\x32%.google.cloud.talent.v4.CommuteFilter\x12\x1d\n\x15\x63ompany_display_names\x18\x06 \x03(\t\x12G\n\x13\x63ompensation_filter\x18\x07 \x01(\x0b\x32*.google.cloud.talent.v4.CompensationFilter\x12\x1f\n\x17\x63ustom_attribute_filter\x18\x08 \x01(\t\x12\x1b\n\x13\x64isable_spell_check\x18\t \x01(\x08\x12@\n\x10\x65mployment_types\x18\n \x03(\x0e\x32&.google.cloud.talent.v4.EmploymentType\x12\x16\n\x0elanguage_codes\x18\x0b \x03(\t\x12\x42\n\x12publish_time_range\x18\x0c \x01(\x0b\x32&.google.cloud.talent.v4.TimestampRange\x12\x15\n\rexcluded_jobs\x18\r \x03(\t\"\xed\x02\n\x0eLocationFilter\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x19\n\x11\x64istance_in_miles\x18\x04 \x01(\x01\x12\\\n\x16telecommute_preference\x18\x05 \x01(\x0e\x32<.google.cloud.talent.v4.LocationFilter.TelecommutePreference\"\x95\x01\n\x15TelecommutePreference\x12&\n\"TELECOMMUTE_PREFERENCE_UNSPECIFIED\x10\x00\x12\x1c\n\x14TELECOMMUTE_EXCLUDED\x10\x01\x1a\x02\x08\x01\x12\x17\n\x13TELECOMMUTE_ALLOWED\x10\x02\x12\x1d\n\x19TELECOMMUTE_JOBS_EXCLUDED\x10\x03\"\xbb\x03\n\x12\x43ompensationFilter\x12H\n\x04type\x18\x01 \x01(\x0e\x32\x35.google.cloud.talent.v4.CompensationFilter.FilterTypeB\x03\xe0\x41\x02\x12M\n\x05units\x18\x02 \x03(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationUnitB\x03\xe0\x41\x02\x12I\n\x05range\x18\x03 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRange\x12\x38\n0include_jobs_with_unspecified_compensation_range\x18\x04 \x01(\x08\"\x86\x01\n\nFilterType\x12\x1b\n\x17\x46ILTER_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tUNIT_ONLY\x10\x01\x12\x13\n\x0fUNIT_AND_AMOUNT\x10\x02\x12\x1a\n\x16\x41NNUALIZED_BASE_AMOUNT\x10\x03\x12\x1b\n\x17\x41NNUALIZED_TOTAL_AMOUNT\x10\x04\"\xc1\x03\n\rCommuteFilter\x12\x42\n\x0e\x63ommute_method\x18\x01 \x01(\x0e\x32%.google.cloud.talent.v4.CommuteMethodB\x03\xe0\x41\x02\x12\x33\n\x11start_coordinates\x18\x02 \x01(\x0b\x32\x13.google.type.LatLngB\x03\xe0\x41\x02\x12\x37\n\x0ftravel_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12!\n\x19\x61llow_imprecise_addresses\x18\x04 \x01(\x08\x12I\n\x0croad_traffic\x18\x05 \x01(\x0e\x32\x31.google.cloud.talent.v4.CommuteFilter.RoadTrafficH\x00\x12\x30\n\x0e\x64\x65parture_time\x18\x06 \x01(\x0b\x32\x16.google.type.TimeOfDayH\x00\"L\n\x0bRoadTraffic\x12\x1c\n\x18ROAD_TRAFFIC_UNSPECIFIED\x10\x00\x12\x10\n\x0cTRAFFIC_FREE\x10\x01\x12\r\n\tBUSY_HOUR\x10\x02\x42\x10\n\x0etraffic_optionBf\n\x1a\x63om.google.cloud.talent.v4B\x0c\x46iltersProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + JobQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobQuery").msgclass + LocationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.LocationFilter").msgclass + LocationFilter::TelecommutePreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.LocationFilter.TelecommutePreference").enummodule + CompensationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationFilter").msgclass + CompensationFilter::FilterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationFilter.FilterType").enummodule + CommuteFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteFilter").msgclass + CommuteFilter::RoadTraffic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteFilter.RoadTraffic").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb new file mode 100644 index 000000000000..185c65a73f10 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/histogram.proto + +require 'google/protobuf' + + +descriptor_data = "\n&google/cloud/talent/v4/histogram.proto\x12\x16google.cloud.talent.v4\")\n\x0eHistogramQuery\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\"\xb1\x01\n\x14HistogramQueryResult\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\x12N\n\thistogram\x18\x02 \x03(\x0b\x32;.google.cloud.talent.v4.HistogramQueryResult.HistogramEntry\x1a\x30\n\x0eHistogramEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x42h\n\x1a\x63om.google.cloud.talent.v4B\x0eHistogramProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + HistogramQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HistogramQuery").msgclass + HistogramQueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HistogramQueryResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb new file mode 100644 index 000000000000..94a8ebe1de45 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/talent/v4/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n google/cloud/talent/v4/job.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf5\x0e\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x07\x63ompany\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12\x1b\n\x0erequisition_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\taddresses\x18\x06 \x03(\t\x12\x45\n\x10\x61pplication_info\x18\x07 \x01(\x0b\x32+.google.cloud.talent.v4.Job.ApplicationInfo\x12\x38\n\x0cjob_benefits\x18\x08 \x03(\x0e\x32\".google.cloud.talent.v4.JobBenefit\x12\x43\n\x11\x63ompensation_info\x18\t \x01(\x0b\x32(.google.cloud.talent.v4.CompensationInfo\x12L\n\x11\x63ustom_attributes\x18\n \x03(\x0b\x32\x31.google.cloud.talent.v4.Job.CustomAttributesEntry\x12\x38\n\x0c\x64\x65gree_types\x18\x0b \x03(\x0e\x32\".google.cloud.talent.v4.DegreeType\x12\x12\n\ndepartment\x18\x0c \x01(\t\x12@\n\x10\x65mployment_types\x18\r \x03(\x0e\x32&.google.cloud.talent.v4.EmploymentType\x12\x12\n\nincentives\x18\x0e \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12\x33\n\tjob_level\x18\x10 \x01(\x0e\x32 .google.cloud.talent.v4.JobLevel\x12\x17\n\x0fpromotion_value\x18\x11 \x01(\x05\x12\x16\n\x0equalifications\x18\x12 \x01(\t\x12\x18\n\x10responsibilities\x18\x13 \x01(\t\x12=\n\x0eposting_region\x18\x14 \x01(\x0e\x32%.google.cloud.talent.v4.PostingRegion\x12:\n\nvisibility\x18\x15 \x01(\x0e\x32\".google.cloud.talent.v4.VisibilityB\x02\x18\x01\x12\x32\n\x0ejob_start_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0cjob_end_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14posting_publish_time\x18\x18 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x13posting_expire_time\x18\x19 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x13posting_create_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13posting_update_time\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12!\n\x14\x63ompany_display_name\x18\x1c \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x0c\x64\x65rived_info\x18\x1d \x01(\x0b\x32\'.google.cloud.talent.v4.Job.DerivedInfoB\x03\xe0\x41\x03\x12I\n\x12processing_options\x18\x1e \x01(\x0b\x32-.google.cloud.talent.v4.Job.ProcessingOptions\x1a\x44\n\x0f\x41pplicationInfo\x12\x0e\n\x06\x65mails\x18\x01 \x03(\t\x12\x13\n\x0binstruction\x18\x02 \x01(\t\x12\x0c\n\x04uris\x18\x03 \x03(\t\x1a\x7f\n\x0b\x44\x65rivedInfo\x12\x33\n\tlocations\x18\x01 \x03(\x0b\x32 .google.cloud.talent.v4.Location\x12;\n\x0ejob_categories\x18\x03 \x03(\x0e\x32#.google.cloud.talent.v4.JobCategory\x1a\x83\x01\n\x11ProcessingOptions\x12)\n!disable_street_address_resolution\x18\x01 \x01(\x08\x12\x43\n\x11html_sanitization\x18\x02 \x01(\x0e\x32(.google.cloud.talent.v4.HtmlSanitization\x1a`\n\x15\x43ustomAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.talent.v4.CustomAttribute:\x02\x38\x01:L\xea\x41I\n\x17jobs.googleapis.com/Job\x12.projects/{project}/tenants/{tenant}/jobs/{job}Bb\n\x1a\x63om.google.cloud.talent.v4B\x08JobProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job").msgclass + Job::ApplicationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.ApplicationInfo").msgclass + Job::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.DerivedInfo").msgclass + Job::ProcessingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.ProcessingOptions").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb new file mode 100644 index 000000000000..72fd641b46a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_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/talent/v4/version" + +require "google/cloud/talent/v4/job_service/credentials" +require "google/cloud/talent/v4/job_service/paths" +require "google/cloud/talent/v4/job_service/operations" +require "google/cloud/talent/v4/job_service/client" +require "google/cloud/talent/v4/job_service/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles job management, including job CRUD, enumeration and search. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/job_service" + # client = ::Google::Cloud::Talent::V4::JobService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/job_service/rest" + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + module JobService + end + end + end + end +end + +helper_path = ::File.join __dir__, "job_service", "helpers.rb" +require "google/cloud/talent/v4/job_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb new file mode 100644 index 000000000000..0c49b93e652d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb @@ -0,0 +1,2062 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/job_service_pb" + +module Google + module Cloud + module Talent + module V4 + module JobService + ## + # Client for the JobService service. + # + # A service handles job management, including job CRUD, enumeration and search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :job_service_stub + + ## + # Configure the JobService Client class. + # + # See {::Google::Cloud::Talent::V4::JobService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobService clients + # ::Google::Cloud::Talent::V4::JobService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_job.timeout = 30.0 + + default_config.rpcs.batch_create_jobs.timeout = 30.0 + + default_config.rpcs.get_job.timeout = 30.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_job.timeout = 30.0 + + default_config.rpcs.batch_update_jobs.timeout = 30.0 + + default_config.rpcs.delete_job.timeout = 30.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.batch_delete_jobs.timeout = 30.0 + + default_config.rpcs.list_jobs.timeout = 30.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_jobs.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the JobService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::JobService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @job_service_stub.universe_domain + end + + ## + # Create a new JobService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobService 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/talent/v4/job_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 + + @job_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::JobService::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 + ) + + @job_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::Talent::V4::JobService::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @job_service_stub.logger + end + + # Service calls + + ## + # Creates a new job. + # + # Typically, the job becomes searchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_job(parent: nil, job: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] + # Required. The Job to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :create_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch create jobs operation. + # + # @overload batch_create_jobs(request, options = nil) + # Pass arguments to `batch_create_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchCreateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_create_jobs(parent: nil, jobs: nil) + # Pass arguments to `batch_create_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] + # Required. The jobs to be created. + # A maximum of 200 jobs can be created in a batch. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new + # + # # Call the batch_create_jobs method. + # result = client.batch_create_jobs request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_create_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchCreateJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_create_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_create_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :batch_create_jobs, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the specified job, whose status is OPEN or recently EXPIRED + # within the last 90 days. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the job to retrieve. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified job. + # + # Typically, updated contents become visible in search results within 10 + # seconds, but it may take up to 5 minutes. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_job(job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] + # Required. The Job to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise + # all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.job&.name + header_params["job.name"] = request.job.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :update_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch update jobs operation. + # + # @overload batch_update_jobs(request, options = nil) + # Pass arguments to `batch_update_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) + # Pass arguments to `batch_update_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] + # Required. The jobs to be updated. + # A maximum of 200 jobs can be updated in a batch. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. Be aware that it will + # also increase latency when checking the status of a batch operation. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} + # are updated. Otherwise all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside + # {::Google::Cloud::Talent::V4::JobResult JobResult} + # will only contains fields that is updated, plus the Id of the Job. + # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, + # which can yield a very large response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new + # + # # Call the batch_update_jobs method. + # result = client.batch_update_jobs request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_update_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_update_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_update_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_update_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :batch_update_jobs, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 the specified job. + # + # Typically, the job becomes unsearchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_job(name: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the job to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :delete_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch delete jobs operation. + # + # @overload batch_delete_jobs(request, options = nil) + # Pass arguments to `batch_delete_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchDeleteJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_delete_jobs(parent: nil, names: nil) + # Pass arguments to `batch_delete_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # + # The parent of all of the jobs specified in `names` must match this field. + # @param names [::Array<::String>] + # The names of the jobs to delete. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". + # For example, "projects/foo/tenants/bar/jobs/baz". + # + # A maximum of 200 jobs can be deleted in a batch. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new + # + # # Call the batch_delete_jobs method. + # result = client.batch_delete_jobs request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_delete_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_delete_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_delete_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_delete_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :batch_delete_jobs, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 jobs by filter. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_jobs(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param filter [::String] + # Required. The filter string specifies the jobs to be enumerated. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` + # * `requisitionId` + # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + # OPEN if no value is specified. + # + # At least one of `companyName` and `requisitionId` must present or an + # INVALID_ARGUMENT error is thrown. + # + # Sample Query: + # + # * companyName = "projects/foo/tenants/bar/companies/baz" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # requisitionId = "req-1" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # status = "EXPIRED" + # * requisitionId = "req-1" + # * requisitionId = "req-1" AND status = "EXPIRED" + # @param page_token [::String] + # The starting point of a query result. + # @param page_size [::Integer] + # The maximum number of jobs to be returned per page of results. + # + # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, + # the maximum allowed page size is 1000. Otherwise, the maximum allowed page + # size is 100. + # + # Default is 100 if empty or a number < 1 is specified. + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the + # search response. Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no + # value is specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Talent::V4::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # + # This call constrains the + # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the + # database, and only returns jobs that the caller has permission to search + # against. + # + # @overload search_jobs(request, options = nil) + # Pass arguments to `search_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param max_page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # + # # Call the search_jobs method. + # result = client.search_jobs request + # + # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + # p result + # + def search_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest + + # Converts hash and nil to 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_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :search_jobs, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # + # This API call is intended for the use case of targeting passive job + # seekers (for example, job seekers who have signed up to receive email + # alerts about potential job opportunities), it has different algorithmic + # adjustments that are designed to specifically target passive job seekers. + # + # This call constrains the + # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the + # database, and only returns jobs the caller has permission to search + # against. + # + # @overload search_jobs_for_alert(request, options = nil) + # Pass arguments to `search_jobs_for_alert` via a request object, either of type + # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param max_page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # + # # Call the search_jobs_for_alert method. + # result = client.search_jobs_for_alert request + # + # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + # p result + # + def search_jobs_for_alert request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest + + # Converts hash and nil to 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_jobs_for_alert.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_jobs_for_alert.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :search_jobs_for_alert, request, 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 JobService API. + # + # This class represents the configuration for JobService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::JobService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::JobService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Talent::V4::JobService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the JobService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `batch_create_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `batch_update_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_jobs + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `batch_delete_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_jobs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `search_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs + ## + # RPC-specific configuration for `search_jobs_for_alert` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs_for_alert + + # @private + def initialize parent_rpcs = nil + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs + @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs + @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs + @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs + @search_jobs = ::Gapic::Config::Method.new search_jobs_config + search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert + @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb new file mode 100644 index 000000000000..8264c8770c63 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Talent + module V4 + module JobService + # Credentials for the JobService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb new file mode 100644 index 000000000000..7519b6ebba50 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_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 Talent + module V4 + module JobService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the JobService 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 JobService 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::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::Talent::V4::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 = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb new file mode 100644 index 000000000000..b40f2cddc538 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/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 Talent + module V4 + module JobService + # Path helper methods for the JobService API. + module Paths + ## + # Create a fully-qualified Company resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/companies/{company}` + # + # @param project [String] + # @param tenant [String] + # @param company [String] + # + # @return [::String] + def company_path project:, tenant:, company: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/companies/#{company}" + end + + ## + # Create a fully-qualified Job resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/jobs/{job}` + # + # @param project [String] + # @param tenant [String] + # @param job [String] + # + # @return [::String] + def job_path project:, tenant:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/jobs/#{job}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb new file mode 100644 index 000000000000..2155d4710be6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_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/talent/v4/version" + +require "google/cloud/talent/v4/job_service/credentials" +require "google/cloud/talent/v4/job_service/paths" +require "google/cloud/talent/v4/job_service/rest/operations" +require "google/cloud/talent/v4/job_service/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles job management, including job CRUD, enumeration and search. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/job_service/rest" + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + module JobService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/job_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb new file mode 100644 index 000000000000..88db35d75db8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb @@ -0,0 +1,1949 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/job_service_pb" +require "google/cloud/talent/v4/job_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module JobService + module Rest + ## + # REST client for the JobService service. + # + # A service handles job management, including job CRUD, enumeration and search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :job_service_stub + + ## + # Configure the JobService Client class. + # + # See {::Google::Cloud::Talent::V4::JobService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobService clients + # ::Google::Cloud::Talent::V4::JobService::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", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_job.timeout = 30.0 + + default_config.rpcs.batch_create_jobs.timeout = 30.0 + + default_config.rpcs.get_job.timeout = 30.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_job.timeout = 30.0 + + default_config.rpcs.batch_update_jobs.timeout = 30.0 + + default_config.rpcs.delete_job.timeout = 30.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.batch_delete_jobs.timeout = 30.0 + + default_config.rpcs.list_jobs.timeout = 30.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_jobs.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the JobService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::JobService::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 + @job_service_stub.universe_domain + end + + ## + # Create a new JobService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobService 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::Talent::V4::JobService::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 + + @job_service_stub = ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @job_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::Talent::V4::JobService::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @job_service_stub.logger + end + + # Service calls + + ## + # Creates a new job. + # + # Typically, the job becomes searchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_job(parent: nil, job: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] + # Required. The Job to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.create_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch create jobs operation. + # + # @overload batch_create_jobs(request, options = nil) + # Pass arguments to `batch_create_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchCreateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_create_jobs(parent: nil, jobs: nil) + # Pass arguments to `batch_create_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] + # Required. The jobs to be created. + # A maximum of 200 jobs can be created in a batch. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new + # + # # Call the batch_create_jobs method. + # result = client.batch_create_jobs request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_create_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchCreateJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_create_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_create_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.batch_create_jobs request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the specified job, whose status is OPEN or recently EXPIRED + # within the last 90 days. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the job to retrieve. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.get_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified job. + # + # Typically, updated contents become visible in search results within 10 + # seconds, but it may take up to 5 minutes. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_job(job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] + # Required. The Job to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise + # all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.update_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch update jobs operation. + # + # @overload batch_update_jobs(request, options = nil) + # Pass arguments to `batch_update_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) + # Pass arguments to `batch_update_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] + # Required. The jobs to be updated. + # A maximum of 200 jobs can be updated in a batch. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. Be aware that it will + # also increase latency when checking the status of a batch operation. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} + # are updated. Otherwise all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside + # {::Google::Cloud::Talent::V4::JobResult JobResult} + # will only contains fields that is updated, plus the Id of the Job. + # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, + # which can yield a very large response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new + # + # # Call the batch_update_jobs method. + # result = client.batch_update_jobs request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_update_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_update_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_update_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_update_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.batch_update_jobs request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 the specified job. + # + # Typically, the job becomes unsearchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_job(name: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the job to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.delete_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch delete jobs operation. + # + # @overload batch_delete_jobs(request, options = nil) + # Pass arguments to `batch_delete_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchDeleteJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_delete_jobs(parent: nil, names: nil) + # Pass arguments to `batch_delete_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # + # The parent of all of the jobs specified in `names` must match this field. + # @param names [::Array<::String>] + # The names of the jobs to delete. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". + # For example, "projects/foo/tenants/bar/jobs/baz". + # + # A maximum of 200 jobs can be deleted in a batch. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new + # + # # Call the batch_delete_jobs method. + # result = client.batch_delete_jobs request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_delete_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_delete_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_delete_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_delete_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.batch_delete_jobs request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 jobs by filter. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_jobs(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param filter [::String] + # Required. The filter string specifies the jobs to be enumerated. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` + # * `requisitionId` + # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + # OPEN if no value is specified. + # + # At least one of `companyName` and `requisitionId` must present or an + # INVALID_ARGUMENT error is thrown. + # + # Sample Query: + # + # * companyName = "projects/foo/tenants/bar/companies/baz" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # requisitionId = "req-1" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # status = "EXPIRED" + # * requisitionId = "req-1" + # * requisitionId = "req-1" AND status = "EXPIRED" + # @param page_token [::String] + # The starting point of a query result. + # @param page_size [::Integer] + # The maximum number of jobs to be returned per page of results. + # + # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, + # the maximum allowed page size is 1000. Otherwise, the maximum allowed page + # size is 100. + # + # Default is 100 if empty or a number < 1 is specified. + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the + # search response. Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no + # value is specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Talent::V4::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.list_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_jobs, "jobs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # + # This call constrains the + # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the + # database, and only returns jobs that the caller has permission to search + # against. + # + # @overload search_jobs(request, options = nil) + # Pass arguments to `search_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param max_page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # + # # Call the search_jobs method. + # result = client.search_jobs request + # + # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + # p result + # + def search_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest + + # Converts hash and nil to an 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_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.search_jobs request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # + # This API call is intended for the use case of targeting passive job + # seekers (for example, job seekers who have signed up to receive email + # alerts about potential job opportunities), it has different algorithmic + # adjustments that are designed to specifically target passive job seekers. + # + # This call constrains the + # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the + # database, and only returns jobs the caller has permission to search + # against. + # + # @overload search_jobs_for_alert(request, options = nil) + # Pass arguments to `search_jobs_for_alert` via a request object, either of type + # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param max_page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # + # # Call the search_jobs_for_alert method. + # result = client.search_jobs_for_alert request + # + # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + # p result + # + def search_jobs_for_alert request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest + + # Converts hash and nil to an 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_jobs_for_alert.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_jobs_for_alert.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.search_jobs_for_alert request, 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 JobService REST API. + # + # This class represents the configuration for JobService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::JobService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::JobService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the JobService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `batch_create_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `batch_update_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_jobs + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `batch_delete_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_jobs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `search_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs + ## + # RPC-specific configuration for `search_jobs_for_alert` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs_for_alert + + # @private + def initialize parent_rpcs = nil + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs + @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs + @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs + @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs + @search_jobs = ::Gapic::Config::Method.new search_jobs_config + search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert + @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb new file mode 100644 index 000000000000..2a2c90d09cf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/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 Talent + module V4 + module JobService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the JobService 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 JobService 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::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb new file mode 100644 index 000000000000..634719f7c02e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb @@ -0,0 +1,698 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/talent/v4/job_service_pb" + +module Google + module Cloud + module Talent + module V4 + module JobService + module Rest + ## + # REST service stub for the JobService 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_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # A result object deserialized from the server's reply + def create_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_create_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchCreateJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_create_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_create_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # A result object deserialized from the server's reply + def get_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # A result object deserialized from the server's reply + def update_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_update_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_update_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_update_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_delete_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_delete_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_delete_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::ListJobsResponse] + # A result object deserialized from the server's reply + def list_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # A result object deserialized from the server's reply + def search_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "search_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::SearchJobsResponse.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_jobs_for_alert REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # A result object deserialized from the server's reply + def search_jobs_for_alert request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_jobs_for_alert_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_jobs_for_alert", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::SearchJobsResponse.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_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs", + body: "job", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchCreateJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v4/{job.name}", + body: "job", + matches: [ + ["job.name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_update_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_update_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_delete_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_delete_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{parent}/jobs", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] + # 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_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:search", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_jobs_for_alert REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] + # 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_jobs_for_alert_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:searchForAlert", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb new file mode 100644 index 000000000000..58b385ae54bc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/job_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/talent/v4/common_pb' +require 'google/cloud/talent/v4/filters_pb' +require 'google/cloud/talent/v4/histogram_pb' +require 'google/cloud/talent/v4/job_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n(google/cloud/talent/v4/job_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a$google/cloud/talent/v4/filters.proto\x1a&google/cloud/talent/v4/histogram.proto\x1a google/cloud/talent/v4/job.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"r\n\x10\x43reateJobRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12-\n\x03job\x18\x02 \x01(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\">\n\rGetJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"r\n\x10UpdateJobRequest\x12-\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"A\n\x10\x44\x65leteJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"\xb1\x01\n\x0fListJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x31\n\x08job_view\x18\x05 \x01(\x0e\x32\x1f.google.cloud.talent.v4.JobView\"\x92\x01\n\x10ListJobsResponse\x12)\n\x04jobs\x18\x01 \x03(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\"\x9d\r\n\x11SearchJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12I\n\x0bsearch_mode\x18\x02 \x01(\x0e\x32\x34.google.cloud.talent.v4.SearchJobsRequest.SearchMode\x12\x46\n\x10request_metadata\x18\x03 \x01(\x0b\x32\'.google.cloud.talent.v4.RequestMetadataB\x03\xe0\x41\x02\x12\x33\n\tjob_query\x18\x04 \x01(\x0b\x32 .google.cloud.talent.v4.JobQuery\x12\x19\n\x11\x65nable_broadening\x18\x05 \x01(\x08\x12\x41\n\x11histogram_queries\x18\x07 \x03(\x0b\x32&.google.cloud.talent.v4.HistogramQuery\x12\x31\n\x08job_view\x18\x08 \x01(\x0e\x32\x1f.google.cloud.talent.v4.JobView\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x15\n\rmax_page_size\x18\n \x01(\x05\x12\x12\n\npage_token\x18\x0b \x01(\t\x12\x10\n\x08order_by\x18\x0c \x01(\t\x12]\n\x15\x64iversification_level\x18\r \x01(\x0e\x32>.google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel\x12X\n\x13\x63ustom_ranking_info\x18\x0e \x01(\x0b\x32;.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo\x12!\n\x15\x64isable_keyword_match\x18\x10 \x01(\x08\x42\x02\x18\x01\x12V\n\x12keyword_match_mode\x18\x12 \x01(\x0e\x32:.google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode\x12^\n\x13relevance_threshold\x18\x13 \x01(\x0e\x32<.google.cloud.talent.v4.SearchJobsRequest.RelevanceThresholdB\x03\xe0\x41\x01\x1a\x95\x02\n\x11\x43ustomRankingInfo\x12j\n\x10importance_level\x18\x01 \x01(\x0e\x32K.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevelB\x03\xe0\x41\x02\x12\x1f\n\x12ranking_expression\x18\x02 \x01(\tB\x03\xe0\x41\x02\"s\n\x0fImportanceLevel\x12 \n\x1cIMPORTANCE_LEVEL_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\x08\n\x04MILD\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\x0b\n\x07\x45XTREME\x10\x06\"R\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nJOB_SEARCH\x10\x01\x12\x17\n\x13\x46\x45\x41TURED_JOB_SEARCH\x10\x02\"\xc0\x01\n\x14\x44iversificationLevel\x12%\n!DIVERSIFICATION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\n\n\x06SIMPLE\x10\x02\x12\x13\n\x0fONE_PER_COMPANY\x10\x03\x12\x13\n\x0fTWO_PER_COMPANY\x10\x04\x12\x19\n\x15MAX_THREE_PER_COMPANY\x10\x06\x12\"\n\x1e\x44IVERSIFY_BY_LOOSER_SIMILARITY\x10\x05\"\x87\x01\n\x10KeywordMatchMode\x12\"\n\x1eKEYWORD_MATCH_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16KEYWORD_MATCH_DISABLED\x10\x01\x12\x15\n\x11KEYWORD_MATCH_ALL\x10\x02\x12\x1c\n\x18KEYWORD_MATCH_TITLE_ONLY\x10\x03\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\x91\x06\n\x12SearchJobsResponse\x12M\n\rmatching_jobs\x18\x01 \x03(\x0b\x32\x36.google.cloud.talent.v4.SearchJobsResponse.MatchingJob\x12M\n\x17histogram_query_results\x18\x02 \x03(\x0b\x32,.google.cloud.talent.v4.HistogramQueryResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12:\n\x10location_filters\x18\x04 \x03(\x0b\x32 .google.cloud.talent.v4.Location\x12\x12\n\ntotal_size\x18\x06 \x01(\x05\x12:\n\x08metadata\x18\x07 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\x12\"\n\x1a\x62roadened_query_jobs_count\x18\x08 \x01(\x05\x12\x44\n\x10spell_correction\x18\t \x01(\x0b\x32*.google.cloud.talent.v4.SpellingCorrection\x1a\xd2\x01\n\x0bMatchingJob\x12(\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\x13\n\x0bjob_summary\x18\x02 \x01(\t\x12\x19\n\x11job_title_snippet\x18\x03 \x01(\t\x12\x1b\n\x13search_text_snippet\x18\x04 \x01(\t\x12L\n\x0c\x63ommute_info\x18\x05 \x01(\x0b\x32\x36.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo\x1ay\n\x0b\x43ommuteInfo\x12\x36\n\x0cjob_location\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4.Location\x12\x32\n\x0ftravel_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"y\n\x16\x42\x61tchCreateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12.\n\x04jobs\x18\x02 \x03(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\"\xaa\x01\n\x16\x42\x61tchUpdateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12.\n\x04jobs\x18\x02 \x03(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"y\n\x16\x42\x61tchDeleteJobsRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12+\n\x05names\x18\x02 \x03(\tB\x1c\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"Y\n\tJobResult\x12(\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"Q\n\x17\x42\x61tchCreateJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult\"Q\n\x17\x42\x61tchUpdateJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult\"Q\n\x17\x42\x61tchDeleteJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult*v\n\x07JobView\x12\x18\n\x14JOB_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10JOB_VIEW_ID_ONLY\x10\x01\x12\x14\n\x10JOB_VIEW_MINIMAL\x10\x02\x12\x12\n\x0eJOB_VIEW_SMALL\x10\x03\x12\x11\n\rJOB_VIEW_FULL\x10\x04\x32\xdc\x0e\n\nJobService\x12\x94\x01\n\tCreateJob\x12(.google.cloud.talent.v4.CreateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"@\xda\x41\nparent,job\x82\xd3\xe4\x93\x02-\"&/v4/{parent=projects/*/tenants/*}/jobs:\x03job\x12\xe1\x01\n\x0f\x42\x61tchCreateJobs\x12..google.cloud.talent.v4.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x31\n\x17\x42\x61tchCreateJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*\x12\x83\x01\n\x06GetJob\x12%.google.cloud.talent.v4.GetJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"5\xda\x41\x04name\x82\xd3\xe4\x93\x02(\x12&/v4/{name=projects/*/tenants/*/jobs/*}\x12\x9d\x01\n\tUpdateJob\x12(.google.cloud.talent.v4.UpdateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"I\xda\x41\x0fjob,update_mask\x82\xd3\xe4\x93\x02\x31\x32*/v4/{job.name=projects/*/tenants/*/jobs/*}:\x03job\x12\xe1\x01\n\x0f\x42\x61tchUpdateJobs\x12..google.cloud.talent.v4.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x31\n\x17\x42\x61tchUpdateJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*\x12\x84\x01\n\tDeleteJob\x12(.google.cloud.talent.v4.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"5\xda\x41\x04name\x82\xd3\xe4\x93\x02(*&/v4/{name=projects/*/tenants/*/jobs/*}\x12\xe3\x01\n\x0f\x42\x61tchDeleteJobs\x12..google.cloud.talent.v4.BatchDeleteJobsRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x31\n\x17\x42\x61tchDeleteJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*\x12\x9d\x01\n\x08ListJobs\x12\'.google.cloud.talent.v4.ListJobsRequest\x1a(.google.cloud.talent.v4.ListJobsResponse\">\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02(\x12&/v4/{parent=projects/*/tenants/*}/jobs\x12\x9d\x01\n\nSearchJobs\x12).google.cloud.talent.v4.SearchJobsRequest\x1a*.google.cloud.talent.v4.SearchJobsResponse\"8\x82\xd3\xe4\x93\x02\x32\"-/v4/{parent=projects/*/tenants/*}/jobs:search:\x01*\x12\xad\x01\n\x12SearchJobsForAlert\x12).google.cloud.talent.v4.SearchJobsRequest\x1a*.google.cloud.talent.v4.SearchJobsResponse\"@\x82\xd3\xe4\x93\x02:\"5/v4/{parent=projects/*/tenants/*}/jobs:searchForAlert:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBi\n\x1a\x63om.google.cloud.talent.v4B\x0fJobServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateJobRequest").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetJobRequest").msgclass + UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateJobRequest").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteJobRequest").msgclass + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsResponse").msgclass + SearchJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest").msgclass + SearchJobsRequest::CustomRankingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo").msgclass + SearchJobsRequest::CustomRankingInfo::ImportanceLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel").enummodule + SearchJobsRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.SearchMode").enummodule + SearchJobsRequest::DiversificationLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel").enummodule + SearchJobsRequest::KeywordMatchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode").enummodule + SearchJobsRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.RelevanceThreshold").enummodule + SearchJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse").msgclass + SearchJobsResponse::MatchingJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.MatchingJob").msgclass + SearchJobsResponse::CommuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.CommuteInfo").msgclass + BatchCreateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsRequest").msgclass + BatchUpdateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsRequest").msgclass + BatchDeleteJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsRequest").msgclass + JobResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobResult").msgclass + BatchCreateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsResponse").msgclass + BatchUpdateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsResponse").msgclass + BatchDeleteJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsResponse").msgclass + JobView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobView").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb new file mode 100644 index 000000000000..e1a90f630e33 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb @@ -0,0 +1,90 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/job_service.proto for package 'google.cloud.talent.v4' +# 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/talent/v4/job_service_pb' + +module Google + module Cloud + module Talent + module V4 + module JobService + # A service handles job management, including job CRUD, enumeration and search. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.JobService' + + # Creates a new job. + # + # Typically, the job becomes searchable within 10 seconds, but it may take + # up to 5 minutes. + rpc :CreateJob, ::Google::Cloud::Talent::V4::CreateJobRequest, ::Google::Cloud::Talent::V4::Job + # Begins executing a batch create jobs operation. + rpc :BatchCreateJobs, ::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Google::Longrunning::Operation + # Retrieves the specified job, whose status is OPEN or recently EXPIRED + # within the last 90 days. + rpc :GetJob, ::Google::Cloud::Talent::V4::GetJobRequest, ::Google::Cloud::Talent::V4::Job + # Updates specified job. + # + # Typically, updated contents become visible in search results within 10 + # seconds, but it may take up to 5 minutes. + rpc :UpdateJob, ::Google::Cloud::Talent::V4::UpdateJobRequest, ::Google::Cloud::Talent::V4::Job + # Begins executing a batch update jobs operation. + rpc :BatchUpdateJobs, ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Google::Longrunning::Operation + # Deletes the specified job. + # + # Typically, the job becomes unsearchable within 10 seconds, but it may take + # up to 5 minutes. + rpc :DeleteJob, ::Google::Cloud::Talent::V4::DeleteJobRequest, ::Google::Protobuf::Empty + # Begins executing a batch delete jobs operation. + rpc :BatchDeleteJobs, ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Google::Longrunning::Operation + # Lists jobs by filter. + rpc :ListJobs, ::Google::Cloud::Talent::V4::ListJobsRequest, ::Google::Cloud::Talent::V4::ListJobsResponse + # Searches for jobs using the provided + # [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. + # + # This call constrains the + # [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the + # database, and only returns jobs that the caller has permission to search + # against. + rpc :SearchJobs, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse + # Searches for jobs using the provided + # [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. + # + # This API call is intended for the use case of targeting passive job + # seekers (for example, job seekers who have signed up to receive email + # alerts about potential job opportunities), it has different algorithmic + # adjustments that are designed to specifically target passive job seekers. + # + # This call constrains the + # [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the + # database, and only returns jobs the caller has permission to search + # against. + rpc :SearchJobsForAlert, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb new file mode 100644 index 000000000000..e29f66d86a27 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/talent/v4/company_service/rest" +require "google/cloud/talent/v4/completion/rest" +require "google/cloud/talent/v4/event_service/rest" +require "google/cloud/talent/v4/job_service/rest" +require "google/cloud/talent/v4/tenant_service/rest" +require "google/cloud/talent/v4/version" + +module Google + module Cloud + module Talent + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/talent/v4/rest" + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + module V4 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb new file mode 100644 index 000000000000..f154e089bf71 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/tenant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n#google/cloud/talent/v4/tenant.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"v\n\x06Tenant\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x65xternal_id\x18\x02 \x01(\tB\x03\xe0\x41\x02:D\xea\x41\x41\n\x1ajobs.googleapis.com/Tenant\x12#projects/{project}/tenants/{tenant}Be\n\x1a\x63om.google.cloud.talent.v4B\x0bTenantProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Tenant").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb new file mode 100644 index 000000000000..ee4160331939 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_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/talent/v4/version" + +require "google/cloud/talent/v4/tenant_service/credentials" +require "google/cloud/talent/v4/tenant_service/paths" +require "google/cloud/talent/v4/tenant_service/client" +require "google/cloud/talent/v4/tenant_service/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service that handles tenant management, including CRUD and enumeration. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/tenant_service" + # client = ::Google::Cloud::Talent::V4::TenantService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/tenant_service/rest" + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + module TenantService + end + end + end + end +end + +helper_path = ::File.join __dir__, "tenant_service", "helpers.rb" +require "google/cloud/talent/v4/tenant_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb new file mode 100644 index 000000000000..fc1db7f8bdb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb @@ -0,0 +1,897 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/tenant_service_pb" + +module Google + module Cloud + module Talent + module V4 + module TenantService + ## + # Client for the TenantService service. + # + # A service that handles tenant management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tenant_service_stub + + ## + # Configure the TenantService Client class. + # + # See {::Google::Cloud::Talent::V4::TenantService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TenantService clients + # ::Google::Cloud::Talent::V4::TenantService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_tenant.timeout = 30.0 + + default_config.rpcs.get_tenant.timeout = 30.0 + default_config.rpcs.get_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_tenant.timeout = 30.0 + + default_config.rpcs.delete_tenant.timeout = 30.0 + default_config.rpcs.delete_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tenants.timeout = 30.0 + default_config.rpcs.list_tenants.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TenantService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::TenantService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @tenant_service_stub.universe_domain + end + + ## + # Create a new TenantService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TenantService 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/talent/v4/tenant_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 + + @tenant_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::TenantService::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 + ) + + @tenant_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 + @tenant_service_stub.logger + end + + # Service calls + + ## + # Creates a new tenant entity. + # + # @overload create_tenant(request, options = nil) + # Pass arguments to `create_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_tenant(parent: nil, tenant: nil) + # Pass arguments to `create_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] + # Required. The tenant to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateTenantRequest.new + # + # # Call the create_tenant method. + # result = client.create_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def create_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_tenant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :create_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified tenant. + # + # @overload get_tenant(request, options = nil) + # Pass arguments to `get_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_tenant(name: nil) + # Pass arguments to `get_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the tenant to be retrieved. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetTenantRequest.new + # + # # Call the get_tenant method. + # result = client.get_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def get_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_tenant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :get_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified tenant. + # + # @overload update_tenant(request, options = nil) + # Pass arguments to `update_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_tenant(tenant: nil, update_mask: nil) + # Pass arguments to `update_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] + # Required. The tenant resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the tenant fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateTenantRequest.new + # + # # Call the update_tenant method. + # result = client.update_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def update_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_tenant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.tenant&.name + header_params["tenant.name"] = request.tenant.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :update_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified tenant. + # + # @overload delete_tenant(request, options = nil) + # Pass arguments to `delete_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_tenant(name: nil) + # Pass arguments to `delete_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the tenant to be deleted. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteTenantRequest.new + # + # # Call the delete_tenant method. + # result = client.delete_tenant request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_tenant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :delete_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all tenants associated with the project. + # + # @overload list_tenants(request, options = nil) + # Pass arguments to `list_tenants` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_tenants(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_tenants` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of tenants to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListTenantsRequest.new + # + # # Call the list_tenants method. + # result = client.list_tenants request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Talent::V4::Tenant. + # p item + # end + # + def list_tenants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_tenants.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_tenants.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tenants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :list_tenants, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tenant_service_stub, :list_tenants, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TenantService API. + # + # This class represents the configuration for TenantService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::TenantService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_tenant to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::TenantService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::Talent::V4::TenantService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the TenantService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tenant + ## + # RPC-specific configuration for `get_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tenant + ## + # RPC-specific configuration for `update_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tenant + ## + # RPC-specific configuration for `delete_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tenant + ## + # RPC-specific configuration for `list_tenants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tenants + + # @private + def initialize parent_rpcs = nil + create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant + @create_tenant = ::Gapic::Config::Method.new create_tenant_config + get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant + @get_tenant = ::Gapic::Config::Method.new get_tenant_config + update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant + @update_tenant = ::Gapic::Config::Method.new update_tenant_config + delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant + @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config + list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants + @list_tenants = ::Gapic::Config::Method.new list_tenants_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb new file mode 100644 index 000000000000..daf2d0afbeef --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Talent + module V4 + module TenantService + # Credentials for the TenantService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb new file mode 100644 index 000000000000..ce93b2ff685b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_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 Talent + module V4 + module TenantService + # Path helper methods for the TenantService API. + module Paths + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb new file mode 100644 index 000000000000..6edaf614d38d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_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/talent/v4/version" + +require "google/cloud/talent/v4/tenant_service/credentials" +require "google/cloud/talent/v4/tenant_service/paths" +require "google/cloud/talent/v4/tenant_service/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service that handles tenant management, including CRUD and enumeration. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/tenant_service/rest" + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + module TenantService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/tenant_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb new file mode 100644 index 000000000000..009b23f72ad2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb @@ -0,0 +1,819 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/talent/v4/tenant_service_pb" +require "google/cloud/talent/v4/tenant_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module TenantService + module Rest + ## + # REST client for the TenantService service. + # + # A service that handles tenant management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tenant_service_stub + + ## + # Configure the TenantService Client class. + # + # See {::Google::Cloud::Talent::V4::TenantService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TenantService clients + # ::Google::Cloud::Talent::V4::TenantService::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", "Talent", "V4"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_tenant.timeout = 30.0 + + default_config.rpcs.get_tenant.timeout = 30.0 + default_config.rpcs.get_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_tenant.timeout = 30.0 + + default_config.rpcs.delete_tenant.timeout = 30.0 + default_config.rpcs.delete_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tenants.timeout = 30.0 + default_config.rpcs.list_tenants.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TenantService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Talent::V4::TenantService::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 + @tenant_service_stub.universe_domain + end + + ## + # Create a new TenantService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TenantService 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 + + @tenant_service_stub = ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @tenant_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 + @tenant_service_stub.logger + end + + # Service calls + + ## + # Creates a new tenant entity. + # + # @overload create_tenant(request, options = nil) + # Pass arguments to `create_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_tenant(parent: nil, tenant: nil) + # Pass arguments to `create_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] + # Required. The tenant to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateTenantRequest.new + # + # # Call the create_tenant method. + # result = client.create_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def create_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_tenant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.create_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified tenant. + # + # @overload get_tenant(request, options = nil) + # Pass arguments to `get_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_tenant(name: nil) + # Pass arguments to `get_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the tenant to be retrieved. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetTenantRequest.new + # + # # Call the get_tenant method. + # result = client.get_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def get_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_tenant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.get_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified tenant. + # + # @overload update_tenant(request, options = nil) + # Pass arguments to `update_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_tenant(tenant: nil, update_mask: nil) + # Pass arguments to `update_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] + # Required. The tenant resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the tenant fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateTenantRequest.new + # + # # Call the update_tenant method. + # result = client.update_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def update_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_tenant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.update_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified tenant. + # + # @overload delete_tenant(request, options = nil) + # Pass arguments to `delete_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_tenant(name: nil) + # Pass arguments to `delete_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the tenant to be deleted. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteTenantRequest.new + # + # # Call the delete_tenant method. + # result = client.delete_tenant request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_tenant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.delete_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all tenants associated with the project. + # + # @overload list_tenants(request, options = nil) + # Pass arguments to `list_tenants` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_tenants(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_tenants` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of tenants to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListTenantsRequest.new + # + # # Call the list_tenants method. + # result = client.list_tenants request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Talent::V4::Tenant. + # p item + # end + # + def list_tenants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_tenants.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Talent::V4::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_tenants.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tenants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.list_tenants request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tenant_service_stub, :list_tenants, "tenants", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TenantService REST API. + # + # This class represents the configuration for TenantService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Talent::V4::TenantService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_tenant to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::TenantService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the TenantService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*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_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tenant + ## + # RPC-specific configuration for `get_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tenant + ## + # RPC-specific configuration for `update_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tenant + ## + # RPC-specific configuration for `delete_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tenant + ## + # RPC-specific configuration for `list_tenants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tenants + + # @private + def initialize parent_rpcs = nil + create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant + @create_tenant = ::Gapic::Config::Method.new create_tenant_config + get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant + @get_tenant = ::Gapic::Config::Method.new get_tenant_config + update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant + @update_tenant = ::Gapic::Config::Method.new update_tenant_config + delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant + @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config + list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants + @list_tenants = ::Gapic::Config::Method.new list_tenants_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb new file mode 100644 index 000000000000..cc7ba8e861ad --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/talent/v4/tenant_service_pb" + +module Google + module Cloud + module Talent + module V4 + module TenantService + module Rest + ## + # REST service stub for the TenantService 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_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateTenantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # A result object deserialized from the server's reply + def create_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tenant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetTenantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # A result object deserialized from the server's reply + def get_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tenant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateTenantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # A result object deserialized from the server's reply + def update_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tenant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteTenantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tenant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_tenants REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListTenantsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::ListTenantsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::ListTenantsResponse] + # A result object deserialized from the server's reply + def list_tenants request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tenants_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_tenants", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ListTenantsResponse.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_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateTenantRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/tenants", + body: "tenant", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetTenantRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateTenantRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v4/{tenant.name}", + body: "tenant", + matches: [ + ["tenant.name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteTenantRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tenants REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListTenantsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_tenants_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{parent}/tenants", + 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-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb new file mode 100644 index 000000000000..d747e3225cb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/tenant_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/talent/v4/common_pb' +require 'google/cloud/talent/v4/tenant_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n+google/cloud/talent/v4/tenant_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a#google/cloud/talent/v4/tenant.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x8f\x01\n\x13\x43reateTenantRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x33\n\x06tenant\x18\x02 \x01(\x0b\x32\x1e.google.cloud.talent.v4.TenantB\x03\xe0\x41\x02\"D\n\x10GetTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"{\n\x13UpdateTenantRequest\x12\x33\n\x06tenant\x18\x01 \x01(\x0b\x32\x1e.google.cloud.talent.v4.TenantB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x13\x44\x65leteTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"\x80\x01\n\x12ListTenantsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x9b\x01\n\x13ListTenantsResponse\x12/\n\x07tenants\x18\x01 \x03(\x0b\x32\x1e.google.cloud.talent.v4.Tenant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata2\xf0\x06\n\rTenantService\x12\x9c\x01\n\x0c\x43reateTenant\x12+.google.cloud.talent.v4.CreateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"?\xda\x41\rparent,tenant\x82\xd3\xe4\x93\x02)\"\x1f/v4/{parent=projects/*}/tenants:\x06tenant\x12\x85\x01\n\tGetTenant\x12(.google.cloud.talent.v4.GetTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{name=projects/*/tenants/*}\x12\xa8\x01\n\x0cUpdateTenant\x12+.google.cloud.talent.v4.UpdateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"K\xda\x41\x12tenant,update_mask\x82\xd3\xe4\x93\x02\x30\x32&/v4/{tenant.name=projects/*/tenants/*}:\x06tenant\x12\x83\x01\n\x0c\x44\x65leteTenant\x12+.google.cloud.talent.v4.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!*\x1f/v4/{name=projects/*/tenants/*}\x12\x98\x01\n\x0bListTenants\x12*.google.cloud.talent.v4.ListTenantsRequest\x1a+.google.cloud.talent.v4.ListTenantsResponse\"0\xda\x41\x06parent\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{parent=projects/*}/tenants\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBl\n\x1a\x63om.google.cloud.talent.v4B\x12TenantServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Talent + module V4 + CreateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateTenantRequest").msgclass + GetTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetTenantRequest").msgclass + UpdateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateTenantRequest").msgclass + DeleteTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteTenantRequest").msgclass + ListTenantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListTenantsRequest").msgclass + ListTenantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListTenantsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb new file mode 100644 index 000000000000..1761f0653df7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb @@ -0,0 +1,53 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/tenant_service.proto for package 'google.cloud.talent.v4' +# 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/talent/v4/tenant_service_pb' + +module Google + module Cloud + module Talent + module V4 + module TenantService + # A service that handles tenant management, including CRUD and enumeration. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.TenantService' + + # Creates a new tenant entity. + rpc :CreateTenant, ::Google::Cloud::Talent::V4::CreateTenantRequest, ::Google::Cloud::Talent::V4::Tenant + # Retrieves specified tenant. + rpc :GetTenant, ::Google::Cloud::Talent::V4::GetTenantRequest, ::Google::Cloud::Talent::V4::Tenant + # Updates specified tenant. + rpc :UpdateTenant, ::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Google::Cloud::Talent::V4::Tenant + # Deletes specified tenant. + rpc :DeleteTenant, ::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Google::Protobuf::Empty + # Lists all tenants associated with the project. + rpc :ListTenants, ::Google::Cloud::Talent::V4::ListTenantsRequest, ::Google::Cloud::Talent::V4::ListTenantsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb new file mode 100644 index 000000000000..c14911f7ba77 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/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 Talent + module V4 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md b/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md new file mode 100644 index 000000000000..4583e024e1f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Talent Solution V4 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-talent-v4/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..5089551e9ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb @@ -0,0 +1,589 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/cloud/talent/v4/common.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb new file mode 100644 index 000000000000..4a754f4d0ab3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb @@ -0,0 +1,959 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # Message representing a period of time between two timestamps. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Begin of the period (inclusive). + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End of the period (exclusive). + class TimestampRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A resource that represents a location with full geographic information. + # @!attribute [rw] location_type + # @return [::Google::Cloud::Talent::V4::Location::LocationType] + # The type of a location, which corresponds to the address lines field of + # {::Google::Type::PostalAddress google.type.PostalAddress}. For example, + # "Downtown, Atlanta, GA, USA" has a type of + # {::Google::Cloud::Talent::V4::Location::LocationType::NEIGHBORHOOD LocationType.NEIGHBORHOOD}, + # and "Kansas City, KS, USA" has a type of + # {::Google::Cloud::Talent::V4::Location::LocationType::LOCALITY LocationType.LOCALITY}. + # @!attribute [rw] postal_address + # @return [::Google::Type::PostalAddress] + # Postal address of the location that includes human readable information, + # such as postal delivery and payments addresses. Given a postal address, + # a postal service can deliver items to a premises, P.O. Box, or other + # delivery location. + # @!attribute [rw] lat_lng + # @return [::Google::Type::LatLng] + # An object representing a latitude/longitude pair. + # @!attribute [rw] radius_miles + # @return [::Float] + # Radius in miles of the job location. This value is derived from the + # location bounding box in which a circle with the specified radius + # centered from {::Google::Type::LatLng google.type.LatLng} covers the area + # associated with the job location. For example, currently, "Mountain View, + # CA, USA" has a radius of 6.17 miles. + class Location + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enum which represents the type of a location. + module LocationType + # Default value if the type isn't specified. + LOCATION_TYPE_UNSPECIFIED = 0 + + # A country level location. + COUNTRY = 1 + + # A state or equivalent level location. + ADMINISTRATIVE_AREA = 2 + + # A county or equivalent level location. + SUB_ADMINISTRATIVE_AREA = 3 + + # A city or equivalent level location. + LOCALITY = 4 + + # A postal code level location. + POSTAL_CODE = 5 + + # A sublocality is a subdivision of a locality, for example a city borough, + # ward, or arrondissement. Sublocalities are usually recognized by a local + # political authority. For example, Manhattan and Brooklyn are recognized + # as boroughs by the City of New York, and are therefore modeled as + # sublocalities. + SUB_LOCALITY = 6 + + # A district or equivalent level location. + SUB_LOCALITY_1 = 7 + + # A smaller district or equivalent level display. + SUB_LOCALITY_2 = 8 + + # A neighborhood level location. + NEIGHBORHOOD = 9 + + # A street address level location. + STREET_ADDRESS = 10 + end + end + + # Meta information related to the job searcher or entity + # conducting the job search. This information is used to improve the + # performance of the service. + # @!attribute [rw] domain + # @return [::String] + # Required if + # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} + # is unset or `false`. + # + # The client-defined scope or source of the service call, which typically + # is the domain on + # which the service has been implemented and is currently being run. + # + # For example, if the service is being run by client Foo, Inc., on + # job board www.foo.com and career site www.bar.com, then this field is + # set to "foo.com" for use on the job board, and "bar.com" for use on the + # career site. + # + # Note that any improvements to the model for a particular tenant site rely + # on this field being set correctly to a unique domain. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] session_id + # @return [::String] + # Required if + # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} + # is unset or `false`. + # + # A unique session identification string. A session is defined as the + # duration of an end user's interaction with the service over a certain + # period. + # Obfuscate this field for privacy concerns before + # providing it to the service. + # + # Note that any improvements to the model for a particular tenant site rely + # on this field being set correctly to a unique session ID. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] user_id + # @return [::String] + # Required if + # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} + # is unset or `false`. + # + # A unique user identification string, as determined by the client. + # To have the strongest positive impact on search quality + # make sure the client-level is unique. + # Obfuscate this field for privacy concerns before + # providing it to the service. + # + # Note that any improvements to the model for a particular tenant site rely + # on this field being set correctly to a unique user ID. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] allow_missing_ids + # @return [::Boolean] + # Only set when any of + # {::Google::Cloud::Talent::V4::RequestMetadata#domain domain}, + # {::Google::Cloud::Talent::V4::RequestMetadata#session_id session_id} and + # {::Google::Cloud::Talent::V4::RequestMetadata#user_id user_id} isn't available + # for some reason. It is highly recommended not to set this field and provide + # accurate {::Google::Cloud::Talent::V4::RequestMetadata#domain domain}, + # {::Google::Cloud::Talent::V4::RequestMetadata#session_id session_id} and + # {::Google::Cloud::Talent::V4::RequestMetadata#user_id user_id} for the best + # service experience. + # @!attribute [rw] device_info + # @return [::Google::Cloud::Talent::V4::DeviceInfo] + # The type of device used by the job seeker at the time of the call to the + # service. + class RequestMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional information returned to client, such as debugging information. + # @!attribute [rw] request_id + # @return [::String] + # A unique id associated with this call. + # This id is logged for tracking purposes. + class ResponseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Device information collected from the job seeker, candidate, or + # other entity conducting the job search. Providing this information improves + # the quality of the search results across devices. + # @!attribute [rw] device_type + # @return [::Google::Cloud::Talent::V4::DeviceInfo::DeviceType] + # Type of the device. + # @!attribute [rw] id + # @return [::String] + # A device-specific ID. The ID must be a unique identifier that + # distinguishes the device from other devices. + class DeviceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enumeration describing an API access portal and exposure mechanism. + module DeviceType + # The device type isn't specified. + DEVICE_TYPE_UNSPECIFIED = 0 + + # A desktop web browser, such as, Chrome, Firefox, Safari, or Internet + # Explorer) + WEB = 1 + + # A mobile device web browser, such as a phone or tablet with a Chrome + # browser. + MOBILE_WEB = 2 + + # An Android device native application. + ANDROID = 3 + + # An iOS device native application. + IOS = 4 + + # A bot, as opposed to a device operated by human beings, such as a web + # crawler. + BOT = 5 + + # Other devices types. + OTHER = 6 + end + end + + # Custom attribute values that are either filterable or non-filterable. + # @!attribute [rw] string_values + # @return [::Array<::String>] + # Exactly one of + # {::Google::Cloud::Talent::V4::CustomAttribute#string_values string_values} or + # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} must be + # specified. + # + # This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or + # `CASE_INSENSITIVE_MATCH`) search. + # For filterable `string_value`s, a maximum total number of 200 values + # is allowed, with each `string_value` has a byte size of no more than + # 500B. For unfilterable `string_values`, the maximum total byte size of + # unfilterable `string_values` is 50KB. + # + # Empty string isn't allowed. + # @!attribute [rw] long_values + # @return [::Array<::Integer>] + # Exactly one of + # {::Google::Cloud::Talent::V4::CustomAttribute#string_values string_values} or + # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} must be + # specified. + # + # This field is used to perform number range search. + # (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. + # + # Currently at most 1 + # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} is + # supported. + # @!attribute [rw] filterable + # @return [::Boolean] + # If the `filterable` flag is true, the custom field values may be used for + # custom attribute filters + # {::Google::Cloud::Talent::V4::JobQuery#custom_attribute_filter JobQuery.custom_attribute_filter}. + # If false, these values may not be used for custom attribute filters. + # + # Default is false. + # @!attribute [rw] keyword_searchable + # @return [::Boolean] + # If the `keyword_searchable` flag is true, the keywords in custom fields are + # searchable by keyword match. + # If false, the values are not searchable by keyword match. + # + # Default is false. + class CustomAttribute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spell check result. + # @!attribute [rw] corrected + # @return [::Boolean] + # Indicates if the query was corrected by the spell checker. + # @!attribute [rw] corrected_text + # @return [::String] + # Correction output consisting of the corrected keyword string. + # @!attribute [rw] corrected_html + # @return [::String] + # Corrected output with html tags to highlight the corrected words. + # Corrected words are called out with the "..." html tags. + # + # For example, the user input query is "software enginear", where the second + # word, "enginear," is incorrect. It should be "engineer". When spelling + # correction is enabled, this value is + # "software engineer". + class SpellingCorrection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Job compensation details. + # @!attribute [rw] entries + # @return [::Array<::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry>] + # Job compensation information. + # + # At most one entry can be of type + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationType::BASE CompensationInfo.CompensationType.BASE}, + # which is referred as **base compensation entry** for the job. + # @!attribute [r] annualized_base_compensation_range + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] + # Output only. Annualized base compensation range. Computed as base + # compensation entry's + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # times + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. + # + # See + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationEntry} + # for explanation on compensation annualization. + # @!attribute [r] annualized_total_compensation_range + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] + # Output only. Annualized total compensation range. Computed as all + # compensation entries' + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # times + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. + # + # See + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationEntry} + # for explanation on compensation annualization. + class CompensationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A compensation entry that represents one component of compensation, such + # as base pay, bonus, or other compensation type. + # + # Annualization: One compensation entry can be annualized if + # - it contains valid + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount amount} + # or + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range range}. + # - and its + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year} + # is set or can be derived. Its annualized range is determined as + # ({::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount amount} + # or + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range range}) + # times + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year}. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationType] + # Compensation type. + # + # Default is + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationType::COMPENSATION_TYPE_UNSPECIFIED CompensationType.COMPENSATION_TYPE_UNSPECIFIED}. + # @!attribute [rw] unit + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit] + # Frequency of the specified amount. + # + # Default is + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED}. + # @!attribute [rw] amount + # @return [::Google::Type::Money] + # Compensation amount. + # + # Note: The following fields are mutually exclusive: `amount`, `range`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] range + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] + # Compensation range. + # + # Note: The following fields are mutually exclusive: `range`, `amount`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] description + # @return [::String] + # Compensation description. For example, could + # indicate equity terms or provide additional context to an estimated + # bonus. + # @!attribute [rw] expected_units_per_year + # @return [::Google::Protobuf::DoubleValue] + # Expected number of units paid each year. If not specified, when + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types} is + # FULLTIME, a default value is inferred based on + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#unit unit}. + # Default values: + # - HOURLY: 2080 + # - DAILY: 260 + # - WEEKLY: 52 + # - MONTHLY: 12 + # - ANNUAL: 1 + class CompensationEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Compensation range. + # @!attribute [rw] max_compensation + # @return [::Google::Type::Money] + # The maximum amount of compensation. If left empty, the value is set + # to a maximal compensation value and the currency code is set to + # match the {::Google::Type::Money#currency_code currency code} of + # min_compensation. + # @!attribute [rw] min_compensation + # @return [::Google::Type::Money] + # The minimum amount of compensation. If left empty, the value is set + # to zero and the currency code is set to match the + # {::Google::Type::Money#currency_code currency code} of max_compensation. + class CompensationRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of compensation. + # + # For compensation amounts specified in non-monetary amounts, + # describe the compensation scheme in the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description}. + # + # For example, tipping format is described in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} + # (for example, "expect 15-20% tips based on customer bill.") and an estimate + # of the tips provided in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # or + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range CompensationEntry.range} + # ($10 per hour). + # + # For example, equity is described in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} + # (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and + # value estimated in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # or + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range CompensationEntry.range}. + # If no value estimate is possible, units are + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED} + # and then further clarified in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} + # field. + module CompensationType + # Default value. + COMPENSATION_TYPE_UNSPECIFIED = 0 + + # Base compensation: Refers to the fixed amount of money paid to an + # employee by an employer in return for work performed. Base compensation + # does not include benefits, bonuses or any other potential compensation + # from an employer. + BASE = 1 + + # Bonus. + BONUS = 2 + + # Signing bonus. + SIGNING_BONUS = 3 + + # Equity. + EQUITY = 4 + + # Profit sharing. + PROFIT_SHARING = 5 + + # Commission. + COMMISSIONS = 6 + + # Tips. + TIPS = 7 + + # Other compensation type. + OTHER_COMPENSATION_TYPE = 8 + end + + # Pay frequency. + module CompensationUnit + # Default value. + COMPENSATION_UNIT_UNSPECIFIED = 0 + + # Hourly. + HOURLY = 1 + + # Daily. + DAILY = 2 + + # Weekly + WEEKLY = 3 + + # Monthly. + MONTHLY = 4 + + # Yearly. + YEARLY = 5 + + # One time. + ONE_TIME = 6 + + # Other compensation units. + OTHER_COMPENSATION_UNIT = 7 + end + end + + # Metadata used for long running operations returned by CTS batch APIs. + # It's used to replace + # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata}. + # @!attribute [rw] state + # @return [::Google::Cloud::Talent::V4::BatchOperationMetadata::State] + # The state of a long running operation. + # @!attribute [rw] state_description + # @return [::String] + # More detailed information about operation state. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of successful item(s) inside an operation. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of failed item(s) inside an operation. + # @!attribute [rw] total_count + # @return [::Integer] + # Count of total item(s) inside an operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch operation is created. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch operation status is updated. The metadata and the + # {::Google::Cloud::Talent::V4::BatchOperationMetadata#update_time update_time} is + # refreshed every minute otherwise cached data is returned. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch operation is finished and + # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is + # set to `true`. + class BatchOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module State + # Default value. + STATE_UNSPECIFIED = 0 + + # The batch operation is being prepared for processing. + INITIALIZING = 1 + + # The batch operation is actively being processed. + PROCESSING = 2 + + # The batch operation is processed, and at least one item has been + # successfully processed. + SUCCEEDED = 3 + + # The batch operation is done and no item has been successfully processed. + FAILED = 4 + + # The batch operation is in the process of cancelling after + # google.longrunning.Operations.CancelOperation + # is called. + CANCELLING = 5 + + # The batch operation is done after + # google.longrunning.Operations.CancelOperation + # is called. Any items processed before cancelling are returned in the + # response. + CANCELLED = 6 + end + end + + # An enum that represents the size of the company. + module CompanySize + # Default value if the size isn't specified. + COMPANY_SIZE_UNSPECIFIED = 0 + + # The company has less than 50 employees. + MINI = 1 + + # The company has between 50 and 99 employees. + SMALL = 2 + + # The company has between 100 and 499 employees. + SMEDIUM = 3 + + # The company has between 500 and 999 employees. + MEDIUM = 4 + + # The company has between 1,000 and 4,999 employees. + BIG = 5 + + # The company has between 5,000 and 9,999 employees. + BIGGER = 6 + + # The company has 10,000 or more employees. + GIANT = 7 + end + + # An enum that represents employee benefits included with the job. + module JobBenefit + # Default value if the type isn't specified. + JOB_BENEFIT_UNSPECIFIED = 0 + + # The job includes access to programs that support child care, such + # as daycare. + CHILD_CARE = 1 + + # The job includes dental services covered by a dental + # insurance plan. + DENTAL = 2 + + # The job offers specific benefits to domestic partners. + DOMESTIC_PARTNER = 3 + + # The job allows for a flexible work schedule. + FLEXIBLE_HOURS = 4 + + # The job includes health services covered by a medical insurance plan. + MEDICAL = 5 + + # The job includes a life insurance plan provided by the employer or + # available for purchase by the employee. + LIFE_INSURANCE = 6 + + # The job allows for a leave of absence to a parent to care for a newborn + # child. + PARENTAL_LEAVE = 7 + + # The job includes a workplace retirement plan provided by the + # employer or available for purchase by the employee. + RETIREMENT_PLAN = 8 + + # The job allows for paid time off due to illness. + SICK_DAYS = 9 + + # The job includes paid time off for vacation. + VACATION = 10 + + # The job includes vision services covered by a vision + # insurance plan. + VISION = 11 + end + + # Educational degree level defined in International Standard Classification + # of Education (ISCED). + module DegreeType + # Default value. Represents no degree, or early childhood education. + # Maps to ISCED code 0. + # Ex) Kindergarten + DEGREE_TYPE_UNSPECIFIED = 0 + + # Primary education which is typically the first stage of compulsory + # education. ISCED code 1. + # Ex) Elementary school + PRIMARY_EDUCATION = 1 + + # Lower secondary education; First stage of secondary education building on + # primary education, typically with a more subject-oriented curriculum. + # ISCED code 2. + # Ex) Middle school + LOWER_SECONDARY_EDUCATION = 2 + + # Middle education; Second/final stage of secondary education preparing for + # tertiary education and/or providing skills relevant to employment. + # Usually with an increased range of subject options and streams. ISCED + # code 3. + # Ex) High school + UPPER_SECONDARY_EDUCATION = 3 + + # Adult Remedial Education; Programmes providing learning experiences that + # build on secondary education and prepare for labour market entry and/or + # tertiary education. The content is broader than secondary but not as + # complex as tertiary education. ISCED code 4. + ADULT_REMEDIAL_EDUCATION = 4 + + # Associate's or equivalent; Short first tertiary programmes that are + # typically practically-based, occupationally-specific and prepare for + # labour market entry. These programmes may also provide a pathway to other + # tertiary programmes. ISCED code 5. + ASSOCIATES_OR_EQUIVALENT = 5 + + # Bachelor's or equivalent; Programmes designed to provide intermediate + # academic and/or professional knowledge, skills and competencies leading + # to a first tertiary degree or equivalent qualification. ISCED code 6. + BACHELORS_OR_EQUIVALENT = 6 + + # Master's or equivalent; Programmes designed to provide advanced academic + # and/or professional knowledge, skills and competencies leading to a + # second tertiary degree or equivalent qualification. ISCED code 7. + MASTERS_OR_EQUIVALENT = 7 + + # Doctoral or equivalent; Programmes designed primarily to lead to an + # advanced research qualification, usually concluding with the submission + # and defense of a substantive dissertation of publishable quality based on + # original research. ISCED code 8. + DOCTORAL_OR_EQUIVALENT = 8 + end + + # An enum that represents the employment type of a job. + module EmploymentType + # The default value if the employment type isn't specified. + EMPLOYMENT_TYPE_UNSPECIFIED = 0 + + # The job requires working a number of hours that constitute full + # time employment, typically 40 or more hours per week. + FULL_TIME = 1 + + # The job entails working fewer hours than a full time job, + # typically less than 40 hours a week. + PART_TIME = 2 + + # The job is offered as a contracted, as opposed to a salaried employee, + # position. + CONTRACTOR = 3 + + # The job is offered as a contracted position with the understanding + # that it's converted into a full-time position at the end of the + # contract. Jobs of this type are also returned by a search for + # {::Google::Cloud::Talent::V4::EmploymentType::CONTRACTOR EmploymentType.CONTRACTOR} + # jobs. + CONTRACT_TO_HIRE = 4 + + # The job is offered as a temporary employment opportunity, usually + # a short-term engagement. + TEMPORARY = 5 + + # The job is a fixed-term opportunity for students or entry-level job + # seekers to obtain on-the-job training, typically offered as a summer + # position. + INTERN = 6 + + # The is an opportunity for an individual to volunteer, where there's no + # expectation of compensation for the provided services. + VOLUNTEER = 7 + + # The job requires an employee to work on an as-needed basis with a + # flexible schedule. + PER_DIEM = 8 + + # The job involves employing people in remote areas and flying them + # temporarily to the work site instead of relocating employees and their + # families permanently. + FLY_IN_FLY_OUT = 9 + + # The job does not fit any of the other listed types. + OTHER_EMPLOYMENT_TYPE = 10 + end + + # An enum that represents the required experience level required for the job. + module JobLevel + # The default value if the level isn't specified. + JOB_LEVEL_UNSPECIFIED = 0 + + # Entry-level individual contributors, typically with less than 2 years of + # experience in a similar role. Includes interns. + ENTRY_LEVEL = 1 + + # Experienced individual contributors, typically with 2+ years of + # experience in a similar role. + EXPERIENCED = 2 + + # Entry- to mid-level managers responsible for managing a team of people. + MANAGER = 3 + + # Senior-level managers responsible for managing teams of managers. + DIRECTOR = 4 + + # Executive-level managers and above, including C-level positions. + EXECUTIVE = 5 + end + + # An enum that represents the categorization or primary focus of specific + # role. This value is different than the "industry" associated with a role, + # which is related to the categorization of the company listing the job. + module JobCategory + # The default value if the category isn't specified. + JOB_CATEGORY_UNSPECIFIED = 0 + + # An accounting and finance job, such as an Accountant. + ACCOUNTING_AND_FINANCE = 1 + + # An administrative and office job, such as an Administrative Assistant. + ADMINISTRATIVE_AND_OFFICE = 2 + + # An advertising and marketing job, such as Marketing Manager. + ADVERTISING_AND_MARKETING = 3 + + # An animal care job, such as Veterinarian. + ANIMAL_CARE = 4 + + # An art, fashion, or design job, such as Designer. + ART_FASHION_AND_DESIGN = 5 + + # A business operations job, such as Business Operations Manager. + BUSINESS_OPERATIONS = 6 + + # A cleaning and facilities job, such as Custodial Staff. + CLEANING_AND_FACILITIES = 7 + + # A computer and IT job, such as Systems Administrator. + COMPUTER_AND_IT = 8 + + # A construction job, such as General Laborer. + CONSTRUCTION = 9 + + # A customer service job, such s Cashier. + CUSTOMER_SERVICE = 10 + + # An education job, such as School Teacher. + EDUCATION = 11 + + # An entertainment and travel job, such as Flight Attendant. + ENTERTAINMENT_AND_TRAVEL = 12 + + # A farming or outdoor job, such as Park Ranger. + FARMING_AND_OUTDOORS = 13 + + # A healthcare job, such as Registered Nurse. + HEALTHCARE = 14 + + # A human resources job, such as Human Resources Director. + HUMAN_RESOURCES = 15 + + # An installation, maintenance, or repair job, such as Electrician. + INSTALLATION_MAINTENANCE_AND_REPAIR = 16 + + # A legal job, such as Law Clerk. + LEGAL = 17 + + # A management job, often used in conjunction with another category, + # such as Store Manager. + MANAGEMENT = 18 + + # A manufacturing or warehouse job, such as Assembly Technician. + MANUFACTURING_AND_WAREHOUSE = 19 + + # A media, communications, or writing job, such as Media Relations. + MEDIA_COMMUNICATIONS_AND_WRITING = 20 + + # An oil, gas or mining job, such as Offshore Driller. + OIL_GAS_AND_MINING = 21 + + # A personal care and services job, such as Hair Stylist. + PERSONAL_CARE_AND_SERVICES = 22 + + # A protective services job, such as Security Guard. + PROTECTIVE_SERVICES = 23 + + # A real estate job, such as Buyer's Agent. + REAL_ESTATE = 24 + + # A restaurant and hospitality job, such as Restaurant Server. + RESTAURANT_AND_HOSPITALITY = 25 + + # A sales and/or retail job, such Sales Associate. + SALES_AND_RETAIL = 26 + + # A science and engineering job, such as Lab Technician. + SCIENCE_AND_ENGINEERING = 27 + + # A social services or non-profit job, such as Case Worker. + SOCIAL_SERVICES_AND_NON_PROFIT = 28 + + # A sports, fitness, or recreation job, such as Personal Trainer. + SPORTS_FITNESS_AND_RECREATION = 29 + + # A transportation or logistics job, such as Truck Driver. + TRANSPORTATION_AND_LOGISTICS = 30 + end + + # An enum that represents the job posting region. In most cases, job postings + # don't need to specify a region. If a region is given, jobs are + # eligible for searches in the specified region. + module PostingRegion + # If the region is unspecified, the job is only returned if it + # matches the {::Google::Cloud::Talent::V4::LocationFilter LocationFilter}. + POSTING_REGION_UNSPECIFIED = 0 + + # In addition to exact location matching, job posting is returned when the + # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in the search query + # is in the same administrative area as the returned job posting. For + # example, if a `ADMINISTRATIVE_AREA` job is posted in "CA, USA", it's + # returned if {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} has + # "Mountain View". + # + # Administrative area refers to top-level administrative subdivision of this + # country. For example, US state, IT region, UK constituent nation and + # JP prefecture. + ADMINISTRATIVE_AREA = 1 + + # In addition to exact location matching, job is returned when + # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in search query is + # in the same country as this job. For example, if a `NATION_WIDE` job is + # posted in "USA", it's returned if + # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} has 'Mountain + # View'. + NATION = 2 + + # Job allows employees to work remotely (telecommute). + # If locations are provided with this value, the job is + # considered as having a location, but telecommuting is allowed. + TELECOMMUTE = 3 + end + + # Deprecated. All resources are only visible to the owner. + # + # An enum that represents who has view access to the resource. + # @deprecated This enum is deprecated and may be removed in the next major version update. + module Visibility + # Default value. + VISIBILITY_UNSPECIFIED = 0 + + # The resource is only visible to the GCP account who owns it. + ACCOUNT_ONLY = 1 + + # The resource is visible to the owner and may be visible to other + # applications and processes at Google. + SHARED_WITH_GOOGLE = 2 + + # The resource is visible to the owner and may be visible to all other API + # clients. + SHARED_WITH_PUBLIC = 3 + end + + # Option for HTML content sanitization on user input fields, for example, job + # description. By setting this option, user can determine whether and how + # sanitization is performed on these fields. + module HtmlSanitization + # Default value. + HTML_SANITIZATION_UNSPECIFIED = 0 + + # Disables sanitization on HTML input. + HTML_SANITIZATION_DISABLED = 1 + + # Sanitizes HTML input, only accepts bold, italic, ordered list, and + # unordered list markup tags. + SIMPLE_FORMATTING_ONLY = 2 + end + + # Method for commute. Walking, biking and wheelchair accessible transit is + # still in the Preview stage. + module CommuteMethod + # Commute method isn't specified. + COMMUTE_METHOD_UNSPECIFIED = 0 + + # Commute time is calculated based on driving time. + DRIVING = 1 + + # Commute time is calculated based on public transit including bus, metro, + # subway, and so on. + TRANSIT = 2 + + # Commute time is calculated based on walking time. + WALKING = 3 + + # Commute time is calculated based on biking time. + CYCLING = 4 + + # Commute time is calculated based on public transit that is wheelchair + # accessible. + TRANSIT_ACCESSIBLE = 5 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb new file mode 100644 index 000000000000..26cd543627a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # A Company resource represents a company in the service. A company is the + # entity that owns job postings, that is, the hiring entity responsible for + # employing applicants for the job position. + # @!attribute [rw] name + # @return [::String] + # Required during company update. + # + # The resource name for a company. This is generated by the service when a + # company is created. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the company, for example, "Google LLC". + # @!attribute [rw] external_id + # @return [::String] + # Required. Client side company identifier, used to uniquely identify the + # company. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] size + # @return [::Google::Cloud::Talent::V4::CompanySize] + # The employer's company size. + # @!attribute [rw] headquarters_address + # @return [::String] + # The street address of the company's main headquarters, which may be + # different from the job location. The service attempts + # to geolocate the provided address, and populates a more specific + # location wherever possible in + # {::Google::Cloud::Talent::V4::Company::DerivedInfo#headquarters_location DerivedInfo.headquarters_location}. + # @!attribute [rw] hiring_agency + # @return [::Boolean] + # Set to true if it is the hiring agency that post jobs for other + # employers. + # + # Defaults to false if not provided. + # @!attribute [rw] eeo_text + # @return [::String] + # Equal Employment Opportunity legal disclaimer text to be + # associated with all jobs, and typically to be displayed in all + # roles. + # + # The maximum number of allowed characters is 500. + # @!attribute [rw] website_uri + # @return [::String] + # The URI representing the company's primary web site or home page, + # for example, "https://www.google.com". + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] career_site_uri + # @return [::String] + # The URI to employer's career site or careers page on the employer's web + # site, for example, "https://careers.google.com". + # @!attribute [rw] image_uri + # @return [::String] + # A URI that hosts the employer's company logo. + # @!attribute [rw] keyword_searchable_job_custom_attributes + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # This field is deprecated. Please set the searchability of the custom + # attribute in the + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} going + # forward. + # + # A list of keys of filterable + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}, + # whose corresponding `string_values` are used in keyword searches. Jobs with + # `string_values` under these specified field keys are returned if any + # of the values match the search keyword. Custom field values with + # parenthesis, brackets and special symbols are not searchable as-is, + # and those keyword queries must be surrounded by quotes. + # @!attribute [r] derived_info + # @return [::Google::Cloud::Talent::V4::Company::DerivedInfo] + # Output only. Derived details about the company. + # @!attribute [r] suspended + # @return [::Boolean] + # Output only. Indicates whether a company is flagged to be suspended from + # public availability by the service when job content appears suspicious, + # abusive, or spammy. + class Company + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Derived details about the company. + # @!attribute [rw] headquarters_location + # @return [::Google::Cloud::Talent::V4::Location] + # A structured headquarters location of the company, resolved from + # {::Google::Cloud::Talent::V4::Company#headquarters_address Company.headquarters_address} + # if provided. + class DerivedInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb new file mode 100644 index 000000000000..bc326d893eab --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb @@ -0,0 +1,133 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # The Request of the CreateCompany method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] company + # @return [::Google::Cloud::Talent::V4::Company] + # Required. The company to be created. + class CreateCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for getting a company by name. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the company to be retrieved. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/api-test-project/tenants/foo/companies/bar". + class GetCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for updating a specified company. + # @!attribute [rw] company + # @return [::Google::Cloud::Talent::V4::Company] + # Required. The company resource to replace the current resource in the + # system. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the company fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Company Company} are + # supported. + class UpdateCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a company. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the company to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + class DeleteCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List companies for which the client has ACL visibility. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] page_token + # @return [::String] + # The starting indicator from which to return results. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of companies to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @!attribute [rw] require_open_jobs + # @return [::Boolean] + # Set to true if the companies requested must have open jobs. + # + # Defaults to false. + # + # If true, at most + # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of + # companies are fetched, among which only those with open jobs are returned. + class ListCompaniesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The List companies response object. + # @!attribute [rw] companies + # @return [::Array<::Google::Cloud::Talent::V4::Company>] + # Companies for the current client. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class ListCompaniesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb new file mode 100644 index 000000000000..0cad28742065 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # Auto-complete parameters. + # @!attribute [rw] tenant + # @return [::String] + # Required. Resource name of tenant the completion is performed within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] query + # @return [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # The list of languages of the query. This is + # the BCP-47 language code, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] page_size + # @return [::Integer] + # Required. Completion result count. + # + # The maximum allowed page size is 10. + # @!attribute [rw] company + # @return [::String] + # If provided, restricts completion to specified company. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @!attribute [rw] scope + # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] + # The scope of the completion. The defaults is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] + # The completion topic. The default is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. + class CompleteQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to specify the scope of completion. + module CompletionScope + # Default value. + COMPLETION_SCOPE_UNSPECIFIED = 0 + + # Suggestions are based only on the data provided by the client. + TENANT = 1 + + # Suggestions are based on all jobs data in the system that's visible to + # the client + PUBLIC = 2 + end + + # Enum to specify auto-completion topics. + module CompletionType + # Default value. + COMPLETION_TYPE_UNSPECIFIED = 0 + + # Suggest job titles for jobs autocomplete. + # + # For + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::JOB_TITLE CompletionType.JOB_TITLE} + # type, only open jobs with the same + # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} + # are returned. + JOB_TITLE = 1 + + # Suggest company names for jobs autocomplete. + # + # For + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMPANY_NAME CompletionType.COMPANY_NAME} + # type, only companies having open jobs with the same + # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} + # are returned. + COMPANY_NAME = 2 + + # Suggest both job titles and company names for jobs autocomplete. + # + # For + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED} + # type, only open jobs with the same + # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} + # or companies having open jobs with the same + # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} + # are returned. + COMBINED = 3 + end + end + + # Response of auto-complete query. + # @!attribute [rw] completion_results + # @return [::Array<::Google::Cloud::Talent::V4::CompleteQueryResponse::CompletionResult>] + # Results of the matching job/company candidates. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class CompleteQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Resource that represents completion results. + # @!attribute [rw] suggestion + # @return [::String] + # The suggestion for the query. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] + # The completion topic. + # @!attribute [rw] image_uri + # @return [::String] + # The URI of the company image for + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMPANY_NAME COMPANY_NAME}. + class CompletionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb new file mode 100644 index 000000000000..aaead09d2855 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb @@ -0,0 +1,179 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # An event issued when an end user interacts with the application that + # implements Cloud Talent Solution. Providing this information improves the + # quality of results for the API clients, enabling the + # service to perform optimally. The number of events sent must be consistent + # with other calls, such as job searches, issued to the service by the client. + # @!attribute [rw] request_id + # @return [::String] + # Strongly recommended for the best service experience. + # + # A unique ID generated in the API responses. It can be found in + # {::Google::Cloud::Talent::V4::ResponseMetadata#request_id ResponseMetadata.request_id}. + # @!attribute [rw] event_id + # @return [::String] + # Required. A unique identifier, generated by the client application. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Required. The timestamp of the event. + # @!attribute [rw] job_event + # @return [::Google::Cloud::Talent::V4::JobEvent] + # An event issued when a job seeker interacts with the application that + # implements Cloud Talent Solution. + # @!attribute [rw] event_notes + # @return [::String] + # Notes about the event provided by recruiters or other users, for example, + # feedback on why a job was bookmarked. + class ClientEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event issued when a job seeker interacts with the application that + # implements Cloud Talent Solution. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::JobEvent::JobEventType] + # Required. The type of the event (see + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType JobEventType}). + # @!attribute [rw] jobs + # @return [::Array<::String>] + # Required. The [job name(s)][google.cloud.talent.v4.Job.name] associated + # with this event. For example, if this is an + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::IMPRESSION impression} + # event, this field contains the identifiers of all jobs shown to the job + # seeker. If this was a + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::VIEW view} event, this field + # contains the identifier of the viewed job. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}", for + # example, "projects/foo/tenants/bar/jobs/baz". + class JobEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enumeration of an event attributed to the behavior of the end user, + # such as a job seeker. + module JobEventType + # The event is unspecified by other provided values. + JOB_EVENT_TYPE_UNSPECIFIED = 0 + + # The job seeker or other entity interacting with the service has + # had a job rendered in their view, such as in a list of search results in + # a compressed or clipped format. This event is typically associated with + # the viewing of a jobs list on a single page by a job seeker. + IMPRESSION = 1 + + # The job seeker, or other entity interacting with the service, has + # viewed the details of a job, including the full description. This + # event doesn't apply to the viewing a snippet of a job appearing as a + # part of the job search results. Viewing a snippet is associated with an + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::IMPRESSION impression}). + VIEW = 2 + + # The job seeker or other entity interacting with the service + # performed an action to view a job and was redirected to a different + # website for job. + VIEW_REDIRECT = 3 + + # The job seeker or other entity interacting with the service + # began the process or demonstrated the intention of applying for a job. + APPLICATION_START = 4 + + # The job seeker or other entity interacting with the service + # submitted an application for a job. + APPLICATION_FINISH = 5 + + # The job seeker or other entity interacting with the service + # submitted an application for a job with a single click without + # entering information. If a job seeker performs this action, send only + # this event to the service. Do not also send + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START} + # or + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} + # events. + APPLICATION_QUICK_SUBMISSION = 6 + + # The job seeker or other entity interacting with the service + # performed an action to apply to a job and was redirected to a different + # website to complete the application. + APPLICATION_REDIRECT = 7 + + # The job seeker or other entity interacting with the service began the + # process or demonstrated the intention of applying for a job from the + # search results page without viewing the details of the job posting. + # If sending this event, JobEventType.VIEW event shouldn't be sent. + APPLICATION_START_FROM_SEARCH = 8 + + # The job seeker, or other entity interacting with the service, performs an + # action with a single click from the search results page to apply to a job + # (without viewing the details of the job posting), and is redirected + # to a different website to complete the application. If a candidate + # performs this action, send only this event to the service. Do not also + # send + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START}, + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} + # or {::Google::Cloud::Talent::V4::JobEvent::JobEventType::VIEW JobEventType.VIEW} + # events. + APPLICATION_REDIRECT_FROM_SEARCH = 9 + + # This event should be used when a company submits an application + # on behalf of a job seeker. This event is intended for use by staffing + # agencies attempting to place candidates. + APPLICATION_COMPANY_SUBMIT = 10 + + # The job seeker or other entity interacting with the service demonstrated + # an interest in a job by bookmarking or saving it. + BOOKMARK = 11 + + # The job seeker or other entity interacting with the service was + # sent a notification, such as an email alert or device notification, + # containing one or more jobs listings generated by the service. + NOTIFICATION = 12 + + # The job seeker or other entity interacting with the service was + # employed by the hiring entity (employer). Send this event + # only if the job seeker was hired through an application that was + # initiated by a search conducted through the Cloud Talent Solution + # service. + HIRED = 13 + + # A recruiter or staffing agency submitted an application on behalf of the + # candidate after interacting with the service to identify a suitable job + # posting. + SENT_CV = 14 + + # The entity interacting with the service (for example, the job seeker), + # was granted an initial interview by the hiring entity (employer). This + # event should only be sent if the job seeker was granted an interview as + # part of an application that was initiated by a search conducted through / + # recommendation provided by the Cloud Talent Solution service. + INTERVIEW_GRANTED = 15 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb new file mode 100644 index 000000000000..284850e682bb --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # The report event request. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the tenant under which the event is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] client_event + # @return [::Google::Cloud::Talent::V4::ClientEvent] + # Required. Events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. + class CreateClientEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb new file mode 100644 index 000000000000..65be9377eb17 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb @@ -0,0 +1,392 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # The query required to perform a search query. + # @!attribute [rw] query + # @return [::String] + # The query string that matches against the job title, description, and + # location fields. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] query_language_code + # @return [::String] + # The language code of {::Google::Cloud::Talent::V4::JobQuery#query query}. For + # example, "en-US". This field helps to better interpret the query. + # + # If a value isn't specified, the query language code is automatically + # detected, which may not be accurate. + # + # Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # @!attribute [rw] companies + # @return [::Array<::String>] + # This filter specifies the company entities to search against. + # + # If a value isn't specified, jobs are searched for against all + # companies. + # + # If multiple values are specified, jobs are searched against the + # companies specified. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For + # example, "projects/foo/tenants/bar/companies/baz". + # + # At most 20 company filters are allowed. + # @!attribute [rw] location_filters + # @return [::Array<::Google::Cloud::Talent::V4::LocationFilter>] + # The location filter specifies geo-regions containing the jobs to + # search against. See {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} + # for more information. + # + # If a location value isn't specified, jobs fitting the other search + # criteria are retrieved regardless of where they're located. + # + # If multiple values are specified, jobs are retrieved from any of the + # specified locations. If different values are specified for the + # {::Google::Cloud::Talent::V4::LocationFilter#distance_in_miles LocationFilter.distance_in_miles} + # parameter, the maximum provided distance is used for all locations. + # + # At most 5 location filters are allowed. + # @!attribute [rw] job_categories + # @return [::Array<::Google::Cloud::Talent::V4::JobCategory>] + # The category filter specifies the categories of jobs to search against. + # See {::Google::Cloud::Talent::V4::JobCategory JobCategory} for more information. + # + # If a value isn't specified, jobs from any category are searched against. + # + # If multiple values are specified, jobs from any of the specified + # categories are searched against. + # @!attribute [rw] commute_filter + # @return [::Google::Cloud::Talent::V4::CommuteFilter] + # Allows filtering jobs by commute time with different travel methods (for + # example, driving or public transit). + # + # Note: This only works when you specify a + # {::Google::Cloud::Talent::V4::CommuteMethod CommuteMethod}. In this case, + # {::Google::Cloud::Talent::V4::JobQuery#location_filters location_filters} is + # ignored. + # + # Currently we don't support sorting by commute time. + # @!attribute [rw] company_display_names + # @return [::Array<::String>] + # This filter specifies the company + # {::Google::Cloud::Talent::V4::Company#display_name Company.display_name} of the + # jobs to search against. The company name must match the value exactly. + # + # Alternatively, the value being searched for can be wrapped in different + # match operators. + # `SUBSTRING_MATCH([value])` + # The company name must contain a case insensitive substring match of the + # value. Using this function may increase latency. + # + # Sample Value: `SUBSTRING_MATCH(google)` + # + # `MULTI_WORD_TOKEN_MATCH([value])` + # The value will be treated as a multi word token and the company name must + # contain a case insensitive match of the value. Using this function may + # increase latency. + # + # Sample Value: `MULTI_WORD_TOKEN_MATCH(google)` + # + # If a value isn't specified, jobs within the search results are + # associated with any company. + # + # If multiple values are specified, jobs within the search results may be + # associated with any of the specified companies. + # + # At most 20 company display name filters are allowed. + # @!attribute [rw] compensation_filter + # @return [::Google::Cloud::Talent::V4::CompensationFilter] + # This search filter is applied only to + # {::Google::Cloud::Talent::V4::Job#compensation_info Job.compensation_info}. For + # example, if the filter is specified as "Hourly job with per-hour + # compensation > $15", only jobs meeting these criteria are searched. If a + # filter isn't defined, all open jobs are searched. + # @!attribute [rw] custom_attribute_filter + # @return [::String] + # This filter specifies a structured syntax to match against the + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} + # marked as `filterable`. + # + # The syntax for this expression is a subset of SQL syntax. + # + # Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the + # left of the operator is a custom field key and the right of the operator + # is a number or a quoted string. You must escape backslash (\\) and + # quote (\") characters. + # + # Supported functions are `LOWER([field_name])` to + # perform a case insensitive match and `EMPTY([field_name])` to filter on the + # existence of a key. + # + # Boolean expressions (AND/OR/NOT) are supported up to 3 levels of + # nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 + # comparisons or functions are allowed in the expression. The expression + # must be < 10000 bytes in length. + # + # Sample Query: + # `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND + # driving_years > 10` + # @!attribute [rw] disable_spell_check + # @return [::Boolean] + # This flag controls the spell-check feature. If false, the + # service attempts to correct a misspelled query, + # for example, "enginee" is corrected to "engineer". + # + # Defaults to false: a spell check is performed. + # @!attribute [rw] employment_types + # @return [::Array<::Google::Cloud::Talent::V4::EmploymentType>] + # The employment type filter specifies the employment type of jobs to + # search against, such as + # {::Google::Cloud::Talent::V4::EmploymentType::FULL_TIME EmploymentType.FULL_TIME}. + # + # If a value isn't specified, jobs in the search results includes any + # employment type. + # + # If multiple values are specified, jobs in the search results include + # any of the specified employment types. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # This filter specifies the locale of jobs to search against, + # for example, "en-US". + # + # If a value isn't specified, the search results can contain jobs in any + # locale. + # + # + # Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # At most 10 language code filters are allowed. + # @!attribute [rw] publish_time_range + # @return [::Google::Cloud::Talent::V4::TimestampRange] + # Jobs published within a range specified by this filter are searched + # against. + # @!attribute [rw] excluded_jobs + # @return [::Array<::String>] + # This filter specifies a list of job names to be excluded during search. + # + # At most 400 excluded job names are allowed. + class JobQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Geographic region of the search. + # @!attribute [rw] address + # @return [::String] + # The address name, such as "Mountain View" or "Bay Area". + # @!attribute [rw] region_code + # @return [::String] + # CLDR region code of the country/region. This field may be used in two ways: + # + # 1) If telecommute preference is not set, this field is used address + # ambiguity of the user-input address. For example, "Liverpool" may refer to + # "Liverpool, NY, US" or "Liverpool, UK". This region code biases the + # address resolution toward a specific country or territory. If this field is + # not set, address resolution is biased toward the United States by default. + # + # 2) If telecommute preference is set to TELECOMMUTE_ALLOWED, the + # telecommute location filter will be limited to the region specified in this + # field. If this field is not set, the telecommute job locations will not be + # + # See + # https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html + # for details. Example: "CH" for Switzerland. + # @!attribute [rw] lat_lng + # @return [::Google::Type::LatLng] + # The latitude and longitude of the geographic center to search from. This + # field is ignored if `address` is provided. + # @!attribute [rw] distance_in_miles + # @return [::Float] + # The distance_in_miles is applied when the location being searched for is + # identified as a city or smaller. This field is ignored if the location + # being searched for is a state or larger. + # @!attribute [rw] telecommute_preference + # @return [::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference] + # Allows the client to return jobs without a + # set location, specifically, telecommuting jobs (telecommuting is considered + # by the service as a special location). + # {::Google::Cloud::Talent::V4::Job#posting_region Job.posting_region} indicates + # if a job permits telecommuting. If this field is set to + # {::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference::TELECOMMUTE_ALLOWED TelecommutePreference.TELECOMMUTE_ALLOWED}, + # telecommuting jobs are searched, and + # {::Google::Cloud::Talent::V4::LocationFilter#address address} and + # {::Google::Cloud::Talent::V4::LocationFilter#lat_lng lat_lng} are ignored. If + # not set or set to + # {::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference::TELECOMMUTE_EXCLUDED TelecommutePreference.TELECOMMUTE_EXCLUDED}, + # the telecommute status of the jobs is ignored. Jobs that have + # {::Google::Cloud::Talent::V4::PostingRegion::TELECOMMUTE PostingRegion.TELECOMMUTE} + # and have additional {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} + # may still be matched based on other location filters using + # {::Google::Cloud::Talent::V4::LocationFilter#address address} or + # {::Google::Cloud::Talent::V4::LocationFilter#lat_lng lat_lng}. + # + # This filter can be used by itself to search exclusively for telecommuting + # jobs, or it can be combined with another location + # filter to search for a combination of job locations, + # such as "Mountain View" or "telecommuting" jobs. However, when used in + # combination with other location filters, telecommuting jobs can be + # treated as less relevant than other jobs in the search response. + # + # This field is only used for job search requests. + class LocationFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specify whether to include telecommute jobs. + module TelecommutePreference + # Default value if the telecommute preference isn't specified. + TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0 + + # Deprecated: Ignore telecommute status of jobs. Use + # TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs. + TELECOMMUTE_EXCLUDED = 1 + + # Allow telecommute jobs. + TELECOMMUTE_ALLOWED = 2 + + # Exclude telecommute jobs. + TELECOMMUTE_JOBS_EXCLUDED = 3 + end + end + + # Filter on job compensation type and amount. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::CompensationFilter::FilterType] + # Required. Type of filter. + # @!attribute [rw] units + # @return [::Array<::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit>] + # Required. Specify desired `base compensation entry's` + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit}. + # @!attribute [rw] range + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] + # Compensation range. + # @!attribute [rw] include_jobs_with_unspecified_compensation_range + # @return [::Boolean] + # If set to true, jobs with unspecified compensation range fields are + # included. + class CompensationFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specify the type of filtering. + module FilterType + # Filter type unspecified. Position holder, INVALID, should never be used. + FILTER_TYPE_UNSPECIFIED = 0 + + # Filter by `base compensation entry's` unit. A job is a match if and + # only if the job contains a base CompensationEntry and the base + # CompensationEntry's unit matches provided + # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. Populate one or + # more {::Google::Cloud::Talent::V4::CompensationFilter#units units}. + # + # See + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} + # for definition of base compensation entry. + UNIT_ONLY = 1 + + # Filter by `base compensation entry's` unit and amount / range. A job + # is a match if and only if the job contains a base CompensationEntry, and + # the base entry's unit matches provided + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationUnit} + # and amount or range overlaps with provided + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange CompensationRange}. + # + # See + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} + # for definition of base compensation entry. + # + # Set exactly one {::Google::Cloud::Talent::V4::CompensationFilter#units units} + # and populate {::Google::Cloud::Talent::V4::CompensationFilter#range range}. + UNIT_AND_AMOUNT = 2 + + # Filter by annualized base compensation amount and `base compensation + # entry's` unit. Populate + # {::Google::Cloud::Talent::V4::CompensationFilter#range range} and zero or more + # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. + ANNUALIZED_BASE_AMOUNT = 3 + + # Filter by annualized total compensation amount and `base compensation + # entry's` unit . Populate + # {::Google::Cloud::Talent::V4::CompensationFilter#range range} and zero or more + # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. + ANNUALIZED_TOTAL_AMOUNT = 4 + end + end + + # Parameters needed for commute search. + # @!attribute [rw] commute_method + # @return [::Google::Cloud::Talent::V4::CommuteMethod] + # Required. The method of transportation to calculate the commute time for. + # @!attribute [rw] start_coordinates + # @return [::Google::Type::LatLng] + # Required. The latitude and longitude of the location to calculate the + # commute time from. + # @!attribute [rw] travel_duration + # @return [::Google::Protobuf::Duration] + # Required. The maximum travel time in seconds. The maximum allowed value is + # `3600s` (one hour). Format is `123s`. + # @!attribute [rw] allow_imprecise_addresses + # @return [::Boolean] + # If `true`, jobs without street level addresses may also be returned. + # For city level addresses, the city center is used. For state and coarser + # level addresses, text matching is used. + # If this field is set to `false` or isn't specified, only jobs that include + # street level addresses will be returned by commute search. + # @!attribute [rw] road_traffic + # @return [::Google::Cloud::Talent::V4::CommuteFilter::RoadTraffic] + # Specifies the traffic density to use when calculating commute time. + # + # Note: The following fields are mutually exclusive: `road_traffic`, `departure_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] departure_time + # @return [::Google::Type::TimeOfDay] + # The departure time used to calculate traffic impact, represented as + # {::Google::Type::TimeOfDay google.type.TimeOfDay} in local time zone. + # + # Currently traffic model is restricted to hour level resolution. + # + # Note: The following fields are mutually exclusive: `departure_time`, `road_traffic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class CommuteFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The traffic density to use when calculating commute time. + module RoadTraffic + # Road traffic situation isn't specified. + ROAD_TRAFFIC_UNSPECIFIED = 0 + + # Optimal commute time without considering any traffic impact. + TRAFFIC_FREE = 1 + + # Commute time calculation takes in account the peak traffic impact. + BUSY_HOUR = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb new file mode 100644 index 000000000000..486c5466ca9e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # The histogram request. + # @!attribute [rw] histogram_query + # @return [::String] + # An expression specifies a histogram request against matching jobs for + # searches. + # + # See + # {::Google::Cloud::Talent::V4::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries} + # for details about syntax. + class HistogramQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Histogram result that matches + # {::Google::Cloud::Talent::V4::HistogramQuery HistogramQuery} specified in + # searches. + # @!attribute [rw] histogram_query + # @return [::String] + # Requested histogram expression. + # @!attribute [rw] histogram + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # A map from the values of the facet associated with distinct values to the + # number of matching entries with corresponding value. + # + # The key format is: + # + # * (for string histogram) string values stored in the field. + # * (for named numeric bucket) name specified in `bucket()` function, like + # for `bucket(0, MAX, "non-negative")`, the key will be `non-negative`. + # * (for anonymous numeric bucket) range formatted as `-`, for + # example, `0-1000`, `MIN-0`, and `0-MAX`. + class HistogramQueryResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class HistogramEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb new file mode 100644 index 000000000000..bf21f608f3bf --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb @@ -0,0 +1,392 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # A Job resource represents a job posting (also referred to as a "job listing" + # or "job requisition"). A job belongs to a + # {::Google::Cloud::Talent::V4::Company Company}, which is the hiring entity + # responsible for the job. + # @!attribute [rw] name + # @return [::String] + # Required during job update. + # + # The resource name for the job. This is generated by the service when a + # job is created. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # Use of this field in job queries and API calls is preferred over the use of + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} since this + # value is unique. + # @!attribute [rw] company + # @return [::String] + # Required. The resource name of the company listing the job. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For + # example, "projects/foo/tenants/bar/companies/baz". + # @!attribute [rw] requisition_id + # @return [::String] + # Required. The requisition ID, also referred to as the posting ID, is + # assigned by the client to identify a job. This field is intended to be used + # by clients for client identification and tracking of postings. A job isn't + # allowed to be created if there is another job with the same + # {::Google::Cloud::Talent::V4::Job#name company}, + # {::Google::Cloud::Talent::V4::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] title + # @return [::String] + # Required. The title of the job, such as "Software Engineer" + # + # The maximum number of allowed characters is 500. + # @!attribute [rw] description + # @return [::String] + # Required. The description of the job, which typically includes a + # multi-paragraph description of the company and related information. + # Separate fields are provided on the job object for + # {::Google::Cloud::Talent::V4::Job#responsibilities responsibilities}, + # {::Google::Cloud::Talent::V4::Job#qualifications qualifications}, and other job + # characteristics. Use of these separate job fields is recommended. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 100,000. + # @!attribute [rw] addresses + # @return [::Array<::String>] + # Strongly recommended for the best service experience. + # + # Location(s) where the employer is looking to hire for this job posting. + # + # Specifying the full street address(es) of the hiring location enables + # better API results, especially job searches by commute time. + # + # At most 50 locations are allowed for best search performance. If a job has + # more locations, it is suggested to split it into multiple jobs with unique + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}s (e.g. 'ReqA' + # becomes 'ReqA-1', 'ReqA-2', and so on.) as multiple jobs with the same + # {::Google::Cloud::Talent::V4::Job#company company}, + # {::Google::Cloud::Talent::V4::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} are not + # allowed. If the original + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} must be + # preserved, a custom field should be used for storage. It is also suggested + # to group the locations that close to each other in the same job for better + # search experience. + # + # Jobs with multiple addresses must have their addresses with the same + # {::Google::Cloud::Talent::V4::Location::LocationType LocationType} to allow + # location filtering to work properly. (For example, a Job with addresses + # "1600 Amphitheatre Parkway, Mountain View, CA, USA" and "London, UK" may + # not have location filters applied correctly at search time since the first + # is a + # {::Google::Cloud::Talent::V4::Location::LocationType::STREET_ADDRESS LocationType.STREET_ADDRESS} + # and the second is a + # {::Google::Cloud::Talent::V4::Location::LocationType::LOCALITY LocationType.LOCALITY}.) + # If a job needs to have multiple addresses, it is suggested to split it into + # multiple jobs with same LocationTypes. + # + # The maximum number of allowed characters is 500. + # @!attribute [rw] application_info + # @return [::Google::Cloud::Talent::V4::Job::ApplicationInfo] + # Job application information. + # @!attribute [rw] job_benefits + # @return [::Array<::Google::Cloud::Talent::V4::JobBenefit>] + # The benefits included with the job. + # @!attribute [rw] compensation_info + # @return [::Google::Cloud::Talent::V4::CompensationInfo] + # Job compensation information (a.k.a. "pay rate") i.e., the compensation + # that will paid to the employee. + # @!attribute [rw] custom_attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Talent::V4::CustomAttribute}] + # A map of fields to hold both filterable and non-filterable custom job + # attributes that are not covered by the provided structured fields. + # + # The keys of the map are strings up to 64 bytes and must match the + # pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, key0LikeThis or + # KEY_1_LIKE_THIS. + # + # At most 100 filterable and at most 100 unfilterable keys are supported. + # For filterable `string_values`, across all keys at most 200 values are + # allowed, with each string no more than 255 characters. For unfilterable + # `string_values`, the maximum total size of `string_values` across all keys + # is 50KB. + # @!attribute [rw] degree_types + # @return [::Array<::Google::Cloud::Talent::V4::DegreeType>] + # The desired education degrees for the job, such as Bachelors, Masters. + # @!attribute [rw] department + # @return [::String] + # The department or functional area within the company with the open + # position. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] employment_types + # @return [::Array<::Google::Cloud::Talent::V4::EmploymentType>] + # The employment type(s) of a job, for example, + # {::Google::Cloud::Talent::V4::EmploymentType::FULL_TIME full time} or + # {::Google::Cloud::Talent::V4::EmploymentType::PART_TIME part time}. + # @!attribute [rw] incentives + # @return [::String] + # A description of bonus, commission, and other compensation + # incentives associated with the job not including salary or pay. + # + # The maximum number of allowed characters is 10,000. + # @!attribute [rw] language_code + # @return [::String] + # The language of the posting. This field is distinct from + # any requirements for fluency that are associated with the job. + # + # Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: + # class="external" target="_blank" }. + # + # If this field is unspecified and + # {::Google::Cloud::Talent::V4::Job#description Job.description} is present, + # detected language code based on + # {::Google::Cloud::Talent::V4::Job#description Job.description} is assigned, + # otherwise defaults to 'en_US'. + # @!attribute [rw] job_level + # @return [::Google::Cloud::Talent::V4::JobLevel] + # The experience level associated with the job, such as "Entry Level". + # @!attribute [rw] promotion_value + # @return [::Integer] + # A promotion value of the job, as determined by the client. + # The value determines the sort order of the jobs returned when searching for + # jobs using the featured jobs search call, with higher promotional values + # being returned first and ties being resolved by relevance sort. Only the + # jobs with a promotionValue >0 are returned in a FEATURED_JOB_SEARCH. + # + # Default value is 0, and negative values are treated as 0. + # @!attribute [rw] qualifications + # @return [::String] + # A description of the qualifications required to perform the + # job. The use of this field is recommended + # as an alternative to using the more general + # {::Google::Cloud::Talent::V4::Job#description description} field. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 10,000. + # @!attribute [rw] responsibilities + # @return [::String] + # A description of job responsibilities. The use of this field is + # recommended as an alternative to using the more general + # {::Google::Cloud::Talent::V4::Job#description description} field. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 10,000. + # @!attribute [rw] posting_region + # @return [::Google::Cloud::Talent::V4::PostingRegion] + # The job {::Google::Cloud::Talent::V4::PostingRegion PostingRegion} (for example, + # state, country) throughout which the job is available. If this field is + # set, a {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in a search + # query within the job region finds this job posting if an exact location + # match isn't specified. If this field is set to + # {::Google::Cloud::Talent::V4::PostingRegion::NATION PostingRegion.NATION} or + # {::Google::Cloud::Talent::V4::PostingRegion::ADMINISTRATIVE_AREA PostingRegion.ADMINISTRATIVE_AREA}, + # setting job {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} to the + # same location level as this field is strongly recommended. + # @!attribute [rw] visibility + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Talent::V4::Visibility] + # Deprecated. The job is only visible to the owner. + # + # The visibility of the job. + # + # Defaults to + # {::Google::Cloud::Talent::V4::Visibility::ACCOUNT_ONLY Visibility.ACCOUNT_ONLY} + # if not specified. + # @!attribute [rw] job_start_time + # @return [::Google::Protobuf::Timestamp] + # The start timestamp of the job in UTC time zone. Typically this field + # is used for contracting engagements. Invalid timestamps are ignored. + # @!attribute [rw] job_end_time + # @return [::Google::Protobuf::Timestamp] + # The end timestamp of the job. Typically this field is used for contracting + # engagements. Invalid timestamps are ignored. + # @!attribute [rw] posting_publish_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp this job posting was most recently published. The default + # value is the time the request arrives at the server. Invalid timestamps are + # ignored. + # @!attribute [rw] posting_expire_time + # @return [::Google::Protobuf::Timestamp] + # Strongly recommended for the best service experience. + # + # The expiration timestamp of the job. After this timestamp, the + # job is marked as expired, and it no longer appears in search results. The + # expired job can't be listed by the + # {::Google::Cloud::Talent::V4::JobService::Client#list_jobs ListJobs} API, but it can be + # retrieved with the {::Google::Cloud::Talent::V4::JobService::Client#get_job GetJob} API + # or updated with the + # {::Google::Cloud::Talent::V4::JobService::Client#update_job UpdateJob} API or deleted + # with the {::Google::Cloud::Talent::V4::JobService::Client#delete_job DeleteJob} API. An + # expired job can be updated and opened again by using a future expiration + # timestamp. Updating an expired job fails if there is another existing open + # job with same {::Google::Cloud::Talent::V4::Job#company company}, + # {::Google::Cloud::Talent::V4::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}. + # + # The expired jobs are retained in our system for 90 days. However, the + # overall expired job count cannot exceed 3 times the maximum number of + # open jobs over previous 7 days. If this threshold is exceeded, + # expired jobs are cleaned out in order of earliest expire time. + # Expired jobs are no longer accessible after they are cleaned + # out. + # + # Invalid timestamps are ignored, and treated as expire time not provided. + # + # If the timestamp is before the instant request is made, the job + # is treated as expired immediately on creation. This kind of job can + # not be updated. And when creating a job with past timestamp, the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time posting_publish_time} + # must be set before + # {::Google::Cloud::Talent::V4::Job#posting_expire_time posting_expire_time}. The + # purpose of this feature is to allow other objects, such as + # {::Google::Cloud::Talent::V4::Job::ApplicationInfo ApplicationInfo}, to refer a + # job that didn't exist in the system prior to becoming expired. If you want + # to modify a job that was expired on creation, delete it and create a new + # one. + # + # If this value isn't provided at the time of job creation or is invalid, + # the job posting expires after 30 days from the job's creation time. For + # example, if the job was created on 2017/01/01 13:00AM UTC with an + # unspecified expiration date, the job expires after 2017/01/31 13:00AM UTC. + # + # If this value isn't provided on job update, it depends on the field masks + # set by + # {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask UpdateJobRequest.update_mask}. + # If the field masks include + # {::Google::Cloud::Talent::V4::Job#job_end_time job_end_time}, or the masks are + # empty meaning that every field is updated, the job posting expires after 30 + # days from the job's last update time. Otherwise the expiration date isn't + # updated. + # @!attribute [r] posting_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when this job posting was created. + # @!attribute [r] posting_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when this job posting was last updated. + # @!attribute [r] company_display_name + # @return [::String] + # Output only. Display name of the company listing the job. + # @!attribute [r] derived_info + # @return [::Google::Cloud::Talent::V4::Job::DerivedInfo] + # Output only. Derived details about the job posting. + # @!attribute [rw] processing_options + # @return [::Google::Cloud::Talent::V4::Job::ProcessingOptions] + # Options for job processing. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Application related details of a job posting. + # @!attribute [rw] emails + # @return [::Array<::String>] + # Use this field to specify email address(es) to which resumes or + # applications can be sent. + # + # The maximum number of allowed characters for each entry is 255. + # @!attribute [rw] instruction + # @return [::String] + # Use this field to provide instructions, such as "Mail your application + # to ...", that a candidate can follow to apply for the job. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 3,000. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Use this URI field to direct an applicant to a website, for example to + # link to an online application form. + # + # The maximum number of allowed characters for each entry is 2,000. + class ApplicationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Derived details about the job posting. + # @!attribute [rw] locations + # @return [::Array<::Google::Cloud::Talent::V4::Location>] + # Structured locations of the job, resolved from + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}. + # + # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations locations} are exactly + # matched to {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} in the + # same order. + # @!attribute [rw] job_categories + # @return [::Array<::Google::Cloud::Talent::V4::JobCategory>] + # Job categories derived from {::Google::Cloud::Talent::V4::Job#title Job.title} + # and {::Google::Cloud::Talent::V4::Job#description Job.description}. + class DerivedInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options for job processing. + # @!attribute [rw] disable_street_address_resolution + # @return [::Boolean] + # If set to `true`, the service does not attempt to resolve a + # more precise address for the job. + # @!attribute [rw] html_sanitization + # @return [::Google::Cloud::Talent::V4::HtmlSanitization] + # Option for job HTML content sanitization. Applied fields are: + # + # * description + # * applicationInfo.instruction + # * incentives + # * qualifications + # * responsibilities + # + # HTML tags in these fields may be stripped if sanitiazation isn't + # disabled. + # + # Defaults to + # {::Google::Cloud::Talent::V4::HtmlSanitization::SIMPLE_FORMATTING_ONLY HtmlSanitization.SIMPLE_FORMATTING_ONLY}. + class ProcessingOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Talent::V4::CustomAttribute] + class CustomAttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb new file mode 100644 index 000000000000..8f673511ad12 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb @@ -0,0 +1,929 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # Create job request. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4::Job] + # Required. The Job to be created. + class CreateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Get job request. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the job to retrieve. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Update job request. + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4::Job] + # Required. The Job to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise + # all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + class UpdateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Delete job request. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the job to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List jobs request. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] filter + # @return [::String] + # Required. The filter string specifies the jobs to be enumerated. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` + # * `requisitionId` + # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + # OPEN if no value is specified. + # + # At least one of `companyName` and `requisitionId` must present or an + # INVALID_ARGUMENT error is thrown. + # + # Sample Query: + # + # * companyName = "projects/foo/tenants/bar/companies/baz" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # requisitionId = "req-1" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # status = "EXPIRED" + # * requisitionId = "req-1" + # * requisitionId = "req-1" AND status = "EXPIRED" + # @!attribute [rw] page_token + # @return [::String] + # The starting point of a query result. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of jobs to be returned per page of results. + # + # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, + # the maximum allowed page size is 1000. Otherwise, the maximum allowed page + # size is 100. + # + # Default is 100 if empty or a number < 1 is specified. + # @!attribute [rw] job_view + # @return [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the + # search response. Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no + # value is specified. + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List jobs response. + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Talent::V4::Job>] + # The Jobs for a given company. + # + # The maximum number of items returned is based on the limit field + # provided in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Request body of the `SearchJobs` call. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] search_mode + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @!attribute [rw] request_metadata + # @return [::Google::Cloud::Talent::V4::RequestMetadata] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @!attribute [rw] job_query + # @return [::Google::Cloud::Talent::V4::JobQuery] + # Query used to search against jobs, such as keyword, location filters, etc. + # @!attribute [rw] enable_broadening + # @return [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @!attribute [rw] histogram_queries + # @return [::Array<::Google::Cloud::Talent::V4::HistogramQuery>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @!attribute [rw] job_view + # @return [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @!attribute [rw] offset + # @return [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @!attribute [rw] max_page_size + # @return [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @!attribute [rw] page_token + # @return [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @!attribute [rw] order_by + # @return [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @!attribute [rw] diversification_level + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @!attribute [rw] custom_ranking_info + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @!attribute [rw] disable_keyword_match + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @!attribute [rw] keyword_match_mode + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @!attribute [rw] relevance_threshold + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + class SearchJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Custom ranking information for + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # @!attribute [rw] importance_level + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo::ImportanceLevel] + # Required. Controls over how important the score of + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression} + # gets applied to job's final ranking position. + # + # An error is thrown if not specified. + # @!attribute [rw] ranking_expression + # @return [::String] + # Required. Controls over how job documents get ranked on top of existing + # relevance score (determined by API algorithm). A combination of the + # ranking expression and relevance score is used to determine job's final + # ranking position. + # + # The syntax for this expression is a subset of Google SQL syntax. + # + # Supported operators are: +, -, *, /, where the left and right side of + # the operator is either a numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} + # key, integer/double value or an expression that can be evaluated to a + # number. + # + # Parenthesis are supported to adjust calculation precedence. The + # expression must be < 200 characters in length. + # + # The expression is considered invalid for a job if the expression + # references custom attributes that are not populated on the job or if the + # expression results in a divide by zero. If an expression is invalid for a + # job, that job is demoted to the end of the results. + # + # Sample ranking expression + # (year + 25) * 0.25 - (freshness / 0.5) + class CustomRankingInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The importance level for + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression}. + module ImportanceLevel + # Default value if the importance level isn't specified. + IMPORTANCE_LEVEL_UNSPECIFIED = 0 + + # The given ranking expression is of None importance, existing relevance + # score (determined by API algorithm) dominates job's final ranking + # position. + NONE = 1 + + # The given ranking expression is of Low importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + LOW = 2 + + # The given ranking expression is of Mild importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + MILD = 3 + + # The given ranking expression is of Medium importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + MEDIUM = 4 + + # The given ranking expression is of High importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + HIGH = 5 + + # The given ranking expression is of Extreme importance, and dominates + # job's final ranking position with existing relevance + # score (determined by API algorithm) ignored. + EXTREME = 6 + end + end + + # A string-represented enumeration of the job search mode. The service + # operate differently for different modes of service. + module SearchMode + # The mode of the search method isn't specified. The default search + # behavior is identical to JOB_SEARCH search behavior. + SEARCH_MODE_UNSPECIFIED = 0 + + # The job search matches against all jobs, and featured jobs + # (jobs with promotionValue > 0) are not specially handled. + JOB_SEARCH = 1 + + # The job search matches only against featured jobs (jobs with a + # promotionValue > 0). This method doesn't return any jobs having a + # promotionValue <= 0. The search results order is determined by the + # promotionValue (jobs with a higher promotionValue are returned higher up + # in the search results), with relevance being used as a tiebreaker. + FEATURED_JOB_SEARCH = 2 + end + + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # If you are using pageToken to page through the result set, + # latency might be lower but we can't guarantee that all results are + # returned. If you are using page offset, latency might be higher but all + # results are returned. + module DiversificationLevel + # The diversification level isn't specified. + DIVERSIFICATION_LEVEL_UNSPECIFIED = 0 + + # Disables diversification. Jobs that would normally be pushed to the last + # page would not have their positions altered. This may result in highly + # similar jobs appearing in sequence in the search results. + DISABLED = 1 + + # Default diversifying behavior. The result list is ordered so that + # highly similar results are pushed to the end of the last page of search + # results. + SIMPLE = 2 + + # Only one job from the same company will be shown at once, other jobs + # under same company are pushed to the end of the last page of search + # result. + ONE_PER_COMPANY = 3 + + # Similar to ONE_PER_COMPANY, but it allows at most two jobs in the + # same company to be shown at once, the other jobs under same company are + # pushed to the end of the last page of search result. + TWO_PER_COMPANY = 4 + + # Similar to ONE_PER_COMPANY, but it allows at most three jobs in the + # same company to be shown at once, the other jobs under same company are + # dropped. + MAX_THREE_PER_COMPANY = 6 + + # The result list is ordered such that somewhat similar results are pushed + # to the end of the last page of the search results. This option is + # recommended if SIMPLE diversification does not diversify enough. + DIVERSIFY_BY_LOOSER_SIMILARITY = 5 + end + + # Controls what keyword matching behavior the search has. When keyword + # matching is enabled, a keyword match returns jobs that may not match given + # category filters when there are matching keywords. For example, for the + # query "program manager" with KeywordMatchMode set to KEYWORD_MATCH_ALL, a + # job posting with the title "software developer," which doesn't fall into + # "program manager" ontology, and "program manager" appearing in its + # description will be surfaced. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this enum's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + module KeywordMatchMode + # The keyword match option isn't specified. Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # behavior. + KEYWORD_MATCH_MODE_UNSPECIFIED = 0 + + # Disables keyword matching. + KEYWORD_MATCH_DISABLED = 1 + + # Enable keyword matching over + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}, and + # keyword searchable + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} + # fields. + KEYWORD_MATCH_ALL = 2 + + # Only enable keyword matching over + # {::Google::Cloud::Talent::V4::Job#title Job.title}. + KEYWORD_MATCH_TITLE_ONLY = 3 + end + + # The relevance threshold of the search results. The higher relevance + # threshold is, the higher relevant results are shown and the less number of + # results are returned. + module RelevanceThreshold + # Default value. In this case, server behavior defaults to Google defined + # threshold. + RELEVANCE_THRESHOLD_UNSPECIFIED = 0 + + # Lowest relevance threshold. + LOWEST = 1 + + # Low relevance threshold. + LOW = 2 + + # Medium relevance threshold. + MEDIUM = 3 + + # High relevance threshold. + HIGH = 4 + end + end + + # Response for SearchJob method. + # @!attribute [rw] matching_jobs + # @return [::Array<::Google::Cloud::Talent::V4::SearchJobsResponse::MatchingJob>] + # The Job entities that match the specified + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # @!attribute [rw] histogram_query_results + # @return [::Array<::Google::Cloud::Talent::V4::HistogramQueryResult>] + # The histogram results that match with specified + # {::Google::Cloud::Talent::V4::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries}. + # @!attribute [rw] next_page_token + # @return [::String] + # The token that specifies the starting position of the next page of results. + # This field is empty if there are no more results. + # @!attribute [rw] location_filters + # @return [::Array<::Google::Cloud::Talent::V4::Location>] + # The location filters that the service applied to the specified query. If + # any filters are lat-lng based, the + # {::Google::Cloud::Talent::V4::Location#location_type Location.location_type} is + # {::Google::Cloud::Talent::V4::Location::LocationType::LOCATION_TYPE_UNSPECIFIED Location.LocationType.LOCATION_TYPE_UNSPECIFIED}. + # @!attribute [rw] total_size + # @return [::Integer] + # Number of jobs that match the specified query. + # + # Note: This size is precise only if the total is less than 100,000. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + # @!attribute [rw] broadened_query_jobs_count + # @return [::Integer] + # If query broadening is enabled, we may append additional results from the + # broadened query. This number indicates how many of the jobs returned in the + # jobs field are from the broadened query. These results are always at the + # end of the jobs list. In particular, a value of 0, or if the field isn't + # set, all the jobs in the jobs list are from the original + # (without broadening) query. If this field is non-zero, subsequent requests + # with offset after this result set should contain all broadened results. + # @!attribute [rw] spell_correction + # @return [::Google::Cloud::Talent::V4::SpellingCorrection] + # The spell checking result, and correction. + class SearchJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Job entry with metadata inside + # {::Google::Cloud::Talent::V4::SearchJobsResponse SearchJobsResponse}. + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4::Job] + # Job resource that matches the specified + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # @!attribute [rw] job_summary + # @return [::String] + # A summary of the job with core information that's displayed on the search + # results listing page. + # @!attribute [rw] job_title_snippet + # @return [::String] + # Contains snippets of text from the + # {::Google::Cloud::Talent::V4::Job#title Job.title} field most closely matching + # a search query's keywords, if available. The matching query keywords are + # enclosed in HTML bold tags. + # @!attribute [rw] search_text_snippet + # @return [::String] + # Contains snippets of text from the + # {::Google::Cloud::Talent::V4::Job#description Job.description} and similar + # fields that most closely match a search query's keywords, if available. + # All HTML tags in the original fields are stripped when returned in this + # field, and matching query keywords are enclosed in HTML bold tags. + # @!attribute [rw] commute_info + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse::CommuteInfo] + # Commute information which is generated based on specified + # {::Google::Cloud::Talent::V4::CommuteFilter CommuteFilter}. + class MatchingJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Commute details related to this job. + # @!attribute [rw] job_location + # @return [::Google::Cloud::Talent::V4::Location] + # Location used as the destination in the commute calculation. + # @!attribute [rw] travel_duration + # @return [::Google::Protobuf::Duration] + # The number of seconds required to travel to the job location from the + # query location. A duration of 0 seconds indicates that the job isn't + # reachable within the requested duration, but was returned as part of an + # expanded query. + class CommuteInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request to create a batch of jobs. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Talent::V4::Job>] + # Required. The jobs to be created. + # A maximum of 200 jobs can be created in a batch. + class BatchCreateJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update a batch of jobs. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Talent::V4::Job>] + # Required. The jobs to be updated. + # A maximum of 200 jobs can be updated in a batch. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. Be aware that it will + # also increase latency when checking the status of a batch operation. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} + # are updated. Otherwise all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside + # {::Google::Cloud::Talent::V4::JobResult JobResult} + # will only contains fields that is updated, plus the Id of the Job. + # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, + # which can yield a very large response. + class BatchUpdateJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a batch of jobs. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # + # The parent of all of the jobs specified in `names` must match this field. + # @!attribute [rw] names + # @return [::Array<::String>] + # The names of the jobs to delete. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". + # For example, "projects/foo/tenants/bar/jobs/baz". + # + # A maximum of 200 jobs can be deleted in a batch. + class BatchDeleteJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Mutation result of a job from a batch operation. + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4::Job] + # Here {::Google::Cloud::Talent::V4::Job Job} only contains basic information + # including {::Google::Cloud::Talent::V4::Job#name name}, + # {::Google::Cloud::Talent::V4::Job#company company}, + # {::Google::Cloud::Talent::V4::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}, use getJob + # method to retrieve detailed information of the created/updated job. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status of the job processed. This field is populated if the + # processing of the {::Google::Cloud::Talent::V4::JobResult#job job} fails. + class JobResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result of + # {::Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs JobService.BatchCreateJobs}. + # It's used to replace + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # in case of success. + # @!attribute [rw] job_results + # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] + # List of job mutation results from a batch create operation. It can change + # until operation status is FINISHED, FAILED or CANCELLED. + class BatchCreateJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result of + # {::Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs JobService.BatchUpdateJobs}. + # It's used to replace + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # in case of success. + # @!attribute [rw] job_results + # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] + # List of job mutation results from a batch update operation. It can change + # until operation status is FINISHED, FAILED or CANCELLED. + class BatchUpdateJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result of + # {::Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs JobService.BatchDeleteJobs}. + # It's used to replace + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # in case of success. + # @!attribute [rw] job_results + # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] + # List of job mutation results from a batch delete operation. It can change + # until operation status is FINISHED, FAILED or CANCELLED. + class BatchDeleteJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An enum that specifies the job attributes that are returned in the + # {::Google::Cloud::Talent::V4::SearchJobsResponse::MatchingJob#job MatchingJob.job} + # or {::Google::Cloud::Talent::V4::ListJobsResponse#jobs ListJobsResponse.jobs} + # fields. + module JobView + # Default value. + JOB_VIEW_UNSPECIFIED = 0 + + # A ID only view of job, with following attributes: + # {::Google::Cloud::Talent::V4::Job#name Job.name}, + # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}. + JOB_VIEW_ID_ONLY = 1 + + # A minimal view of the job, with the following attributes: + # {::Google::Cloud::Talent::V4::Job#name Job.name}, + # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#company Job.company}, + # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations Job.DerivedInfo.locations}, + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}. + JOB_VIEW_MINIMAL = 2 + + # A small view of the job, with the following attributes in the search + # results: {::Google::Cloud::Talent::V4::Job#name Job.name}, + # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#company Job.company}, + # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations Job.DerivedInfo.locations}, + # {::Google::Cloud::Talent::V4::Job#visibility Job.visibility}, + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}. + JOB_VIEW_SMALL = 3 + + # All available attributes are included in the search results. + JOB_VIEW_FULL = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb new file mode 100644 index 000000000000..75689dcc538b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # A Tenant resource represents a tenant in the service. A tenant is a group or + # entity that shares common access with specific privileges for resources like + # jobs. Customer may create multiple tenants to provide data isolation for + # different groups. + # @!attribute [rw] name + # @return [::String] + # Required during tenant update. + # + # The resource name for a tenant. This is generated by the service when a + # tenant is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] external_id + # @return [::String] + # Required. Client side tenant identifier, used to uniquely identify the + # tenant. + # + # The maximum number of allowed characters is 255. + class Tenant + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb new file mode 100644 index 000000000000..69e01584823c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Talent + module V4 + # The Request of the CreateTenant method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @!attribute [rw] tenant + # @return [::Google::Cloud::Talent::V4::Tenant] + # Required. The tenant to be created. + class CreateTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for getting a tenant by name. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the tenant to be retrieved. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + class GetTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for updating a specified tenant. + # @!attribute [rw] tenant + # @return [::Google::Cloud::Talent::V4::Tenant] + # Required. The tenant resource to replace the current resource in the + # system. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the tenant fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. + class UpdateTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a tenant. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the tenant to be deleted. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + class DeleteTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List tenants for which the client has ACL visibility. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @!attribute [rw] page_token + # @return [::String] + # The starting indicator from which to return results. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of tenants to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + class ListTenantsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The List tenants response object. + # @!attribute [rw] tenants + # @return [::Array<::Google::Cloud::Talent::V4::Tenant>] + # Tenants for the current client. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class ListTenantsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..9a7c0269fa42 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb new file mode 100644 index 000000000000..c15e78a39a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.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! + + +module Google + module Type + # An object that represents a latitude/longitude pair. This is expressed as a + # pair of doubles to represent degrees latitude and degrees longitude. Unless + # specified otherwise, this must conform to the + # WGS84 + # standard. Values must be within normalized ranges. + # @!attribute [rw] latitude + # @return [::Float] + # The latitude in degrees. It must be in the range [-90.0, +90.0]. + # @!attribute [rw] longitude + # @return [::Float] + # The longitude in degrees. It must be in the range [-180.0, +180.0]. + class LatLng + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb new file mode 100644 index 000000000000..56a32eee300d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb new file mode 100644 index 000000000000..9cd0c16495dd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 postal address, e.g. for postal delivery or payments addresses. + # Given a postal address, a postal service can deliver items to a premise, P.O. + # Box or similar. + # It is not intended to model geographical locations (roads, towns, + # mountains). + # + # In typical usage an address would be created via user input or from importing + # existing data, depending on the type of process. + # + # Advice on address input / editing: + # - Use an i18n-ready address widget such as + # https://github.com/google/libaddressinput) + # - Users should not be presented with UI elements for input or editing of + # fields outside countries where that field is used. + # + # For more guidance on how to use this schema, please see: + # https://support.google.com/business/answer/6397478 + # @!attribute [rw] revision + # @return [::Integer] + # The schema revision of the `PostalAddress`. This must be set to 0, which is + # the latest revision. + # + # All new revisions **must** be backward compatible with old revisions. + # @!attribute [rw] region_code + # @return [::String] + # Required. CLDR region code of the country/region of the address. This + # is never inferred and it is up to the user to ensure the value is + # correct. See http://cldr.unicode.org/ and + # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + # for details. Example: "CH" for Switzerland. + # @!attribute [rw] language_code + # @return [::String] + # Optional. BCP-47 language code of the contents of this address (if + # known). This is often the UI language of the input form or is expected + # to match one of the languages used in the address' country/region, or their + # transliterated equivalents. + # This can affect formatting in certain countries, but is not critical + # to the correctness of the data and will never affect any validation or + # other non-formatting related operations. + # + # If this value is not known, it should be omitted (rather than specifying a + # possibly incorrect default). + # + # Examples: "zh-Hant", "ja", "ja-Latn", "en". + # @!attribute [rw] postal_code + # @return [::String] + # Optional. Postal code of the address. Not all countries use or require + # postal codes to be present, but where they are used, they may trigger + # additional validation with other parts of the address (e.g. state/zip + # validation in the U.S.A.). + # @!attribute [rw] sorting_code + # @return [::String] + # Optional. Additional, country-specific, sorting code. This is not used + # in most regions. Where it is used, the value is either a string like + # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + # alone, representing the "sector code" (Jamaica), "delivery area indicator" + # (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + # @!attribute [rw] administrative_area + # @return [::String] + # Optional. Highest administrative subdivision which is used for postal + # addresses of a country or region. + # For example, this can be a state, a province, an oblast, or a prefecture. + # Specifically, for Spain this is the province and not the autonomous + # community (e.g. "Barcelona" and not "Catalonia"). + # Many countries don't use an administrative area in postal addresses. E.g. + # in Switzerland this should be left unpopulated. + # @!attribute [rw] locality + # @return [::String] + # Optional. Generally refers to the city/town portion of the address. + # Examples: US city, IT comune, UK post town. + # In regions of the world where localities are not well defined or do not fit + # into this structure well, leave locality empty and use address_lines. + # @!attribute [rw] sublocality + # @return [::String] + # Optional. Sublocality of the address. + # For example, this can be neighborhoods, boroughs, districts. + # @!attribute [rw] address_lines + # @return [::Array<::String>] + # Unstructured address lines describing the lower levels of an address. + # + # Because values in address_lines do not have type information and may + # sometimes contain multiple values in a single field (e.g. + # "Austin, TX"), it is important that the line order is clear. The order of + # address lines should be "envelope order" for the country/region of the + # address. In places where this can vary (e.g. Japan), address_language is + # used to make it explicit (e.g. "ja" for large-to-small ordering and + # "ja-Latn" or "en" for small-to-large). This way, the most specific line of + # an address can be selected based on the language. + # + # The minimum permitted structural representation of an address consists + # of a region_code with all remaining information placed in the + # address_lines. It would be possible to format such an address very + # approximately without geocoding, but no semantic reasoning could be + # made about any of the address components until it was at least + # partially resolved. + # + # Creating an address only containing a region_code and address_lines, and + # then geocoding is the recommended way to handle completely unstructured + # addresses (as opposed to guessing which parts of the address should be + # localities or administrative areas). + # @!attribute [rw] recipients + # @return [::Array<::String>] + # Optional. The recipient at the address. + # This field may, under certain circumstances, contain multiline information. + # For example, it might contain "care of" information. + # @!attribute [rw] organization + # @return [::String] + # Optional. The name of the organization at the address. + class PostalAddress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..8372dad8beb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/snippets/Gemfile b/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile new file mode 100644 index 000000000000..b3bffd08bc08 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4", path: "../" +else + gem "google-cloud-talent-v4" +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-talent-v4/snippets/company_service/create_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb new file mode 100644 index 000000000000..e56a55c05094 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_CompanyService_CreateCompany_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the create_company call in the CompanyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#create_company. +# +def create_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateCompanyRequest.new + + # Call the create_company method. + result = client.create_company request + + # The returned object is of type Google::Cloud::Talent::V4::Company. + p result +end +# [END jobs_v4_generated_CompanyService_CreateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb new file mode 100644 index 000000000000..40fdb75b8cc4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_CompanyService_DeleteCompany_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the delete_company call in the CompanyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#delete_company. +# +def delete_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new + + # Call the delete_company method. + result = client.delete_company request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END jobs_v4_generated_CompanyService_DeleteCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb new file mode 100644 index 000000000000..9c22acb2386a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_CompanyService_GetCompany_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the get_company call in the CompanyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#get_company. +# +def get_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::GetCompanyRequest.new + + # Call the get_company method. + result = client.get_company request + + # The returned object is of type Google::Cloud::Talent::V4::Company. + p result +end +# [END jobs_v4_generated_CompanyService_GetCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb new file mode 100644 index 000000000000..020a9f51d83c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.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 jobs_v4_generated_CompanyService_ListCompanies_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the list_companies call in the CompanyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#list_companies. +# +def list_companies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::ListCompaniesRequest.new + + # Call the list_companies method. + result = client.list_companies request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Talent::V4::Company. + p item + end +end +# [END jobs_v4_generated_CompanyService_ListCompanies_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb new file mode 100644 index 000000000000..8b646272a21b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_CompanyService_UpdateCompany_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the update_company call in the CompanyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#update_company. +# +def update_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new + + # Call the update_company method. + result = client.update_company request + + # The returned object is of type Google::Cloud::Talent::V4::Company. + p result +end +# [END jobs_v4_generated_CompanyService_UpdateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb new file mode 100644 index 000000000000..43f84207b6e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_Completion_CompleteQuery_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the complete_query call in the Completion service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::Completion::Client#complete_query. +# +def complete_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::Completion::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CompleteQueryRequest.new + + # Call the complete_query method. + result = client.complete_query request + + # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. + p result +end +# [END jobs_v4_generated_Completion_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb new file mode 100644 index 000000000000..ade74776472e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_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 jobs_v4_generated_EventService_CreateClientEvent_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the create_client_event call in the EventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::EventService::Client#create_client_event. +# +def create_client_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::EventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateClientEventRequest.new + + # Call the create_client_event method. + result = client.create_client_event request + + # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. + p result +end +# [END jobs_v4_generated_EventService_CreateClientEvent_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb new file mode 100644 index 000000000000..21835b11ffce --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_BatchCreateJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the batch_create_jobs call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs. +# +def batch_create_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new + + # Call the batch_create_jobs method. + result = client.batch_create_jobs request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END jobs_v4_generated_JobService_BatchCreateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb new file mode 100644 index 000000000000..0cb9e4d13b0b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_BatchDeleteJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the batch_delete_jobs call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs. +# +def batch_delete_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new + + # Call the batch_delete_jobs method. + result = client.batch_delete_jobs request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END jobs_v4_generated_JobService_BatchDeleteJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb new file mode 100644 index 000000000000..bb184ab697d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_BatchUpdateJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the batch_update_jobs call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs. +# +def batch_update_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new + + # Call the batch_update_jobs method. + result = client.batch_update_jobs request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END jobs_v4_generated_JobService_BatchUpdateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb new file mode 100644 index 000000000000..aba1bba6ca7b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_CreateJob_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the create_job call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#create_job. +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateJobRequest.new + + # Call the create_job method. + result = client.create_job request + + # The returned object is of type Google::Cloud::Talent::V4::Job. + p result +end +# [END jobs_v4_generated_JobService_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb new file mode 100644 index 000000000000..1391253de76b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_DeleteJob_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the delete_job call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#delete_job. +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::DeleteJobRequest.new + + # Call the delete_job method. + result = client.delete_job request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END jobs_v4_generated_JobService_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb new file mode 100644 index 000000000000..16f9c7382f55 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_GetJob_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the get_job call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#get_job. +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::Talent::V4::Job. + p result +end +# [END jobs_v4_generated_JobService_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb new file mode 100644 index 000000000000..2445a495de35 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_ListJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the list_jobs call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#list_jobs. +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::ListJobsRequest.new + + # Call the list_jobs method. + result = client.list_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Talent::V4::Job. + p item + end +end +# [END jobs_v4_generated_JobService_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb new file mode 100644 index 000000000000..6b29ad36b790 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_SearchJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the search_jobs call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#search_jobs. +# +def search_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::SearchJobsRequest.new + + # Call the search_jobs method. + result = client.search_jobs request + + # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + p result +end +# [END jobs_v4_generated_JobService_SearchJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb new file mode 100644 index 000000000000..3e422ee69d93 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_SearchJobsForAlert_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the search_jobs_for_alert call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert. +# +def search_jobs_for_alert + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::SearchJobsRequest.new + + # Call the search_jobs_for_alert method. + result = client.search_jobs_for_alert request + + # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + p result +end +# [END jobs_v4_generated_JobService_SearchJobsForAlert_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb new file mode 100644 index 000000000000..7be182860d89 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_JobService_UpdateJob_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the update_job call in the JobService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#update_job. +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::UpdateJobRequest.new + + # Call the update_job method. + result = client.update_job request + + # The returned object is of type Google::Cloud::Talent::V4::Job. + p result +end +# [END jobs_v4_generated_JobService_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json b/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json new file mode 100644 index 000000000000..282652fed372 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json @@ -0,0 +1,895 @@ +{ + "client_library": { + "name": "google-cloud-talent-v4", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.talent.v4", + "version": "v4" + } + ] + }, + "snippets": [ + { + "region_tag": "jobs_v4_generated_CompanyService_CreateCompany_sync", + "title": "Snippet for the create_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#create_company.", + "file": "company_service/create_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_company", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#create_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CreateCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Company", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "CreateCompany", + "full_name": "google.cloud.talent.v4.CompanyService.CreateCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_CompanyService_GetCompany_sync", + "title": "Snippet for the get_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#get_company.", + "file": "company_service/get_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_company", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#get_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::GetCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Company", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "GetCompany", + "full_name": "google.cloud.talent.v4.CompanyService.GetCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_CompanyService_UpdateCompany_sync", + "title": "Snippet for the update_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#update_company.", + "file": "company_service/update_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_company", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#update_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::UpdateCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Company", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "UpdateCompany", + "full_name": "google.cloud.talent.v4.CompanyService.UpdateCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_CompanyService_DeleteCompany_sync", + "title": "Snippet for the delete_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#delete_company.", + "file": "company_service/delete_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_company", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#delete_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::DeleteCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "DeleteCompany", + "full_name": "google.cloud.talent.v4.CompanyService.DeleteCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_CompanyService_ListCompanies_sync", + "title": "Snippet for the list_companies call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#list_companies.", + "file": "company_service/list_companies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_companies", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#list_companies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::ListCompaniesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::ListCompaniesResponse", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "ListCompanies", + "full_name": "google.cloud.talent.v4.CompanyService.ListCompanies", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_Completion_CompleteQuery_sync", + "title": "Snippet for the complete_query call in the Completion service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::Completion::Client#complete_query.", + "file": "completion/complete_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "complete_query", + "full_name": "::Google::Cloud::Talent::V4::Completion::Client#complete_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CompleteQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::CompleteQueryResponse", + "client": { + "short_name": "Completion::Client", + "full_name": "::Google::Cloud::Talent::V4::Completion::Client" + }, + "method": { + "short_name": "CompleteQuery", + "full_name": "google.cloud.talent.v4.Completion.CompleteQuery", + "service": { + "short_name": "Completion", + "full_name": "google.cloud.talent.v4.Completion" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_EventService_CreateClientEvent_sync", + "title": "Snippet for the create_client_event call in the EventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::EventService::Client#create_client_event.", + "file": "event_service/create_client_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_client_event", + "full_name": "::Google::Cloud::Talent::V4::EventService::Client#create_client_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CreateClientEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::ClientEvent", + "client": { + "short_name": "EventService::Client", + "full_name": "::Google::Cloud::Talent::V4::EventService::Client" + }, + "method": { + "short_name": "CreateClientEvent", + "full_name": "google.cloud.talent.v4.EventService.CreateClientEvent", + "service": { + "short_name": "EventService", + "full_name": "google.cloud.talent.v4.EventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_CreateJob_sync", + "title": "Snippet for the create_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#create_job.", + "file": "job_service/create_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_job", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#create_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CreateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Job", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "CreateJob", + "full_name": "google.cloud.talent.v4.JobService.CreateJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_BatchCreateJobs_sync", + "title": "Snippet for the batch_create_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs.", + "file": "job_service/batch_create_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::BatchCreateJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "BatchCreateJobs", + "full_name": "google.cloud.talent.v4.JobService.BatchCreateJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_GetJob_sync", + "title": "Snippet for the get_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#get_job.", + "file": "job_service/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Job", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.talent.v4.JobService.GetJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_UpdateJob_sync", + "title": "Snippet for the update_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#update_job.", + "file": "job_service/update_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_job", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#update_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::UpdateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Job", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "UpdateJob", + "full_name": "google.cloud.talent.v4.JobService.UpdateJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_BatchUpdateJobs_sync", + "title": "Snippet for the batch_update_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs.", + "file": "job_service/batch_update_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_update_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::BatchUpdateJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "BatchUpdateJobs", + "full_name": "google.cloud.talent.v4.JobService.BatchUpdateJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_DeleteJob_sync", + "title": "Snippet for the delete_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#delete_job.", + "file": "job_service/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.talent.v4.JobService.DeleteJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_BatchDeleteJobs_sync", + "title": "Snippet for the batch_delete_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs.", + "file": "job_service/batch_delete_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_delete_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::BatchDeleteJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "BatchDeleteJobs", + "full_name": "google.cloud.talent.v4.JobService.BatchDeleteJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_ListJobs_sync", + "title": "Snippet for the list_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#list_jobs.", + "file": "job_service/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::ListJobsResponse", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.talent.v4.JobService.ListJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_SearchJobs_sync", + "title": "Snippet for the search_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#search_jobs.", + "file": "job_service/search_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#search_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::SearchJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::SearchJobsResponse", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "SearchJobs", + "full_name": "google.cloud.talent.v4.JobService.SearchJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_SearchJobsForAlert_sync", + "title": "Snippet for the search_jobs_for_alert call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert.", + "file": "job_service/search_jobs_for_alert.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_jobs_for_alert", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::SearchJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::SearchJobsResponse", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "SearchJobsForAlert", + "full_name": "google.cloud.talent.v4.JobService.SearchJobsForAlert", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_CreateTenant_sync", + "title": "Snippet for the create_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#create_tenant.", + "file": "tenant_service/create_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tenant", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#create_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CreateTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Tenant", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "CreateTenant", + "full_name": "google.cloud.talent.v4.TenantService.CreateTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_GetTenant_sync", + "title": "Snippet for the get_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#get_tenant.", + "file": "tenant_service/get_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tenant", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#get_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::GetTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Tenant", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "GetTenant", + "full_name": "google.cloud.talent.v4.TenantService.GetTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_UpdateTenant_sync", + "title": "Snippet for the update_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#update_tenant.", + "file": "tenant_service/update_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tenant", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#update_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::UpdateTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Tenant", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "UpdateTenant", + "full_name": "google.cloud.talent.v4.TenantService.UpdateTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_DeleteTenant_sync", + "title": "Snippet for the delete_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#delete_tenant.", + "file": "tenant_service/delete_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tenant", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#delete_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::DeleteTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "DeleteTenant", + "full_name": "google.cloud.talent.v4.TenantService.DeleteTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_ListTenants_sync", + "title": "Snippet for the list_tenants call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#list_tenants.", + "file": "tenant_service/list_tenants.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tenants", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#list_tenants", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::ListTenantsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::ListTenantsResponse", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "ListTenants", + "full_name": "google.cloud.talent.v4.TenantService.ListTenants", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "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-talent-v4/snippets/tenant_service/create_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb new file mode 100644 index 000000000000..665aba99974d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_TenantService_CreateTenant_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the create_tenant call in the TenantService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#create_tenant. +# +def create_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateTenantRequest.new + + # Call the create_tenant method. + result = client.create_tenant request + + # The returned object is of type Google::Cloud::Talent::V4::Tenant. + p result +end +# [END jobs_v4_generated_TenantService_CreateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb new file mode 100644 index 000000000000..f0ee2dc8605a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_TenantService_DeleteTenant_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the delete_tenant call in the TenantService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#delete_tenant. +# +def delete_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::DeleteTenantRequest.new + + # Call the delete_tenant method. + result = client.delete_tenant request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END jobs_v4_generated_TenantService_DeleteTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb new file mode 100644 index 000000000000..92928f5b47d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_TenantService_GetTenant_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the get_tenant call in the TenantService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#get_tenant. +# +def get_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::GetTenantRequest.new + + # Call the get_tenant method. + result = client.get_tenant request + + # The returned object is of type Google::Cloud::Talent::V4::Tenant. + p result +end +# [END jobs_v4_generated_TenantService_GetTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb new file mode 100644 index 000000000000..4cfc79e6fc24 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_TenantService_ListTenants_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the list_tenants call in the TenantService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#list_tenants. +# +def list_tenants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::ListTenantsRequest.new + + # Call the list_tenants method. + result = client.list_tenants request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Talent::V4::Tenant. + p item + end +end +# [END jobs_v4_generated_TenantService_ListTenants_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb new file mode 100644 index 000000000000..19154714e44b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START jobs_v4_generated_TenantService_UpdateTenant_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the update_tenant call in the TenantService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#update_tenant. +# +def update_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::UpdateTenantRequest.new + + # Call the update_tenant method. + result = client.update_tenant request + + # The returned object is of type Google::Cloud::Talent::V4::Tenant. + p result +end +# [END jobs_v4_generated_TenantService_UpdateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb new file mode 100644 index 000000000000..51d748c725d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_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/talent/v4/company_service" + +class ::Google::Cloud::Talent::V4::CompanyService::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_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.company_path project: "value0", tenant: "value1", company: "value2" + assert_equal "projects/value0/tenants/value1/companies/value2", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb new file mode 100644 index 000000000000..55e30df49147 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/talent/v4/company_service_pb" +require "google/cloud/talent/v4/company_service/rest" + + +class ::Google::Cloud::Talent::V4::CompanyService::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_company + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Company.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + company = {} + + create_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_create_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_company({ parent: parent, company: company }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_company parent: parent, company: company do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_company ::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_company({ parent: parent, company: company }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_company(::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_company_client_stub.call_count + end + end + end + + def test_get_company + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Company.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_get_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_company({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_company name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_company ::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_company({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_company(::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_company_client_stub.call_count + end + end + end + + def test_update_company + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Company.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + company = {} + update_mask = {} + + update_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_update_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_company({ company: company, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_company company: company, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_company ::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_company({ company: company, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_company(::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_company_client_stub.call_count + end + end + end + + def test_delete_company + # 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_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_delete_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_company({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_company name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_company ::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_company({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_company(::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_company_client_stub.call_count + end + end + end + + def test_list_companies + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + require_open_jobs = true + + list_companies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_list_companies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_companies_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_companies ::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_companies(::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_companies_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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb new file mode 100644 index 000000000000..e4827e8d8ef9 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb @@ -0,0 +1,409 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/talent/v4/company_service_pb" +require "google/cloud/talent/v4/company_service" + +class ::Google::Cloud::Talent::V4::CompanyService::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_company + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Company.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + company = {} + + create_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_company, name + assert_kind_of ::Google::Cloud::Talent::V4::CreateCompanyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Company), request["company"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_company({ parent: parent, company: company }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_company parent: parent, company: company do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_company ::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_company({ parent: parent, company: company }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_company(::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_company_client_stub.call_rpc_count + end + end + + def test_get_company + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Company.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_company, name + assert_kind_of ::Google::Cloud::Talent::V4::GetCompanyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_company({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_company name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_company ::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_company({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_company(::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_company_client_stub.call_rpc_count + end + end + + def test_update_company + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Company.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + company = {} + update_mask = {} + + update_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_company, name + assert_kind_of ::Google::Cloud::Talent::V4::UpdateCompanyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Company), request["company"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_company({ company: company, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_company company: company, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_company ::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, 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_company({ company: company, 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_company(::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, 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_company_client_stub.call_rpc_count + end + end + + def test_delete_company + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_company, name + assert_kind_of ::Google::Cloud::Talent::V4::DeleteCompanyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_company({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_company name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_company ::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_company({ 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_company(::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(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_company_client_stub.call_rpc_count + end + end + + def test_list_companies + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::ListCompaniesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + require_open_jobs = true + + list_companies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_companies, name + assert_kind_of ::Google::Cloud::Talent::V4::ListCompaniesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal true, request["require_open_jobs"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_companies_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_companies ::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_companies(::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_companies_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::CompanyService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb new file mode 100644 index 000000000000..aeb6b9d2f969 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_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/talent/v4/completion" + +class ::Google::Cloud::Talent::V4::Completion::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_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.company_path project: "value0", tenant: "value1", company: "value2" + assert_equal "projects/value0/tenants/value1/companies/value2", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb new file mode 100644 index 000000000000..4a17510d2b0d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.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 "helper" +require "gapic/rest" +require "google/cloud/talent/v4/completion_service_pb" +require "google/cloud/talent/v4/completion/rest" + + +class ::Google::Cloud::Talent::V4::Completion::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_complete_query + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + tenant = "hello world" + query = "hello world" + language_codes = ["hello world"] + page_size = 42 + company = "hello world" + scope = :COMPLETION_SCOPE_UNSPECIFIED + type = :COMPLETION_TYPE_UNSPECIFIED + + complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::Completion::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.complete_query tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.complete_query ::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, complete_query_client_stub.call_count + end + end + end + + def test_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::Talent::V4::Completion::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::Talent::V4::Completion::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb new file mode 100644 index 000000000000..1099c4c1ade7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/talent/v4/completion_service_pb" +require "google/cloud/talent/v4/completion" + +class ::Google::Cloud::Talent::V4::Completion::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_complete_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::CompleteQueryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + tenant = "hello world" + query = "hello world" + language_codes = ["hello world"] + page_size = 42 + company = "hello world" + scope = :COMPLETION_SCOPE_UNSPECIFIED + type = :COMPLETION_TYPE_UNSPECIFIED + + complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :complete_query, name + assert_kind_of ::Google::Cloud::Talent::V4::CompleteQueryRequest, request + assert_equal "hello world", request["tenant"] + assert_equal "hello world", request["query"] + assert_equal ["hello world"], request["language_codes"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["company"] + assert_equal :COMPLETION_SCOPE_UNSPECIFIED, request["scope"] + assert_equal :COMPLETION_TYPE_UNSPECIFIED, request["type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.complete_query tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.complete_query ::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, complete_query_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::Completion::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::Talent::V4::Completion::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::Talent::V4::Completion::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::Completion::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb new file mode 100644 index 000000000000..9812de9567dd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/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/talent/v4/event_service" + +class ::Google::Cloud::Talent::V4::EventService::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_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb new file mode 100644 index 000000000000..9d149f603fb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/talent/v4/event_service_pb" +require "google/cloud/talent/v4/event_service/rest" + + +class ::Google::Cloud::Talent::V4::EventService::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_client_event + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::ClientEvent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + client_event = {} + + create_client_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::Talent::V4::EventService::Rest::ServiceStub.stub :transcode_create_client_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_client_event_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_client_event({ parent: parent, client_event: client_event }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_client_event parent: parent, client_event: client_event do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_client_event ::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_client_event({ parent: parent, client_event: client_event }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_client_event(::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_client_event_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::Talent::V4::EventService::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::Talent::V4::EventService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb new file mode 100644 index 000000000000..90ae40a15d96 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/talent/v4/event_service_pb" +require "google/cloud/talent/v4/event_service" + +class ::Google::Cloud::Talent::V4::EventService::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_client_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::ClientEvent.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + client_event = {} + + create_client_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_client_event, name + assert_kind_of ::Google::Cloud::Talent::V4::CreateClientEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::ClientEvent), request["client_event"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_client_event_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_client_event({ parent: parent, client_event: client_event }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_client_event parent: parent, client_event: client_event do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_client_event ::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_client_event({ parent: parent, client_event: client_event }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_client_event(::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_client_event_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::EventService::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::Talent::V4::EventService::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::Talent::V4::EventService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::EventService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb new file mode 100644 index 000000000000..21555365b3e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_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/talent/v4/job_service_pb" +require "google/cloud/talent/v4/job_service_services_pb" +require "google/cloud/talent/v4/job_service" + +class ::Google::Cloud::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb new file mode 100644 index 000000000000..c7a1a286edc7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/talent/v4/job_service" + +class ::Google::Cloud::Talent::V4::JobService::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_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.company_path project: "value0", tenant: "value1", company: "value2" + assert_equal "projects/value0/tenants/value1/companies/value2", path + end + end + + def test_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", tenant: "value1", job: "value2" + assert_equal "projects/value0/tenants/value1/jobs/value2", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb new file mode 100644 index 000000000000..f898410562ca --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb @@ -0,0 +1,679 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/talent/v4/job_service_pb" +require "google/cloud/talent/v4/job_service/rest" + + +class ::Google::Cloud::Talent::V4::JobService::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_job + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_job parent: parent, job: job do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_job ::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_count + end + end + end + + def test_batch_create_jobs + # Create test objects. + 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" + jobs = [{}] + + batch_create_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_create_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_create_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_create_jobs({ parent: parent, jobs: jobs }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_create_jobs parent: parent, jobs: jobs do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_create_jobs ::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_create_jobs({ parent: parent, jobs: jobs }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_create_jobs(::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_create_jobs_client_stub.call_count + end + end + end + + def test_get_job + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_job ::Google::Cloud::Talent::V4::GetJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Talent::V4::GetJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_count + end + end + end + + def test_update_job + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_job job: job, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_job ::Google::Cloud::Talent::V4::UpdateJobRequest.new(job: job, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_job({ job: job, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Talent::V4::UpdateJobRequest.new(job: job, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_count + end + end + end + + def test_batch_update_jobs + # Create test objects. + 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" + jobs = [{}] + update_mask = {} + + batch_update_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_update_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_update_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_update_jobs ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_update_jobs(::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_update_jobs_client_stub.call_count + end + end + end + + def test_delete_job + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_count + end + end + end + + def test_batch_delete_jobs + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + names = ["hello world"] + + batch_delete_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_delete_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_delete_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_delete_jobs({ parent: parent, names: names }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_delete_jobs parent: parent, names: names do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_delete_jobs ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_delete_jobs({ parent: parent, names: names }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_delete_jobs(::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_delete_jobs_client_stub.call_count + end + end + end + + def test_list_jobs + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::ListJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + job_view = :JOB_VIEW_UNSPECIFIED + + list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_jobs parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_count + end + end + end + + def test_search_jobs + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::SearchJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + max_page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_search_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_jobs ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_jobs(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_jobs_client_stub.call_count + end + end + end + + def test_search_jobs_for_alert + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::SearchJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + max_page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_search_jobs_for_alert_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_jobs_for_alert_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_jobs_for_alert ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_jobs_for_alert(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_jobs_for_alert_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::Talent::V4::JobService::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::Talent::V4::JobService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb new file mode 100644 index 000000000000..d450c7816e63 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb @@ -0,0 +1,798 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/talent/v4/job_service_pb" +require "google/cloud/talent/v4/job_service" + +class ::Google::Cloud::Talent::V4::JobService::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_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_job, name + assert_kind_of ::Google::Cloud::Talent::V4::CreateJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Job), request["job"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_job parent: parent, job: job do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_job ::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_rpc_count + end + end + + def test_batch_create_jobs + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + jobs = [{}] + + batch_create_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::BatchCreateJobsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Talent::V4::Job, request["jobs"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_jobs({ parent: parent, jobs: jobs }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_create_jobs parent: parent, jobs: jobs do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_create_jobs ::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_create_jobs({ parent: parent, jobs: jobs }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_create_jobs(::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_create_jobs_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_job, name + assert_kind_of ::Google::Cloud::Talent::V4::GetJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::Talent::V4::GetJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Talent::V4::GetJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_rpc_count + end + end + + def test_update_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_job, name + assert_kind_of ::Google::Cloud::Talent::V4::UpdateJobRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Job), request["job"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_job job: job, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_job ::Google::Cloud::Talent::V4::UpdateJobRequest.new(job: job, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_job({ job: job, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Talent::V4::UpdateJobRequest.new(job: job, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_rpc_count + end + end + + def test_batch_update_jobs + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + jobs = [{}] + update_mask = {} + + batch_update_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_update_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Talent::V4::Job, request["jobs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_update_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_update_jobs({ parent: parent, jobs: jobs, 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.batch_update_jobs parent: parent, jobs: jobs, 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.batch_update_jobs ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, 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.batch_update_jobs({ parent: parent, jobs: jobs, 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.batch_update_jobs(::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, 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, batch_update_jobs_client_stub.call_rpc_count + end + end + + def test_delete_job + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_job, name + assert_kind_of ::Google::Cloud::Talent::V4::DeleteJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_rpc_count + end + end + + def test_batch_delete_jobs + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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"] + + batch_delete_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_delete_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["names"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_delete_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_delete_jobs({ parent: parent, names: names }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_delete_jobs parent: parent, names: names do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_delete_jobs ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_delete_jobs({ parent: parent, names: names }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_delete_jobs(::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_delete_jobs_client_stub.call_rpc_count + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::ListJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + job_view = :JOB_VIEW_UNSPECIFIED + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::ListJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_jobs parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_rpc_count + end + end + + def test_search_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::SearchJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + max_page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::SearchJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::RequestMetadata), request["request_metadata"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::JobQuery), request["job_query"] + assert_equal true, request["enable_broadening"] + assert_kind_of ::Google::Cloud::Talent::V4::HistogramQuery, request["histogram_queries"].first + assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] + assert_equal 42, request["offset"] + assert_equal 42, request["max_page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] + assert_equal true, request["disable_keyword_match"] + assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] + assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_jobs ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_jobs(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_jobs_client_stub.call_rpc_count + end + end + + def test_search_jobs_for_alert + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::SearchJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + max_page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_for_alert_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_jobs_for_alert, name + assert_kind_of ::Google::Cloud::Talent::V4::SearchJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::RequestMetadata), request["request_metadata"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::JobQuery), request["job_query"] + assert_equal true, request["enable_broadening"] + assert_kind_of ::Google::Cloud::Talent::V4::HistogramQuery, request["histogram_queries"].first + assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] + assert_equal 42, request["offset"] + assert_equal 42, request["max_page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] + assert_equal true, request["disable_keyword_match"] + assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] + assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_jobs_for_alert_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_jobs_for_alert ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_jobs_for_alert(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_jobs_for_alert_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::JobService::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::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Talent::V4::JobService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb new file mode 100644 index 000000000000..0b082784d6bd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_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/talent/v4/tenant_service" + +class ::Google::Cloud::Talent::V4::TenantService::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::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb new file mode 100644 index 000000000000..ea21ef440774 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb @@ -0,0 +1,373 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/talent/v4/tenant_service_pb" +require "google/cloud/talent/v4/tenant_service/rest" + + +class ::Google::Cloud::Talent::V4::TenantService::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_tenant + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tenant = {} + + create_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_create_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tenant({ parent: parent, tenant: tenant }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tenant parent: parent, tenant: tenant do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tenant ::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tenant({ parent: parent, tenant: tenant }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tenant(::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tenant_client_stub.call_count + end + end + end + + def test_get_tenant + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_get_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_tenant({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_tenant name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_tenant ::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_tenant({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_tenant(::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_tenant_client_stub.call_count + end + end + end + + def test_update_tenant + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + tenant = {} + update_mask = {} + + update_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_update_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tenant tenant: tenant, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tenant ::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_tenant({ tenant: tenant, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_tenant(::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tenant_client_stub.call_count + end + end + end + + def test_delete_tenant + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_delete_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tenant({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tenant name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tenant ::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tenant({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tenant(::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tenant_client_stub.call_count + end + end + end + + def test_list_tenants + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::ListTenantsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_tenants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_list_tenants_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tenants_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_tenants parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_tenants ::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_tenants(::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_tenants_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::Talent::V4::TenantService::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::Talent::V4::TenantService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb new file mode 100644 index 000000000000..9f48a5264f89 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb @@ -0,0 +1,407 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/talent/v4/tenant_service_pb" +require "google/cloud/talent/v4/tenant_service" + +class ::Google::Cloud::Talent::V4::TenantService::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_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Tenant.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tenant = {} + + create_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4::CreateTenantRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Tenant), request["tenant"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tenant({ parent: parent, tenant: tenant }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_tenant parent: parent, tenant: tenant do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_tenant ::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_tenant({ parent: parent, tenant: tenant }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_tenant(::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_tenant_client_stub.call_rpc_count + end + end + + def test_get_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Tenant.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4::GetTenantRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tenant({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tenant name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tenant ::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_tenant({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_tenant(::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_tenant_client_stub.call_rpc_count + end + end + + def test_update_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Tenant.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + tenant = {} + update_mask = {} + + update_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4::UpdateTenantRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Tenant), request["tenant"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_tenant tenant: tenant, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_tenant ::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_tenant({ tenant: tenant, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_tenant(::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_tenant_client_stub.call_rpc_count + end + end + + def test_delete_tenant + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4::DeleteTenantRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tenant({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_tenant name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_tenant ::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_tenant({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_tenant(::Google::Cloud::Talent::V4::DeleteTenantRequest.new(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_tenant_client_stub.call_rpc_count + end + end + + def test_list_tenants + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::ListTenantsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_tenants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tenants, name + assert_kind_of ::Google::Cloud::Talent::V4::ListTenantsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_tenants_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_tenants parent: parent, page_token: page_token, page_size: page_size do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_tenants ::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_tenants(::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_tenants_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::TenantService::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::Talent::V4::TenantService::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::Talent::V4::TenantService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::TenantService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/helper.rb b/owl-bot-staging/google-cloud-talent-v4/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" From cb7bbc3963fc10e4bb1be05640eb17b49ae83659 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Mar 2026 21:23:41 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/auth.rb | 1 + .../proto_docs/google/api/backend.rb | 11 + .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/control.rb | 4 +- .../proto_docs/google/api/service.rb | 3 +- .../proto_docs/google/api/usage.rb | 32 +- .../proto_docs/google/api/auth.rb | 1 + .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/usage.rb | 32 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/routing.rb | 10 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../proto_docs/google/api/client.rb | 174 +- .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-service_control-v1/.toys.rb | 28 - .../google-cloud-service_control-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-service_control-v1/Gemfile | 14 - .../LICENSE.md | 201 - .../google-cloud-service_control-v1/README.md | 154 - .../google-cloud-service_control-v1/Rakefile | 169 - .../gapic_metadata.json | 42 - .../google-cloud-service_control-v1.gemspec | 28 - .../lib/google-cloud-service_control-v1.rb | 21 - .../api/servicecontrol/v1/check_error_pb.rb | 24 - .../api/servicecontrol/v1/distribution_pb.rb | 26 - .../api/servicecontrol/v1/http_request_pb.rb | 23 - .../api/servicecontrol/v1/log_entry_pb.rb | 29 - .../api/servicecontrol/v1/metric_value_pb.rb | 25 - .../api/servicecontrol/v1/operation_pb.rb | 27 - .../servicecontrol/v1/quota_controller_pb.rb | 31 - .../v1/quota_controller_services_pb.rb | 58 - .../v1/service_controller_pb.rb | 34 - .../v1/service_controller_services_pb.rb | 80 - .../lib/google/cloud/service_control/v1.rb | 46 - .../service_control/v1/quota_controller.rb | 57 - .../v1/quota_controller/client.rb | 494 --- .../v1/quota_controller/credentials.rb | 52 - .../v1/quota_controller/rest.rb | 54 - .../v1/quota_controller/rest/client.rb | 444 -- .../v1/quota_controller/rest/service_stub.rb | 143 - .../google/cloud/service_control/v1/rest.rb | 38 - .../service_control/v1/service_controller.rb | 57 - .../v1/service_controller/client.rb | 640 --- .../v1/service_controller/credentials.rb | 52 - .../v1/service_controller/rest.rb | 54 - .../v1/service_controller/rest/client.rb | 583 --- .../service_controller/rest/service_stub.rb | 205 - .../cloud/service_control/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/distribution.rb | 233 -- .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../api/servicecontrol/v1/check_error.rb | 125 - .../api/servicecontrol/v1/distribution.rb | 157 - .../api/servicecontrol/v1/http_request.rb | 95 - .../google/api/servicecontrol/v1/log_entry.rb | 142 - .../api/servicecontrol/v1/metric_value.rb | 98 - .../google/api/servicecontrol/v1/operation.rb | 130 - .../api/servicecontrol/v1/quota_controller.rb | 232 -- .../servicecontrol/v1/service_controller.rb | 217 - .../google/logging/type/log_severity.rb | 71 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - .../quota_controller/allocate_quota.rb | 47 - .../snippets/service_controller/check.rb | 47 - .../snippets/service_controller/report.rb | 47 - ...metadata_google.api.servicecontrol.v1.json | 135 - .../v1/quota_controller_rest_test.rb | 155 - .../v1/quota_controller_test.rb | 166 - .../v1/service_controller_rest_test.rb | 211 - .../v1/service_controller_test.rb | 228 - .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-service_directory-v1/Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 122 - .../google-cloud-service_directory-v1.gemspec | 30 - .../lib/google-cloud-service_directory-v1.rb | 21 - .../lib/google/cloud/service_directory/v1.rb | 46 - .../service_directory/v1/bindings_override.rb | 75 - .../service_directory/v1/lookup_service.rb | 55 - .../v1/lookup_service/client.rb | 538 --- .../v1/lookup_service/credentials.rb | 51 - .../v1/lookup_service/paths.rb | 54 - .../v1/lookup_service/rest.rb | 53 - .../v1/lookup_service/rest/client.rb | 496 --- .../v1/lookup_service/rest/service_stub.rb | 143 - .../v1/registration_service.rb | 69 - .../v1/registration_service/client.rb | 2297 ----------- .../v1/registration_service/credentials.rb | 51 - .../v1/registration_service/paths.rb | 130 - .../v1/registration_service/rest.rb | 67 - .../v1/registration_service/rest/client.rb | 2136 ---------- .../registration_service/rest/service_stub.rb | 1212 ------ .../google/cloud/service_directory/v1/rest.rb | 39 - .../cloud/service_directory/v1/version.rb | 28 - .../cloud/servicedirectory/v1/endpoint_pb.rb | 24 - .../servicedirectory/v1/lookup_service_pb.rb | 28 - .../v1/lookup_service_services_pb.rb | 47 - .../cloud/servicedirectory/v1/namespace_pb.rb | 24 - .../v1/registration_service_pb.rb | 50 - .../v1/registration_service_services_pb.rb | 95 - .../cloud/servicedirectory/v1/service_pb.rb | 25 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/servicedirectory/v1/endpoint.rb | 97 - .../servicedirectory/v1/lookup_service.rb | 89 - .../cloud/servicedirectory/v1/namespace.rb | 56 - .../v1/registration_service.rb | 425 -- .../cloud/servicedirectory/v1/service.rb | 80 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 -- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../lookup_service/resolve_service.rb | 47 - .../registration_service/create_endpoint.rb | 47 - .../registration_service/create_namespace.rb | 47 - .../registration_service/create_service.rb | 47 - .../registration_service/delete_endpoint.rb | 47 - .../registration_service/delete_namespace.rb | 47 - .../registration_service/delete_service.rb | 47 - .../registration_service/get_endpoint.rb | 47 - .../registration_service/get_iam_policy.rb | 47 - .../registration_service/get_namespace.rb | 47 - .../registration_service/get_service.rb | 47 - .../registration_service/list_endpoints.rb | 51 - .../registration_service/list_namespaces.rb | 51 - .../registration_service/list_services.rb | 51 - .../registration_service/set_iam_policy.rb | 47 - .../test_iam_permissions.rb | 47 - .../registration_service/update_endpoint.rb | 47 - .../registration_service/update_namespace.rb | 47 - .../registration_service/update_service.rb | 47 - ...data_google.cloud.servicedirectory.v1.json | 775 ---- .../v1/lookup_service_paths_test.rb | 55 - .../v1/lookup_service_rest_test.rb | 155 - .../v1/lookup_service_test.rb | 166 - .../v1/registration_service_paths_test.rb | 103 - .../v1/registration_service_rest_test.rb | 1096 ----- .../v1/registration_service_test.rb | 1213 ------ .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 122 - ...le-cloud-service_directory-v1beta1.gemspec | 30 - .../google-cloud-service_directory-v1beta1.rb | 21 - .../google/cloud/service_directory/v1beta1.rb | 46 - .../v1beta1/bindings_override.rb | 75 - .../v1beta1/lookup_service.rb | 55 - .../v1beta1/lookup_service/client.rb | 538 --- .../v1beta1/lookup_service/credentials.rb | 51 - .../v1beta1/lookup_service/paths.rb | 54 - .../v1beta1/lookup_service/rest.rb | 53 - .../v1beta1/lookup_service/rest/client.rb | 496 --- .../lookup_service/rest/service_stub.rb | 143 - .../v1beta1/registration_service.rb | 69 - .../v1beta1/registration_service/client.rb | 2305 ----------- .../registration_service/credentials.rb | 51 - .../v1beta1/registration_service/paths.rb | 130 - .../v1beta1/registration_service/rest.rb | 67 - .../registration_service/rest/client.rb | 2144 ---------- .../registration_service/rest/service_stub.rb | 1236 ------ .../cloud/service_directory/v1beta1/rest.rb | 39 - .../service_directory/v1beta1/version.rb | 28 - .../servicedirectory/v1beta1/endpoint_pb.rb | 25 - .../v1beta1/lookup_service_pb.rb | 28 - .../v1beta1/lookup_service_services_pb.rb | 47 - .../servicedirectory/v1beta1/namespace_pb.rb | 25 - .../v1beta1/registration_service_pb.rb | 50 - .../registration_service_services_pb.rb | 96 - .../servicedirectory/v1beta1/service_pb.rb | 26 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../servicedirectory/v1beta1/endpoint.rb | 103 - .../v1beta1/lookup_service.rb | 89 - .../servicedirectory/v1beta1/namespace.rb | 62 - .../v1beta1/registration_service.rb | 432 -- .../cloud/servicedirectory/v1beta1/service.rb | 88 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 -- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../lookup_service/resolve_service.rb | 47 - .../registration_service/create_endpoint.rb | 47 - .../registration_service/create_namespace.rb | 47 - .../registration_service/create_service.rb | 47 - .../registration_service/delete_endpoint.rb | 47 - .../registration_service/delete_namespace.rb | 47 - .../registration_service/delete_service.rb | 47 - .../registration_service/get_endpoint.rb | 47 - .../registration_service/get_iam_policy.rb | 47 - .../registration_service/get_namespace.rb | 47 - .../registration_service/get_service.rb | 47 - .../registration_service/list_endpoints.rb | 51 - .../registration_service/list_namespaces.rb | 51 - .../registration_service/list_services.rb | 51 - .../registration_service/set_iam_policy.rb | 47 - .../test_iam_permissions.rb | 47 - .../registration_service/update_endpoint.rb | 47 - .../registration_service/update_namespace.rb | 47 - .../registration_service/update_service.rb | 47 - ...google.cloud.servicedirectory.v1beta1.json | 775 ---- .../v1beta1/lookup_service_paths_test.rb | 55 - .../v1beta1/lookup_service_rest_test.rb | 155 - .../v1beta1/lookup_service_test.rb | 166 - .../registration_service_paths_test.rb | 103 - .../v1beta1/registration_service_rest_test.rb | 1096 ----- .../v1beta1/registration_service_test.rb | 1213 ------ .../test/helper.rb | 26 - .../google-cloud-service_health-v1/.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-service_health-v1/.toys.rb | 28 - .../google-cloud-service_health-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-service_health-v1/Gemfile | 14 - .../google-cloud-service_health-v1/LICENSE.md | 201 - .../google-cloud-service_health-v1/README.md | 154 - .../google-cloud-service_health-v1/Rakefile | 169 - .../gapic_metadata.json | 48 - .../google-cloud-service_health-v1.gemspec | 29 - .../lib/google-cloud-service_health-v1.rb | 21 - .../lib/google/cloud/service_health/v1.rb | 45 - .../service_health/v1/bindings_override.rb | 75 - .../google/cloud/service_health/v1/rest.rb | 38 - .../cloud/service_health/v1/service_health.rb | 55 - .../v1/service_health/client.rb | 1142 ----- .../v1/service_health/credentials.rb | 47 - .../service_health/v1/service_health/paths.rb | 124 - .../service_health/v1/service_health/rest.rb | 53 - .../v1/service_health/rest/client.rb | 1065 ----- .../v1/service_health/rest/service_stub.rb | 447 -- .../google/cloud/service_health/v1/version.rb | 28 - .../servicehealth/v1/event_resources_pb.rb | 52 - .../servicehealth/v1/event_service_pb.rb | 24 - .../v1/event_service_services_pb.rb | 58 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/servicehealth/v1/event_resources.rb | 718 ---- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../snippets/Gemfile | 32 - .../snippets/service_health/get_event.rb | 47 - .../service_health/get_organization_event.rb | 47 - .../service_health/get_organization_impact.rb | 47 - .../snippets/service_health/list_events.rb | 51 - .../list_organization_events.rb | 51 - .../list_organization_impacts.rb | 51 - ...etadata_google.cloud.servicehealth.v1.json | 255 -- .../v1/service_health_paths_test.rb | 103 - .../v1/service_health_rest_test.rb | 434 -- .../service_health/v1/service_health_test.rb | 489 --- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 153 - .../Rakefile | 169 - .../gapic_metadata.json | 83 - ...google-cloud-service_management-v1.gemspec | 29 - .../lib/google-cloud-service_management-v1.rb | 21 - .../api/servicemanagement/v1/resources_pb.rb | 39 - .../servicemanagement/v1/servicemanager_pb.rb | 50 - .../v1/servicemanager_services_pb.rb | 143 - .../lib/google/cloud/service_management/v1.rb | 45 - .../v1/bindings_override.rb | 110 - .../cloud/service_management/v1/rest.rb | 38 - .../service_management/v1/service_manager.rb | 56 - .../v1/service_manager/client.rb | 1809 -------- .../v1/service_manager/credentials.rb | 54 - .../v1/service_manager/operations.rb | 833 ---- .../v1/service_manager/rest.rb | 54 - .../v1/service_manager/rest/client.rb | 1701 -------- .../v1/service_manager/rest/operations.rb | 923 ----- .../v1/service_manager/rest/service_stub.rb | 882 ---- .../cloud/service_management/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/auth.rb | 259 -- .../proto_docs/google/api/backend.rb | 199 - .../proto_docs/google/api/billing.rb | 82 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/config_change.rb | 89 - .../proto_docs/google/api/context.rb | 97 - .../proto_docs/google/api/control.rb | 41 - .../proto_docs/google/api/documentation.rb | 176 - .../proto_docs/google/api/endpoint.rb | 71 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/label.rb | 49 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/log.rb | 54 - .../proto_docs/google/api/logging.rb | 86 - .../proto_docs/google/api/metric.rb | 299 -- .../google/api/monitored_resource.rb | 150 - .../proto_docs/google/api/monitoring.rb | 112 - .../proto_docs/google/api/policy.rb | 75 - .../proto_docs/google/api/quota.rb | 208 - .../proto_docs/google/api/resource.rb | 227 - .../proto_docs/google/api/service.rb | 170 - .../api/servicemanagement/v1/resources.rb | 332 -- .../servicemanagement/v1/servicemanager.rb | 334 -- .../proto_docs/google/api/source_info.rb | 31 - .../proto_docs/google/api/system_parameter.rb | 104 - .../proto_docs/google/api/usage.rb | 81 - .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/api.rb | 194 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../google/protobuf/source_context.rb | 33 - .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/protobuf/type.rb | 232 -- .../proto_docs/google/protobuf/wrappers.rb | 148 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../service_manager/create_service.rb | 54 - .../service_manager/create_service_config.rb | 47 - .../service_manager/create_service_rollout.rb | 54 - .../service_manager/delete_service.rb | 54 - .../service_manager/generate_config_report.rb | 47 - .../snippets/service_manager/get_service.rb | 47 - .../service_manager/get_service_config.rb | 47 - .../service_manager/get_service_rollout.rb | 47 - .../service_manager/list_service_configs.rb | 51 - .../service_manager/list_service_rollouts.rb | 51 - .../snippets/service_manager/list_services.rb | 51 - .../service_manager/submit_config_source.rb | 54 - .../service_manager/undelete_service.rb | 54 - ...adata_google.api.servicemanagement.v1.json | 535 --- .../v1/service_manager_operations_test.rb | 400 -- .../v1/service_manager_rest_test.rb | 817 ---- .../v1/service_manager_test.rb | 944 ----- .../test/helper.rb | 26 - .../google-cloud-service_usage-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-service_usage-v1/.toys.rb | 28 - .../google-cloud-service_usage-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-service_usage-v1/Gemfile | 14 - .../google-cloud-service_usage-v1/LICENSE.md | 201 - .../google-cloud-service_usage-v1/README.md | 154 - .../google-cloud-service_usage-v1/Rakefile | 169 - .../gapic_metadata.json | 48 - .../google-cloud-service_usage-v1.gemspec | 28 - .../lib/google-cloud-service_usage-v1.rb | 21 - .../api/serviceusage/v1/resources_pb.rb | 34 - .../api/serviceusage/v1/serviceusage_pb.rb | 38 - .../v1/serviceusage_services_pb.rb | 80 - .../lib/google/cloud/service_usage/v1.rb | 45 - .../lib/google/cloud/service_usage/v1/rest.rb | 37 - .../cloud/service_usage/v1/service_usage.rb | 59 - .../service_usage/v1/service_usage/client.rb | 1075 ----- .../v1/service_usage/credentials.rb | 53 - .../v1/service_usage/operations.rb | 833 ---- .../service_usage/v1/service_usage/rest.rb | 56 - .../v1/service_usage/rest/client.rb | 990 ----- .../v1/service_usage/rest/operations.rb | 923 ----- .../v1/service_usage/rest/service_stub.rb | 450 -- .../google/cloud/service_usage/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/auth.rb | 259 -- .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/documentation.rb | 176 - .../proto_docs/google/api/endpoint.rb | 71 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/label.rb | 49 - .../proto_docs/google/api/launch_stage.rb | 71 - .../google/api/monitored_resource.rb | 150 - .../proto_docs/google/api/monitoring.rb | 112 - .../proto_docs/google/api/quota.rb | 208 - .../proto_docs/google/api/resource.rb | 227 - .../google/api/serviceusage/v1/resources.rb | 123 - .../api/serviceusage/v1/serviceusage.rb | 242 -- .../proto_docs/google/api/usage.rb | 81 - .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/api.rb | 194 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../google/protobuf/source_context.rb | 33 - .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/type.rb | 232 -- .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - .../service_usage/batch_enable_services.rb | 54 - .../service_usage/batch_get_services.rb | 47 - .../snippets/service_usage/disable_service.rb | 54 - .../snippets/service_usage/enable_service.rb | 54 - .../snippets/service_usage/get_service.rb | 47 - .../snippets/service_usage/list_services.rb | 51 - ...t_metadata_google.api.serviceusage.v1.json | 255 -- .../v1/service_usage_operations_test.rb | 400 -- .../v1/service_usage_rest_test.rb | 430 -- .../service_usage/v1/service_usage_test.rb | 500 --- .../test/helper.rb | 26 - .../google-cloud-shell-v1/.gitignore | 22 - .../google-cloud-shell-v1/.repo-metadata.json | 18 - .../google-cloud-shell-v1/.rubocop.yml | 33 - .../google-cloud-shell-v1/.toys.rb | 28 - .../google-cloud-shell-v1/.yardopts | 12 - .../google-cloud-shell-v1/AUTHENTICATION.md | 122 - .../google-cloud-shell-v1/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-shell-v1/Gemfile | 14 - .../google-cloud-shell-v1/LICENSE.md | 201 - .../google-cloud-shell-v1/README.md | 154 - .../google-cloud-shell-v1/Rakefile | 169 - .../google-cloud-shell-v1/gapic_metadata.json | 43 - .../google-cloud-shell-v1.gemspec | 28 - .../lib/google-cloud-shell-v1.rb | 21 - .../lib/google/cloud/shell/v1.rb | 45 - .../cloud/shell/v1/cloud_shell_service.rb | 62 - .../shell/v1/cloud_shell_service/client.rb | 954 ----- .../v1/cloud_shell_service/credentials.rb | 51 - .../v1/cloud_shell_service/operations.rb | 841 ---- .../shell/v1/cloud_shell_service/paths.rb | 50 - .../shell/v1/cloud_shell_service/rest.rb | 59 - .../v1/cloud_shell_service/rest/client.rb | 876 ---- .../v1/cloud_shell_service/rest/operations.rb | 925 ----- .../cloud_shell_service/rest/service_stub.rb | 390 -- .../google/cloud/shell/v1/cloudshell_pb.rb | 47 - .../cloud/shell/v1/cloudshell_services_pb.rb | 72 - .../lib/google/cloud/shell/v1/rest.rb | 37 - .../lib/google/cloud/shell/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/shell/v1/cloudshell.rb | 331 -- .../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/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../google-cloud-shell-v1/snippets/Gemfile | 32 - .../cloud_shell_service/add_public_key.rb | 54 - .../authorize_environment.rb | 54 - .../cloud_shell_service/get_environment.rb | 47 - .../cloud_shell_service/remove_public_key.rb | 54 - .../cloud_shell_service/start_environment.rb | 54 - ...nippet_metadata_google.cloud.shell.v1.json | 215 - .../v1/cloud_shell_service_operations_test.rb | 400 -- .../v1/cloud_shell_service_paths_test.rb | 55 - .../shell/v1/cloud_shell_service_rest_test.rb | 376 -- .../shell/v1/cloud_shell_service_test.rb | 442 -- .../google-cloud-shell-v1/test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 153 - .../Rakefile | 169 - .../gapic_metadata.json | 153 - ...le-cloud-spanner-admin-database-v1.gemspec | 29 - .../google-cloud-spanner-admin-database-v1.rb | 21 - .../google/cloud/spanner/admin/database/v1.rb | 49 - .../admin/database/v1/database_admin.rb | 66 - .../database/v1/database_admin/client.rb | 3658 ----------------- .../database/v1/database_admin/credentials.rb | 56 - .../database/v1/database_admin/operations.rb | 845 ---- .../admin/database/v1/database_admin/paths.rb | 176 - .../admin/database/v1/database_admin/rest.rb | 63 - .../database/v1/database_admin/rest/client.rb | 3338 --------------- .../v1/database_admin/rest/operations.rb | 1012 ----- .../v1/database_admin/rest/service_stub.rb | 1740 -------- .../cloud/spanner/admin/database/v1/rest.rb | 41 - .../spanner/admin/database/v1/version.rb | 32 - .../spanner/admin/database/v1/backup_pb.rb | 52 - .../admin/database/v1/backup_schedule_pb.rb | 40 - .../spanner/admin/database/v1/common_pb.rb | 34 - .../database/v1/spanner_database_admin_pb.rb | 73 - .../v1/spanner_database_admin_services_pb.rb | 245 -- .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 -- .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../spanner/admin/database/v1/backup.rb | 730 ---- .../admin/database/v1/backup_schedule.rb | 220 - .../spanner/admin/database/v1/common.rb | 123 - .../database/v1/spanner_database_admin.rb | 834 ---- .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../database_admin/add_split_points.rb | 47 - .../snippets/database_admin/copy_backup.rb | 54 - .../snippets/database_admin/create_backup.rb | 54 - .../database_admin/create_backup_schedule.rb | 47 - .../database_admin/create_database.rb | 54 - .../snippets/database_admin/delete_backup.rb | 47 - .../database_admin/delete_backup_schedule.rb | 47 - .../snippets/database_admin/drop_database.rb | 47 - .../snippets/database_admin/get_backup.rb | 47 - .../database_admin/get_backup_schedule.rb | 47 - .../snippets/database_admin/get_database.rb | 47 - .../database_admin/get_database_ddl.rb | 47 - .../snippets/database_admin/get_iam_policy.rb | 47 - .../internal_update_graph_operation.rb | 47 - .../database_admin/list_backup_operations.rb | 51 - .../database_admin/list_backup_schedules.rb | 51 - .../snippets/database_admin/list_backups.rb | 51 - .../list_database_operations.rb | 51 - .../database_admin/list_database_roles.rb | 51 - .../snippets/database_admin/list_databases.rb | 51 - .../database_admin/restore_database.rb | 54 - .../snippets/database_admin/set_iam_policy.rb | 47 - .../database_admin/test_iam_permissions.rb | 47 - .../snippets/database_admin/update_backup.rb | 47 - .../database_admin/update_backup_schedule.rb | 47 - .../database_admin/update_database.rb | 54 - .../database_admin/update_database_ddl.rb | 54 - ...data_google.spanner.admin.database.v1.json | 1095 ----- .../v1/database_admin_operations_test.rb | 400 -- .../database/v1/database_admin_paths_test.rb | 127 - .../database/v1/database_admin_rest_test.rb | 1548 ------- .../admin/database/v1/database_admin_test.rb | 1843 --------- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 153 - .../Rakefile | 169 - .../gapic_metadata.json | 123 - ...le-cloud-spanner-admin-instance-v1.gemspec | 29 - .../google-cloud-spanner-admin-instance-v1.rb | 21 - .../google/cloud/spanner/admin/instance/v1.rb | 49 - .../admin/instance/v1/instance_admin.rb | 80 - .../instance/v1/instance_admin/client.rb | 3140 -------------- .../instance/v1/instance_admin/credentials.rb | 56 - .../instance/v1/instance_admin/operations.rb | 845 ---- .../admin/instance/v1/instance_admin/paths.rb | 104 - .../admin/instance/v1/instance_admin/rest.rb | 77 - .../instance/v1/instance_admin/rest/client.rb | 2948 ------------- .../v1/instance_admin/rest/operations.rb | 1068 ----- .../v1/instance_admin/rest/service_stub.rb | 1376 ------- .../cloud/spanner/admin/instance/v1/rest.rb | 41 - .../spanner/admin/instance/v1/version.rb | 32 - .../spanner/admin/instance/v1/common_pb.rb | 31 - .../instance/v1/spanner_instance_admin_pb.rb | 89 - .../v1/spanner_instance_admin_services_pb.rb | 463 --- .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 -- .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../spanner/admin/instance/v1/common.rb | 71 - .../instance/v1/spanner_instance_admin.rb | 1561 ------- .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../instance_admin/create_instance.rb | 54 - .../instance_admin/create_instance_config.rb | 54 - .../create_instance_partition.rb | 54 - .../instance_admin/delete_instance.rb | 47 - .../instance_admin/delete_instance_config.rb | 47 - .../delete_instance_partition.rb | 47 - .../snippets/instance_admin/get_iam_policy.rb | 47 - .../snippets/instance_admin/get_instance.rb | 47 - .../instance_admin/get_instance_config.rb | 47 - .../instance_admin/get_instance_partition.rb | 47 - .../list_instance_config_operations.rb | 51 - .../instance_admin/list_instance_configs.rb | 51 - .../list_instance_partition_operations.rb | 51 - .../list_instance_partitions.rb | 51 - .../snippets/instance_admin/list_instances.rb | 51 - .../snippets/instance_admin/move_instance.rb | 54 - .../snippets/instance_admin/set_iam_policy.rb | 47 - .../instance_admin/test_iam_permissions.rb | 47 - .../instance_admin/update_instance.rb | 54 - .../instance_admin/update_instance_config.rb | 54 - .../update_instance_partition.rb | 54 - ...data_google.spanner.admin.instance.v1.json | 855 ---- .../v1/instance_admin_operations_test.rb | 400 -- .../instance/v1/instance_admin_paths_test.rb | 91 - .../instance/v1/instance_admin_rest_test.rb | 1269 ------ .../admin/instance/v1/instance_admin_test.rb | 1468 ------- .../test/helper.rb | 26 - .../google-cloud-spanner-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-spanner-v1/.rubocop.yml | 33 - .../google-cloud-spanner-v1/.toys.rb | 28 - .../google-cloud-spanner-v1/.yardopts | 12 - .../google-cloud-spanner-v1/AUTHENTICATION.md | 122 - .../google-cloud-spanner-v1/CHANGELOG.md | 2 - .../google-cloud-spanner-v1/Gemfile | 14 - .../google-cloud-spanner-v1/LICENSE.md | 201 - .../google-cloud-spanner-v1/README.md | 153 - .../google-cloud-spanner-v1/Rakefile | 169 - .../gapic_metadata.json | 98 - .../google-cloud-spanner-v1.gemspec | 28 - .../lib/google-cloud-spanner-v1.rb | 21 - .../lib/google/cloud/spanner/v1.rb | 40 - .../lib/google/cloud/spanner/v1/spanner.rb | 52 - .../google/cloud/spanner/v1/spanner/client.rb | 2636 ------------ .../cloud/spanner/v1/spanner/credentials.rb | 52 - .../google/cloud/spanner/v1/spanner/paths.rb | 73 - .../lib/google/cloud/spanner/v1/version.rb | 28 - .../lib/google/spanner/v1/change_stream_pb.rb | 37 - .../google/spanner/v1/commit_response_pb.rb | 27 - .../lib/google/spanner/v1/keys_pb.rb | 24 - .../lib/google/spanner/v1/location_pb.rb | 35 - .../lib/google/spanner/v1/mutation_pb.rb | 30 - .../lib/google/spanner/v1/query_plan_pb.rb | 30 - .../lib/google/spanner/v1/result_set_pb.rb | 31 - .../lib/google/spanner/v1/spanner_pb.rb | 73 - .../google/spanner/v1/spanner_services_pb.rb | 216 - .../lib/google/spanner/v1/transaction_pb.rb | 34 - .../lib/google/spanner/v1/type_pb.rb | 27 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../proto_docs/google/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 - .../google/spanner/v1/change_stream.rb | 488 --- .../google/spanner/v1/commit_response.rb | 73 - .../proto_docs/google/spanner/v1/keys.rb | 170 - .../proto_docs/google/spanner/v1/location.rb | 417 -- .../proto_docs/google/spanner/v1/mutation.rb | 178 - .../google/spanner/v1/query_plan.rb | 180 - .../google/spanner/v1/result_set.rb | 265 -- .../proto_docs/google/spanner/v1/spanner.rb | 1203 ------ .../google/spanner/v1/transaction.rb | 357 -- .../proto_docs/google/spanner/v1/type.rb | 222 - .../google-cloud-spanner-v1/snippets/Gemfile | 32 - .../snippet_metadata_google.spanner.v1.json | 655 --- .../snippets/spanner/batch_create_sessions.rb | 47 - .../snippets/spanner/batch_write.rb | 50 - .../snippets/spanner/begin_transaction.rb | 47 - .../snippets/spanner/commit.rb | 47 - .../snippets/spanner/create_session.rb | 47 - .../snippets/spanner/delete_session.rb | 47 - .../snippets/spanner/execute_batch_dml.rb | 47 - .../snippets/spanner/execute_sql.rb | 47 - .../snippets/spanner/execute_streaming_sql.rb | 50 - .../snippets/spanner/get_session.rb | 47 - .../snippets/spanner/list_sessions.rb | 51 - .../snippets/spanner/partition_query.rb | 47 - .../snippets/spanner/partition_read.rb | 47 - .../snippets/spanner/read.rb | 47 - .../snippets/spanner/rollback.rb | 47 - .../snippets/spanner/streaming_read.rb | 50 - .../cloud/spanner/v1/spanner_paths_test.rb | 67 - .../google/cloud/spanner/v1/spanner_test.rb | 1269 ------ .../google-cloud-spanner-v1/test/helper.rb | 26 - .../google-cloud-speech-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-speech-v1/.rubocop.yml | 33 - .../google-cloud-speech-v1/.toys.rb | 28 - .../google-cloud-speech-v1/.yardopts | 12 - .../google-cloud-speech-v1/AUTHENTICATION.md | 122 - .../google-cloud-speech-v1/CHANGELOG.md | 2 - .../google-cloud-speech-v1/Gemfile | 14 - .../google-cloud-speech-v1/LICENSE.md | 201 - .../google-cloud-speech-v1/README.md | 154 - .../google-cloud-speech-v1/Rakefile | 169 - .../gapic_metadata.json | 92 - .../google-cloud-speech-v1.gemspec | 28 - .../lib/google-cloud-speech-v1.rb | 21 - .../lib/google/cloud/speech/v1.rb | 46 - .../lib/google/cloud/speech/v1/adaptation.rb | 55 - .../cloud/speech/v1/adaptation/client.rb | 1434 ------- .../cloud/speech/v1/adaptation/credentials.rb | 51 - .../cloud/speech/v1/adaptation/paths.rb | 88 - .../google/cloud/speech/v1/adaptation/rest.rb | 52 - .../cloud/speech/v1/adaptation/rest/client.rb | 1321 ------ .../speech/v1/adaptation/rest/service_stub.rb | 695 ---- .../speech/v1/cloud_speech_adaptation_pb.rb | 40 - .../v1/cloud_speech_adaptation_services_pb.rb | 65 - .../google/cloud/speech/v1/cloud_speech_pb.rb | 56 - .../speech/v1/cloud_speech_services_pb.rb | 56 - .../lib/google/cloud/speech/v1/resource_pb.rb | 30 - .../lib/google/cloud/speech/v1/rest.rb | 38 - .../lib/google/cloud/speech/v1/speech.rb | 56 - .../google/cloud/speech/v1/speech/client.rb | 685 --- .../cloud/speech/v1/speech/credentials.rb | 51 - .../cloud/speech/v1/speech/operations.rb | 833 ---- .../google/cloud/speech/v1/speech/paths.rb | 71 - .../lib/google/cloud/speech/v1/speech/rest.rb | 53 - .../cloud/speech/v1/speech/rest/client.rb | 553 --- .../cloud/speech/v1/speech/rest/operations.rb | 923 ----- .../speech/v1/speech/rest/service_stub.rb | 201 - .../lib/google/cloud/speech/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/speech/v1/cloud_speech.rb | 1003 ----- .../speech/v1/cloud_speech_adaptation.rb | 270 -- .../google/cloud/speech/v1/resource.rb | 185 - .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/protobuf/wrappers.rb | 148 - .../proto_docs/google/rpc/status.rb | 48 - .../google-cloud-speech-v1/snippets/Gemfile | 32 - .../adaptation/create_custom_class.rb | 47 - .../snippets/adaptation/create_phrase_set.rb | 47 - .../adaptation/delete_custom_class.rb | 47 - .../snippets/adaptation/delete_phrase_set.rb | 47 - .../snippets/adaptation/get_custom_class.rb | 47 - .../snippets/adaptation/get_phrase_set.rb | 47 - .../adaptation/list_custom_classes.rb | 51 - .../snippets/adaptation/list_phrase_set.rb | 51 - .../adaptation/update_custom_class.rb | 47 - .../snippets/adaptation/update_phrase_set.rb | 47 - ...ippet_metadata_google.cloud.speech.v1.json | 535 --- .../snippets/speech/long_running_recognize.rb | 54 - .../snippets/speech/recognize.rb | 47 - .../snippets/speech/streaming_recognize.rb | 56 - .../cloud/speech/v1/adaptation_paths_test.rb | 79 - .../cloud/speech/v1/adaptation_rest_test.rb | 649 --- .../google/cloud/speech/v1/adaptation_test.rb | 714 ---- .../cloud/speech/v1/speech_operations_test.rb | 400 -- .../cloud/speech/v1/speech_paths_test.rb | 67 - .../cloud/speech/v1/speech_rest_test.rb | 210 - .../google/cloud/speech/v1/speech_test.rb | 334 -- .../google-cloud-speech-v1/test/helper.rb | 26 - .../google-cloud-speech-v1p1beta1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-speech-v1p1beta1/.toys.rb | 28 - .../google-cloud-speech-v1p1beta1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-speech-v1p1beta1/Gemfile | 14 - .../google-cloud-speech-v1p1beta1/LICENSE.md | 201 - .../google-cloud-speech-v1p1beta1/README.md | 154 - .../google-cloud-speech-v1p1beta1/Rakefile | 169 - .../gapic_metadata.json | 92 - .../google-cloud-speech-v1p1beta1.gemspec | 28 - .../lib/google-cloud-speech-v1p1beta1.rb | 21 - .../lib/google/cloud/speech/v1p1beta1.rb | 46 - .../cloud/speech/v1p1beta1/adaptation.rb | 55 - .../speech/v1p1beta1/adaptation/client.rb | 1434 ------- .../v1p1beta1/adaptation/credentials.rb | 51 - .../speech/v1p1beta1/adaptation/paths.rb | 132 - .../cloud/speech/v1p1beta1/adaptation/rest.rb | 52 - .../v1p1beta1/adaptation/rest/client.rb | 1321 ------ .../v1p1beta1/adaptation/rest/service_stub.rb | 695 ---- .../v1p1beta1/cloud_speech_adaptation_pb.rb | 40 - .../cloud_speech_adaptation_services_pb.rb | 65 - .../cloud/speech/v1p1beta1/cloud_speech_pb.rb | 56 - .../v1p1beta1/cloud_speech_services_pb.rb | 56 - .../cloud/speech/v1p1beta1/resource_pb.rb | 34 - .../lib/google/cloud/speech/v1p1beta1/rest.rb | 38 - .../google/cloud/speech/v1p1beta1/speech.rb | 56 - .../cloud/speech/v1p1beta1/speech/client.rb | 685 --- .../speech/v1p1beta1/speech/credentials.rb | 51 - .../speech/v1p1beta1/speech/operations.rb | 833 ---- .../cloud/speech/v1p1beta1/speech/paths.rb | 115 - .../cloud/speech/v1p1beta1/speech/rest.rb | 53 - .../speech/v1p1beta1/speech/rest/client.rb | 553 --- .../v1p1beta1/speech/rest/operations.rb | 923 ----- .../v1p1beta1/speech/rest/service_stub.rb | 201 - .../google/cloud/speech/v1p1beta1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/speech/v1p1beta1/cloud_speech.rb | 1033 ----- .../v1p1beta1/cloud_speech_adaptation.rb | 270 -- .../google/cloud/speech/v1p1beta1/resource.rb | 325 -- .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/protobuf/wrappers.rb | 148 - .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - .../adaptation/create_custom_class.rb | 47 - .../snippets/adaptation/create_phrase_set.rb | 47 - .../adaptation/delete_custom_class.rb | 47 - .../snippets/adaptation/delete_phrase_set.rb | 47 - .../snippets/adaptation/get_custom_class.rb | 47 - .../snippets/adaptation/get_phrase_set.rb | 47 - .../adaptation/list_custom_classes.rb | 51 - .../snippets/adaptation/list_phrase_set.rb | 51 - .../adaptation/update_custom_class.rb | 47 - .../snippets/adaptation/update_phrase_set.rb | 47 - ...etadata_google.cloud.speech.v1p1beta1.json | 535 --- .../snippets/speech/long_running_recognize.rb | 54 - .../snippets/speech/recognize.rb | 47 - .../snippets/speech/streaming_recognize.rb | 56 - .../speech/v1p1beta1/adaptation_paths_test.rb | 103 - .../speech/v1p1beta1/adaptation_rest_test.rb | 649 --- .../cloud/speech/v1p1beta1/adaptation_test.rb | 714 ---- .../v1p1beta1/speech_operations_test.rb | 400 -- .../speech/v1p1beta1/speech_paths_test.rb | 91 - .../speech/v1p1beta1/speech_rest_test.rb | 210 - .../cloud/speech/v1p1beta1/speech_test.rb | 334 -- .../test/helper.rb | 26 - .../google-cloud-speech-v2/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-speech-v2/.rubocop.yml | 33 - .../google-cloud-speech-v2/.toys.rb | 28 - .../google-cloud-speech-v2/.yardopts | 12 - .../google-cloud-speech-v2/AUTHENTICATION.md | 122 - .../google-cloud-speech-v2/CHANGELOG.md | 2 - .../google-cloud-speech-v2/Gemfile | 14 - .../google-cloud-speech-v2/LICENSE.md | 201 - .../google-cloud-speech-v2/README.md | 154 - .../google-cloud-speech-v2/Rakefile | 169 - .../gapic_metadata.json | 133 - .../google-cloud-speech-v2.gemspec | 29 - .../lib/google-cloud-speech-v2.rb | 21 - .../lib/google/cloud/speech/v2.rb | 45 - .../cloud/speech/v2/bindings_override.rb | 75 - .../google/cloud/speech/v2/cloud_speech_pb.rb | 109 - .../speech/v2/cloud_speech_services_pb.rb | 98 - .../cloud/speech/v2/locations_metadata_pb.rb | 27 - .../lib/google/cloud/speech/v2/rest.rb | 38 - .../lib/google/cloud/speech/v2/speech.rb | 56 - .../google/cloud/speech/v2/speech/client.rb | 2922 ------------- .../cloud/speech/v2/speech/credentials.rb | 51 - .../cloud/speech/v2/speech/operations.rb | 841 ---- .../google/cloud/speech/v2/speech/paths.rb | 168 - .../lib/google/cloud/speech/v2/speech/rest.rb | 54 - .../cloud/speech/v2/speech/rest/client.rb | 2647 ------------ .../cloud/speech/v2/speech/rest/operations.rb | 925 ----- .../speech/v2/speech/rest/service_stub.rb | 1435 ------- .../lib/google/cloud/speech/v2/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/speech/v2/cloud_speech.rb | 2086 ---------- .../cloud/speech/v2/locations_metadata.rb | 120 - .../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 - .../google-cloud-speech-v2/snippets/Gemfile | 32 - ...ippet_metadata_google.cloud.speech.v2.json | 935 ----- .../snippets/speech/batch_recognize.rb | 54 - .../snippets/speech/create_custom_class.rb | 54 - .../snippets/speech/create_phrase_set.rb | 54 - .../snippets/speech/create_recognizer.rb | 54 - .../snippets/speech/delete_custom_class.rb | 54 - .../snippets/speech/delete_phrase_set.rb | 54 - .../snippets/speech/delete_recognizer.rb | 54 - .../snippets/speech/get_config.rb | 47 - .../snippets/speech/get_custom_class.rb | 47 - .../snippets/speech/get_phrase_set.rb | 47 - .../snippets/speech/get_recognizer.rb | 47 - .../snippets/speech/list_custom_classes.rb | 51 - .../snippets/speech/list_phrase_sets.rb | 51 - .../snippets/speech/list_recognizers.rb | 51 - .../snippets/speech/recognize.rb | 47 - .../snippets/speech/streaming_recognize.rb | 56 - .../snippets/speech/undelete_custom_class.rb | 54 - .../snippets/speech/undelete_phrase_set.rb | 54 - .../snippets/speech/undelete_recognizer.rb | 54 - .../snippets/speech/update_config.rb | 47 - .../snippets/speech/update_custom_class.rb | 54 - .../snippets/speech/update_phrase_set.rb | 54 - .../snippets/speech/update_recognizer.rb | 54 - .../cloud/speech/v2/speech_operations_test.rb | 400 -- .../cloud/speech/v2/speech_paths_test.rb | 127 - .../cloud/speech/v2/speech_rest_test.rb | 1335 ------ .../google/cloud/speech/v2/speech_test.rb | 1662 -------- .../google-cloud-speech-v2/test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-storage-control-v2/.toys.rb | 28 - .../google-cloud-storage-control-v2/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-storage-control-v2/Gemfile | 14 - .../LICENSE.md | 201 - .../google-cloud-storage-control-v2/README.md | 154 - .../google-cloud-storage-control-v2/Rakefile | 169 - .../gapic_metadata.json | 153 - .../google-cloud-storage-control-v2.gemspec | 29 - .../lib/google-cloud-storage-control-v2.rb | 21 - .../lib/google/cloud/storage/control/v2.rb | 47 - .../google/cloud/storage/control/v2/rest.rb | 39 - .../storage/control/v2/storage_control.rb | 58 - .../control/v2/storage_control/client.rb | 3379 --------------- .../control/v2/storage_control/credentials.rb | 53 - .../control/v2/storage_control/operations.rb | 843 ---- .../control/v2/storage_control/paths.rb | 178 - .../control/v2/storage_control/rest.rb | 54 - .../control/v2/storage_control/rest/client.rb | 913 ---- .../v2/storage_control/rest/service_stub.rb | 452 -- .../cloud/storage/control/v2/version.rb | 30 - .../storage/control/v2/storage_control_pb.rb | 83 - .../control/v2/storage_control_services_pb.rb | 125 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../proto_docs/google/api/routing.rb | 463 --- .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 -- .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../storage/control/v2/storage_control.rb | 1026 ----- .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - ...et_metadata_google.storage.control.v2.json | 1095 ----- .../storage_control/create_anywhere_cache.rb | 54 - .../snippets/storage_control/create_folder.rb | 47 - .../storage_control/create_managed_folder.rb | 47 - .../snippets/storage_control/delete_folder.rb | 47 - .../delete_folder_recursive.rb | 54 - .../storage_control/delete_managed_folder.rb | 47 - .../storage_control/disable_anywhere_cache.rb | 47 - .../storage_control/get_anywhere_cache.rb | 47 - .../snippets/storage_control/get_folder.rb | 47 - .../get_folder_intelligence_config.rb | 47 - .../storage_control/get_iam_policy.rb | 47 - .../storage_control/get_managed_folder.rb | 47 - .../get_organization_intelligence_config.rb | 47 - .../get_project_intelligence_config.rb | 47 - .../storage_control/get_storage_layout.rb | 47 - .../storage_control/list_anywhere_caches.rb | 51 - .../snippets/storage_control/list_folders.rb | 51 - .../storage_control/list_managed_folders.rb | 51 - .../storage_control/pause_anywhere_cache.rb | 47 - .../snippets/storage_control/rename_folder.rb | 54 - .../storage_control/resume_anywhere_cache.rb | 47 - .../storage_control/set_iam_policy.rb | 47 - .../storage_control/test_iam_permissions.rb | 47 - .../storage_control/update_anywhere_cache.rb | 54 - .../update_folder_intelligence_config.rb | 47 - ...update_organization_intelligence_config.rb | 47 - .../update_project_intelligence_config.rb | 47 - .../v2/storage_control_operations_test.rb | 400 -- .../control/v2/storage_control_paths_test.rb | 121 - .../control/v2/storage_control_rest_test.rb | 429 -- .../control/v2/storage_control_test.rb | 1853 --------- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 53 - ...-cloud-storage_batch_operations-v1.gemspec | 29 - ...oogle-cloud-storage_batch_operations-v1.rb | 21 - .../cloud/storage_batch_operations/v1.rb | 45 - .../v1/bindings_override.rb | 75 - .../cloud/storage_batch_operations/v1/rest.rb | 38 - .../v1/storage_batch_operations.rb | 59 - .../v1/storage_batch_operations/client.rb | 1150 ------ .../storage_batch_operations/credentials.rb | 47 - .../v1/storage_batch_operations/operations.rb | 841 ---- .../v1/storage_batch_operations/paths.rb | 111 - .../v1/storage_batch_operations/rest.rb | 57 - .../storage_batch_operations/rest/client.rb | 1066 ----- .../rest/operations.rb | 925 ----- .../rest/service_stub.rb | 510 --- .../storage_batch_operations/v1/version.rb | 28 - .../v1/storage_batch_operations_pb.rb | 41 - .../storage_batch_operations_services_pb.rb | 60 - .../v1/storage_batch_operations_types_pb.rb | 49 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../v1/storage_batch_operations.rb | 221 - .../v1/storage_batch_operations_types.rb | 564 --- .../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/timestamp.rb | 127 - .../proto_docs/google/rpc/code.rb | 185 - .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - ...oogle.cloud.storagebatchoperations.v1.json | 295 -- .../storage_batch_operations/cancel_job.rb | 47 - .../storage_batch_operations/create_job.rb | 54 - .../storage_batch_operations/delete_job.rb | 47 - .../get_bucket_operation.rb | 47 - .../storage_batch_operations/get_job.rb | 47 - .../list_bucket_operations.rb | 51 - .../storage_batch_operations/list_jobs.rb | 51 - ...torage_batch_operations_operations_test.rb | 400 -- .../v1/storage_batch_operations_paths_test.rb | 91 - .../v1/storage_batch_operations_rest_test.rb | 491 --- .../v1/storage_batch_operations_test.rb | 567 --- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-storage_insights-v1/.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-storage_insights-v1/Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 153 - .../google-cloud-storage_insights-v1/Rakefile | 169 - .../gapic_metadata.json | 88 - .../google-cloud-storage_insights-v1.gemspec | 29 - .../lib/google-cloud-storage_insights-v1.rb | 21 - .../lib/google/cloud/storage_insights/v1.rb | 45 - .../storage_insights/v1/bindings_override.rb | 75 - .../google/cloud/storage_insights/v1/rest.rb | 38 - .../storage_insights/v1/storage_insights.rb | 56 - .../v1/storage_insights/client.rb | 1944 --------- .../v1/storage_insights/credentials.rb | 47 - .../v1/storage_insights/operations.rb | 841 ---- .../v1/storage_insights/paths.rb | 109 - .../v1/storage_insights/rest.rb | 54 - .../v1/storage_insights/rest/client.rb | 1811 -------- .../v1/storage_insights/rest/operations.rb | 925 ----- .../v1/storage_insights/rest/service_stub.rb | 941 ----- .../cloud/storage_insights/v1/version.rb | 28 - .../storageinsights/v1/storageinsights_pb.rb | 75 - .../v1/storageinsights_services_pb.rb | 72 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../storageinsights/v1/storageinsights.rb | 930 ----- .../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/date.rb | 53 - .../proto_docs/google/type/datetime.rb | 103 - .../snippets/Gemfile | 32 - ...adata_google.cloud.storageinsights.v1.json | 575 --- .../storage_insights/create_dataset_config.rb | 54 - .../storage_insights/create_report_config.rb | 47 - .../storage_insights/delete_dataset_config.rb | 54 - .../storage_insights/delete_report_config.rb | 47 - .../storage_insights/get_dataset_config.rb | 47 - .../storage_insights/get_report_config.rb | 47 - .../storage_insights/get_report_detail.rb | 47 - .../snippets/storage_insights/link_dataset.rb | 54 - .../storage_insights/list_dataset_configs.rb | 51 - .../storage_insights/list_report_configs.rb | 51 - .../storage_insights/list_report_details.rb | 51 - .../storage_insights/unlink_dataset.rb | 54 - .../storage_insights/update_dataset_config.rb | 54 - .../storage_insights/update_report_config.rb | 47 - .../v1/storage_insights_operations_test.rb | 400 -- .../v1/storage_insights_paths_test.rb | 91 - .../v1/storage_insights_rest_test.rb | 879 ---- .../v1/storage_insights_test.rb | 1018 ----- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-storage_transfer-v1/.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-storage_transfer-v1/Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../google-cloud-storage_transfer-v1/Rakefile | 169 - .../gapic_metadata.json | 88 - .../google-cloud-storage_transfer-v1.gemspec | 28 - .../lib/google-cloud-storage_transfer-v1.rb | 21 - .../lib/google/cloud/storage_transfer/v1.rb | 45 - .../google/cloud/storage_transfer/v1/rest.rb | 37 - .../v1/storage_transfer_service.rb | 58 - .../v1/storage_transfer_service/client.rb | 1832 --------- .../storage_transfer_service/credentials.rb | 47 - .../v1/storage_transfer_service/operations.rb | 841 ---- .../v1/storage_transfer_service/paths.rb | 50 - .../v1/storage_transfer_service/rest.rb | 55 - .../storage_transfer_service/rest/client.rb | 1707 -------- .../rest/operations.rb | 925 ----- .../rest/service_stub.rb | 938 ----- .../cloud/storage_transfer/v1/version.rb | 28 - .../google/storagetransfer/v1/transfer_pb.rb | 44 - .../v1/transfer_services_pb.rb | 91 - .../storagetransfer/v1/transfer_types_pb.rb | 78 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/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/code.rb | 185 - .../proto_docs/google/rpc/status.rb | 48 - .../google/storagetransfer/v1/transfer.rb | 307 -- .../storagetransfer/v1/transfer_types.rb | 1534 ------- .../proto_docs/google/type/date.rb | 53 - .../proto_docs/google/type/timeofday.rb | 45 - .../snippets/Gemfile | 32 - ...et_metadata_google.storagetransfer.v1.json | 575 --- .../create_agent_pool.rb | 47 - .../create_transfer_job.rb | 47 - .../delete_agent_pool.rb | 47 - .../delete_transfer_job.rb | 47 - .../get_agent_pool.rb | 47 - .../get_google_service_account.rb | 47 - .../get_transfer_job.rb | 47 - .../list_agent_pools.rb | 51 - .../list_transfer_jobs.rb | 51 - .../pause_transfer_operation.rb | 47 - .../resume_transfer_operation.rb | 47 - .../run_transfer_job.rb | 54 - .../update_agent_pool.rb | 47 - .../update_transfer_job.rb | 47 - ...torage_transfer_service_operations_test.rb | 400 -- .../v1/storage_transfer_service_paths_test.rb | 55 - .../v1/storage_transfer_service_rest_test.rb | 869 ---- .../v1/storage_transfer_service_test.rb | 973 ----- .../test/helper.rb | 26 - .../google-cloud-support-v2/.gitignore | 22 - .../.repo-metadata.json | 17 - .../google-cloud-support-v2/.rubocop.yml | 33 - .../google-cloud-support-v2/.toys.rb | 28 - .../google-cloud-support-v2/.yardopts | 12 - .../google-cloud-support-v2/AUTHENTICATION.md | 122 - .../google-cloud-support-v2/CHANGELOG.md | 2 - .../google-cloud-support-v2/Gemfile | 14 - .../google-cloud-support-v2/LICENSE.md | 201 - .../google-cloud-support-v2/README.md | 154 - .../google-cloud-support-v2/Rakefile | 169 - .../gapic_metadata.json | 91 - .../google-cloud-support-v2.gemspec | 28 - .../lib/google-cloud-support-v2.rb | 21 - .../lib/google/cloud/support/v2.rb | 42 - .../lib/google/cloud/support/v2/actor_pb.rb | 23 - .../google/cloud/support/v2/attachment_pb.rb | 26 - .../cloud/support/v2/attachment_service_pb.rb | 28 - .../v2/attachment_service_services_pb.rb | 45 - .../support/v2/case_attachment_service.rb | 49 - .../v2/case_attachment_service/client.rb | 497 --- .../v2/case_attachment_service/credentials.rb | 47 - .../v2/case_attachment_service/paths.rb | 72 - .../lib/google/cloud/support/v2/case_pb.rb | 29 - .../google/cloud/support/v2/case_service.rb | 49 - .../cloud/support/v2/case_service/client.rb | 1264 ------ .../support/v2/case_service/credentials.rb | 47 - .../cloud/support/v2/case_service/paths.rb | 100 - .../cloud/support/v2/case_service_pb.rb | 39 - .../support/v2/case_service_services_pb.rb | 82 - .../lib/google/cloud/support/v2/comment_pb.rb | 26 - .../cloud/support/v2/comment_service.rb | 49 - .../support/v2/comment_service/client.rb | 588 --- .../support/v2/comment_service/credentials.rb | 47 - .../cloud/support/v2/comment_service/paths.rb | 115 - .../cloud/support/v2/comment_service_pb.rb | 29 - .../support/v2/comment_service_services_pb.rb | 49 - .../google/cloud/support/v2/escalation_pb.rb | 24 - .../lib/google/cloud/support/v2/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/support/v2/actor.rb | 59 - .../google/cloud/support/v2/attachment.rb | 58 - .../cloud/support/v2/attachment_service.rb | 63 - .../google/cloud/support/v2/case.rb | 191 - .../google/cloud/support/v2/case_service.rb | 238 -- .../google/cloud/support/v2/comment.rb | 58 - .../cloud/support/v2/comment_service.rb | 68 - .../google/cloud/support/v2/escalation.rb | 55 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../google-cloud-support-v2/snippets/Gemfile | 32 - .../list_attachments.rb | 51 - .../snippets/case_service/close_case.rb | 47 - .../snippets/case_service/create_case.rb | 47 - .../snippets/case_service/escalate_case.rb | 47 - .../snippets/case_service/get_case.rb | 47 - .../snippets/case_service/list_cases.rb | 51 - .../search_case_classifications.rb | 51 - .../snippets/case_service/search_cases.rb | 51 - .../snippets/case_service/update_case.rb | 47 - .../comment_service/create_comment.rb | 47 - .../snippets/comment_service/list_comments.rb | 51 - ...ppet_metadata_google.cloud.support.v2.json | 455 -- .../v2/case_attachment_service_paths_test.rb | 58 - .../v2/case_attachment_service_test.rb | 171 - .../support/v2/case_service_paths_test.rb | 82 - .../cloud/support/v2/case_service_test.rb | 605 --- .../support/v2/comment_service_paths_test.rb | 73 - .../cloud/support/v2/comment_service_test.rb | 231 -- .../google-cloud-support-v2/test/helper.rb | 26 - .../google-cloud-support-v2beta/.gitignore | 22 - .../.repo-metadata.json | 17 - .../google-cloud-support-v2beta/.rubocop.yml | 33 - .../google-cloud-support-v2beta/.toys.rb | 28 - .../google-cloud-support-v2beta/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-support-v2beta/CHANGELOG.md | 2 - .../google-cloud-support-v2beta/Gemfile | 14 - .../google-cloud-support-v2beta/LICENSE.md | 201 - .../google-cloud-support-v2beta/README.md | 154 - .../google-cloud-support-v2beta/Rakefile | 169 - .../gapic_metadata.json | 115 - .../google-cloud-support-v2beta.gemspec | 28 - .../lib/google-cloud-support-v2beta.rb | 21 - .../lib/google/cloud/support/v2beta.rb | 48 - .../google/cloud/support/v2beta/actor_pb.rb | 23 - .../cloud/support/v2beta/attachment_pb.rb | 26 - .../support/v2beta/attachment_service_pb.rb | 29 - .../v2beta/attachment_service_services_pb.rb | 47 - .../support/v2beta/case_attachment_service.rb | 55 - .../v2beta/case_attachment_service/client.rb | 589 --- .../case_attachment_service/credentials.rb | 47 - .../v2beta/case_attachment_service/paths.rb | 115 - .../v2beta/case_attachment_service/rest.rb | 52 - .../case_attachment_service/rest/client.rb | 532 --- .../rest/service_stub.rb | 210 - .../google/cloud/support/v2beta/case_pb.rb | 31 - .../cloud/support/v2beta/case_service.rb | 55 - .../support/v2beta/case_service/client.rb | 1269 ------ .../v2beta/case_service/credentials.rb | 47 - .../support/v2beta/case_service/paths.rb | 100 - .../cloud/support/v2beta/case_service/rest.rb | 52 - .../v2beta/case_service/rest/client.rb | 1178 ------ .../v2beta/case_service/rest/service_stub.rb | 624 --- .../cloud/support/v2beta/case_service_pb.rb | 39 - .../v2beta/case_service_services_pb.rb | 82 - .../google/cloud/support/v2beta/comment_pb.rb | 26 - .../cloud/support/v2beta/comment_service.rb | 55 - .../support/v2beta/comment_service/client.rb | 680 --- .../v2beta/comment_service/credentials.rb | 47 - .../support/v2beta/comment_service/paths.rb | 115 - .../support/v2beta/comment_service/rest.rb | 52 - .../v2beta/comment_service/rest/client.rb | 616 --- .../comment_service/rest/service_stub.rb | 280 -- .../support/v2beta/comment_service_pb.rb | 30 - .../v2beta/comment_service_services_pb.rb | 51 - .../google/cloud/support/v2beta/content_pb.rb | 21 - .../cloud/support/v2beta/email_message_pb.rb | 27 - .../cloud/support/v2beta/escalation_pb.rb | 24 - .../cloud/support/v2beta/feed_item_pb.rb | 27 - .../cloud/support/v2beta/feed_service.rb | 55 - .../support/v2beta/feed_service/client.rb | 499 --- .../v2beta/feed_service/credentials.rb | 47 - .../support/v2beta/feed_service/paths.rb | 72 - .../cloud/support/v2beta/feed_service/rest.rb | 52 - .../v2beta/feed_service/rest/client.rb | 449 -- .../v2beta/feed_service/rest/service_stub.rb | 149 - .../cloud/support/v2beta/feed_service_pb.rb | 28 - .../v2beta/feed_service_services_pb.rb | 46 - .../lib/google/cloud/support/v2beta/rest.rb | 40 - .../google/cloud/support/v2beta/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/support/v2beta/actor.rb | 59 - .../google/cloud/support/v2beta/attachment.rb | 58 - .../support/v2beta/attachment_service.rb | 72 - .../google/cloud/support/v2beta/case.rb | 215 - .../cloud/support/v2beta/case_service.rb | 245 -- .../google/cloud/support/v2beta/comment.rb | 58 - .../cloud/support/v2beta/comment_service.rb | 77 - .../google/cloud/support/v2beta/content.rb | 35 - .../cloud/support/v2beta/email_message.rb | 55 - .../google/cloud/support/v2beta/escalation.rb | 55 - .../google/cloud/support/v2beta/feed_item.rb | 56 - .../cloud/support/v2beta/feed_service.rb | 65 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../snippets/Gemfile | 32 - .../case_attachment_service/get_attachment.rb | 47 - .../list_attachments.rb | 51 - .../snippets/case_service/close_case.rb | 47 - .../snippets/case_service/create_case.rb | 47 - .../snippets/case_service/escalate_case.rb | 47 - .../snippets/case_service/get_case.rb | 47 - .../snippets/case_service/list_cases.rb | 51 - .../search_case_classifications.rb | 51 - .../snippets/case_service/search_cases.rb | 51 - .../snippets/case_service/update_case.rb | 47 - .../comment_service/create_comment.rb | 47 - .../snippets/comment_service/get_comment.rb | 47 - .../snippets/comment_service/list_comments.rb | 51 - .../snippets/feed_service/show_feed.rb | 51 - ..._metadata_google.cloud.support.v2beta.json | 575 --- .../case_attachment_service_paths_test.rb | 73 - .../case_attachment_service_rest_test.rb | 209 - .../v2beta/case_attachment_service_test.rb | 229 -- .../support/v2beta/case_service_paths_test.rb | 82 - .../support/v2beta/case_service_rest_test.rb | 544 --- .../cloud/support/v2beta/case_service_test.rb | 610 --- .../v2beta/comment_service_paths_test.rb | 73 - .../v2beta/comment_service_rest_test.rb | 264 -- .../support/v2beta/comment_service_test.rb | 289 -- .../support/v2beta/feed_service_paths_test.rb | 58 - .../support/v2beta/feed_service_rest_test.rb | 156 - .../cloud/support/v2beta/feed_service_test.rb | 173 - .../test/helper.rb | 26 - .../google-cloud-talent-v4/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-talent-v4/.rubocop.yml | 33 - .../google-cloud-talent-v4/.toys.rb | 28 - .../google-cloud-talent-v4/.yardopts | 12 - .../google-cloud-talent-v4/AUTHENTICATION.md | 122 - .../google-cloud-talent-v4/CHANGELOG.md | 2 - .../google-cloud-talent-v4/Gemfile | 14 - .../google-cloud-talent-v4/LICENSE.md | 201 - .../google-cloud-talent-v4/README.md | 154 - .../google-cloud-talent-v4/Rakefile | 169 - .../gapic_metadata.json | 164 - .../google-cloud-talent-v4.gemspec | 28 - .../lib/google-cloud-talent-v4.rb | 21 - .../lib/google/cloud/talent/v4.rb | 49 - .../lib/google/cloud/talent/v4/common_pb.rb | 53 - .../lib/google/cloud/talent/v4/company_pb.rb | 26 - .../google/cloud/talent/v4/company_service.rb | 55 - .../cloud/talent/v4/company_service/client.rb | 909 ---- .../talent/v4/company_service/credentials.rb | 52 - .../cloud/talent/v4/company_service/paths.rb | 69 - .../cloud/talent/v4/company_service/rest.rb | 52 - .../talent/v4/company_service/rest/client.rb | 831 ---- .../v4/company_service/rest/service_stub.rb | 388 -- .../cloud/talent/v4/company_service_pb.rb | 35 - .../talent/v4/company_service_services_pb.rb | 54 - .../lib/google/cloud/talent/v4/completion.rb | 55 - .../cloud/talent/v4/completion/client.rb | 510 --- .../cloud/talent/v4/completion/credentials.rb | 52 - .../cloud/talent/v4/completion/paths.rb | 69 - .../google/cloud/talent/v4/completion/rest.rb | 52 - .../cloud/talent/v4/completion/rest/client.rb | 460 --- .../talent/v4/completion/rest/service_stub.rb | 142 - .../cloud/talent/v4/completion_service_pb.rb | 31 - .../v4/completion_service_services_pb.rb | 46 - .../lib/google/cloud/talent/v4/event_pb.rb | 26 - .../google/cloud/talent/v4/event_service.rb | 55 - .../cloud/talent/v4/event_service/client.rb | 488 --- .../talent/v4/event_service/credentials.rb | 52 - .../cloud/talent/v4/event_service/paths.rb | 50 - .../cloud/talent/v4/event_service/rest.rb | 52 - .../talent/v4/event_service/rest/client.rb | 438 -- .../v4/event_service/rest/service_stub.rb | 143 - .../cloud/talent/v4/event_service_pb.rb | 27 - .../talent/v4/event_service_services_pb.rb | 51 - .../lib/google/cloud/talent/v4/filters_pb.rb | 33 - .../google/cloud/talent/v4/histogram_pb.rb | 22 - .../lib/google/cloud/talent/v4/job_pb.rb | 29 - .../lib/google/cloud/talent/v4/job_service.rb | 56 - .../cloud/talent/v4/job_service/client.rb | 2062 ---------- .../talent/v4/job_service/credentials.rb | 52 - .../cloud/talent/v4/job_service/operations.rb | 841 ---- .../cloud/talent/v4/job_service/paths.rb | 88 - .../cloud/talent/v4/job_service/rest.rb | 53 - .../talent/v4/job_service/rest/client.rb | 1949 --------- .../talent/v4/job_service/rest/operations.rb | 925 ----- .../v4/job_service/rest/service_stub.rb | 698 ---- .../google/cloud/talent/v4/job_service_pb.rb | 58 - .../talent/v4/job_service_services_pb.rb | 90 - .../lib/google/cloud/talent/v4/rest.rb | 41 - .../lib/google/cloud/talent/v4/tenant_pb.rb | 24 - .../google/cloud/talent/v4/tenant_service.rb | 55 - .../cloud/talent/v4/tenant_service/client.rb | 897 ---- .../talent/v4/tenant_service/credentials.rb | 52 - .../cloud/talent/v4/tenant_service/paths.rb | 64 - .../cloud/talent/v4/tenant_service/rest.rb | 52 - .../talent/v4/tenant_service/rest/client.rb | 819 ---- .../v4/tenant_service/rest/service_stub.rb | 388 -- .../cloud/talent/v4/tenant_service_pb.rb | 35 - .../talent/v4/tenant_service_services_pb.rb | 53 - .../lib/google/cloud/talent/v4/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 589 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/talent/v4/common.rb | 959 ----- .../google/cloud/talent/v4/company.rb | 123 - .../google/cloud/talent/v4/company_service.rb | 133 - .../cloud/talent/v4/completion_service.rb | 148 - .../google/cloud/talent/v4/event.rb | 179 - .../google/cloud/talent/v4/event_service.rb | 42 - .../google/cloud/talent/v4/filters.rb | 392 -- .../google/cloud/talent/v4/histogram.rb | 72 - .../proto_docs/google/cloud/talent/v4/job.rb | 392 -- .../google/cloud/talent/v4/job_service.rb | 929 ----- .../google/cloud/talent/v4/tenant.rb | 50 - .../google/cloud/talent/v4/tenant_service.rb | 121 - .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/protobuf/wrappers.rb | 148 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/latlng.rb | 38 - .../proto_docs/google/type/money.rb | 43 - .../proto_docs/google/type/postal_address.rb | 135 - .../proto_docs/google/type/timeofday.rb | 45 - .../google-cloud-talent-v4/snippets/Gemfile | 32 - .../company_service/create_company.rb | 47 - .../company_service/delete_company.rb | 47 - .../snippets/company_service/get_company.rb | 47 - .../company_service/list_companies.rb | 51 - .../company_service/update_company.rb | 47 - .../snippets/completion/complete_query.rb | 47 - .../event_service/create_client_event.rb | 47 - .../snippets/job_service/batch_create_jobs.rb | 54 - .../snippets/job_service/batch_delete_jobs.rb | 54 - .../snippets/job_service/batch_update_jobs.rb | 54 - .../snippets/job_service/create_job.rb | 47 - .../snippets/job_service/delete_job.rb | 47 - .../snippets/job_service/get_job.rb | 47 - .../snippets/job_service/list_jobs.rb | 51 - .../snippets/job_service/search_jobs.rb | 47 - .../job_service/search_jobs_for_alert.rb | 47 - .../snippets/job_service/update_job.rb | 47 - ...ippet_metadata_google.cloud.talent.v4.json | 895 ---- .../snippets/tenant_service/create_tenant.rb | 47 - .../snippets/tenant_service/delete_tenant.rb | 47 - .../snippets/tenant_service/get_tenant.rb | 47 - .../snippets/tenant_service/list_tenants.rb | 51 - .../snippets/tenant_service/update_tenant.rb | 47 - .../talent/v4/company_service_paths_test.rb | 67 - .../talent/v4/company_service_rest_test.rb | 374 -- .../cloud/talent/v4/company_service_test.rb | 409 -- .../cloud/talent/v4/completion_paths_test.rb | 67 - .../cloud/talent/v4/completion_rest_test.rb | 159 - .../google/cloud/talent/v4/completion_test.rb | 174 - .../talent/v4/event_service_paths_test.rb | 55 - .../talent/v4/event_service_rest_test.rb | 154 - .../cloud/talent/v4/event_service_test.rb | 164 - .../talent/v4/job_service_operations_test.rb | 400 -- .../cloud/talent/v4/job_service_paths_test.rb | 79 - .../cloud/talent/v4/job_service_rest_test.rb | 679 --- .../cloud/talent/v4/job_service_test.rb | 798 ---- .../talent/v4/tenant_service_paths_test.rb | 67 - .../talent/v4/tenant_service_rest_test.rb | 373 -- .../cloud/talent/v4/tenant_service_test.rb | 407 -- .../google-cloud-talent-v4/test/helper.rb | 26 - 1580 files changed, 2935 insertions(+), 304641 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/google-cloud-service_control-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google-cloud-service_control-v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/check_error_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/distribution_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/http_request_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/log_entry_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/metric_value_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/operation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/distribution.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/check_error.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/distribution.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/http_request.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/log_entry.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/metric_value.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/operation.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/quota_controller.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/service_controller.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/logging/type/log_severity.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/check.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/report.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_control-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/google-cloud-service_directory-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google-cloud-service_directory-v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/endpoint_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/namespace_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/lookup_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/registration_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/google-cloud-service_directory-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google-cloud-service_directory-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/endpoint_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/namespace_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/lookup_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/registration_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_directory-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/google-cloud-service_health-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google-cloud-service_health-v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/paths.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/cloud/servicehealth/v1/event_resources.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_event.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_event.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_impact.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_events.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_events.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_impacts.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/snippets/snippet_metadata_google.cloud.servicehealth.v1.json delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_health-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/google-cloud-service_management-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google-cloud-service_management-v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/operations.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/auth.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/backend.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/billing.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/config_change.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/context.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/control.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/label.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/log.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/logging.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/metric.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitoring.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/policy.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/quota.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/service.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/servicemanager.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/source_info.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/system_parameter.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/usage.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/api.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/source_context.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/type.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_services.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_management-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/google-cloud-service_usage-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google-cloud-service_usage-v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/operations.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/label.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitoring.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/serviceusage.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/api.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/source_context.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/type.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb delete mode 100644 owl-bot-staging/google-cloud-service_usage-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-shell-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-shell-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-shell-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-shell-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-shell-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-shell-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-shell-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-shell-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-shell-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-shell-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-shell-v1/google-cloud-shell-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google-cloud-shell-v1.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json delete mode 100644 owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-shell-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/google-cloud-spanner-admin-database-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google-cloud-spanner-admin-database-v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/common.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/add_split_points.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup_schedule.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup_schedule.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup_schedule.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/internal_update_graph_operation.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_schedules.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup_schedule.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-database-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/transaction_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/type_pb.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb delete mode 100644 owl-bot-staging/google-cloud-spanner-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-speech-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-speech-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-speech-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-speech-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-speech-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-speech-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-speech-v1/google-cloud-speech-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google-cloud-speech-v1.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/paths.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/resource_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/paths.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech_adaptation.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/resource.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/speech/recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/google-cloud-speech-v1p1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google-cloud-speech-v1p1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/resource_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/paths.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/resource.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v1p1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-speech-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb delete mode 100644 owl-bot-staging/google-cloud-speech-v2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/google-cloud-storage_batch_operations-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google-cloud-storage_batch_operations-v1.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/paths.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations_types.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/code.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/snippet_metadata_google.cloud.storagebatchoperations.v1.json delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/cancel_job.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/create_job.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/delete_job.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_bucket_operation.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_job.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_bucket_operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_batch_operations-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/google-cloud-storage_insights-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google-cloud-storage_insights-v1.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/date.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/datetime.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/snippet_metadata_google.cloud.storageinsights.v1.json delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_dataset_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_report_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_dataset_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_report_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_dataset_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_detail.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/link_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_dataset_configs.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_configs.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_details.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/unlink_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_dataset_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_report_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_insights-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/google-cloud-storage_transfer-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google-cloud-storage_transfer-v1.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_types_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/code.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer_types.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/date.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage_transfer-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-support-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-support-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-support-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-support-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-support-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-support-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-support-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-support-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-support-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-support-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-support-v2/google-cloud-support-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google-cloud-support-v2.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/actor_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/escalation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/actor.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/escalation.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_attachment_service/list_attachments.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/close_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/create_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/escalate_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/get_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/list_cases.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_case_classifications.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_cases.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/case_service/update_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/comment_service/create_comment.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/comment_service/list_comments.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/snippets/snippet_metadata_google.cloud.support.v2.json delete mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/.gitignore delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/.yardopts delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/Gemfile delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/README.md delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/Rakefile delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/google-cloud-support-v2beta.gemspec delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google-cloud-support-v2beta.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/actor_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/content_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/email_message_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/escalation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_item_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/rest.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/version.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/actor.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/content.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/email_message.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/escalation.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_item.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_service.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/get_attachment.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/list_attachments.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/close_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/create_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/escalate_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/get_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/list_cases.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_case_classifications.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_cases.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/update_case.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/create_comment.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/get_comment.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/list_comments.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/feed_service/show_feed.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/snippets/snippet_metadata_google.cloud.support.v2beta.json delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-support-v2beta/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.gitignore delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.yardopts delete mode 100644 owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/Gemfile delete mode 100644 owl-bot-staging/google-cloud-talent-v4/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/README.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/Rakefile delete mode 100644 owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/helper.rb diff --git a/google-cloud-service_control-v1/proto_docs/google/api/client.rb b/google-cloud-service_control-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-service_control-v1/proto_docs/google/api/client.rb +++ b/google-cloud-service_control-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-service_directory-v1/proto_docs/google/api/client.rb b/google-cloud-service_directory-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-service_directory-v1/proto_docs/google/api/client.rb +++ b/google-cloud-service_directory-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb b/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-service_health-v1/proto_docs/google/api/client.rb b/google-cloud-service_health-v1/proto_docs/google/api/client.rb index 483a6510978e..a8b1b06d1cad 100644 --- a/google-cloud-service_health-v1/proto_docs/google/api/client.rb +++ b/google-cloud-service_health-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-service_management-v1/proto_docs/google/api/auth.rb b/google-cloud-service_management-v1/proto_docs/google/api/auth.rb index 2581e8d595c3..6d0e08e83fc1 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/auth.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/auth.rb @@ -213,6 +213,7 @@ class AuthProvider # The list of publicly documented OAuth scopes that are allowed access. An # OAuth token containing any of these scopes will be accepted. # + # # Example: # # canonical_scopes: https://www.googleapis.com/auth/calendar, diff --git a/google-cloud-service_management-v1/proto_docs/google/api/backend.rb b/google-cloud-service_management-v1/proto_docs/google/api/backend.rb index 2cdc24b1e234..1bf881715f1e 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/backend.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/backend.rb @@ -73,6 +73,10 @@ class Backend # operation. The default is no deadline. # @!attribute [rw] path_translation # @return [::Google::Api::BackendRule::PathTranslation] + # Path translation specifies how to combine the backend address with the + # request path in order to produce the appropriate forwarding URL for the + # request. See {::Google::Api::BackendRule::PathTranslation PathTranslation} for + # more details. # @!attribute [rw] jwt_audience # @return [::String] # The JWT audience is used when generating a JWT ID token for the backend. @@ -114,6 +118,13 @@ class Backend # @!attribute [rw] overrides_by_request_protocol # @return [::Google::Protobuf::Map{::String => ::Google::Api::BackendRule}] # The map between request protocol and the backend address. + # @!attribute [rw] load_balancing_policy + # @return [::String] + # The load balancing policy used for connection to the application backend. + # + # Defined as an arbitrary string to accomondate custom load balancing + # policies supported by the underlying channel, but suggest most users use + # one of the standard policies, such as the default, "RoundRobin". class BackendRule include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-service_management-v1/proto_docs/google/api/client.rb b/google-cloud-service_management-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/client.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-service_management-v1/proto_docs/google/api/control.rb b/google-cloud-service_management-v1/proto_docs/google/api/control.rb index 2ff97deae4e0..b0734e515ed8 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/control.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/control.rb @@ -28,8 +28,8 @@ module Api # @!attribute [rw] environment # @return [::String] # The service controller environment to use. If empty, no control plane - # feature (like quota and billing) will be enabled. The recommended value for - # most services is servicecontrol.googleapis.com + # features (like quota and billing) will be enabled. The recommended value + # for most services is servicecontrol.googleapis.com. # @!attribute [rw] method_policies # @return [::Array<::Google::Api::MethodPolicy>] # Defines policies applying to the API methods of the service. diff --git a/google-cloud-service_management-v1/proto_docs/google/api/service.rb b/google-cloud-service_management-v1/proto_docs/google/api/service.rb index 0934d128b9f3..816babddeac4 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/service.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/service.rb @@ -135,8 +135,7 @@ module Api # @!attribute [rw] monitored_resources # @return [::Array<::Google::Api::MonitoredResourceDescriptor>] # Defines the monitored resources used by this service. This is required - # by the {::Google::Api::Service#monitoring Service.monitoring} and - # {::Google::Api::Service#logging Service.logging} configurations. + # by the `Service.monitoring` and `Service.logging` configurations. # @!attribute [rw] billing # @return [::Google::Api::Billing] # Billing configuration. diff --git a/google-cloud-service_management-v1/proto_docs/google/api/usage.rb b/google-cloud-service_management-v1/proto_docs/google/api/usage.rb index d45b06b59247..a52b799afeac 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/usage.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/usage.rb @@ -52,30 +52,6 @@ class Usage end # Usage configuration rules for the service. - # - # NOTE: Under development. - # - # - # Use this rule to configure unregistered calls for the service. Unregistered - # calls are calls that do not contain consumer project identity. - # (Example: calls that do not contain an API key). - # By default, API methods do not allow unregistered calls, and each method call - # must be identified by a consumer project identity. Use this rule to - # allow/disallow unregistered calls. - # - # Example of an API that wants to allow unregistered calls for entire service. - # - # usage: - # rules: - # - selector: "*" - # allow_unregistered_calls: true - # - # Example of a method that wants to allow unregistered calls. - # - # usage: - # rules: - # - selector: "google.example.library.v1.LibraryService.CreateBook" - # allow_unregistered_calls: true # @!attribute [rw] selector # @return [::String] # Selects the methods to which this rule applies. Use '*' to indicate all @@ -85,8 +61,12 @@ class Usage # details. # @!attribute [rw] allow_unregistered_calls # @return [::Boolean] - # If true, the selected method allows unregistered calls, e.g. calls - # that don't identify any user or application. + # Use this rule to configure unregistered calls for the service. Unregistered + # calls are calls that do not contain consumer project identity. + # (Example: calls that do not contain an API key). + # + # WARNING: By default, API methods do not allow unregistered calls, and each + # method call must be identified by a consumer project identity. # @!attribute [rw] skip_service_control # @return [::Boolean] # If true, the selected method should skip service control and the control diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb b/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb index f2f6a8b7a576..2c028c644f75 100644 --- a/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb +++ b/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb @@ -213,6 +213,7 @@ class AuthProvider # The list of publicly documented OAuth scopes that are allowed access. An # OAuth token containing any of these scopes will be accepted. # + # # Example: # # canonical_scopes: https://www.googleapis.com/auth/calendar, diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/client.rb b/google-cloud-service_usage-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-service_usage-v1/proto_docs/google/api/client.rb +++ b/google-cloud-service_usage-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb b/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb index e2e5f4edbaa5..31b7892b2729 100644 --- a/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb +++ b/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb @@ -52,30 +52,6 @@ class Usage end # Usage configuration rules for the service. - # - # NOTE: Under development. - # - # - # Use this rule to configure unregistered calls for the service. Unregistered - # calls are calls that do not contain consumer project identity. - # (Example: calls that do not contain an API key). - # By default, API methods do not allow unregistered calls, and each method call - # must be identified by a consumer project identity. Use this rule to - # allow/disallow unregistered calls. - # - # Example of an API that wants to allow unregistered calls for entire service. - # - # usage: - # rules: - # - selector: "*" - # allow_unregistered_calls: true - # - # Example of a method that wants to allow unregistered calls. - # - # usage: - # rules: - # - selector: "google.example.library.v1.LibraryService.CreateBook" - # allow_unregistered_calls: true # @!attribute [rw] selector # @return [::String] # Selects the methods to which this rule applies. Use '*' to indicate all @@ -85,8 +61,12 @@ class Usage # details. # @!attribute [rw] allow_unregistered_calls # @return [::Boolean] - # If true, the selected method allows unregistered calls, e.g. calls - # that don't identify any user or application. + # Use this rule to configure unregistered calls for the service. Unregistered + # calls are calls that do not contain consumer project identity. + # (Example: calls that do not contain an API key). + # + # WARNING: By default, API methods do not allow unregistered calls, and each + # method call must be identified by a consumer project identity. # @!attribute [rw] skip_service_control # @return [::Boolean] # If true, the selected method should skip service control and the control diff --git a/google-cloud-shell-v1/proto_docs/google/api/client.rb b/google-cloud-shell-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-shell-v1/proto_docs/google/api/client.rb +++ b/google-cloud-shell-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb b/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb +++ b/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb b/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb +++ b/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-spanner-v1/proto_docs/google/api/client.rb b/google-cloud-spanner-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-spanner-v1/proto_docs/google/api/client.rb +++ b/google-cloud-spanner-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-speech-v1/proto_docs/google/api/client.rb b/google-cloud-speech-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-speech-v1/proto_docs/google/api/client.rb +++ b/google-cloud-speech-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb b/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-speech-v2/proto_docs/google/api/client.rb b/google-cloud-speech-v2/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-speech-v2/proto_docs/google/api/client.rb +++ b/google-cloud-speech-v2/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-storage-control-v2/proto_docs/google/api/client.rb b/google-cloud-storage-control-v2/proto_docs/google/api/client.rb index 483a6510978e..a8b1b06d1cad 100644 --- a/google-cloud-storage-control-v2/proto_docs/google/api/client.rb +++ b/google-cloud-storage-control-v2/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb b/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb index 0a6697baa4a9..497560392276 100644 --- a/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb +++ b/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb @@ -49,9 +49,13 @@ module Api # app_profile_id: profiles/prof_qux # } # - # The routing header consists of one or multiple key-value pairs. Every key - # and value must be percent-encoded, and joined together in the format of - # `key1=value1&key2=value2`. + # The routing header consists of one or multiple key-value pairs. The order of + # the key-value pairs is undefined, the order of the `routing_parameters` in + # the `RoutingRule` only matters for the evaluation order of the path + # templates when `field` is the same. See the examples below for more details. + # + # Every key and value in the routing header must be percent-encoded, + # and joined together in the following format: `key1=value1&key2=value2`. # The examples below skip the percent-encoding for readability. # # Example 1 diff --git a/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb b/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb index c6b6b60729c9..25b227e61cdc 100644 --- a/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb +++ b/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb b/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb index 44c6bee7f2e5..97193034f37c 100644 --- a/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb +++ b/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb b/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb +++ b/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-support-v2/proto_docs/google/api/client.rb b/google-cloud-support-v2/proto_docs/google/api/client.rb index 44c6bee7f2e5..97193034f37c 100644 --- a/google-cloud-support-v2/proto_docs/google/api/client.rb +++ b/google-cloud-support-v2/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-support-v2beta/proto_docs/google/api/client.rb b/google-cloud-support-v2beta/proto_docs/google/api/client.rb index c6b6b60729c9..25b227e61cdc 100644 --- a/google-cloud-support-v2beta/proto_docs/google/api/client.rb +++ b/google-cloud-support-v2beta/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/google-cloud-talent-v4/proto_docs/google/api/client.rb b/google-cloud-talent-v4/proto_docs/google/api/client.rb index 8f4ca4b4d6e5..7796382e3a21 100644 --- a/google-cloud-talent-v4/proto_docs/google/api/client.rb +++ b/google-cloud-talent-v4/proto_docs/google/api/client.rb @@ -141,9 +141,10 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 + # publishing: + # library_settings: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 # @!attribute [rw] service_class_names # @return [::Google::Protobuf::Map{::String => ::String}] # Configure the Java class name to use instead of the service's for its @@ -155,11 +156,11 @@ class Publishing # # Example of a YAML configuration:: # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. @@ -190,6 +191,20 @@ class CppSettings # @!attribute [rw] common # @return [::Google::Api::CommonLanguageSettings] # Some settings. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 class PhpSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -318,10 +333,12 @@ class RubySettings # service names and values are the name to be used for the service client # and call options. # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin class GoSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -344,10 +361,10 @@ class RenamedServicesEntry # # Example: # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... # @!attribute [rw] long_running # @return [::Google::Api::MethodSettings::LongRunning] # Describes settings to use for long-running operations when generating @@ -356,14 +373,14 @@ class RenamedServicesEntry # # Example of a YAML configuration:: # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes # @!attribute [rw] auto_populated_fields # @return [::Array<::String>] # List of top-level fields of the request message, that should be @@ -372,11 +389,24 @@ class RenamedServicesEntry # # Example of a YAML configuration: # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 class MethodSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +458,77 @@ class SelectiveGapicGeneration extend ::Google::Protobuf::MessageExts::ClassMethods end + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The organization for which the client libraries are being published. # Affects the url where generated docs are published, etc. module ClientLibraryOrganization @@ -469,5 +570,20 @@ module ClientLibraryDestination # Publish the library to package managers like nuget.org and npmjs.com. PACKAGE_MANAGER = 20 end + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end end end diff --git a/owl-bot-staging/google-cloud-service_control-v1/.gitignore b/owl-bot-staging/google-cloud-service_control-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_control-v1/.repo-metadata.json deleted file mode 100644 index 6f4ac0605165..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "servicecontrol.googleapis.com", - "api_shortname": "servicecontrol", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_control-v1/latest", - "distribution_name": "google-cloud-service_control-v1", - "is_cloud": true, - "language": "ruby", - "name": "servicecontrol", - "name_pretty": "Service Control API V1 API", - "product_documentation": "https://cloud.google.com/service-infrastructure/docs/overview/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Service Control API provides control plane functionality to managed services, such as logging, monitoring, and status checks. Note that google-cloud-service_control-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_control instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SERVICE_CONTROL", - "ruby-cloud-product-url": "https://cloud.google.com/service-infrastructure/docs/overview/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-service_control-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_control-v1/.rubocop.yml deleted file mode 100644 index 12b1f90426a5..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-service_control-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-service_control-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_control-v1/.toys.rb b/owl-bot-staging/google-cloud-service_control-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/.yardopts b/owl-bot-staging/google-cloud-service_control-v1/.yardopts deleted file mode 100644 index 2bbe9053aeb8..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Service Control API 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-service_control-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_control-v1/AUTHENTICATION.md deleted file mode 100644 index d242e6b29038..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-service_control-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-service_control-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/service_control/v1" - -client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/service_control/v1" - -::Google::Cloud::ServiceControl::V1::QuotaController::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::ServiceControl::V1::QuotaController::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-service_control-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/service_control/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::ServiceControl::V1::QuotaController::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-service_control-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_control-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-service_control-v1/Gemfile b/owl-bot-staging/google-cloud-service_control-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_control-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_control-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/README.md b/owl-bot-staging/google-cloud-service_control-v1/README.md deleted file mode 100644 index 61c19750c2f2..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Service Control API V1 API - -Provides admission control and telemetry reporting for services integrated with Service Infrastructure. - -The Service Control API provides control plane functionality to managed services, such as logging, monitoring, and status checks. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Service Control API V1 API. Most users should consider using -the main client gem, -[google-cloud-service_control](https://rubygems.org/gems/google-cloud-service_control). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-service_control-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/servicecontrol.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/service_control/v1" - -client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new -request = ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new # (request fields as keyword arguments...) -response = client.allocate_quota request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_control-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/service-infrastructure/docs/overview/) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/service_control/v1" -require "logger" - -client = ::Google::Cloud::ServiceControl::V1::QuotaController::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-service_control`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-service_control-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-service_control`. -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-service_control-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-service_control-v1/Rakefile b/owl-bot-staging/google-cloud-service_control-v1/Rakefile deleted file mode 100644 index 1cadd92fcbaf..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SERVICE_CONTROL_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SERVICE_CONTROL_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SERVICE_CONTROL_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 SERVICE_CONTROL_TEST_PROJECT=test123 SERVICE_CONTROL_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/service_control/v1/quota_controller/credentials" - ::Google::Cloud::ServiceControl::V1::QuotaController::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SERVICE_CONTROL_PROJECT"] = project - ENV["SERVICE_CONTROL_TEST_PROJECT"] = project - ENV["SERVICE_CONTROL_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-service_control-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-service_control-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-service_control-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-service_control-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-service_control-v1" - header "google-cloud-service_control-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-service_control-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-service_control-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-service_control-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-service_control-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-service_control-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_control-v1/gapic_metadata.json deleted file mode 100644 index f4217c466359..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/gapic_metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.api.servicecontrol.v1", - "libraryPackage": "::Google::Cloud::ServiceControl::V1", - "services": { - "QuotaController": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ServiceControl::V1::QuotaController::Client", - "rpcs": { - "AllocateQuota": { - "methods": [ - "allocate_quota" - ] - } - } - } - } - }, - "ServiceController": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ServiceControl::V1::ServiceController::Client", - "rpcs": { - "Check": { - "methods": [ - "check" - ] - }, - "Report": { - "methods": [ - "report" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-service_control-v1/google-cloud-service_control-v1.gemspec b/owl-bot-staging/google-cloud-service_control-v1/google-cloud-service_control-v1.gemspec deleted file mode 100644 index afc0b1bb3a36..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/google-cloud-service_control-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/service_control/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-service_control-v1" - gem.version = Google::Cloud::ServiceControl::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Service Control API provides control plane functionality to managed services, such as logging, monitoring, and status checks. Note that google-cloud-service_control-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_control instead. See the readme for more details." - gem.summary = "Provides admission control and telemetry reporting for services integrated with Service Infrastructure." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google-cloud-service_control-v1.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google-cloud-service_control-v1.rb deleted file mode 100644 index bfde08f78cb8..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google-cloud-service_control-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/service_control/v1" diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/check_error_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/check_error_pb.rb deleted file mode 100644 index 413356e9ac39..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/check_error_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicecontrol/v1/check_error.proto - -require 'google/protobuf' - -require 'google/rpc/status_pb' - - -descriptor_data = "\n.google/api/servicecontrol/v1/check_error.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x17google/rpc/status.proto\"\xae\x05\n\nCheckError\x12;\n\x04\x63ode\x18\x01 \x01(\x0e\x32-.google.api.servicecontrol.v1.CheckError.Code\x12\x0f\n\x07subject\x18\x04 \x01(\t\x12\x0e\n\x06\x64\x65tail\x18\x02 \x01(\t\x12\"\n\x06status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\"\x9d\x04\n\x04\x43ode\x12\x1a\n\x16\x45RROR_CODE_UNSPECIFIED\x10\x00\x12\r\n\tNOT_FOUND\x10\x05\x12\x15\n\x11PERMISSION_DENIED\x10\x07\x12\x16\n\x12RESOURCE_EXHAUSTED\x10\x08\x12\x19\n\x15SERVICE_NOT_ACTIVATED\x10h\x12\x14\n\x10\x42ILLING_DISABLED\x10k\x12\x13\n\x0fPROJECT_DELETED\x10l\x12\x13\n\x0fPROJECT_INVALID\x10r\x12\x14\n\x10\x43ONSUMER_INVALID\x10}\x12\x16\n\x12IP_ADDRESS_BLOCKED\x10m\x12\x13\n\x0fREFERER_BLOCKED\x10n\x12\x16\n\x12\x43LIENT_APP_BLOCKED\x10o\x12\x16\n\x12\x41PI_TARGET_BLOCKED\x10z\x12\x13\n\x0f\x41PI_KEY_INVALID\x10i\x12\x13\n\x0f\x41PI_KEY_EXPIRED\x10p\x12\x15\n\x11\x41PI_KEY_NOT_FOUND\x10q\x12\x16\n\x12INVALID_CREDENTIAL\x10{\x12!\n\x1cNAMESPACE_LOOKUP_UNAVAILABLE\x10\xac\x02\x12\x1f\n\x1aSERVICE_STATUS_UNAVAILABLE\x10\xad\x02\x12\x1f\n\x1a\x42ILLING_STATUS_UNAVAILABLE\x10\xae\x02\x12/\n*CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE\x10\xb1\x02\x42\xea\x01\n com.google.api.servicecontrol.v1B\x0f\x43heckErrorProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceControl - module V1 - CheckError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckError").msgclass - CheckError::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckError.Code").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/distribution_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/distribution_pb.rb deleted file mode 100644 index 3e7990f61904..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/distribution_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicecontrol/v1/distribution.proto - -require 'google/protobuf' - -require 'google/api/distribution_pb' - - -descriptor_data = "\n/google/api/servicecontrol/v1/distribution.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x1dgoogle/api/distribution.proto\"\x9e\x05\n\x0c\x44istribution\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\x12\x0c\n\x04mean\x18\x02 \x01(\x01\x12\x0f\n\x07minimum\x18\x03 \x01(\x01\x12\x0f\n\x07maximum\x18\x04 \x01(\x01\x12 \n\x18sum_of_squared_deviation\x18\x05 \x01(\x01\x12\x15\n\rbucket_counts\x18\x06 \x03(\x03\x12R\n\x0elinear_buckets\x18\x07 \x01(\x0b\x32\x38.google.api.servicecontrol.v1.Distribution.LinearBucketsH\x00\x12\\\n\x13\x65xponential_buckets\x18\x08 \x01(\x0b\x32=.google.api.servicecontrol.v1.Distribution.ExponentialBucketsH\x00\x12V\n\x10\x65xplicit_buckets\x18\t \x01(\x0b\x32:.google.api.servicecontrol.v1.Distribution.ExplicitBucketsH\x00\x12\x34\n\texemplars\x18\n \x03(\x0b\x32!.google.api.Distribution.Exemplar\x1aJ\n\rLinearBuckets\x12\x1a\n\x12num_finite_buckets\x18\x01 \x01(\x05\x12\r\n\x05width\x18\x02 \x01(\x01\x12\x0e\n\x06offset\x18\x03 \x01(\x01\x1aV\n\x12\x45xponentialBuckets\x12\x1a\n\x12num_finite_buckets\x18\x01 \x01(\x05\x12\x15\n\rgrowth_factor\x18\x02 \x01(\x01\x12\r\n\x05scale\x18\x03 \x01(\x01\x1a!\n\x0f\x45xplicitBuckets\x12\x0e\n\x06\x62ounds\x18\x01 \x03(\x01\x42\x0f\n\rbucket_optionB\xec\x01\n com.google.api.servicecontrol.v1B\x11\x44istributionProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceControl - module V1 - Distribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Distribution").msgclass - Distribution::LinearBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Distribution.LinearBuckets").msgclass - Distribution::ExponentialBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Distribution.ExponentialBuckets").msgclass - Distribution::ExplicitBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Distribution.ExplicitBuckets").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/http_request_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/http_request_pb.rb deleted file mode 100644 index de8a58424660..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/http_request_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicecontrol/v1/http_request.proto - -require 'google/protobuf' - -require 'google/protobuf/duration_pb' - - -descriptor_data = "\n/google/api/servicecontrol/v1/http_request.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x1egoogle/protobuf/duration.proto\"\xef\x02\n\x0bHttpRequest\x12\x16\n\x0erequest_method\x18\x01 \x01(\t\x12\x13\n\x0brequest_url\x18\x02 \x01(\t\x12\x14\n\x0crequest_size\x18\x03 \x01(\x03\x12\x0e\n\x06status\x18\x04 \x01(\x05\x12\x15\n\rresponse_size\x18\x05 \x01(\x03\x12\x12\n\nuser_agent\x18\x06 \x01(\t\x12\x11\n\tremote_ip\x18\x07 \x01(\t\x12\x11\n\tserver_ip\x18\r \x01(\t\x12\x0f\n\x07referer\x18\x08 \x01(\t\x12*\n\x07latency\x18\x0e \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x14\n\x0c\x63\x61\x63he_lookup\x18\x0b \x01(\x08\x12\x11\n\tcache_hit\x18\t \x01(\x08\x12*\n\"cache_validated_with_origin_server\x18\n \x01(\x08\x12\x18\n\x10\x63\x61\x63he_fill_bytes\x18\x0c \x01(\x03\x12\x10\n\x08protocol\x18\x0f \x01(\tB\xe8\x01\n com.google.api.servicecontrol.v1B\x10HttpRequestProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceControl - module V1 - HttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.HttpRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/log_entry_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/log_entry_pb.rb deleted file mode 100644 index 33520e195e44..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/log_entry_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicecontrol/v1/log_entry.proto - -require 'google/protobuf' - -require 'google/api/servicecontrol/v1/http_request_pb' -require 'google/logging/type/log_severity_pb' -require 'google/protobuf/any_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/api/servicecontrol/v1/log_entry.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a/google/api/servicecontrol/v1/http_request.proto\x1a&google/logging/type/log_severity.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe9\x04\n\x08LogEntry\x12\x0c\n\x04name\x18\n \x01(\t\x12-\n\ttimestamp\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x08severity\x18\x0c \x01(\x0e\x32 .google.logging.type.LogSeverity\x12?\n\x0chttp_request\x18\x0e \x01(\x0b\x32).google.api.servicecontrol.v1.HttpRequest\x12\r\n\x05trace\x18\x0f \x01(\t\x12\x11\n\tinsert_id\x18\x04 \x01(\t\x12\x42\n\x06labels\x18\r \x03(\x0b\x32\x32.google.api.servicecontrol.v1.LogEntry.LabelsEntry\x12-\n\rproto_payload\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12\x16\n\x0ctext_payload\x18\x03 \x01(\tH\x00\x12\x31\n\x0estruct_payload\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x42\n\toperation\x18\x10 \x01(\x0b\x32/.google.api.servicecontrol.v1.LogEntryOperation\x12M\n\x0fsource_location\x18\x11 \x01(\x0b\x32\x34.google.api.servicecontrol.v1.LogEntrySourceLocation\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07payload\"N\n\x11LogEntryOperation\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08producer\x18\x02 \x01(\t\x12\r\n\x05\x66irst\x18\x03 \x01(\x08\x12\x0c\n\x04last\x18\x04 \x01(\x08\"F\n\x16LogEntrySourceLocation\x12\x0c\n\x04\x66ile\x18\x01 \x01(\t\x12\x0c\n\x04line\x18\x02 \x01(\x03\x12\x10\n\x08\x66unction\x18\x03 \x01(\tB\xe5\x01\n com.google.api.servicecontrol.v1B\rLogEntryProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceControl - module V1 - LogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.LogEntry").msgclass - LogEntryOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.LogEntryOperation").msgclass - LogEntrySourceLocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.LogEntrySourceLocation").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/metric_value_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/metric_value_pb.rb deleted file mode 100644 index f9d9676426f2..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/metric_value_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicecontrol/v1/metric_value.proto - -require 'google/protobuf' - -require 'google/api/servicecontrol/v1/distribution_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/api/servicecontrol/v1/metric_value.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a/google/api/servicecontrol/v1/distribution.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x91\x03\n\x0bMetricValue\x12\x45\n\x06labels\x18\x01 \x03(\x0b\x32\x35.google.api.servicecontrol.v1.MetricValue.LabelsEntry\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\nbool_value\x18\x04 \x01(\x08H\x00\x12\x15\n\x0bint64_value\x18\x05 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x06 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x07 \x01(\tH\x00\x12H\n\x12\x64istribution_value\x18\x08 \x01(\x0b\x32*.google.api.servicecontrol.v1.DistributionH\x00\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x07\n\x05value\"g\n\x0eMetricValueSet\x12\x13\n\x0bmetric_name\x18\x01 \x01(\t\x12@\n\rmetric_values\x18\x02 \x03(\x0b\x32).google.api.servicecontrol.v1.MetricValueB\xee\x01\n com.google.api.servicecontrol.v1B\x13MetricValueSetProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceControl - module V1 - MetricValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.MetricValue").msgclass - MetricValueSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.MetricValueSet").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/operation_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/operation_pb.rb deleted file mode 100644 index 0c98c8aaddb4..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/operation_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicecontrol/v1/operation.proto - -require 'google/protobuf' - -require 'google/api/servicecontrol/v1/log_entry_pb' -require 'google/api/servicecontrol/v1/metric_value_pb' -require 'google/protobuf/any_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/api/servicecontrol/v1/operation.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a,google/api/servicecontrol/v1/log_entry.proto\x1a/google/api/servicecontrol/v1/metric_value.proto\x1a\x19google/protobuf/any.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb9\x04\n\tOperation\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12\x16\n\x0eoperation_name\x18\x02 \x01(\t\x12\x13\n\x0b\x63onsumer_id\x18\x03 \x01(\t\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.api.servicecontrol.v1.Operation.LabelsEntry\x12G\n\x11metric_value_sets\x18\x07 \x03(\x0b\x32,.google.api.servicecontrol.v1.MetricValueSet\x12;\n\x0blog_entries\x18\x08 \x03(\x0b\x32&.google.api.servicecontrol.v1.LogEntry\x12\x46\n\nimportance\x18\x0b \x01(\x0e\x32\x32.google.api.servicecontrol.v1.Operation.Importance\x12(\n\nextensions\x18\x10 \x03(\x0b\x32\x14.google.protobuf.Any\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x1f\n\nImportance\x12\x07\n\x03LOW\x10\x00\x12\x08\n\x04HIGH\x10\x01\x42\xe9\x01\n com.google.api.servicecontrol.v1B\x0eOperationProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceControl - module V1 - Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Operation").msgclass - Operation::Importance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.Operation.Importance").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_pb.rb deleted file mode 100644 index 0ea8ec878e62..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_pb.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicecontrol/v1/quota_controller.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/servicecontrol/v1/metric_value_pb' -require 'google/rpc/status_pb' -require 'google/api/client_pb' - - -descriptor_data = "\n3google/api/servicecontrol/v1/quota_controller.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x1cgoogle/api/annotations.proto\x1a/google/api/servicecontrol/v1/metric_value.proto\x1a\x17google/rpc/status.proto\x1a\x17google/api/client.proto\"\x91\x01\n\x14\x41llocateQuotaRequest\x12\x14\n\x0cservice_name\x18\x01 \x01(\t\x12H\n\x12\x61llocate_operation\x18\x02 \x01(\x0b\x32,.google.api.servicecontrol.v1.QuotaOperation\x12\x19\n\x11service_config_id\x18\x04 \x01(\t\"\xc6\x03\n\x0eQuotaOperation\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12\x13\n\x0bmethod_name\x18\x02 \x01(\t\x12\x13\n\x0b\x63onsumer_id\x18\x03 \x01(\t\x12H\n\x06labels\x18\x04 \x03(\x0b\x32\x38.google.api.servicecontrol.v1.QuotaOperation.LabelsEntry\x12\x43\n\rquota_metrics\x18\x05 \x03(\x0b\x32,.google.api.servicecontrol.v1.MetricValueSet\x12J\n\nquota_mode\x18\x06 \x01(\x0e\x32\x36.google.api.servicecontrol.v1.QuotaOperation.QuotaMode\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"j\n\tQuotaMode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x0f\n\x0b\x42\x45ST_EFFORT\x10\x02\x12\x0e\n\nCHECK_ONLY\x10\x03\x12\x0e\n\nQUERY_ONLY\x10\x04\x12\x0f\n\x0b\x41\x44JUST_ONLY\x10\x05\"\xd0\x01\n\x15\x41llocateQuotaResponse\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12\x41\n\x0f\x61llocate_errors\x18\x02 \x03(\x0b\x32(.google.api.servicecontrol.v1.QuotaError\x12\x43\n\rquota_metrics\x18\x03 \x03(\x0b\x32,.google.api.servicecontrol.v1.MetricValueSet\x12\x19\n\x11service_config_id\x18\x04 \x01(\t\"\x9c\x02\n\nQuotaError\x12;\n\x04\x63ode\x18\x01 \x01(\x0e\x32-.google.api.servicecontrol.v1.QuotaError.Code\x12\x0f\n\x07subject\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\"\n\x06status\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"\x86\x01\n\x04\x43ode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x16\n\x12RESOURCE_EXHAUSTED\x10\x08\x12\x16\n\x12\x42ILLING_NOT_ACTIVE\x10k\x12\x13\n\x0fPROJECT_DELETED\x10l\x12\x13\n\x0f\x41PI_KEY_INVALID\x10i\x12\x13\n\x0f\x41PI_KEY_EXPIRED\x10p2\xc5\x02\n\x0fQuotaController\x12\xae\x01\n\rAllocateQuota\x12\x32.google.api.servicecontrol.v1.AllocateQuotaRequest\x1a\x33.google.api.servicecontrol.v1.AllocateQuotaResponse\"4\x82\xd3\xe4\x93\x02.\")/v1/services/{service_name}:allocateQuota:\x01*\x1a\x80\x01\xca\x41\x1dservicecontrol.googleapis.com\xd2\x41]https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/servicecontrolB\xef\x01\n com.google.api.servicecontrol.v1B\x14QuotaControllerProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceControl - module V1 - AllocateQuotaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.AllocateQuotaRequest").msgclass - QuotaOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.QuotaOperation").msgclass - QuotaOperation::QuotaMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.QuotaOperation.QuotaMode").enummodule - AllocateQuotaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.AllocateQuotaResponse").msgclass - QuotaError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.QuotaError").msgclass - QuotaError::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.QuotaError.Code").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_services_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_services_pb.rb deleted file mode 100644 index 9e6901992de2..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/quota_controller_services_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/api/servicecontrol/v1/quota_controller.proto for package 'Google.Cloud.ServiceControl.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/api/servicecontrol/v1/quota_controller_pb' - -module Google - module Cloud - module ServiceControl - module V1 - module QuotaController - # [Google Quota Control API](/service-control/overview) - # - # Allows clients to allocate and release quota against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.api.servicecontrol.v1.QuotaController' - - # Attempts to allocate quota for the specified consumer. It should be called - # before the operation is executed. - # - # This method requires the `servicemanagement.services.quota` - # permission on the specified service. For more information, see - # [Cloud IAM](https://cloud.google.com/iam). - # - # **NOTE:** The client **must** fail-open on server errors `INTERNAL`, - # `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system - # reliability, the server may inject these errors to prohibit any hard - # dependency on the quota functionality. - rpc :AllocateQuota, ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest, ::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_pb.rb deleted file mode 100644 index 4c2ddaba171b..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicecontrol/v1/service_controller.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/servicecontrol/v1/check_error_pb' -require 'google/api/servicecontrol/v1/operation_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n5google/api/servicecontrol/v1/service_controller.proto\x12\x1cgoogle.api.servicecontrol.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a.google/api/servicecontrol/v1/check_error.proto\x1a,google/api/servicecontrol/v1/operation.proto\x1a\x17google/rpc/status.proto\"{\n\x0c\x43heckRequest\x12\x14\n\x0cservice_name\x18\x01 \x01(\t\x12:\n\toperation\x18\x02 \x01(\x0b\x32\'.google.api.servicecontrol.v1.Operation\x12\x19\n\x11service_config_id\x18\x04 \x01(\t\"\xfc\x04\n\rCheckResponse\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12>\n\x0c\x63heck_errors\x18\x02 \x03(\x0b\x32(.google.api.servicecontrol.v1.CheckError\x12\x19\n\x11service_config_id\x18\x05 \x01(\t\x12\x1a\n\x12service_rollout_id\x18\x0b \x01(\t\x12I\n\ncheck_info\x18\x06 \x01(\x0b\x32\x35.google.api.servicecontrol.v1.CheckResponse.CheckInfo\x1a\x8b\x01\n\tCheckInfo\x12\x18\n\x10unused_arguments\x18\x01 \x03(\t\x12O\n\rconsumer_info\x18\x02 \x01(\x0b\x32\x38.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo\x12\x13\n\x0b\x61pi_key_uid\x18\x05 \x01(\t\x1a\x84\x02\n\x0c\x43onsumerInfo\x12\x16\n\x0eproject_number\x18\x01 \x01(\x03\x12S\n\x04type\x18\x02 \x01(\x0e\x32\x45.google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType\x12\x17\n\x0f\x63onsumer_number\x18\x03 \x01(\x03\"n\n\x0c\x43onsumerType\x12\x1d\n\x19\x43ONSUMER_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PROJECT\x10\x01\x12\n\n\x06\x46OLDER\x10\x02\x12\x10\n\x0cORGANIZATION\x10\x03\x12\x14\n\x10SERVICE_SPECIFIC\x10\x04\"}\n\rReportRequest\x12\x14\n\x0cservice_name\x18\x01 \x01(\t\x12;\n\noperations\x18\x02 \x03(\x0b\x32\'.google.api.servicecontrol.v1.Operation\x12\x19\n\x11service_config_id\x18\x03 \x01(\t\"\xe1\x01\n\x0eReportResponse\x12O\n\rreport_errors\x18\x01 \x03(\x0b\x32\x38.google.api.servicecontrol.v1.ReportResponse.ReportError\x12\x19\n\x11service_config_id\x18\x02 \x01(\t\x12\x1a\n\x12service_rollout_id\x18\x04 \x01(\t\x1aG\n\x0bReportError\x12\x14\n\x0coperation_id\x18\x01 \x01(\t\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status2\xbc\x03\n\x11ServiceController\x12\x8e\x01\n\x05\x43heck\x12*.google.api.servicecontrol.v1.CheckRequest\x1a+.google.api.servicecontrol.v1.CheckResponse\",\x82\xd3\xe4\x93\x02&\"!/v1/services/{service_name}:check:\x01*\x12\x92\x01\n\x06Report\x12+.google.api.servicecontrol.v1.ReportRequest\x1a,.google.api.servicecontrol.v1.ReportResponse\"-\x82\xd3\xe4\x93\x02\'\"\"/v1/services/{service_name}:report:\x01*\x1a\x80\x01\xca\x41\x1dservicecontrol.googleapis.com\xd2\x41]https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/servicecontrolB\xf8\x01\n com.google.api.servicecontrol.v1B\x16ServiceControllerProtoP\x01ZJcloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb\xf8\x01\x01\xa2\x02\x04GASC\xaa\x02\x1eGoogle.Cloud.ServiceControl.V1\xca\x02\x1eGoogle\\Cloud\\ServiceControl\\V1\xea\x02!Google::Cloud::ServiceControl::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceControl - module V1 - CheckRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckRequest").msgclass - CheckResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckResponse").msgclass - CheckResponse::CheckInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckResponse.CheckInfo").msgclass - CheckResponse::ConsumerInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckResponse.ConsumerInfo").msgclass - CheckResponse::ConsumerInfo::ConsumerType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.CheckResponse.ConsumerInfo.ConsumerType").enummodule - ReportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.ReportRequest").msgclass - ReportResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.ReportResponse").msgclass - ReportResponse::ReportError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicecontrol.v1.ReportResponse.ReportError").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_services_pb.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_services_pb.rb deleted file mode 100644 index fe7d24ccfbad..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/api/servicecontrol/v1/service_controller_services_pb.rb +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/api/servicecontrol/v1/service_controller.proto for package 'Google.Cloud.ServiceControl.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/api/servicecontrol/v1/service_controller_pb' - -module Google - module Cloud - module ServiceControl - module V1 - module ServiceController - # [Google Service Control API](/service-control/overview) - # - # Lets clients check and report operations against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.api.servicecontrol.v1.ServiceController' - - # Checks whether an operation on a service should be allowed to proceed - # based on the configuration of the service and related policies. It must be - # called before the operation is executed. - # - # If feasible, the client should cache the check results and reuse them for - # 60 seconds. In case of any server errors, the client should rely on the - # cached results for much longer time to avoid outage. - # WARNING: There is general 60s delay for the configuration and policy - # propagation, therefore callers MUST NOT depend on the `Check` method having - # the latest policy information. - # - # NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has - # the size limit (wire-format byte size) of 1MB. - # - # This method requires the `servicemanagement.services.check` permission - # on the specified service. For more information, see - # [Cloud IAM](https://cloud.google.com/iam). - rpc :Check, ::Google::Cloud::ServiceControl::V1::CheckRequest, ::Google::Cloud::ServiceControl::V1::CheckResponse - # Reports operation results to Google Service Control, such as logs and - # metrics. It should be called after an operation is completed. - # - # If feasible, the client should aggregate reporting data for up to 5 - # seconds to reduce API traffic. Limiting aggregation to 5 seconds is to - # reduce data loss during client crashes. Clients should carefully choose - # the aggregation time window to avoid data loss risk more than 0.01% - # for business and compliance reasons. - # - # NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has - # the size limit (wire-format byte size) of 1MB. - # - # This method requires the `servicemanagement.services.report` permission - # on the specified service. For more information, see - # [Google Cloud IAM](https://cloud.google.com/iam). - rpc :Report, ::Google::Cloud::ServiceControl::V1::ReportRequest, ::Google::Cloud::ServiceControl::V1::ReportResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1.rb deleted file mode 100644 index dcc95829cf0e..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1.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/service_control/v1/quota_controller" -require "google/cloud/service_control/v1/service_controller" -require "google/cloud/service_control/v1/version" - -module Google - module Cloud - module ServiceControl - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/service_control/v1" - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/service_control/v1" - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/service_control/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller.rb deleted file mode 100644 index 32352d8a09f5..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/service_control/v1/version" - -require "google/cloud/service_control/v1/quota_controller/credentials" -require "google/cloud/service_control/v1/quota_controller/client" -require "google/cloud/service_control/v1/quota_controller/rest" - -module Google - module Cloud - module ServiceControl - module V1 - ## - # [Google Quota Control API](/service-control/overview) - # - # Allows clients to allocate and release quota against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/service_control/v1/quota_controller" - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/service_control/v1/quota_controller/rest" - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new - # - module QuotaController - end - end - end - end -end - -helper_path = ::File.join __dir__, "quota_controller", "helpers.rb" -require "google/cloud/service_control/v1/quota_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/client.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/client.rb deleted file mode 100644 index da48107007a9..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/client.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 "google/cloud/errors" -require "google/api/servicecontrol/v1/quota_controller_pb" - -module Google - module Cloud - module ServiceControl - module V1 - module QuotaController - ## - # Client for the QuotaController service. - # - # [Google Quota Control API](/service-control/overview) - # - # Allows clients to allocate and release quota against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicecontrol.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :quota_controller_stub - - ## - # Configure the QuotaController Client class. - # - # See {::Google::Cloud::ServiceControl::V1::QuotaController::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all QuotaController clients - # ::Google::Cloud::ServiceControl::V1::QuotaController::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceControl", "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 QuotaController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceControl::V1::QuotaController::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @quota_controller_stub.universe_domain - end - - ## - # Create a new QuotaController client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the QuotaController 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/api/servicecontrol/v1/quota_controller_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 - - @quota_controller_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ServiceControl::V1::QuotaController::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 - ) - - @quota_controller_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 - @quota_controller_stub.logger - end - - # Service calls - - ## - # Attempts to allocate quota for the specified consumer. It should be called - # before the operation is executed. - # - # This method requires the `servicemanagement.services.quota` - # permission on the specified service. For more information, see - # [Cloud IAM](https://cloud.google.com/iam). - # - # **NOTE:** The client **must** fail-open on server errors `INTERNAL`, - # `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system - # reliability, the server may inject these errors to prohibit any hard - # dependency on the quota functionality. - # - # @overload allocate_quota(request, options = nil) - # Pass arguments to `allocate_quota` via a request object, either of type - # {::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload allocate_quota(service_name: nil, allocate_operation: nil, service_config_id: nil) - # Pass arguments to `allocate_quota` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Name of the service as specified in the service configuration. For example, - # `"pubsub.googleapis.com"`. - # - # See [google.api.Service][google.api.Service] for the definition of a service name. - # @param allocate_operation [::Google::Cloud::ServiceControl::V1::QuotaOperation, ::Hash] - # Operation that describes the quota allocation. - # @param service_config_id [::String] - # Specifies which version of service configuration should be used to process - # the request. If unspecified or no matching version can be found, the latest - # one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_control/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceControl::V1::QuotaController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new - # - # # Call the allocate_quota method. - # result = client.allocate_quota request - # - # # The returned object is of type Google::Cloud::ServiceControl::V1::AllocateQuotaResponse. - # p result - # - def allocate_quota request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.allocate_quota.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.allocate_quota.timeout, - metadata: metadata, - retry_policy: @config.rpcs.allocate_quota.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @quota_controller_stub.call_rpc :allocate_quota, request, 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 QuotaController API. - # - # This class represents the configuration for QuotaController, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceControl::V1::QuotaController::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # allocate_quota to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceControl::V1::QuotaController::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.allocate_quota.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.allocate_quota.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::ServiceControl::V1::QuotaController::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicecontrol.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the QuotaController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `allocate_quota` - # @return [::Gapic::Config::Method] - # - attr_reader :allocate_quota - - # @private - def initialize parent_rpcs = nil - allocate_quota_config = parent_rpcs.allocate_quota if parent_rpcs.respond_to? :allocate_quota - @allocate_quota = ::Gapic::Config::Method.new allocate_quota_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/credentials.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/credentials.rb deleted file mode 100644 index e06bb9ba406a..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module ServiceControl - module V1 - module QuotaController - # Credentials for the QuotaController API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/servicecontrol" - ] - self.env_vars = [ - "SERVICE_CONTROL_CREDENTIALS", - "SERVICE_CONTROL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SERVICE_CONTROL_CREDENTIALS_JSON", - "SERVICE_CONTROL_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-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest.rb deleted file mode 100644 index cc62437a5104..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/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/service_control/v1/version" - -require "google/cloud/service_control/v1/quota_controller/credentials" -require "google/cloud/service_control/v1/quota_controller/rest/client" - -module Google - module Cloud - module ServiceControl - module V1 - ## - # [Google Quota Control API](/service-control/overview) - # - # Allows clients to allocate and release quota against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/service_control/v1/quota_controller/rest" - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new - # - module QuotaController - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/service_control/v1/quota_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/client.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/client.rb deleted file mode 100644 index 1e3c298cf0b2..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/client.rb +++ /dev/null @@ -1,444 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/api/servicecontrol/v1/quota_controller_pb" -require "google/cloud/service_control/v1/quota_controller/rest/service_stub" - -module Google - module Cloud - module ServiceControl - module V1 - module QuotaController - module Rest - ## - # REST client for the QuotaController service. - # - # [Google Quota Control API](/service-control/overview) - # - # Allows clients to allocate and release quota against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicecontrol.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :quota_controller_stub - - ## - # Configure the QuotaController Client class. - # - # See {::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all QuotaController clients - # ::Google::Cloud::ServiceControl::V1::QuotaController::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", "ServiceControl", "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 QuotaController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceControl::V1::QuotaController::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 - @quota_controller_stub.universe_domain - end - - ## - # Create a new QuotaController REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the QuotaController 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 - - @quota_controller_stub = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @quota_controller_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 - @quota_controller_stub.logger - end - - # Service calls - - ## - # Attempts to allocate quota for the specified consumer. It should be called - # before the operation is executed. - # - # This method requires the `servicemanagement.services.quota` - # permission on the specified service. For more information, see - # [Cloud IAM](https://cloud.google.com/iam). - # - # **NOTE:** The client **must** fail-open on server errors `INTERNAL`, - # `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system - # reliability, the server may inject these errors to prohibit any hard - # dependency on the quota functionality. - # - # @overload allocate_quota(request, options = nil) - # Pass arguments to `allocate_quota` via a request object, either of type - # {::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload allocate_quota(service_name: nil, allocate_operation: nil, service_config_id: nil) - # Pass arguments to `allocate_quota` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Name of the service as specified in the service configuration. For example, - # `"pubsub.googleapis.com"`. - # - # See [google.api.Service][google.api.Service] for the definition of a service name. - # @param allocate_operation [::Google::Cloud::ServiceControl::V1::QuotaOperation, ::Hash] - # Operation that describes the quota allocation. - # @param service_config_id [::String] - # Specifies which version of service configuration should be used to process - # the request. If unspecified or no matching version can be found, the latest - # one will be used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_control/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new - # - # # Call the allocate_quota method. - # result = client.allocate_quota request - # - # # The returned object is of type Google::Cloud::ServiceControl::V1::AllocateQuotaResponse. - # p result - # - def allocate_quota request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.allocate_quota.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.allocate_quota.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.allocate_quota.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @quota_controller_stub.allocate_quota request, 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 QuotaController REST API. - # - # This class represents the configuration for QuotaController REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # allocate_quota to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.allocate_quota.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.allocate_quota.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicecontrol.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the QuotaController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `allocate_quota` - # @return [::Gapic::Config::Method] - # - attr_reader :allocate_quota - - # @private - def initialize parent_rpcs = nil - allocate_quota_config = parent_rpcs.allocate_quota if parent_rpcs.respond_to? :allocate_quota - @allocate_quota = ::Gapic::Config::Method.new allocate_quota_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb deleted file mode 100644 index f4dcafdb9c1a..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/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/api/servicecontrol/v1/quota_controller_pb" - -module Google - module Cloud - module ServiceControl - module V1 - module QuotaController - module Rest - ## - # REST service stub for the QuotaController 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 allocate_quota REST call - # - # @param request_pb [::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse] - # A result object deserialized from the server's reply - def allocate_quota request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_allocate_quota_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "allocate_quota", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse.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 allocate_quota REST call - # - # @param request_pb [::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_allocate_quota_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/services/{service_name}:allocateQuota", - body: "*", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/rest.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/rest.rb deleted file mode 100644 index b1390881305c..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/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/service_control/v1/quota_controller/rest" -require "google/cloud/service_control/v1/service_controller/rest" -require "google/cloud/service_control/v1/version" - -module Google - module Cloud - module ServiceControl - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/service_control/v1/rest" - # client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller.rb deleted file mode 100644 index fcd57419afc9..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/service_control/v1/version" - -require "google/cloud/service_control/v1/service_controller/credentials" -require "google/cloud/service_control/v1/service_controller/client" -require "google/cloud/service_control/v1/service_controller/rest" - -module Google - module Cloud - module ServiceControl - module V1 - ## - # [Google Service Control API](/service-control/overview) - # - # Lets clients check and report operations against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/service_control/v1/service_controller" - # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/service_control/v1/service_controller/rest" - # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new - # - module ServiceController - end - end - end - end -end - -helper_path = ::File.join __dir__, "service_controller", "helpers.rb" -require "google/cloud/service_control/v1/service_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/client.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/client.rb deleted file mode 100644 index 994cb7199cb4..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/client.rb +++ /dev/null @@ -1,640 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/api/servicecontrol/v1/service_controller_pb" - -module Google - module Cloud - module ServiceControl - module V1 - module ServiceController - ## - # Client for the ServiceController service. - # - # [Google Service Control API](/service-control/overview) - # - # Lets clients check and report operations against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicecontrol.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :service_controller_stub - - ## - # Configure the ServiceController Client class. - # - # See {::Google::Cloud::ServiceControl::V1::ServiceController::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServiceController clients - # ::Google::Cloud::ServiceControl::V1::ServiceController::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceControl", "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.check.timeout = 5.0 - default_config.rpcs.check.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.report.timeout = 16.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServiceController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceControl::V1::ServiceController::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @service_controller_stub.universe_domain - end - - ## - # Create a new ServiceController client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServiceController 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/api/servicecontrol/v1/service_controller_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 - - @service_controller_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ServiceControl::V1::ServiceController::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 - ) - - @service_controller_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 - @service_controller_stub.logger - end - - # Service calls - - ## - # Checks whether an operation on a service should be allowed to proceed - # based on the configuration of the service and related policies. It must be - # called before the operation is executed. - # - # If feasible, the client should cache the check results and reuse them for - # 60 seconds. In case of any server errors, the client should rely on the - # cached results for much longer time to avoid outage. - # WARNING: There is general 60s delay for the configuration and policy - # propagation, therefore callers MUST NOT depend on the `Check` method having - # the latest policy information. - # - # NOTE: the {::Google::Cloud::ServiceControl::V1::CheckRequest CheckRequest} has - # the size limit (wire-format byte size) of 1MB. - # - # This method requires the `servicemanagement.services.check` permission - # on the specified service. For more information, see - # [Cloud IAM](https://cloud.google.com/iam). - # - # @overload check(request, options = nil) - # Pass arguments to `check` via a request object, either of type - # {::Google::Cloud::ServiceControl::V1::CheckRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceControl::V1::CheckRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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(service_name: nil, operation: nil, service_config_id: nil) - # Pass arguments to `check` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # The service name as specified in its service configuration. For example, - # `"pubsub.googleapis.com"`. - # - # See - # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - # for the definition of a service name. - # @param operation [::Google::Cloud::ServiceControl::V1::Operation, ::Hash] - # The operation to be checked. - # @param service_config_id [::String] - # Specifies which version of service configuration should be used to process - # the request. - # - # If unspecified or no matching version can be found, the - # latest one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceControl::V1::CheckResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceControl::V1::CheckResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_control/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceControl::V1::CheckRequest.new - # - # # Call the check method. - # result = client.check request - # - # # The returned object is of type Google::Cloud::ServiceControl::V1::CheckResponse. - # p result - # - def check request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::CheckRequest - - # Converts hash and nil to 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.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.check.timeout, - metadata: metadata, - retry_policy: @config.rpcs.check.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_controller_stub.call_rpc :check, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Reports operation results to Google Service Control, such as logs and - # metrics. It should be called after an operation is completed. - # - # If feasible, the client should aggregate reporting data for up to 5 - # seconds to reduce API traffic. Limiting aggregation to 5 seconds is to - # reduce data loss during client crashes. Clients should carefully choose - # the aggregation time window to avoid data loss risk more than 0.01% - # for business and compliance reasons. - # - # NOTE: the {::Google::Cloud::ServiceControl::V1::ReportRequest ReportRequest} has - # the size limit (wire-format byte size) of 1MB. - # - # This method requires the `servicemanagement.services.report` permission - # on the specified service. For more information, see - # [Google Cloud IAM](https://cloud.google.com/iam). - # - # @overload report(request, options = nil) - # Pass arguments to `report` via a request object, either of type - # {::Google::Cloud::ServiceControl::V1::ReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceControl::V1::ReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload report(service_name: nil, operations: nil, service_config_id: nil) - # Pass arguments to `report` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # The service name as specified in its service configuration. For example, - # `"pubsub.googleapis.com"`. - # - # See - # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - # for the definition of a service name. - # @param operations [::Array<::Google::Cloud::ServiceControl::V1::Operation, ::Hash>] - # Operations to be reported. - # - # Typically the service should report one operation per request. - # Putting multiple operations into a single request is allowed, but should - # be used only when multiple operations are natually available at the time - # of the report. - # - # There is no limit on the number of operations in the same ReportRequest, - # however the ReportRequest size should be no larger than 1MB. See - # {::Google::Cloud::ServiceControl::V1::ReportResponse#report_errors ReportResponse.report_errors} - # for partial failure behavior. - # @param service_config_id [::String] - # Specifies which version of service config should be used to process the - # request. - # - # If unspecified or no matching version can be found, the - # latest one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceControl::V1::ReportResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceControl::V1::ReportResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_control/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceControl::V1::ReportRequest.new - # - # # Call the report method. - # result = client.report request - # - # # The returned object is of type Google::Cloud::ServiceControl::V1::ReportResponse. - # p result - # - def report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::ReportRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.report.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.report.timeout, - metadata: metadata, - retry_policy: @config.rpcs.report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_controller_stub.call_rpc :report, request, 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 ServiceController API. - # - # This class represents the configuration for ServiceController, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceControl::V1::ServiceController::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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 to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceControl::V1::ServiceController::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.check.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.check.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::ServiceControl::V1::ServiceController::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicecontrol.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ServiceController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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` - # @return [::Gapic::Config::Method] - # - attr_reader :check - ## - # RPC-specific configuration for `report` - # @return [::Gapic::Config::Method] - # - attr_reader :report - - # @private - def initialize parent_rpcs = nil - check_config = parent_rpcs.check if parent_rpcs.respond_to? :check - @check = ::Gapic::Config::Method.new check_config - report_config = parent_rpcs.report if parent_rpcs.respond_to? :report - @report = ::Gapic::Config::Method.new report_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/credentials.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/credentials.rb deleted file mode 100644 index ae04179c3e7e..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module ServiceControl - module V1 - module ServiceController - # Credentials for the ServiceController API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/servicecontrol" - ] - self.env_vars = [ - "SERVICE_CONTROL_CREDENTIALS", - "SERVICE_CONTROL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SERVICE_CONTROL_CREDENTIALS_JSON", - "SERVICE_CONTROL_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-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest.rb deleted file mode 100644 index 13f29e53b5c0..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/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/service_control/v1/version" - -require "google/cloud/service_control/v1/service_controller/credentials" -require "google/cloud/service_control/v1/service_controller/rest/client" - -module Google - module Cloud - module ServiceControl - module V1 - ## - # [Google Service Control API](/service-control/overview) - # - # Lets clients check and report operations against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/service_control/v1/service_controller/rest" - # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new - # - module ServiceController - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/service_control/v1/service_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/client.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/client.rb deleted file mode 100644 index a657751772a9..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/client.rb +++ /dev/null @@ -1,583 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/api/servicecontrol/v1/service_controller_pb" -require "google/cloud/service_control/v1/service_controller/rest/service_stub" - -module Google - module Cloud - module ServiceControl - module V1 - module ServiceController - module Rest - ## - # REST client for the ServiceController service. - # - # [Google Service Control API](/service-control/overview) - # - # Lets clients check and report operations against a [managed - # service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicecontrol.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :service_controller_stub - - ## - # Configure the ServiceController Client class. - # - # See {::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServiceController clients - # ::Google::Cloud::ServiceControl::V1::ServiceController::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", "ServiceControl", "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.check.timeout = 5.0 - default_config.rpcs.check.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.report.timeout = 16.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServiceController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceControl::V1::ServiceController::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 - @service_controller_stub.universe_domain - end - - ## - # Create a new ServiceController REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServiceController 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 - - @service_controller_stub = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @service_controller_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 - @service_controller_stub.logger - end - - # Service calls - - ## - # Checks whether an operation on a service should be allowed to proceed - # based on the configuration of the service and related policies. It must be - # called before the operation is executed. - # - # If feasible, the client should cache the check results and reuse them for - # 60 seconds. In case of any server errors, the client should rely on the - # cached results for much longer time to avoid outage. - # WARNING: There is general 60s delay for the configuration and policy - # propagation, therefore callers MUST NOT depend on the `Check` method having - # the latest policy information. - # - # NOTE: the {::Google::Cloud::ServiceControl::V1::CheckRequest CheckRequest} has - # the size limit (wire-format byte size) of 1MB. - # - # This method requires the `servicemanagement.services.check` permission - # on the specified service. For more information, see - # [Cloud IAM](https://cloud.google.com/iam). - # - # @overload check(request, options = nil) - # Pass arguments to `check` via a request object, either of type - # {::Google::Cloud::ServiceControl::V1::CheckRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceControl::V1::CheckRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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(service_name: nil, operation: nil, service_config_id: nil) - # Pass arguments to `check` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # The service name as specified in its service configuration. For example, - # `"pubsub.googleapis.com"`. - # - # See - # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - # for the definition of a service name. - # @param operation [::Google::Cloud::ServiceControl::V1::Operation, ::Hash] - # The operation to be checked. - # @param service_config_id [::String] - # Specifies which version of service configuration should be used to process - # the request. - # - # If unspecified or no matching version can be found, the - # latest one will be used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceControl::V1::CheckResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceControl::V1::CheckResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_control/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceControl::V1::CheckRequest.new - # - # # Call the check method. - # result = client.check request - # - # # The returned object is of type Google::Cloud::ServiceControl::V1::CheckResponse. - # p result - # - def check request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::CheckRequest - - # Converts hash and nil to an 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.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.check.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_controller_stub.check request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Reports operation results to Google Service Control, such as logs and - # metrics. It should be called after an operation is completed. - # - # If feasible, the client should aggregate reporting data for up to 5 - # seconds to reduce API traffic. Limiting aggregation to 5 seconds is to - # reduce data loss during client crashes. Clients should carefully choose - # the aggregation time window to avoid data loss risk more than 0.01% - # for business and compliance reasons. - # - # NOTE: the {::Google::Cloud::ServiceControl::V1::ReportRequest ReportRequest} has - # the size limit (wire-format byte size) of 1MB. - # - # This method requires the `servicemanagement.services.report` permission - # on the specified service. For more information, see - # [Google Cloud IAM](https://cloud.google.com/iam). - # - # @overload report(request, options = nil) - # Pass arguments to `report` via a request object, either of type - # {::Google::Cloud::ServiceControl::V1::ReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceControl::V1::ReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload report(service_name: nil, operations: nil, service_config_id: nil) - # Pass arguments to `report` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # The service name as specified in its service configuration. For example, - # `"pubsub.googleapis.com"`. - # - # See - # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - # for the definition of a service name. - # @param operations [::Array<::Google::Cloud::ServiceControl::V1::Operation, ::Hash>] - # Operations to be reported. - # - # Typically the service should report one operation per request. - # Putting multiple operations into a single request is allowed, but should - # be used only when multiple operations are natually available at the time - # of the report. - # - # There is no limit on the number of operations in the same ReportRequest, - # however the ReportRequest size should be no larger than 1MB. See - # {::Google::Cloud::ServiceControl::V1::ReportResponse#report_errors ReportResponse.report_errors} - # for partial failure behavior. - # @param service_config_id [::String] - # Specifies which version of service config should be used to process the - # request. - # - # If unspecified or no matching version can be found, the - # latest one will be used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceControl::V1::ReportResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceControl::V1::ReportResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_control/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceControl::V1::ReportRequest.new - # - # # Call the report method. - # result = client.report request - # - # # The returned object is of type Google::Cloud::ServiceControl::V1::ReportResponse. - # p result - # - def report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceControl::V1::ReportRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.report.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceControl::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.report.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_controller_stub.report request, 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 ServiceController REST API. - # - # This class represents the configuration for ServiceController REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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 to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.check.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.check.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicecontrol.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the ServiceController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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` - # @return [::Gapic::Config::Method] - # - attr_reader :check - ## - # RPC-specific configuration for `report` - # @return [::Gapic::Config::Method] - # - attr_reader :report - - # @private - def initialize parent_rpcs = nil - check_config = parent_rpcs.check if parent_rpcs.respond_to? :check - @check = ::Gapic::Config::Method.new check_config - report_config = parent_rpcs.report if parent_rpcs.respond_to? :report - @report = ::Gapic::Config::Method.new report_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb deleted file mode 100644 index 3203240fae04..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/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/api/servicecontrol/v1/service_controller_pb" - -module Google - module Cloud - module ServiceControl - module V1 - module ServiceController - module Rest - ## - # REST service stub for the ServiceController 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 REST call - # - # @param request_pb [::Google::Cloud::ServiceControl::V1::CheckRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceControl::V1::CheckResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceControl::V1::CheckResponse] - # A result object deserialized from the server's reply - def check request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_check_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceControl::V1::CheckResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the report REST call - # - # @param request_pb [::Google::Cloud::ServiceControl::V1::ReportRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceControl::V1::ReportResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceControl::V1::ReportResponse] - # A result object deserialized from the server's reply - def report request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_report_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "report", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceControl::V1::ReportResponse.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 REST call - # - # @param request_pb [::Google::Cloud::ServiceControl::V1::CheckRequest] - # 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_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/services/{service_name}:check", - body: "*", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the report REST call - # - # @param request_pb [::Google::Cloud::ServiceControl::V1::ReportRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_report_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/services/{service_name}:report", - body: "*", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/version.rb b/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/version.rb deleted file mode 100644 index f4ed47989a7e..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/lib/google/cloud/service_control/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 ServiceControl - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/README.md deleted file mode 100644 index 9aa07e3d9899..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Service Control API 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-service_control-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/distribution.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/distribution.rb deleted file mode 100644 index e4f870d5ad0d..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/distribution.rb +++ /dev/null @@ -1,233 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # `Distribution` contains summary statistics for a population of values. It - # optionally contains a histogram representing the distribution of those values - # across a set of buckets. - # - # The summary statistics are the count, mean, sum of the squared deviation from - # the mean, the minimum, and the maximum of the set of population of values. - # The histogram is based on a sequence of buckets and gives a count of values - # that fall into each bucket. The boundaries of the buckets are given either - # explicitly or by formulas for buckets of fixed or exponentially increasing - # widths. - # - # Although it is not forbidden, it is generally a bad idea to include - # non-finite values (infinities or NaNs) in the population of values, as this - # will render the `mean` and `sum_of_squared_deviation` fields meaningless. - # @!attribute [rw] count - # @return [::Integer] - # The number of values in the population. Must be non-negative. This value - # must equal the sum of the values in `bucket_counts` if a histogram is - # provided. - # @!attribute [rw] mean - # @return [::Float] - # The arithmetic mean of the values in the population. If `count` is zero - # then this field must be zero. - # @!attribute [rw] sum_of_squared_deviation - # @return [::Float] - # The sum of squared deviations from the mean of the values in the - # population. For values x_i this is: - # - # Sum[i=1..n]((x_i - mean)^2) - # - # Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition - # describes Welford's method for accumulating this sum in one pass. - # - # If `count` is zero then this field must be zero. - # @!attribute [rw] range - # @return [::Google::Api::Distribution::Range] - # If specified, contains the range of the population values. The field - # must not be present if the `count` is zero. - # @!attribute [rw] bucket_options - # @return [::Google::Api::Distribution::BucketOptions] - # Defines the histogram bucket boundaries. If the distribution does not - # contain a histogram, then omit this field. - # @!attribute [rw] bucket_counts - # @return [::Array<::Integer>] - # The number of values in each bucket of the histogram, as described in - # `bucket_options`. If the distribution does not have a histogram, then omit - # this field. If there is a histogram, then the sum of the values in - # `bucket_counts` must equal the value in the `count` field of the - # distribution. - # - # If present, `bucket_counts` should contain N values, where N is the number - # of buckets specified in `bucket_options`. If you supply fewer than N - # values, the remaining values are assumed to be 0. - # - # The order of the values in `bucket_counts` follows the bucket numbering - # schemes described for the three bucket types. The first value must be the - # count for the underflow bucket (number 0). The next N-2 values are the - # counts for the finite buckets (number 1 through N-2). The N'th value in - # `bucket_counts` is the count for the overflow bucket (number N-1). - # @!attribute [rw] exemplars - # @return [::Array<::Google::Api::Distribution::Exemplar>] - # Must be in increasing order of `value` field. - class Distribution - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The range of the population values. - # @!attribute [rw] min - # @return [::Float] - # The minimum of the population values. - # @!attribute [rw] max - # @return [::Float] - # The maximum of the population values. - class Range - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BucketOptions` describes the bucket boundaries used to create a histogram - # for the distribution. The buckets can be in a linear sequence, an - # exponential sequence, or each bucket can be specified explicitly. - # `BucketOptions` does not include the number of values in each bucket. - # - # A bucket has an inclusive lower bound and exclusive upper bound for the - # values that are counted for that bucket. The upper bound of a bucket must - # be strictly greater than the lower bound. The sequence of N buckets for a - # distribution consists of an underflow bucket (number 0), zero or more - # finite buckets (number 1 through N - 2) and an overflow bucket (number N - - # 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the - # same as the upper bound of bucket i - 1. The buckets span the whole range - # of finite values: lower bound of the underflow bucket is -infinity and the - # upper bound of the overflow bucket is +infinity. The finite buckets are - # so-called because both bounds are finite. - # @!attribute [rw] linear_buckets - # @return [::Google::Api::Distribution::BucketOptions::Linear] - # The linear bucket. - # - # Note: The following fields are mutually exclusive: `linear_buckets`, `exponential_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exponential_buckets - # @return [::Google::Api::Distribution::BucketOptions::Exponential] - # The exponential buckets. - # - # Note: The following fields are mutually exclusive: `exponential_buckets`, `linear_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] explicit_buckets - # @return [::Google::Api::Distribution::BucketOptions::Explicit] - # The explicit buckets. - # - # Note: The following fields are mutually exclusive: `explicit_buckets`, `linear_buckets`, `exponential_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class BucketOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies a linear sequence of buckets that all have the same width - # (except overflow and underflow). Each bucket represents a constant - # absolute uncertainty on the specific value in the bucket. - # - # There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the - # following boundaries: - # - # Upper bound (0 <= i < N-1): offset + (width * i). - # - # Lower bound (1 <= i < N): offset + (width * (i - 1)). - # @!attribute [rw] num_finite_buckets - # @return [::Integer] - # Must be greater than 0. - # @!attribute [rw] width - # @return [::Float] - # Must be greater than 0. - # @!attribute [rw] offset - # @return [::Float] - # Lower bound of the first bucket. - class Linear - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies an exponential sequence of buckets that have a width that is - # proportional to the value of the lower bound. Each bucket represents a - # constant relative uncertainty on a specific value in the bucket. - # - # There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the - # following boundaries: - # - # Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). - # - # Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). - # @!attribute [rw] num_finite_buckets - # @return [::Integer] - # Must be greater than 0. - # @!attribute [rw] growth_factor - # @return [::Float] - # Must be greater than 1. - # @!attribute [rw] scale - # @return [::Float] - # Must be greater than 0. - class Exponential - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies a set of buckets with arbitrary widths. - # - # There are `size(bounds) + 1` (= N) buckets. Bucket `i` has the following - # boundaries: - # - # Upper bound (0 <= i < N-1): bounds[i] - # Lower bound (1 <= i < N); bounds[i - 1] - # - # The `bounds` field must contain at least one element. If `bounds` has - # only one element, then there are no finite buckets, and that single - # element is the common boundary of the overflow and underflow buckets. - # @!attribute [rw] bounds - # @return [::Array<::Float>] - # The values must be monotonically increasing. - class Explicit - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Exemplars are example points that may be used to annotate aggregated - # distribution values. They are metadata that gives information about a - # particular value added to a Distribution bucket, such as a trace ID that - # was active when a value was added. They may contain further information, - # such as a example values and timestamps, origin, etc. - # @!attribute [rw] value - # @return [::Float] - # Value of the exemplar point. This value determines to which bucket the - # exemplar belongs. - # @!attribute [rw] timestamp - # @return [::Google::Protobuf::Timestamp] - # The observation (sampling) time of the above value. - # @!attribute [rw] attachments - # @return [::Array<::Google::Protobuf::Any>] - # Contextual information about the example value. Examples are: - # - # Trace: type.googleapis.com/google.monitoring.v3.SpanContext - # - # Literal string: type.googleapis.com/google.protobuf.StringValue - # - # Labels dropped during aggregation: - # type.googleapis.com/google.monitoring.v3.DroppedLabels - # - # There may be only a single attachment of any given message type in a - # single exemplar, and this is enforced by the system. - class Exemplar - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/api/servicecontrol/v1/check_error.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/check_error.rb deleted file mode 100644 index 7110942b8071..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/check_error.rb +++ /dev/null @@ -1,125 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceControl - module V1 - # Defines the errors to be returned in - # {::Google::Cloud::ServiceControl::V1::CheckResponse#check_errors google.api.servicecontrol.v1.CheckResponse.check_errors}. - # @!attribute [rw] code - # @return [::Google::Cloud::ServiceControl::V1::CheckError::Code] - # The error code. - # @!attribute [rw] subject - # @return [::String] - # Subject to whom this error applies. See the specific code enum for more - # details on this field. For example: - # - # - "project:" - # - "folder:" - # - "organization:" - # @!attribute [rw] detail - # @return [::String] - # Free-form text providing details on the error cause of the error. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Contains public information about the check error. If available, - # `status.code` will be non zero and client can propagate it out as public - # error. - class CheckError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Error codes for Check responses. - module Code - # This is never used in `CheckResponse`. - ERROR_CODE_UNSPECIFIED = 0 - - # The consumer's project id, network container, or resource container was - # not found. Same as [google.rpc.Code.NOT_FOUND][google.rpc.Code.NOT_FOUND]. - NOT_FOUND = 5 - - # The consumer doesn't have access to the specified resource. - # Same as [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. - PERMISSION_DENIED = 7 - - # Quota check failed. Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED]. - RESOURCE_EXHAUSTED = 8 - - # The consumer hasn't activated the service. - SERVICE_NOT_ACTIVATED = 104 - - # The consumer cannot access the service because billing is disabled. - BILLING_DISABLED = 107 - - # The consumer's project has been marked as deleted (soft deletion). - PROJECT_DELETED = 108 - - # The consumer's project number or id does not represent a valid project. - PROJECT_INVALID = 114 - - # The input consumer info does not represent a valid consumer folder or - # organization. - CONSUMER_INVALID = 125 - - # The IP address of the consumer is invalid for the specific consumer - # project. - IP_ADDRESS_BLOCKED = 109 - - # The referer address of the consumer request is invalid for the specific - # consumer project. - REFERER_BLOCKED = 110 - - # The client application of the consumer request is invalid for the - # specific consumer project. - CLIENT_APP_BLOCKED = 111 - - # The API targeted by this request is invalid for the specified consumer - # project. - API_TARGET_BLOCKED = 122 - - # The consumer's API key is invalid. - API_KEY_INVALID = 105 - - # The consumer's API Key has expired. - API_KEY_EXPIRED = 112 - - # The consumer's API Key was not found in config record. - API_KEY_NOT_FOUND = 113 - - # The credential in the request can not be verified. - INVALID_CREDENTIAL = 123 - - # The backend server for looking up project id/number is unavailable. - NAMESPACE_LOOKUP_UNAVAILABLE = 300 - - # The backend server for checking service status is unavailable. - SERVICE_STATUS_UNAVAILABLE = 301 - - # The backend server for checking billing status is unavailable. - BILLING_STATUS_UNAVAILABLE = 302 - - # Cloud Resource Manager backend server is unavailable. - CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE = 305 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/distribution.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/distribution.rb deleted file mode 100644 index 7138a0567228..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/distribution.rb +++ /dev/null @@ -1,157 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceControl - module V1 - # Distribution represents a frequency distribution of double-valued sample - # points. It contains the size of the population of sample points plus - # additional optional information: - # - # * the arithmetic mean of the samples - # * the minimum and maximum of the samples - # * the sum-squared-deviation of the samples, used to compute variance - # * a histogram of the values of the sample points - # @!attribute [rw] count - # @return [::Integer] - # The total number of samples in the distribution. Must be >= 0. - # @!attribute [rw] mean - # @return [::Float] - # The arithmetic mean of the samples in the distribution. If `count` is - # zero then this field must be zero. - # @!attribute [rw] minimum - # @return [::Float] - # The minimum of the population of values. Ignored if `count` is zero. - # @!attribute [rw] maximum - # @return [::Float] - # The maximum of the population of values. Ignored if `count` is zero. - # @!attribute [rw] sum_of_squared_deviation - # @return [::Float] - # The sum of squared deviations from the mean: - # Sum[i=1..count]((x_i - mean)^2) - # where each x_i is a sample values. If `count` is zero then this field - # must be zero, otherwise validation of the request fails. - # @!attribute [rw] bucket_counts - # @return [::Array<::Integer>] - # The number of samples in each histogram bucket. `bucket_counts` are - # optional. If present, they must sum to the `count` value. - # - # The buckets are defined below in `bucket_option`. There are N buckets. - # `bucket_counts[0]` is the number of samples in the underflow bucket. - # `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples - # in each of the finite buckets. And `bucket_counts[N] is the number - # of samples in the overflow bucket. See the comments of `bucket_option` - # below for more details. - # - # Any suffix of trailing zeros may be omitted. - # @!attribute [rw] linear_buckets - # @return [::Google::Cloud::ServiceControl::V1::Distribution::LinearBuckets] - # Buckets with constant width. - # - # Note: The following fields are mutually exclusive: `linear_buckets`, `exponential_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exponential_buckets - # @return [::Google::Cloud::ServiceControl::V1::Distribution::ExponentialBuckets] - # Buckets with exponentially growing width. - # - # Note: The following fields are mutually exclusive: `exponential_buckets`, `linear_buckets`, `explicit_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] explicit_buckets - # @return [::Google::Cloud::ServiceControl::V1::Distribution::ExplicitBuckets] - # Buckets with arbitrary user-provided width. - # - # Note: The following fields are mutually exclusive: `explicit_buckets`, `linear_buckets`, `exponential_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exemplars - # @return [::Array<::Google::Api::Distribution::Exemplar>] - # Example points. Must be in increasing order of `value` field. - class Distribution - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describing buckets with constant width. - # @!attribute [rw] num_finite_buckets - # @return [::Integer] - # The number of finite buckets. With the underflow and overflow buckets, - # the total number of buckets is `num_finite_buckets` + 2. - # See comments on `bucket_options` for details. - # @!attribute [rw] width - # @return [::Float] - # The i'th linear bucket covers the interval - # [offset + (i-1) * width, offset + i * width) - # where i ranges from 1 to num_finite_buckets, inclusive. - # Must be strictly positive. - # @!attribute [rw] offset - # @return [::Float] - # The i'th linear bucket covers the interval - # [offset + (i-1) * width, offset + i * width) - # where i ranges from 1 to num_finite_buckets, inclusive. - class LinearBuckets - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describing buckets with exponentially growing width. - # @!attribute [rw] num_finite_buckets - # @return [::Integer] - # The number of finite buckets. With the underflow and overflow buckets, - # the total number of buckets is `num_finite_buckets` + 2. - # See comments on `bucket_options` for details. - # @!attribute [rw] growth_factor - # @return [::Float] - # The i'th exponential bucket covers the interval - # [scale * growth_factor^(i-1), scale * growth_factor^i) - # where i ranges from 1 to num_finite_buckets inclusive. - # Must be larger than 1.0. - # @!attribute [rw] scale - # @return [::Float] - # The i'th exponential bucket covers the interval - # [scale * growth_factor^(i-1), scale * growth_factor^i) - # where i ranges from 1 to num_finite_buckets inclusive. - # Must be > 0. - class ExponentialBuckets - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describing buckets with arbitrary user-provided width. - # @!attribute [rw] bounds - # @return [::Array<::Float>] - # 'bound' is a list of strictly increasing boundaries between - # buckets. Note that a list of length N-1 defines N buckets because - # of fenceposting. See comments on `bucket_options` for details. - # - # The i'th finite bucket covers the interval - # [bound[i-1], bound[i]) - # where i ranges from 1 to bound_size() - 1. Note that there are no - # finite buckets at all if 'bound' only contains a single element; in - # that special case the single bound defines the boundary between the - # underflow and overflow buckets. - # - # bucket number lower bound upper bound - # i == 0 (underflow) -inf bound[i] - # 0 < i < bound_size() bound[i-1] bound[i] - # i == bound_size() (overflow) bound[i-1] +inf - class ExplicitBuckets - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/http_request.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/http_request.rb deleted file mode 100644 index ac7a9f7bee71..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/http_request.rb +++ /dev/null @@ -1,95 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceControl - module V1 - # A common proto for logging HTTP requests. Only contains semantics - # defined by the HTTP specification. Product-specific logging - # information MUST be defined in a separate message. - # @!attribute [rw] request_method - # @return [::String] - # The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. - # @!attribute [rw] request_url - # @return [::String] - # The scheme (http, https), the host name, the path, and the query - # portion of the URL that was requested. - # Example: `"http://example.com/some/info?color=red"`. - # @!attribute [rw] request_size - # @return [::Integer] - # The size of the HTTP request message in bytes, including the request - # headers and the request body. - # @!attribute [rw] status - # @return [::Integer] - # The response code indicating the status of the response. - # Examples: 200, 404. - # @!attribute [rw] response_size - # @return [::Integer] - # The size of the HTTP response message sent back to the client, in bytes, - # including the response headers and the response body. - # @!attribute [rw] user_agent - # @return [::String] - # The user agent sent by the client. Example: - # `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET - # CLR 1.0.3705)"`. - # @!attribute [rw] remote_ip - # @return [::String] - # The IP address (IPv4 or IPv6) of the client that issued the HTTP - # request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. - # @!attribute [rw] server_ip - # @return [::String] - # The IP address (IPv4 or IPv6) of the origin server that the request was - # sent to. - # @!attribute [rw] referer - # @return [::String] - # The referer URL of the request, as defined in - # [HTTP/1.1 Header Field - # Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). - # @!attribute [rw] latency - # @return [::Google::Protobuf::Duration] - # The request processing latency on the server, from the time the request was - # received until the response was sent. - # @!attribute [rw] cache_lookup - # @return [::Boolean] - # Whether or not a cache lookup was attempted. - # @!attribute [rw] cache_hit - # @return [::Boolean] - # Whether or not an entity was served from cache - # (with or without validation). - # @!attribute [rw] cache_validated_with_origin_server - # @return [::Boolean] - # Whether or not the response was validated with the origin server before - # being served from cache. This field is only meaningful if `cache_hit` is - # True. - # @!attribute [rw] cache_fill_bytes - # @return [::Integer] - # The number of HTTP response bytes inserted into cache. Set only when a - # cache fill was attempted. - # @!attribute [rw] protocol - # @return [::String] - # Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" - class HttpRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/log_entry.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/log_entry.rb deleted file mode 100644 index bb1679135a7f..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/log_entry.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! - - -module Google - module Cloud - module ServiceControl - module V1 - # An individual log entry. - # @!attribute [rw] name - # @return [::String] - # Required. The log to which this log entry belongs. Examples: `"syslog"`, - # `"book_log"`. - # @!attribute [rw] timestamp - # @return [::Google::Protobuf::Timestamp] - # The time the event described by the log entry occurred. If - # omitted, defaults to operation start time. - # @!attribute [rw] severity - # @return [::Google::Cloud::Logging::Type::LogSeverity] - # The severity of the log entry. The default value is - # `LogSeverity.DEFAULT`. - # @!attribute [rw] http_request - # @return [::Google::Cloud::ServiceControl::V1::HttpRequest] - # Optional. Information about the HTTP request associated with this - # log entry, if applicable. - # @!attribute [rw] trace - # @return [::String] - # Optional. Resource name of the trace associated with the log entry, if any. - # If this field contains a relative resource name, you can assume the name is - # relative to `//tracing.googleapis.com`. Example: - # `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` - # @!attribute [rw] insert_id - # @return [::String] - # A unique ID for the log entry used for deduplication. If omitted, - # the implementation will generate one based on operation_id. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # A set of user-defined (key, value) data that provides additional - # information about the log entry. - # @!attribute [rw] proto_payload - # @return [::Google::Protobuf::Any] - # The log entry payload, represented as a protocol buffer that is - # expressed as a JSON object. The only accepted type currently is - # [AuditLog][google.cloud.audit.AuditLog]. - # - # Note: The following fields are mutually exclusive: `proto_payload`, `text_payload`, `struct_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_payload - # @return [::String] - # The log entry payload, represented as a Unicode string (UTF-8). - # - # Note: The following fields are mutually exclusive: `text_payload`, `proto_payload`, `struct_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_payload - # @return [::Google::Protobuf::Struct] - # The log entry payload, represented as a structure that - # is expressed as a JSON object. - # - # Note: The following fields are mutually exclusive: `struct_payload`, `proto_payload`, `text_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] operation - # @return [::Google::Cloud::ServiceControl::V1::LogEntryOperation] - # Optional. Information about an operation associated with the log entry, if - # applicable. - # @!attribute [rw] source_location - # @return [::Google::Cloud::ServiceControl::V1::LogEntrySourceLocation] - # Optional. Source code location information associated with the log entry, - # if any. - class LogEntry - 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 - - # Additional information about a potentially long-running operation with which - # a log entry is associated. - # @!attribute [rw] id - # @return [::String] - # Optional. An arbitrary operation identifier. Log entries with the - # same identifier are assumed to be part of the same operation. - # @!attribute [rw] producer - # @return [::String] - # Optional. An arbitrary producer identifier. The combination of - # `id` and `producer` must be globally unique. Examples for `producer`: - # `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - # @!attribute [rw] first - # @return [::Boolean] - # Optional. Set this to True if this is the first log entry in the operation. - # @!attribute [rw] last - # @return [::Boolean] - # Optional. Set this to True if this is the last log entry in the operation. - class LogEntryOperation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional information about the source code location that produced the log - # entry. - # @!attribute [rw] file - # @return [::String] - # Optional. Source file name. Depending on the runtime environment, this - # might be a simple name or a fully-qualified name. - # @!attribute [rw] line - # @return [::Integer] - # Optional. Line within the source file. 1-based; 0 indicates no line number - # available. - # @!attribute [rw] function - # @return [::String] - # Optional. Human-readable name of the function or method being invoked, with - # optional context such as the class or package name. This information may be - # used in contexts such as the logs viewer, where a file and line number are - # less meaningful. The format can vary by language. For example: - # `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` - # (Python). - class LogEntrySourceLocation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/metric_value.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/metric_value.rb deleted file mode 100644 index 619686dfb260..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/metric_value.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceControl - module V1 - # Represents a single metric value. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels describing the metric value. - # See comments on {::Google::Cloud::ServiceControl::V1::Operation#labels google.api.servicecontrol.v1.Operation.labels} for - # the overriding relationship. - # Note that this map must not contain monitored resource labels. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The start of the time period over which this metric value's measurement - # applies. The time period has different semantics for different metric - # types (cumulative, delta, and gauge). See the metric definition - # documentation in the service configuration for details. If not specified, - # {::Google::Cloud::ServiceControl::V1::Operation#start_time google.api.servicecontrol.v1.Operation.start_time} will be used. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The end of the time period over which this metric value's measurement - # applies. If not specified, - # {::Google::Cloud::ServiceControl::V1::Operation#end_time google.api.servicecontrol.v1.Operation.end_time} will be used. - # @!attribute [rw] bool_value - # @return [::Boolean] - # A boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `int64_value`, `double_value`, `string_value`, `distribution_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] int64_value - # @return [::Integer] - # A signed 64-bit integer value. - # - # Note: The following fields are mutually exclusive: `int64_value`, `bool_value`, `double_value`, `string_value`, `distribution_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] double_value - # @return [::Float] - # A double precision floating point value. - # - # Note: The following fields are mutually exclusive: `double_value`, `bool_value`, `int64_value`, `string_value`, `distribution_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] - # A text string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `bool_value`, `int64_value`, `double_value`, `distribution_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] distribution_value - # @return [::Google::Cloud::ServiceControl::V1::Distribution] - # A distribution value. - # - # Note: The following fields are mutually exclusive: `distribution_value`, `bool_value`, `int64_value`, `double_value`, `string_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class MetricValue - 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 - - # Represents a set of metric values in the same metric. - # Each metric value in the set should have a unique combination of start time, - # end time, and label values. - # @!attribute [rw] metric_name - # @return [::String] - # The metric name defined in the service configuration. - # @!attribute [rw] metric_values - # @return [::Array<::Google::Cloud::ServiceControl::V1::MetricValue>] - # The values in this metric. - class MetricValueSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/operation.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/operation.rb deleted file mode 100644 index 11aeafef060a..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/operation.rb +++ /dev/null @@ -1,130 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceControl - module V1 - # Represents information regarding an operation. - # @!attribute [rw] operation_id - # @return [::String] - # Identity of the operation. This must be unique within the scope of the - # service that generated the operation. If the service calls - # Check() and Report() on the same operation, the two calls should carry - # the same id. - # - # UUID version 4 is recommended, though not required. - # In scenarios where an operation is computed from existing information - # and an idempotent id is desirable for deduplication purpose, UUID version 5 - # is recommended. See RFC 4122 for details. - # @!attribute [rw] operation_name - # @return [::String] - # Fully qualified name of the operation. Reserved for future use. - # @!attribute [rw] consumer_id - # @return [::String] - # Identity of the consumer who is using the service. - # This field should be filled in for the operations initiated by a - # consumer, but not for service-initiated operations that are - # not related to a specific consumer. - # - # - This can be in one of the following formats: - # - project:PROJECT_ID, - # - project`_`number:PROJECT_NUMBER, - # - projects/PROJECT_ID or PROJECT_NUMBER, - # - folders/FOLDER_NUMBER, - # - organizations/ORGANIZATION_NUMBER, - # - api`_`key:API_KEY. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Required. Start time of the operation. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End time of the operation. - # Required when the operation is used in - # {::Google::Cloud::ServiceControl::V1::ServiceController::Client#report ServiceController.Report}, - # but optional when the operation is used in - # {::Google::Cloud::ServiceControl::V1::ServiceController::Client#check ServiceController.Check}. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels describing the operation. Only the following labels are allowed: - # - # - Labels describing monitored resources as defined in - # the service configuration. - # - Default labels of metric values. When specified, labels defined in the - # metric value override these default. - # - The following labels defined by Google Cloud Platform: - # - `cloud.googleapis.com/location` describing the location where the - # operation happened, - # - `servicecontrol.googleapis.com/user_agent` describing the user agent - # of the API request, - # - `servicecontrol.googleapis.com/service_agent` describing the service - # used to handle the API request (e.g. ESP), - # - `servicecontrol.googleapis.com/platform` describing the platform - # where the API is served, such as App Engine, Compute Engine, or - # Kubernetes Engine. - # @!attribute [rw] metric_value_sets - # @return [::Array<::Google::Cloud::ServiceControl::V1::MetricValueSet>] - # Represents information about this operation. Each MetricValueSet - # corresponds to a metric defined in the service configuration. - # The data type used in the MetricValueSet must agree with - # the data type specified in the metric definition. - # - # Within a single operation, it is not allowed to have more than one - # MetricValue instances that have the same metric names and identical - # label value combinations. If a request has such duplicated MetricValue - # instances, the entire request is rejected with - # an invalid argument error. - # @!attribute [rw] log_entries - # @return [::Array<::Google::Cloud::ServiceControl::V1::LogEntry>] - # Represents information to be logged. - # @!attribute [rw] importance - # @return [::Google::Cloud::ServiceControl::V1::Operation::Importance] - # DO NOT USE. This is an experimental field. - # @!attribute [rw] extensions - # @return [::Array<::Google::Protobuf::Any>] - # Unimplemented. - class Operation - 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 - - # Defines the importance of the data contained in the operation. - module Importance - # Allows data caching, batching, and aggregation. It provides - # higher performance with higher data loss risk. - LOW = 0 - - # Disables data aggregation to minimize data loss. It is for operations - # that contains significant monetary value or audit trail. This feature - # only applies to the client libraries. - HIGH = 1 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/quota_controller.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/quota_controller.rb deleted file mode 100644 index ebc862a7e774..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/quota_controller.rb +++ /dev/null @@ -1,232 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceControl - module V1 - # Request message for the AllocateQuota method. - # @!attribute [rw] service_name - # @return [::String] - # Name of the service as specified in the service configuration. For example, - # `"pubsub.googleapis.com"`. - # - # See [google.api.Service][google.api.Service] for the definition of a service name. - # @!attribute [rw] allocate_operation - # @return [::Google::Cloud::ServiceControl::V1::QuotaOperation] - # Operation that describes the quota allocation. - # @!attribute [rw] service_config_id - # @return [::String] - # Specifies which version of service configuration should be used to process - # the request. If unspecified or no matching version can be found, the latest - # one will be used. - class AllocateQuotaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents information regarding a quota operation. - # @!attribute [rw] operation_id - # @return [::String] - # Identity of the operation. This is expected to be unique within the scope - # of the service that generated the operation, and guarantees idempotency in - # case of retries. - # - # In order to ensure best performance and latency in the Quota backends, - # operation_ids are optimally associated with time, so that related - # operations can be accessed fast in storage. For this reason, the - # recommended token for services that intend to operate at a high QPS is - # Unix time in nanos + UUID - # @!attribute [rw] method_name - # @return [::String] - # Fully qualified name of the API method for which this quota operation is - # requested. This name is used for matching quota rules or metric rules and - # billing status rules defined in service configuration. - # - # This field should not be set if any of the following is true: - # (1) the quota operation is performed on non-API resources. - # (2) quota_metrics is set because the caller is doing quota override. - # - # - # Example of an RPC method name: - # google.example.library.v1.LibraryService.CreateShelf - # @!attribute [rw] consumer_id - # @return [::String] - # Identity of the consumer for whom this quota operation is being performed. - # - # This can be in one of the following formats: - # project:, - # project_number:, - # api_key:. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels describing the operation. - # @!attribute [rw] quota_metrics - # @return [::Array<::Google::Cloud::ServiceControl::V1::MetricValueSet>] - # Represents information about this operation. Each MetricValueSet - # corresponds to a metric defined in the service configuration. - # The data type used in the MetricValueSet must agree with - # the data type specified in the metric definition. - # - # Within a single operation, it is not allowed to have more than one - # MetricValue instances that have the same metric names and identical - # label value combinations. If a request has such duplicated MetricValue - # instances, the entire request is rejected with - # an invalid argument error. - # - # This field is mutually exclusive with method_name. - # @!attribute [rw] quota_mode - # @return [::Google::Cloud::ServiceControl::V1::QuotaOperation::QuotaMode] - # Quota mode for this operation. - class QuotaOperation - 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 - - # Supported quota modes. - module QuotaMode - # Guard against implicit default. Must not be used. - UNSPECIFIED = 0 - - # For AllocateQuota request, allocates quota for the amount specified in - # the service configuration or specified using the quota metrics. If the - # amount is higher than the available quota, allocation error will be - # returned and no quota will be allocated. - # If multiple quotas are part of the request, and one fails, none of the - # quotas are allocated or released. - NORMAL = 1 - - # The operation allocates quota for the amount specified in the service - # configuration or specified using the quota metrics. If the amount is - # higher than the available quota, request does not fail but all available - # quota will be allocated. - # For rate quota, BEST_EFFORT will continue to deduct from other groups - # even if one does not have enough quota. For allocation, it will find the - # minimum available amount across all groups and deduct that amount from - # all the affected groups. - BEST_EFFORT = 2 - - # For AllocateQuota request, only checks if there is enough quota - # available and does not change the available quota. No lock is placed on - # the available quota either. - CHECK_ONLY = 3 - - # Unimplemented. When used in AllocateQuotaRequest, this returns the - # effective quota limit(s) in the response, and no quota check will be - # performed. Not supported for other requests, and even for - # AllocateQuotaRequest, this is currently supported only for allowlisted - # services. - QUERY_ONLY = 4 - - # The operation allocates quota for the amount specified in the service - # configuration or specified using the quota metrics. If the requested - # amount is higher than the available quota, request does not fail and - # remaining quota would become negative (going over the limit). - # Not supported for Rate Quota. - ADJUST_ONLY = 5 - end - end - - # Response message for the AllocateQuota method. - # @!attribute [rw] operation_id - # @return [::String] - # The same operation_id value used in the AllocateQuotaRequest. Used for - # logging and diagnostics purposes. - # @!attribute [rw] allocate_errors - # @return [::Array<::Google::Cloud::ServiceControl::V1::QuotaError>] - # Indicates the decision of the allocate. - # @!attribute [rw] quota_metrics - # @return [::Array<::Google::Cloud::ServiceControl::V1::MetricValueSet>] - # Quota metrics to indicate the result of allocation. Depending on the - # request, one or more of the following metrics will be included: - # - # 1. Per quota group or per quota metric incremental usage will be specified - # using the following delta metric : - # "serviceruntime.googleapis.com/api/consumer/quota_used_count" - # - # 2. The quota limit reached condition will be specified using the following - # boolean metric : - # "serviceruntime.googleapis.com/quota/exceeded" - # @!attribute [rw] service_config_id - # @return [::String] - # ID of the actual config used to process the request. - class AllocateQuotaResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents error information for {::Google::Cloud::ServiceControl::V1::QuotaOperation QuotaOperation}. - # @!attribute [rw] code - # @return [::Google::Cloud::ServiceControl::V1::QuotaError::Code] - # Error code. - # @!attribute [rw] subject - # @return [::String] - # Subject to whom this error applies. See the specific enum for more details - # on this field. For example, "clientip:" or - # "project:". - # @!attribute [rw] description - # @return [::String] - # Free-form text that provides details on the cause of the error. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Contains additional information about the quota error. - # If available, `status.code` will be non zero. - class QuotaError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Error codes related to project config validations are deprecated since the - # quota controller methods do not perform these validations. Instead services - # have to call the Check method, without quota_properties field, to perform - # these validations before calling the quota controller methods. These - # methods check only for project deletion to be wipe out compliant. - module Code - # This is never used. - UNSPECIFIED = 0 - - # Quota allocation failed. - # Same as [google.rpc.Code.RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED]. - RESOURCE_EXHAUSTED = 8 - - # Consumer cannot access the service because the service requires active - # billing. - BILLING_NOT_ACTIVE = 107 - - # Consumer's project has been marked as deleted (soft deletion). - PROJECT_DELETED = 108 - - # Specified API key is invalid. - API_KEY_INVALID = 105 - - # Specified API Key has expired. - API_KEY_EXPIRED = 112 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/service_controller.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/service_controller.rb deleted file mode 100644 index c63f78cb240d..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/api/servicecontrol/v1/service_controller.rb +++ /dev/null @@ -1,217 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceControl - module V1 - # Request message for the Check method. - # @!attribute [rw] service_name - # @return [::String] - # The service name as specified in its service configuration. For example, - # `"pubsub.googleapis.com"`. - # - # See - # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - # for the definition of a service name. - # @!attribute [rw] operation - # @return [::Google::Cloud::ServiceControl::V1::Operation] - # The operation to be checked. - # @!attribute [rw] service_config_id - # @return [::String] - # Specifies which version of service configuration should be used to process - # the request. - # - # If unspecified or no matching version can be found, the - # latest one will be used. - class CheckRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the Check method. - # @!attribute [rw] operation_id - # @return [::String] - # The same operation_id value used in the - # {::Google::Cloud::ServiceControl::V1::CheckRequest CheckRequest}. Used for logging - # and diagnostics purposes. - # @!attribute [rw] check_errors - # @return [::Array<::Google::Cloud::ServiceControl::V1::CheckError>] - # Indicate the decision of the check. - # - # If no check errors are present, the service should process the operation. - # Otherwise the service should use the list of errors to determine the - # appropriate action. - # @!attribute [rw] service_config_id - # @return [::String] - # The actual config id used to process the request. - # @!attribute [rw] service_rollout_id - # @return [::String] - # The current service rollout id used to process the request. - # @!attribute [rw] check_info - # @return [::Google::Cloud::ServiceControl::V1::CheckResponse::CheckInfo] - # Feedback data returned from the server during processing a Check request. - class CheckResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contains additional information about the check operation. - # @!attribute [rw] unused_arguments - # @return [::Array<::String>] - # A list of fields and label keys that are ignored by the server. - # The client doesn't need to send them for following requests to improve - # performance and allow better aggregation. - # @!attribute [rw] consumer_info - # @return [::Google::Cloud::ServiceControl::V1::CheckResponse::ConsumerInfo] - # Consumer info of this check. - # @!attribute [rw] api_key_uid - # @return [::String] - # The unique id of the api key in the format of "apikey:". - # This field will be populated when the consumer passed to Service Control - # is an API key and all the API key related validations are successful. - class CheckInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ConsumerInfo` provides information about the consumer. - # @!attribute [rw] project_number - # @return [::Integer] - # The Google cloud project number, e.g. 1234567890. A value of 0 indicates - # no project number is found. - # - # NOTE: This field is deprecated after we support flexible consumer - # id. New code should not depend on this field anymore. - # @!attribute [rw] type - # @return [::Google::Cloud::ServiceControl::V1::CheckResponse::ConsumerInfo::ConsumerType] - # The type of the consumer which should have been defined in - # [Google Resource Manager](https://cloud.google.com/resource-manager/). - # @!attribute [rw] consumer_number - # @return [::Integer] - # The consumer identity number, can be Google cloud project number, folder - # number or organization number e.g. 1234567890. A value of 0 indicates no - # consumer number is found. - class ConsumerInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of the consumer as defined in - # [Google Resource Manager](https://cloud.google.com/resource-manager/). - module ConsumerType - # This is never used. - CONSUMER_TYPE_UNSPECIFIED = 0 - - # The consumer is a Google Cloud Project. - PROJECT = 1 - - # The consumer is a Google Cloud Folder. - FOLDER = 2 - - # The consumer is a Google Cloud Organization. - ORGANIZATION = 3 - - # Service-specific resource container which is defined by the service - # producer to offer their users the ability to manage service control - # functionalities at a finer level of granularity than the PROJECT. - SERVICE_SPECIFIC = 4 - end - end - end - - # Request message for the Report method. - # @!attribute [rw] service_name - # @return [::String] - # The service name as specified in its service configuration. For example, - # `"pubsub.googleapis.com"`. - # - # See - # [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - # for the definition of a service name. - # @!attribute [rw] operations - # @return [::Array<::Google::Cloud::ServiceControl::V1::Operation>] - # Operations to be reported. - # - # Typically the service should report one operation per request. - # Putting multiple operations into a single request is allowed, but should - # be used only when multiple operations are natually available at the time - # of the report. - # - # There is no limit on the number of operations in the same ReportRequest, - # however the ReportRequest size should be no larger than 1MB. See - # {::Google::Cloud::ServiceControl::V1::ReportResponse#report_errors ReportResponse.report_errors} - # for partial failure behavior. - # @!attribute [rw] service_config_id - # @return [::String] - # Specifies which version of service config should be used to process the - # request. - # - # If unspecified or no matching version can be found, the - # latest one will be used. - class ReportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the Report method. - # @!attribute [rw] report_errors - # @return [::Array<::Google::Cloud::ServiceControl::V1::ReportResponse::ReportError>] - # Partial failures, one for each `Operation` in the request that failed - # processing. There are three possible combinations of the RPC status: - # - # 1. The combination of a successful RPC status and an empty `report_errors` - # list indicates a complete success where all `Operations` in the - # request are processed successfully. - # 2. The combination of a successful RPC status and a non-empty - # `report_errors` list indicates a partial success where some - # `Operations` in the request succeeded. Each - # `Operation` that failed processing has a corresponding item - # in this list. - # 3. A failed RPC status indicates a general non-deterministic failure. - # When this happens, it's impossible to know which of the - # 'Operations' in the request succeeded or failed. - # @!attribute [rw] service_config_id - # @return [::String] - # The actual config id used to process the request. - # @!attribute [rw] service_rollout_id - # @return [::String] - # The current service rollout id used to process the request. - class ReportResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the processing error of one - # {::Google::Cloud::ServiceControl::V1::Operation Operation} in the request. - # @!attribute [rw] operation_id - # @return [::String] - # The - # {::Google::Cloud::ServiceControl::V1::Operation#operation_id Operation.operation_id} - # value from the request. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Details of the error when processing the - # {::Google::Cloud::ServiceControl::V1::Operation Operation}. - class ReportError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/logging/type/log_severity.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/logging/type/log_severity.rb deleted file mode 100644 index 63f6b0689a92..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/logging/type/log_severity.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Logging - module Type - # The severity of the event described in a log entry, expressed as one of the - # standard severity levels listed below. For your reference, the levels are - # assigned the listed numeric values. The effect of using numeric values other - # than those listed is undefined. - # - # You can filter for log entries by severity. For example, the following - # filter expression will match log entries with severities `INFO`, `NOTICE`, - # and `WARNING`: - # - # severity > DEBUG AND severity <= WARNING - # - # If you are writing log entries, you should map other severity encodings to - # one of these standard levels. For example, you might map all of Java's FINE, - # FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the - # original severity level in the log entry payload if you wish. - module LogSeverity - # (0) The log entry has no assigned severity level. - DEFAULT = 0 - - # (100) Debug or trace information. - DEBUG = 100 - - # (200) Routine information, such as ongoing status or performance. - INFO = 200 - - # (300) Normal but significant events, such as start up, shut down, or - # a configuration change. - NOTICE = 300 - - # (400) Warning events might cause problems. - WARNING = 400 - - # (500) Error events are likely to cause problems. - ERROR = 500 - - # (600) Critical events cause more severe problems or outages. - CRITICAL = 600 - - # (700) A person must take an action immediately. - ALERT = 700 - - # (800) One or more systems are unusable. - EMERGENCY = 800 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-service_control-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_control-v1/snippets/Gemfile deleted file mode 100644 index 2860c5bace9a..000000000000 --- a/owl-bot-staging/google-cloud-service_control-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-service_control-v1", path: "../" -else - gem "google-cloud-service_control-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-service_control-v1/snippets/quota_controller/allocate_quota.rb b/owl-bot-staging/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb deleted file mode 100644 index 6b1f93d4a4b8..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicecontrol_v1_generated_QuotaController_AllocateQuota_sync] -require "google/cloud/service_control/v1" - -## -# Snippet for the allocate_quota call in the QuotaController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceControl::V1::QuotaController::Client#allocate_quota. -# -def allocate_quota - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceControl::V1::QuotaController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new - - # Call the allocate_quota method. - result = client.allocate_quota request - - # The returned object is of type Google::Cloud::ServiceControl::V1::AllocateQuotaResponse. - p result -end -# [END servicecontrol_v1_generated_QuotaController_AllocateQuota_sync] diff --git a/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/check.rb b/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/check.rb deleted file mode 100644 index 2f26d0a78028..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/check.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicecontrol_v1_generated_ServiceController_Check_sync] -require "google/cloud/service_control/v1" - -## -# Snippet for the check call in the ServiceController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceControl::V1::ServiceController::Client#check. -# -def check - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceControl::V1::CheckRequest.new - - # Call the check method. - result = client.check request - - # The returned object is of type Google::Cloud::ServiceControl::V1::CheckResponse. - p result -end -# [END servicecontrol_v1_generated_ServiceController_Check_sync] diff --git a/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/report.rb b/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/report.rb deleted file mode 100644 index cc7c77bb4409..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/snippets/service_controller/report.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicecontrol_v1_generated_ServiceController_Report_sync] -require "google/cloud/service_control/v1" - -## -# Snippet for the report call in the ServiceController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceControl::V1::ServiceController::Client#report. -# -def report - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceControl::V1::ReportRequest.new - - # Call the report method. - result = client.report request - - # The returned object is of type Google::Cloud::ServiceControl::V1::ReportResponse. - p result -end -# [END servicecontrol_v1_generated_ServiceController_Report_sync] diff --git a/owl-bot-staging/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json b/owl-bot-staging/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json deleted file mode 100644 index fc96d4a24ac2..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-service_control-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.api.servicecontrol.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "servicecontrol_v1_generated_QuotaController_AllocateQuota_sync", - "title": "Snippet for the allocate_quota call in the QuotaController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceControl::V1::QuotaController::Client#allocate_quota.", - "file": "quota_controller/allocate_quota.rb", - "language": "RUBY", - "client_method": { - "short_name": "allocate_quota", - "full_name": "::Google::Cloud::ServiceControl::V1::QuotaController::Client#allocate_quota", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse", - "client": { - "short_name": "QuotaController::Client", - "full_name": "::Google::Cloud::ServiceControl::V1::QuotaController::Client" - }, - "method": { - "short_name": "AllocateQuota", - "full_name": "google.api.servicecontrol.v1.QuotaController.AllocateQuota", - "service": { - "short_name": "QuotaController", - "full_name": "google.api.servicecontrol.v1.QuotaController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicecontrol_v1_generated_ServiceController_Check_sync", - "title": "Snippet for the check call in the ServiceController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceControl::V1::ServiceController::Client#check.", - "file": "service_controller/check.rb", - "language": "RUBY", - "client_method": { - "short_name": "check", - "full_name": "::Google::Cloud::ServiceControl::V1::ServiceController::Client#check", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceControl::V1::CheckRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceControl::V1::CheckResponse", - "client": { - "short_name": "ServiceController::Client", - "full_name": "::Google::Cloud::ServiceControl::V1::ServiceController::Client" - }, - "method": { - "short_name": "Check", - "full_name": "google.api.servicecontrol.v1.ServiceController.Check", - "service": { - "short_name": "ServiceController", - "full_name": "google.api.servicecontrol.v1.ServiceController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicecontrol_v1_generated_ServiceController_Report_sync", - "title": "Snippet for the report call in the ServiceController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceControl::V1::ServiceController::Client#report.", - "file": "service_controller/report.rb", - "language": "RUBY", - "client_method": { - "short_name": "report", - "full_name": "::Google::Cloud::ServiceControl::V1::ServiceController::Client#report", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceControl::V1::ReportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceControl::V1::ReportResponse", - "client": { - "short_name": "ServiceController::Client", - "full_name": "::Google::Cloud::ServiceControl::V1::ServiceController::Client" - }, - "method": { - "short_name": "Report", - "full_name": "google.api.servicecontrol.v1.ServiceController.Report", - "service": { - "short_name": "ServiceController", - "full_name": "google.api.servicecontrol.v1.ServiceController" - } - } - }, - "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-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb deleted file mode 100644 index 0f19356538a5..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_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/api/servicecontrol/v1/quota_controller_pb" -require "google/cloud/service_control/v1/quota_controller/rest" - - -class ::Google::Cloud::ServiceControl::V1::QuotaController::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_allocate_quota - # Create test objects. - client_result = ::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - allocate_operation = {} - service_config_id = "hello world" - - allocate_quota_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::ServiceStub.stub :transcode_allocate_quota_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, allocate_quota_client_stub do - # Create client - client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.allocate_quota({ service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.allocate_quota service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.allocate_quota ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new(service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.allocate_quota({ service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.allocate_quota(::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new(service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, allocate_quota_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::ServiceControl::V1::QuotaController::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::ServiceControl::V1::QuotaController::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb deleted file mode 100644 index afde88fdd136..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb +++ /dev/null @@ -1,166 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/api/servicecontrol/v1/quota_controller_pb" -require "google/cloud/service_control/v1/quota_controller" - -class ::Google::Cloud::ServiceControl::V1::QuotaController::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_allocate_quota - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceControl::V1::AllocateQuotaResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - allocate_operation = {} - service_config_id = "hello world" - - allocate_quota_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :allocate_quota, name - assert_kind_of ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest, request - assert_equal "hello world", request["service_name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceControl::V1::QuotaOperation), request["allocate_operation"] - assert_equal "hello world", request["service_config_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, allocate_quota_client_stub do - # Create client - client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.allocate_quota({ service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.allocate_quota service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.allocate_quota ::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new(service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.allocate_quota({ service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.allocate_quota(::Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new(service_name: service_name, allocate_operation: allocate_operation, service_config_id: service_config_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, allocate_quota_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceControl::V1::QuotaController::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::ServiceControl::V1::QuotaController::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::ServiceControl::V1::QuotaController::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ServiceControl::V1::QuotaController::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb deleted file mode 100644 index e69da3904bfb..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb +++ /dev/null @@ -1,211 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/api/servicecontrol/v1/service_controller_pb" -require "google/cloud/service_control/v1/service_controller/rest" - - -class ::Google::Cloud::ServiceControl::V1::ServiceController::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 - # Create test objects. - client_result = ::Google::Cloud::ServiceControl::V1::CheckResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - operation = {} - service_config_id = "hello world" - - check_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::ServiceStub.stub :transcode_check_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, check_client_stub do - # Create client - client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.check({ service_name: service_name, operation: operation, service_config_id: service_config_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.check service_name: service_name, operation: operation, service_config_id: service_config_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.check ::Google::Cloud::ServiceControl::V1::CheckRequest.new(service_name: service_name, operation: operation, service_config_id: service_config_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.check({ service_name: service_name, operation: operation, service_config_id: service_config_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.check(::Google::Cloud::ServiceControl::V1::CheckRequest.new(service_name: service_name, operation: operation, service_config_id: service_config_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, check_client_stub.call_count - end - end - end - - def test_report - # Create test objects. - client_result = ::Google::Cloud::ServiceControl::V1::ReportResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - operations = [{}] - service_config_id = "hello world" - - report_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::ServiceStub.stub :transcode_report_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, report_client_stub do - # Create client - client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.report({ service_name: service_name, operations: operations, service_config_id: service_config_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.report service_name: service_name, operations: operations, service_config_id: service_config_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.report ::Google::Cloud::ServiceControl::V1::ReportRequest.new(service_name: service_name, operations: operations, service_config_id: service_config_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.report({ service_name: service_name, operations: operations, service_config_id: service_config_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.report(::Google::Cloud::ServiceControl::V1::ReportRequest.new(service_name: service_name, operations: operations, service_config_id: service_config_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, report_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::ServiceControl::V1::ServiceController::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::ServiceControl::V1::ServiceController::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb b/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb deleted file mode 100644 index 28c4b1c80654..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb +++ /dev/null @@ -1,228 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/api/servicecontrol/v1/service_controller_pb" -require "google/cloud/service_control/v1/service_controller" - -class ::Google::Cloud::ServiceControl::V1::ServiceController::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 - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceControl::V1::CheckResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - operation = {} - service_config_id = "hello world" - - check_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :check, name - assert_kind_of ::Google::Cloud::ServiceControl::V1::CheckRequest, request - assert_equal "hello world", request["service_name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceControl::V1::Operation), request["operation"] - assert_equal "hello world", request["service_config_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, check_client_stub do - # Create client - client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.check({ service_name: service_name, operation: operation, service_config_id: service_config_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.check service_name: service_name, operation: operation, service_config_id: service_config_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.check ::Google::Cloud::ServiceControl::V1::CheckRequest.new(service_name: service_name, operation: operation, service_config_id: service_config_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.check({ service_name: service_name, operation: operation, service_config_id: service_config_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.check(::Google::Cloud::ServiceControl::V1::CheckRequest.new(service_name: service_name, operation: operation, service_config_id: service_config_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, check_client_stub.call_rpc_count - end - end - - def test_report - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceControl::V1::ReportResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - operations = [{}] - service_config_id = "hello world" - - report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :report, name - assert_kind_of ::Google::Cloud::ServiceControl::V1::ReportRequest, request - assert_equal "hello world", request["service_name"] - assert_kind_of ::Google::Cloud::ServiceControl::V1::Operation, request["operations"].first - assert_equal "hello world", request["service_config_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, report_client_stub do - # Create client - client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.report({ service_name: service_name, operations: operations, service_config_id: service_config_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.report service_name: service_name, operations: operations, service_config_id: service_config_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.report ::Google::Cloud::ServiceControl::V1::ReportRequest.new(service_name: service_name, operations: operations, service_config_id: service_config_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.report({ service_name: service_name, operations: operations, service_config_id: service_config_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.report(::Google::Cloud::ServiceControl::V1::ReportRequest.new(service_name: service_name, operations: operations, service_config_id: service_config_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, report_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceControl::V1::ServiceController::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::ServiceControl::V1::ServiceController::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::ServiceControl::V1::ServiceController::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ServiceControl::V1::ServiceController::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-service_control-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_control-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-service_control-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_directory-v1/.gitignore b/owl-bot-staging/google-cloud-service_directory-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_directory-v1/.repo-metadata.json deleted file mode 100644 index e30062150998..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "servicedirectory.googleapis.com", - "api_shortname": "servicedirectory", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1/latest", - "distribution_name": "google-cloud-service_directory-v1", - "is_cloud": true, - "language": "ruby", - "name": "servicedirectory", - "name_pretty": "Service Directory V1 API", - "product_documentation": "https://cloud.google.com/service-directory", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Service Directory is the single place to register, browse, and resolve application services. Note that google-cloud-service_directory-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_directory instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SERVICE_DIRECTORY", - "ruby-cloud-product-url": "https://cloud.google.com/service-directory", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-service_directory-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_directory-v1/.rubocop.yml deleted file mode 100644 index 2903a8a1c753..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-service_directory-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-service_directory-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_directory-v1/.toys.rb b/owl-bot-staging/google-cloud-service_directory-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/.yardopts b/owl-bot-staging/google-cloud-service_directory-v1/.yardopts deleted file mode 100644 index 769ff9a87e62..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Service Directory 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-service_directory-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_directory-v1/AUTHENTICATION.md deleted file mode 100644 index 8f7d9efc4ef2..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-service_directory-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-service_directory-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/service_directory/v1" - -client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/service_directory/v1" - -::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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-service_directory-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/service_directory/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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-service_directory-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_directory-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-service_directory-v1/Gemfile b/owl-bot-staging/google-cloud-service_directory-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_directory-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_directory-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/README.md b/owl-bot-staging/google-cloud-service_directory-v1/README.md deleted file mode 100644 index 247ee156e088..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Service Directory V1 API - -Service Directory is a platform for discovering, publishing, and connecting services. - -Service Directory is the single place to register, browse, and resolve application 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 Service Directory V1 API. Most users should consider using -the main client gem, -[google-cloud-service_directory](https://rubygems.org/gems/google-cloud-service_directory). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-service_directory-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/servicedirectory.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/service_directory/v1" - -client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new -request = ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new # (request fields as keyword arguments...) -response = client.resolve_service request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/service-directory) -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/service_directory/v1" -require "logger" - -client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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-service_directory`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-service_directory-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-service_directory`. -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-service_directory-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-service_directory-v1/Rakefile b/owl-bot-staging/google-cloud-service_directory-v1/Rakefile deleted file mode 100644 index f9df8b5c37c1..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SERVICE_DIRECTORY_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SERVICE_DIRECTORY_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SERVICE_DIRECTORY_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 SERVICE_DIRECTORY_TEST_PROJECT=test123 SERVICE_DIRECTORY_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/service_directory/v1/lookup_service/credentials" - ::Google::Cloud::ServiceDirectory::V1::LookupService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SERVICE_DIRECTORY_PROJECT"] = project - ENV["SERVICE_DIRECTORY_TEST_PROJECT"] = project - ENV["SERVICE_DIRECTORY_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-service_directory-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-service_directory-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-service_directory-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-service_directory-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-service_directory-v1" - header "google-cloud-service_directory-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-service_directory-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-service_directory-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-service_directory-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-service_directory-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-service_directory-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_directory-v1/gapic_metadata.json deleted file mode 100644 index 7e737f2663a2..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/gapic_metadata.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.servicedirectory.v1", - "libraryPackage": "::Google::Cloud::ServiceDirectory::V1", - "services": { - "LookupService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ServiceDirectory::V1::LookupService::Client", - "rpcs": { - "ResolveService": { - "methods": [ - "resolve_service" - ] - } - } - } - } - }, - "RegistrationService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client", - "rpcs": { - "CreateNamespace": { - "methods": [ - "create_namespace" - ] - }, - "ListNamespaces": { - "methods": [ - "list_namespaces" - ] - }, - "GetNamespace": { - "methods": [ - "get_namespace" - ] - }, - "UpdateNamespace": { - "methods": [ - "update_namespace" - ] - }, - "DeleteNamespace": { - "methods": [ - "delete_namespace" - ] - }, - "CreateService": { - "methods": [ - "create_service" - ] - }, - "ListServices": { - "methods": [ - "list_services" - ] - }, - "GetService": { - "methods": [ - "get_service" - ] - }, - "UpdateService": { - "methods": [ - "update_service" - ] - }, - "DeleteService": { - "methods": [ - "delete_service" - ] - }, - "CreateEndpoint": { - "methods": [ - "create_endpoint" - ] - }, - "ListEndpoints": { - "methods": [ - "list_endpoints" - ] - }, - "GetEndpoint": { - "methods": [ - "get_endpoint" - ] - }, - "UpdateEndpoint": { - "methods": [ - "update_endpoint" - ] - }, - "DeleteEndpoint": { - "methods": [ - "delete_endpoint" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-service_directory-v1/google-cloud-service_directory-v1.gemspec b/owl-bot-staging/google-cloud-service_directory-v1/google-cloud-service_directory-v1.gemspec deleted file mode 100644 index 5d5f9fb75909..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/google-cloud-service_directory-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/service_directory/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-service_directory-v1" - gem.version = Google::Cloud::ServiceDirectory::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Service Directory is the single place to register, browse, and resolve application services. Note that google-cloud-service_directory-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_directory instead. See the readme for more details." - gem.summary = "Service Directory is a platform for discovering, publishing, and connecting services." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google-cloud-service_directory-v1.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google-cloud-service_directory-v1.rb deleted file mode 100644 index 7e40c302a7eb..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google-cloud-service_directory-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/service_directory/v1" diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1.rb deleted file mode 100644 index 356086baaaf1..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1.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/service_directory/v1/lookup_service" -require "google/cloud/service_directory/v1/registration_service" -require "google/cloud/service_directory/v1/version" - -module Google - module Cloud - module ServiceDirectory - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/service_directory/v1" - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/service_directory/v1" - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/service_directory/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/bindings_override.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/bindings_override.rb deleted file mode 100644 index 0b6ee08b6376..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/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 ServiceDirectory - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/service_directory/v1/rest" - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceDirectory"] - parent_config = while namespace.any? - parent_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-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service.rb deleted file mode 100644 index f8b983756e2c..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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/service_directory/v1/version" - -require "google/cloud/service_directory/v1/lookup_service/credentials" -require "google/cloud/service_directory/v1/lookup_service/paths" -require "google/cloud/service_directory/v1/lookup_service/client" -require "google/cloud/service_directory/v1/lookup_service/rest" - -module Google - module Cloud - module ServiceDirectory - module V1 - ## - # Service Directory API for looking up service data at runtime. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/service_directory/v1/lookup_service" - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/service_directory/v1/lookup_service/rest" - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new - # - module LookupService - end - end - end - end -end - -helper_path = ::File.join __dir__, "lookup_service", "helpers.rb" -require "google/cloud/service_directory/v1/lookup_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb deleted file mode 100644 index d450c568ab7e..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb +++ /dev/null @@ -1,538 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/servicedirectory/v1/lookup_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module ServiceDirectory - module V1 - module LookupService - ## - # Client for the LookupService service. - # - # Service Directory API for looking up service data at runtime. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :lookup_service_stub - - ## - # Configure the LookupService Client class. - # - # See {::Google::Cloud::ServiceDirectory::V1::LookupService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all LookupService clients - # ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceDirectory", "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 = 15.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the LookupService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceDirectory::V1::LookupService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @lookup_service_stub.universe_domain - end - - ## - # Create a new LookupService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the LookupService 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/servicedirectory/v1/lookup_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 - - @lookup_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ServiceDirectory::V1::LookupService::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 - ) - - @lookup_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @lookup_service_stub.endpoint - config.universe_domain = @lookup_service_stub.universe_domain - config.logger = @lookup_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @lookup_service_stub.logger - end - - # Service calls - - ## - # Returns a {::Google::Cloud::ServiceDirectory::V1::Service service} and its - # associated endpoints. - # Resolving a service is not considered an active developer method. - # - # @overload resolve_service(request, options = nil) - # Pass arguments to `resolve_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) - # Pass arguments to `resolve_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to resolve. - # @param max_endpoints [::Integer] - # Optional. The maximum number of endpoints to return. Defaults to 25. - # Maximum is 100. If a value less than one is specified, the Default is used. - # If a value greater than the Maximum is specified, the Maximum is used. - # @param endpoint_filter [::String] - # Optional. The filter applied to the endpoints of the resolved service. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, or `annotations.` for - # map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `annotations.owner` returns endpoints that have a annotation with the - # key `owner`, this is the same as `annotations:owner` - # * `annotations.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * - # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - # returns the endpoint that has an endpoint_id equal to `ep-1` - # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - # have `owner` in annotation key but value is not `sd` AND have - # key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoint, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::LookupService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new - # - # # Call the resolve_service method. - # result = client.resolve_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse. - # p result - # - def resolve_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.resolve_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.resolve_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resolve_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @lookup_service_stub.call_rpc :resolve_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the LookupService API. - # - # This class represents the configuration for LookupService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceDirectory::V1::LookupService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # resolve_service to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.resolve_service.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.resolve_service.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::ServiceDirectory::V1::LookupService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the LookupService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `resolve_service` - # @return [::Gapic::Config::Method] - # - attr_reader :resolve_service - - # @private - def initialize parent_rpcs = nil - resolve_service_config = parent_rpcs.resolve_service if parent_rpcs.respond_to? :resolve_service - @resolve_service = ::Gapic::Config::Method.new resolve_service_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/credentials.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/credentials.rb deleted file mode 100644 index 6c5cf14ef212..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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 ServiceDirectory - module V1 - module LookupService - # Credentials for the LookupService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SERVICE_DIRECTORY_CREDENTIALS", - "SERVICE_DIRECTORY_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SERVICE_DIRECTORY_CREDENTIALS_JSON", - "SERVICE_DIRECTORY_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-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/paths.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/paths.rb deleted file mode 100644 index cc44f978fb76..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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 ServiceDirectory - module V1 - module LookupService - # Path helper methods for the LookupService API. - module Paths - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, namespace:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest.rb deleted file mode 100644 index b8876ebbbc79..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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/service_directory/v1/version" -require "google/cloud/service_directory/v1/bindings_override" - -require "google/cloud/service_directory/v1/lookup_service/credentials" -require "google/cloud/service_directory/v1/lookup_service/paths" -require "google/cloud/service_directory/v1/lookup_service/rest/client" - -module Google - module Cloud - module ServiceDirectory - module V1 - ## - # Service Directory API for looking up service data at runtime. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/service_directory/v1/lookup_service/rest" - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new - # - module LookupService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/service_directory/v1/lookup_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb deleted file mode 100644 index 363bf0c08240..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/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/cloud/servicedirectory/v1/lookup_service_pb" -require "google/cloud/service_directory/v1/lookup_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module ServiceDirectory - module V1 - module LookupService - module Rest - ## - # REST client for the LookupService service. - # - # Service Directory API for looking up service data at runtime. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :lookup_service_stub - - ## - # Configure the LookupService Client class. - # - # See {::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all LookupService clients - # ::Google::Cloud::ServiceDirectory::V1::LookupService::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", "ServiceDirectory", "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 = 15.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the LookupService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceDirectory::V1::LookupService::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 - @lookup_service_stub.universe_domain - end - - ## - # Create a new LookupService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the LookupService 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 - - @lookup_service_stub = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @lookup_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @lookup_service_stub.endpoint - config.universe_domain = @lookup_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @lookup_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @lookup_service_stub.logger - end - - # Service calls - - ## - # Returns a {::Google::Cloud::ServiceDirectory::V1::Service service} and its - # associated endpoints. - # Resolving a service is not considered an active developer method. - # - # @overload resolve_service(request, options = nil) - # Pass arguments to `resolve_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) - # Pass arguments to `resolve_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to resolve. - # @param max_endpoints [::Integer] - # Optional. The maximum number of endpoints to return. Defaults to 25. - # Maximum is 100. If a value less than one is specified, the Default is used. - # If a value greater than the Maximum is specified, the Maximum is used. - # @param endpoint_filter [::String] - # Optional. The filter applied to the endpoints of the resolved service. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, or `annotations.` for - # map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `annotations.owner` returns endpoints that have a annotation with the - # key `owner`, this is the same as `annotations:owner` - # * `annotations.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * - # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - # returns the endpoint that has an endpoint_id equal to `ep-1` - # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - # have `owner` in annotation key but value is not `sd` AND have - # key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoint, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new - # - # # Call the resolve_service method. - # result = client.resolve_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse. - # p result - # - def resolve_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.resolve_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.resolve_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resolve_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @lookup_service_stub.resolve_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the LookupService REST API. - # - # This class represents the configuration for LookupService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # resolve_service to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.resolve_service.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.resolve_service.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 LookupService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `resolve_service` - # @return [::Gapic::Config::Method] - # - attr_reader :resolve_service - - # @private - def initialize parent_rpcs = nil - resolve_service_config = parent_rpcs.resolve_service if parent_rpcs.respond_to? :resolve_service - @resolve_service = ::Gapic::Config::Method.new resolve_service_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb deleted file mode 100644 index 2afe5d13b79c..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_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/servicedirectory/v1/lookup_service_pb" - -module Google - module Cloud - module ServiceDirectory - module V1 - module LookupService - module Rest - ## - # REST service stub for the LookupService 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 resolve_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse] - # A result object deserialized from the server's reply - def resolve_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resolve_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "resolve_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse.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 resolve_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resolve_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:resolve", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service.rb deleted file mode 100644 index 33d7c627d411..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/service_directory/v1/version" - -require "google/cloud/service_directory/v1/registration_service/credentials" -require "google/cloud/service_directory/v1/registration_service/paths" -require "google/cloud/service_directory/v1/registration_service/client" -require "google/cloud/service_directory/v1/registration_service/rest" - -module Google - module Cloud - module ServiceDirectory - module V1 - ## - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Namespace Namespace} - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Service Service} resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Endpoint Endpoint} - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/service_directory/v1/registration_service" - # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/service_directory/v1/registration_service/rest" - # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - module RegistrationService - end - end - end - end -end - -helper_path = ::File.join __dir__, "registration_service", "helpers.rb" -require "google/cloud/service_directory/v1/registration_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb deleted file mode 100644 index ec031e78140d..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb +++ /dev/null @@ -1,2297 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/servicedirectory/v1/registration_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module ServiceDirectory - module V1 - module RegistrationService - ## - # Client for the RegistrationService service. - # - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Namespace Namespace} - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Service Service} resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Endpoint Endpoint} - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :registration_service_stub - - ## - # Configure the RegistrationService Client class. - # - # See {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RegistrationService clients - # ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceDirectory", "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 = 15.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RegistrationService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @registration_service_stub.universe_domain - end - - ## - # Create a new RegistrationService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RegistrationService 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/servicedirectory/v1/registration_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 - - @registration_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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 - ) - - @registration_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @registration_service_stub.endpoint - config.universe_domain = @registration_service_stub.universe_domain - config.logger = @registration_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @registration_service_stub.logger - end - - # Service calls - - ## - # Creates a namespace, and returns the new namespace. - # - # @overload create_namespace(request, options = nil) - # Pass arguments to `create_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_namespace(parent: nil, namespace_id: nil, namespace: nil) - # Pass arguments to `create_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project and location the namespace - # will be created in. - # @param namespace_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param namespace [::Google::Cloud::ServiceDirectory::V1::Namespace, ::Hash] - # Required. A namespace with initial fields set. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Namespace] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new - # - # # Call the create_namespace method. - # result = client.create_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. - # p result - # - def create_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest - - # Converts hash and nil to 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_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_namespace.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :create_namespace, request, 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 namespaces. - # - # @overload list_namespaces(request, options = nil) - # Pass arguments to `list_namespaces` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_namespaces` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project and location whose namespaces - # you'd like to list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name` or `labels.` for map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `labels.owner` returns namespaces that have a label with the key - # `owner`, this is the same as `labels:owner` - # * `labels.owner=sd` returns namespaces that have key/value - # `owner=sd` - # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - # returns namespaces that have name that is alphabetically later than the - # string, so "namespace-e" is returned but "namespace-a" is not - # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - # `owner` in label key but value is not `sd` AND have key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that namespace - # doesn't have a field called "doesnotexist". Since the filter does not - # match any namespaces, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.new - # - # # Call the list_namespaces method. - # result = client.list_namespaces request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Namespace. - # p item - # end - # - def list_namespaces request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_namespaces.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_namespaces.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_namespaces.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :list_namespaces, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_namespaces, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a namespace. - # - # @overload get_namespace(request, options = nil) - # Pass arguments to `get_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_namespace(name: nil) - # Pass arguments to `get_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 namespace to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Namespace] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new - # - # # Call the get_namespace method. - # result = client.get_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. - # p result - # - def get_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_namespace.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :get_namespace, request, 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 namespace. - # - # @overload update_namespace(request, options = nil) - # Pass arguments to `update_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_namespace(namespace: nil, update_mask: nil) - # Pass arguments to `update_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param namespace [::Google::Cloud::ServiceDirectory::V1::Namespace, ::Hash] - # Required. The updated namespace. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Namespace] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new - # - # # Call the update_namespace method. - # result = client.update_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. - # p result - # - def update_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest - - # Converts hash and nil to 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_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.namespace&.name - header_params["namespace.name"] = request.namespace.name - end - - request_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_namespace.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :update_namespace, request, 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 namespace. This also deletes all services and endpoints in - # the namespace. - # - # @overload delete_namespace(request, options = nil) - # Pass arguments to `delete_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_namespace(name: nil) - # Pass arguments to `delete_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 namespace to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new - # - # # Call the delete_namespace method. - # result = client.delete_namespace request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_namespace.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :delete_namespace, request, 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 service, and returns the new service. - # - # @overload create_service(request, options = nil) - # Pass arguments to `create_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_service(parent: nil, service_id: nil, service: nil) - # Pass arguments to `create_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the namespace this service will belong to. - # @param service_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param service [::Google::Cloud::ServiceDirectory::V1::Service, ::Hash] - # Required. A service with initial fields set. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Service] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new - # - # # Call the create_service method. - # result = client.create_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. - # p result - # - def create_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest - - # Converts hash and nil to 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :create_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all services belonging to a namespace. - # - # @overload list_services(request, options = nil) - # Pass arguments to `list_services` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::ListServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::ListServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the namespace whose services you'd - # like to list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name` or `annotations.` for map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `annotations.owner` returns services that have a annotation with the - # key `owner`, this is the same as `annotations:owner` - # * `annotations.protocol=gRPC` returns services that have key/value - # `protocol=gRPC` - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - # returns services that have name that is alphabetically later than the - # string, so "service-e" is returned but "service-a" is not - # * `annotations.owner!=sd AND annotations.foo=bar` returns services that - # have `owner` in annotation key but value is not `sd` AND have - # key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that service - # doesn't have a field called "doesnotexist". Since the filter does not - # match any services, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::ListServicesRequest.new - # - # # Call the list_services method. - # result = client.list_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Service. - # p item - # end - # - def list_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_services.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :list_services, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_services, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a service. - # - # @overload get_service(request, options = nil) - # Pass arguments to `get_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::GetServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::GetServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_service(name: nil) - # Pass arguments to `get_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Service] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new - # - # # Call the get_service method. - # result = client.get_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. - # p result - # - def get_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :get_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a service. - # - # @overload update_service(request, options = nil) - # Pass arguments to `update_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_service(service: nil, update_mask: nil) - # Pass arguments to `update_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service [::Google::Cloud::ServiceDirectory::V1::Service, ::Hash] - # Required. The updated service. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Service] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new - # - # # Call the update_service method. - # result = client.update_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. - # p result - # - def update_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest - - # Converts hash and nil to 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service&.name - header_params["service.name"] = request.service.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :update_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a service. This also deletes all endpoints associated with - # the service. - # - # @overload delete_service(request, options = nil) - # Pass arguments to `delete_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_service(name: nil) - # Pass arguments to `delete_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new - # - # # Call the delete_service method. - # result = client.delete_service request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :delete_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an endpoint, and returns the new endpoint. - # - # @overload create_endpoint(request, options = nil) - # Pass arguments to `create_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) - # Pass arguments to `create_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the service that this endpoint provides. - # @param endpoint_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param endpoint [::Google::Cloud::ServiceDirectory::V1::Endpoint, ::Hash] - # Required. A endpoint with initial fields set. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new - # - # # Call the create_endpoint method. - # result = client.create_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. - # p result - # - def create_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest - - # Converts hash and nil to 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_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :create_endpoint, request, 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 endpoints. - # - # @overload list_endpoints(request, options = nil) - # Pass arguments to `list_endpoints` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_endpoints` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the service whose endpoints you'd like to - # list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, or `annotations.` for - # map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `annotations.owner` returns endpoints that have a annotation with the - # key `owner`, this is the same as `annotations:owner` - # * `annotations.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - # have `owner` in annotation key but value is not `sd` AND have - # key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoints, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows values: `name`, `address`, `port` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.new - # - # # Call the list_endpoints method. - # result = client.list_endpoints request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Endpoint. - # p item - # end - # - def list_endpoints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_endpoints.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_endpoints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :list_endpoints, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_endpoints, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an endpoint. - # - # @overload get_endpoint(request, options = nil) - # Pass arguments to `get_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_endpoint(name: nil) - # Pass arguments to `get_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 endpoint to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new - # - # # Call the get_endpoint method. - # result = client.get_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. - # p result - # - def get_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :get_endpoint, request, 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 endpoint. - # - # @overload update_endpoint(request, options = nil) - # Pass arguments to `update_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_endpoint(endpoint: nil, update_mask: nil) - # Pass arguments to `update_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param endpoint [::Google::Cloud::ServiceDirectory::V1::Endpoint, ::Hash] - # Required. The updated endpoint. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new - # - # # Call the update_endpoint method. - # result = client.update_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. - # p result - # - def update_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest - - # Converts hash and nil to 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_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.endpoint&.name - header_params["endpoint.name"] = request.endpoint.name - end - - request_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_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :update_endpoint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an endpoint. - # - # @overload delete_endpoint(request, options = nil) - # Pass arguments to `delete_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_endpoint(name: nil) - # Pass arguments to `delete_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 endpoint to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new - # - # # Call the delete_endpoint method. - # result = client.delete_endpoint request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :delete_endpoint, request, 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 IAM Policy for a resource (namespace or service only). - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the IAM Policy for a resource (namespace or service only). - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Tests IAM permissions for a resource (namespace or service only). - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the RegistrationService API. - # - # This class represents the configuration for RegistrationService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_namespace to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_namespace.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_namespace.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::ServiceDirectory::V1::RegistrationService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the RegistrationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :create_namespace - ## - # RPC-specific configuration for `list_namespaces` - # @return [::Gapic::Config::Method] - # - attr_reader :list_namespaces - ## - # RPC-specific configuration for `get_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :get_namespace - ## - # RPC-specific configuration for `update_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :update_namespace - ## - # RPC-specific configuration for `delete_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_namespace - ## - # RPC-specific configuration for `create_service` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service - ## - # RPC-specific configuration for `list_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_services - ## - # RPC-specific configuration for `get_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service - ## - # RPC-specific configuration for `update_service` - # @return [::Gapic::Config::Method] - # - attr_reader :update_service - ## - # RPC-specific configuration for `delete_service` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_service - ## - # RPC-specific configuration for `create_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :create_endpoint - ## - # RPC-specific configuration for `list_endpoints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_endpoints - ## - # RPC-specific configuration for `get_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_endpoint - ## - # RPC-specific configuration for `update_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :update_endpoint - ## - # RPC-specific configuration for `delete_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_endpoint - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - create_namespace_config = parent_rpcs.create_namespace if parent_rpcs.respond_to? :create_namespace - @create_namespace = ::Gapic::Config::Method.new create_namespace_config - list_namespaces_config = parent_rpcs.list_namespaces if parent_rpcs.respond_to? :list_namespaces - @list_namespaces = ::Gapic::Config::Method.new list_namespaces_config - get_namespace_config = parent_rpcs.get_namespace if parent_rpcs.respond_to? :get_namespace - @get_namespace = ::Gapic::Config::Method.new get_namespace_config - update_namespace_config = parent_rpcs.update_namespace if parent_rpcs.respond_to? :update_namespace - @update_namespace = ::Gapic::Config::Method.new update_namespace_config - delete_namespace_config = parent_rpcs.delete_namespace if parent_rpcs.respond_to? :delete_namespace - @delete_namespace = ::Gapic::Config::Method.new delete_namespace_config - create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service - @create_service = ::Gapic::Config::Method.new create_service_config - list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services - @list_services = ::Gapic::Config::Method.new list_services_config - get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service - @get_service = ::Gapic::Config::Method.new get_service_config - update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service - @update_service = ::Gapic::Config::Method.new update_service_config - delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service - @delete_service = ::Gapic::Config::Method.new delete_service_config - create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint - @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config - list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints - @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config - get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint - @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config - update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint - @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config - delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint - @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/credentials.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/credentials.rb deleted file mode 100644 index f73edf4dec0f..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_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 ServiceDirectory - module V1 - module RegistrationService - # Credentials for the RegistrationService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SERVICE_DIRECTORY_CREDENTIALS", - "SERVICE_DIRECTORY_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SERVICE_DIRECTORY_CREDENTIALS_JSON", - "SERVICE_DIRECTORY_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-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/paths.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/paths.rb deleted file mode 100644 index 57e83b8a9a40..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/paths.rb +++ /dev/null @@ -1,130 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceDirectory - module V1 - module RegistrationService - # Path helper methods for the RegistrationService API. - module Paths - ## - # Create a fully-qualified Endpoint resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # @param service [String] - # @param endpoint [String] - # - # @return [::String] - def endpoint_path project:, location:, namespace:, service:, endpoint: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" - raise ::ArgumentError, "service cannot contain /" if service.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}/endpoints/#{endpoint}" - 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 Namespace resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # - # @return [::String] - def namespace_path project:, location:, namespace: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}" - end - - ## - # Create a fully-qualified Network resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/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}/locations/global/networks/#{network}" - end - - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, namespace:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest.rb deleted file mode 100644 index d9c6b16b6864..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/service_directory/v1/version" -require "google/cloud/service_directory/v1/bindings_override" - -require "google/cloud/service_directory/v1/registration_service/credentials" -require "google/cloud/service_directory/v1/registration_service/paths" -require "google/cloud/service_directory/v1/registration_service/rest/client" - -module Google - module Cloud - module ServiceDirectory - module V1 - ## - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Namespace Namespace} - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Service Service} resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Endpoint Endpoint} - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/service_directory/v1/registration_service/rest" - # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - module RegistrationService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/service_directory/v1/registration_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb deleted file mode 100644 index ea1aa47e9ae9..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb +++ /dev/null @@ -1,2136 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/servicedirectory/v1/registration_service_pb" -require "google/cloud/service_directory/v1/registration_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module ServiceDirectory - module V1 - module RegistrationService - module Rest - ## - # REST client for the RegistrationService service. - # - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Namespace Namespace} - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Service Service} resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # {::Google::Cloud::ServiceDirectory::V1::Endpoint Endpoint} - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :registration_service_stub - - ## - # Configure the RegistrationService Client class. - # - # See {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RegistrationService clients - # ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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", "ServiceDirectory", "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 = 15.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RegistrationService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceDirectory::V1::RegistrationService::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 - @registration_service_stub.universe_domain - end - - ## - # Create a new RegistrationService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RegistrationService 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 - - @registration_service_stub = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @registration_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @registration_service_stub.endpoint - config.universe_domain = @registration_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @registration_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @registration_service_stub.logger - end - - # Service calls - - ## - # Creates a namespace, and returns the new namespace. - # - # @overload create_namespace(request, options = nil) - # Pass arguments to `create_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_namespace(parent: nil, namespace_id: nil, namespace: nil) - # Pass arguments to `create_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project and location the namespace - # will be created in. - # @param namespace_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param namespace [::Google::Cloud::ServiceDirectory::V1::Namespace, ::Hash] - # Required. A namespace with initial fields set. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new - # - # # Call the create_namespace method. - # result = client.create_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. - # p result - # - def create_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest - - # Converts hash and nil to an 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_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_namespace.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.create_namespace request, 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 namespaces. - # - # @overload list_namespaces(request, options = nil) - # Pass arguments to `list_namespaces` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_namespaces` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project and location whose namespaces - # you'd like to list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name` or `labels.` for map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `labels.owner` returns namespaces that have a label with the key - # `owner`, this is the same as `labels:owner` - # * `labels.owner=sd` returns namespaces that have key/value - # `owner=sd` - # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - # returns namespaces that have name that is alphabetically later than the - # string, so "namespace-e" is returned but "namespace-a" is not - # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - # `owner` in label key but value is not `sd` AND have key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that namespace - # doesn't have a field called "doesnotexist". Since the filter does not - # match any namespaces, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.new - # - # # Call the list_namespaces method. - # result = client.list_namespaces request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Namespace. - # p item - # end - # - def list_namespaces request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_namespaces.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_namespaces.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_namespaces.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.list_namespaces request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_namespaces, "namespaces", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a namespace. - # - # @overload get_namespace(request, options = nil) - # Pass arguments to `get_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_namespace(name: nil) - # Pass arguments to `get_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 namespace to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new - # - # # Call the get_namespace method. - # result = client.get_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. - # p result - # - def get_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_namespace.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.get_namespace request, 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 namespace. - # - # @overload update_namespace(request, options = nil) - # Pass arguments to `update_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_namespace(namespace: nil, update_mask: nil) - # Pass arguments to `update_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param namespace [::Google::Cloud::ServiceDirectory::V1::Namespace, ::Hash] - # Required. The updated namespace. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new - # - # # Call the update_namespace method. - # result = client.update_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. - # p result - # - def update_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest - - # Converts hash and nil to an 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_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_namespace.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.update_namespace request, 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 namespace. This also deletes all services and endpoints in - # the namespace. - # - # @overload delete_namespace(request, options = nil) - # Pass arguments to `delete_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_namespace(name: nil) - # Pass arguments to `delete_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 namespace to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new - # - # # Call the delete_namespace method. - # result = client.delete_namespace request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_namespace.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.delete_namespace request, 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 service, and returns the new service. - # - # @overload create_service(request, options = nil) - # Pass arguments to `create_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_service(parent: nil, service_id: nil, service: nil) - # Pass arguments to `create_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the namespace this service will belong to. - # @param service_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param service [::Google::Cloud::ServiceDirectory::V1::Service, ::Hash] - # Required. A service with initial fields set. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new - # - # # Call the create_service method. - # result = client.create_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. - # p result - # - def create_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest - - # Converts hash and nil to an 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.create_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all services belonging to a namespace. - # - # @overload list_services(request, options = nil) - # Pass arguments to `list_services` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::ListServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::ListServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the namespace whose services you'd - # like to list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name` or `annotations.` for map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `annotations.owner` returns services that have a annotation with the - # key `owner`, this is the same as `annotations:owner` - # * `annotations.protocol=gRPC` returns services that have key/value - # `protocol=gRPC` - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - # returns services that have name that is alphabetically later than the - # string, so "service-e" is returned but "service-a" is not - # * `annotations.owner!=sd AND annotations.foo=bar` returns services that - # have `owner` in annotation key but value is not `sd` AND have - # key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that service - # doesn't have a field called "doesnotexist". Since the filter does not - # match any services, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::ListServicesRequest.new - # - # # Call the list_services method. - # result = client.list_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Service. - # p item - # end - # - def list_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_services.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.list_services request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_services, "services", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a service. - # - # @overload get_service(request, options = nil) - # Pass arguments to `get_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::GetServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::GetServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_service(name: nil) - # Pass arguments to `get_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new - # - # # Call the get_service method. - # result = client.get_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. - # p result - # - def get_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.get_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a service. - # - # @overload update_service(request, options = nil) - # Pass arguments to `update_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_service(service: nil, update_mask: nil) - # Pass arguments to `update_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service [::Google::Cloud::ServiceDirectory::V1::Service, ::Hash] - # Required. The updated service. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new - # - # # Call the update_service method. - # result = client.update_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. - # p result - # - def update_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest - - # Converts hash and nil to an 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.update_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a service. This also deletes all endpoints associated with - # the service. - # - # @overload delete_service(request, options = nil) - # Pass arguments to `delete_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_service(name: nil) - # Pass arguments to `delete_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new - # - # # Call the delete_service method. - # result = client.delete_service request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.delete_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an endpoint, and returns the new endpoint. - # - # @overload create_endpoint(request, options = nil) - # Pass arguments to `create_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) - # Pass arguments to `create_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the service that this endpoint provides. - # @param endpoint_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param endpoint [::Google::Cloud::ServiceDirectory::V1::Endpoint, ::Hash] - # Required. A endpoint with initial fields set. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new - # - # # Call the create_endpoint method. - # result = client.create_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. - # p result - # - def create_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest - - # Converts hash and nil to an 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_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.create_endpoint request, 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 endpoints. - # - # @overload list_endpoints(request, options = nil) - # Pass arguments to `list_endpoints` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_endpoints` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the service whose endpoints you'd like to - # list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, or `annotations.` for - # map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `annotations.owner` returns endpoints that have a annotation with the - # key `owner`, this is the same as `annotations:owner` - # * `annotations.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - # have `owner` in annotation key but value is not `sd` AND have - # key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoints, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows values: `name`, `address`, `port` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.new - # - # # Call the list_endpoints method. - # result = client.list_endpoints request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Endpoint. - # p item - # end - # - def list_endpoints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_endpoints.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_endpoints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.list_endpoints request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_endpoints, "endpoints", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an endpoint. - # - # @overload get_endpoint(request, options = nil) - # Pass arguments to `get_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_endpoint(name: nil) - # Pass arguments to `get_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 endpoint to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new - # - # # Call the get_endpoint method. - # result = client.get_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. - # p result - # - def get_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.get_endpoint request, 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 endpoint. - # - # @overload update_endpoint(request, options = nil) - # Pass arguments to `update_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_endpoint(endpoint: nil, update_mask: nil) - # Pass arguments to `update_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param endpoint [::Google::Cloud::ServiceDirectory::V1::Endpoint, ::Hash] - # Required. The updated endpoint. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new - # - # # Call the update_endpoint method. - # result = client.update_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. - # p result - # - def update_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest - - # Converts hash and nil to an 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_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.update_endpoint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an endpoint. - # - # @overload delete_endpoint(request, options = nil) - # Pass arguments to `delete_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_endpoint(name: nil) - # Pass arguments to `delete_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 endpoint to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new - # - # # Call the delete_endpoint method. - # result = client.delete_endpoint request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.delete_endpoint request, 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 IAM Policy for a resource (namespace or service only). - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the IAM Policy for a resource (namespace or service only). - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Tests IAM permissions for a resource (namespace or service only). - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the RegistrationService REST API. - # - # This class represents the configuration for RegistrationService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_namespace to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_namespace.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_namespace.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 RegistrationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :create_namespace - ## - # RPC-specific configuration for `list_namespaces` - # @return [::Gapic::Config::Method] - # - attr_reader :list_namespaces - ## - # RPC-specific configuration for `get_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :get_namespace - ## - # RPC-specific configuration for `update_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :update_namespace - ## - # RPC-specific configuration for `delete_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_namespace - ## - # RPC-specific configuration for `create_service` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service - ## - # RPC-specific configuration for `list_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_services - ## - # RPC-specific configuration for `get_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service - ## - # RPC-specific configuration for `update_service` - # @return [::Gapic::Config::Method] - # - attr_reader :update_service - ## - # RPC-specific configuration for `delete_service` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_service - ## - # RPC-specific configuration for `create_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :create_endpoint - ## - # RPC-specific configuration for `list_endpoints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_endpoints - ## - # RPC-specific configuration for `get_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_endpoint - ## - # RPC-specific configuration for `update_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :update_endpoint - ## - # RPC-specific configuration for `delete_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_endpoint - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - create_namespace_config = parent_rpcs.create_namespace if parent_rpcs.respond_to? :create_namespace - @create_namespace = ::Gapic::Config::Method.new create_namespace_config - list_namespaces_config = parent_rpcs.list_namespaces if parent_rpcs.respond_to? :list_namespaces - @list_namespaces = ::Gapic::Config::Method.new list_namespaces_config - get_namespace_config = parent_rpcs.get_namespace if parent_rpcs.respond_to? :get_namespace - @get_namespace = ::Gapic::Config::Method.new get_namespace_config - update_namespace_config = parent_rpcs.update_namespace if parent_rpcs.respond_to? :update_namespace - @update_namespace = ::Gapic::Config::Method.new update_namespace_config - delete_namespace_config = parent_rpcs.delete_namespace if parent_rpcs.respond_to? :delete_namespace - @delete_namespace = ::Gapic::Config::Method.new delete_namespace_config - create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service - @create_service = ::Gapic::Config::Method.new create_service_config - list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services - @list_services = ::Gapic::Config::Method.new list_services_config - get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service - @get_service = ::Gapic::Config::Method.new get_service_config - update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service - @update_service = ::Gapic::Config::Method.new update_service_config - delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service - @delete_service = ::Gapic::Config::Method.new delete_service_config - create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint - @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config - list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints - @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config - get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint - @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config - update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint - @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config - delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint - @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb deleted file mode 100644 index 7b4fd8ee718b..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb +++ /dev/null @@ -1,1212 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/servicedirectory/v1/registration_service_pb" - -module Google - module Cloud - module ServiceDirectory - module V1 - module RegistrationService - module Rest - ## - # REST service stub for the RegistrationService 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_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # A result object deserialized from the server's reply - def create_namespace request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_namespace_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_namespace", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::Namespace.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_namespaces REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse] - # A result object deserialized from the server's reply - def list_namespaces request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_namespaces_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_namespaces", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # A result object deserialized from the server's reply - def get_namespace request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_namespace_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_namespace", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::Namespace.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_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # A result object deserialized from the server's reply - def update_namespace request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_namespace_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_namespace", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::Namespace.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_namespace request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_namespace_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_namespace", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 create_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # A result object deserialized from the server's reply - def create_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::Service.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_services REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListServicesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ListServicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::ListServicesResponse] - # A result object deserialized from the server's reply - def list_services request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_services_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_services", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # A result object deserialized from the server's reply - def get_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::Service.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_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # A result object deserialized from the server's reply - def update_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::Service.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 create_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # A result object deserialized from the server's reply - def create_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_endpoint_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.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_endpoints REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse] - # A result object deserialized from the server's reply - def list_endpoints request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_endpoints_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_endpoints", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # A result object deserialized from the server's reply - def get_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_endpoint_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.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_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # A result object deserialized from the server's reply - def update_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_endpoint_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_endpoint_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest] - # 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_namespace_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/namespaces", - body: "namespace", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_namespaces REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_namespaces_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/namespaces", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_namespace_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest] - # 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_namespace_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{namespace.name}", - body: "namespace", - matches: [ - ["namespace.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_namespace_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest] - # 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_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/services", - body: "service", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_services REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListServicesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_services_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/services", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest] - # 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_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{service.name}", - body: "service", - matches: [ - ["service.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest] - # 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_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/endpoints", - body: "endpoint", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_endpoints REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_endpoints_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/endpoints", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest] - # 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_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{endpoint.name}", - body: "endpoint", - matches: [ - ["endpoint.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/rest.rb deleted file mode 100644 index 908b621706ff..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/service_directory/v1/lookup_service/rest" -require "google/cloud/service_directory/v1/registration_service/rest" -require "google/cloud/service_directory/v1/bindings_override" -require "google/cloud/service_directory/v1/version" - -module Google - module Cloud - module ServiceDirectory - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/service_directory/v1/rest" - # client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/version.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/version.rb deleted file mode 100644 index 8c946fd91333..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/service_directory/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 ServiceDirectory - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/endpoint_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/endpoint_pb.rb deleted file mode 100644 index e3f1be259794..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/endpoint_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1/endpoint.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n/google/cloud/servicedirectory/v1/endpoint.proto\x12 google.cloud.servicedirectory.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xbe\x03\n\x08\x45ndpoint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04port\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12U\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32;.google.cloud.servicedirectory.v1.Endpoint.AnnotationsEntryB\x03\xe0\x41\x01\x12@\n\x07network\x18\x08 \x01(\tB/\xe0\x41\x05\xfa\x41)\n\'servicedirectory.googleapis.com/Network\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x96\x01\xea\x41\x92\x01\n(servicedirectory.googleapis.com/Endpoint\x12\x66projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B\xd9\x02\n$com.google.cloud.servicedirectory.v1B\rEndpointProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1\xea\x41\x61\n\'servicedirectory.googleapis.com/Network\x12\x36projects/{project}/locations/global/networks/{network}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1 - Endpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.Endpoint").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_pb.rb deleted file mode 100644 index b4d80dacd301..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1/lookup_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/servicedirectory/v1/service_pb' - - -descriptor_data = "\n5google/cloud/servicedirectory/v1/lookup_service.proto\x12 google.cloud.servicedirectory.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/servicedirectory/v1/service.proto\"\x90\x01\n\x15ResolveServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x1a\n\rmax_endpoints\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1c\n\x0f\x65ndpoint_filter\x18\x03 \x01(\tB\x03\xe0\x41\x01\"T\n\x16ResolveServiceResponse\x12:\n\x07service\x18\x01 \x01(\x0b\x32).google.cloud.servicedirectory.v1.Service2\xb8\x02\n\rLookupService\x12\xd1\x01\n\x0eResolveService\x12\x37.google.cloud.servicedirectory.v1.ResolveServiceRequest\x1a\x38.google.cloud.servicedirectory.v1.ResolveServiceResponse\"L\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve:\x01*\x1aS\xca\x41\x1fservicedirectory.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xfa\x01\n$com.google.cloud.servicedirectory.v1B\x12LookupServiceProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1 - ResolveServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ResolveServiceRequest").msgclass - ResolveServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ResolveServiceResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_services_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_services_pb.rb deleted file mode 100644 index 6ae9e530a2c6..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/lookup_service_services_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/servicedirectory/v1/lookup_service.proto for package 'Google.Cloud.ServiceDirectory.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/servicedirectory/v1/lookup_service_pb' - -module Google - module Cloud - module ServiceDirectory - module V1 - module LookupService - # Service Directory API for looking up service data at runtime. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.servicedirectory.v1.LookupService' - - # Returns a [service][google.cloud.servicedirectory.v1.Service] and its - # associated endpoints. - # Resolving a service is not considered an active developer method. - rpc :ResolveService, ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest, ::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/namespace_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/namespace_pb.rb deleted file mode 100644 index 3c410e6a30eb..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/namespace_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1/namespace.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n0google/cloud/servicedirectory/v1/namespace.proto\x12 google.cloud.servicedirectory.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9d\x02\n\tNamespace\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12L\n\x06labels\x18\x02 \x03(\x0b\x32\x37.google.cloud.servicedirectory.v1.Namespace.LabelsEntryB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x05 \x01(\tB\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:n\xea\x41k\n)servicedirectory.googleapis.com/Namespace\x12>projects/{project}/locations/{location}/namespaces/{namespace}B\xf6\x01\n$com.google.cloud.servicedirectory.v1B\x0eNamespaceProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1 - Namespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.Namespace").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_pb.rb deleted file mode 100644 index 0bb3da719b14..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1/registration_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/servicedirectory/v1/endpoint_pb' -require 'google/cloud/servicedirectory/v1/namespace_pb' -require 'google/cloud/servicedirectory/v1/service_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n;google/cloud/servicedirectory/v1/registration_service.proto\x12 google.cloud.servicedirectory.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/servicedirectory/v1/endpoint.proto\x1a\x30google/cloud/servicedirectory/v1/namespace.proto\x1a.google/cloud/servicedirectory/v1/service.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb3\x01\n\x16\x43reateNamespaceRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0cnamespace_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\tnamespace\x18\x03 \x01(\x0b\x32+.google.cloud.servicedirectory.v1.NamespaceB\x03\xe0\x41\x02\"\xaf\x01\n\x15ListNamespacesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"r\n\x16ListNamespacesResponse\x12?\n\nnamespaces\x18\x01 \x03(\x0b\x32+.google.cloud.servicedirectory.v1.Namespace\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x13GetNamespaceRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\"\x93\x01\n\x16UpdateNamespaceRequest\x12\x43\n\tnamespace\x18\x01 \x01(\x0b\x32+.google.cloud.servicedirectory.v1.NamespaceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"Y\n\x16\x44\x65leteNamespaceRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\"\xb3\x01\n\x14\x43reateServiceRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\x12\x17\n\nservice_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x07service\x18\x03 \x01(\x0b\x32).google.cloud.servicedirectory.v1.ServiceB\x03\xe0\x41\x02\"\xb5\x01\n\x13ListServicesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\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\"l\n\x14ListServicesResponse\x12;\n\x08services\x18\x01 \x03(\x0b\x32).google.cloud.servicedirectory.v1.Service\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x11GetServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\"\x8d\x01\n\x14UpdateServiceRequest\x12?\n\x07service\x18\x01 \x01(\x0b\x32).google.cloud.servicedirectory.v1.ServiceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"U\n\x14\x44\x65leteServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\"\xb5\x01\n\x15\x43reateEndpointRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x18\n\x0b\x65ndpoint_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x08\x65ndpoint\x18\x03 \x01(\x0b\x32*.google.cloud.servicedirectory.v1.EndpointB\x03\xe0\x41\x02\"\xb4\x01\n\x14ListEndpointsRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\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\"o\n\x15ListEndpointsResponse\x12=\n\tendpoints\x18\x01 \x03(\x0b\x32*.google.cloud.servicedirectory.v1.Endpoint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x12GetEndpointRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(servicedirectory.googleapis.com/Endpoint\"\x90\x01\n\x15UpdateEndpointRequest\x12\x41\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32*.google.cloud.servicedirectory.v1.EndpointB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"W\n\x15\x44\x65leteEndpointRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(servicedirectory.googleapis.com/Endpoint2\xdf\x1e\n\x13RegistrationService\x12\xdb\x01\n\x0f\x43reateNamespace\x12\x38.google.cloud.servicedirectory.v1.CreateNamespaceRequest\x1a+.google.cloud.servicedirectory.v1.Namespace\"a\xda\x41\x1dparent,namespace,namespace_id\x82\xd3\xe4\x93\x02;\"./v1/{parent=projects/*/locations/*}/namespaces:\tnamespace\x12\xc4\x01\n\x0eListNamespaces\x12\x37.google.cloud.servicedirectory.v1.ListNamespacesRequest\x1a\x38.google.cloud.servicedirectory.v1.ListNamespacesResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/namespaces\x12\xb1\x01\n\x0cGetNamespace\x12\x35.google.cloud.servicedirectory.v1.GetNamespaceRequest\x1a+.google.cloud.servicedirectory.v1.Namespace\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/namespaces/*}\x12\xdd\x01\n\x0fUpdateNamespace\x12\x38.google.cloud.servicedirectory.v1.UpdateNamespaceRequest\x1a+.google.cloud.servicedirectory.v1.Namespace\"c\xda\x41\x15namespace,update_mask\x82\xd3\xe4\x93\x02\x45\x32\x38/v1/{namespace.name=projects/*/locations/*/namespaces/*}:\tnamespace\x12\xa2\x01\n\x0f\x44\x65leteNamespace\x12\x38.google.cloud.servicedirectory.v1.DeleteNamespaceRequest\x1a\x16.google.protobuf.Empty\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/namespaces/*}\x12\xda\x01\n\rCreateService\x12\x36.google.cloud.servicedirectory.v1.CreateServiceRequest\x1a).google.cloud.servicedirectory.v1.Service\"f\xda\x41\x19parent,service,service_id\x82\xd3\xe4\x93\x02\x44\"9/v1/{parent=projects/*/locations/*/namespaces/*}/services:\x07service\x12\xc9\x01\n\x0cListServices\x12\x35.google.cloud.servicedirectory.v1.ListServicesRequest\x1a\x36.google.cloud.servicedirectory.v1.ListServicesResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/namespaces/*}/services\x12\xb6\x01\n\nGetService\x12\x33.google.cloud.servicedirectory.v1.GetServiceRequest\x1a).google.cloud.servicedirectory.v1.Service\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/namespaces/*/services/*}\x12\xdc\x01\n\rUpdateService\x12\x36.google.cloud.servicedirectory.v1.UpdateServiceRequest\x1a).google.cloud.servicedirectory.v1.Service\"h\xda\x41\x13service,update_mask\x82\xd3\xe4\x93\x02L2A/v1/{service.name=projects/*/locations/*/namespaces/*/services/*}:\x07service\x12\xa9\x01\n\rDeleteService\x12\x36.google.cloud.servicedirectory.v1.DeleteServiceRequest\x1a\x16.google.protobuf.Empty\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/namespaces/*/services/*}\x12\xec\x01\n\x0e\x43reateEndpoint\x12\x37.google.cloud.servicedirectory.v1.CreateEndpointRequest\x1a*.google.cloud.servicedirectory.v1.Endpoint\"u\xda\x41\x1bparent,endpoint,endpoint_id\x82\xd3\xe4\x93\x02Q\"E/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints:\x08\x65ndpoint\x12\xd8\x01\n\rListEndpoints\x12\x36.google.cloud.servicedirectory.v1.ListEndpointsRequest\x1a\x37.google.cloud.servicedirectory.v1.ListEndpointsResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints\x12\xc5\x01\n\x0bGetEndpoint\x12\x34.google.cloud.servicedirectory.v1.GetEndpointRequest\x1a*.google.cloud.servicedirectory.v1.Endpoint\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}\x12\xee\x01\n\x0eUpdateEndpoint\x12\x37.google.cloud.servicedirectory.v1.UpdateEndpointRequest\x1a*.google.cloud.servicedirectory.v1.Endpoint\"w\xda\x41\x14\x65ndpoint,update_mask\x82\xd3\xe4\x93\x02Z2N/v1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}:\x08\x65ndpoint\x12\xb7\x01\n\x0e\x44\x65leteEndpoint\x12\x37.google.cloud.servicedirectory.v1.DeleteEndpointRequest\x1a\x16.google.protobuf.Empty\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G*E/v1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}\x12\xe8\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x9c\x01\x82\xd3\xe4\x93\x02\x95\x01\"?/v1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:\x01*ZO\"J/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:\x01*\x12\xe8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x9c\x01\x82\xd3\xe4\x93\x02\x95\x01\"?/v1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:\x01*ZO\"J/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:\x01*\x12\x94\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xa8\x01\x82\xd3\xe4\x93\x02\xa1\x01\"E/v1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:\x01*ZU\"P/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:\x01*\x1aS\xca\x41\x1fservicedirectory.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x80\x02\n$com.google.cloud.servicedirectory.v1B\x18RegistrationServiceProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1 - CreateNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.CreateNamespaceRequest").msgclass - ListNamespacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListNamespacesRequest").msgclass - ListNamespacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListNamespacesResponse").msgclass - GetNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.GetNamespaceRequest").msgclass - UpdateNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.UpdateNamespaceRequest").msgclass - DeleteNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.DeleteNamespaceRequest").msgclass - CreateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.CreateServiceRequest").msgclass - ListServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListServicesRequest").msgclass - ListServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListServicesResponse").msgclass - GetServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.GetServiceRequest").msgclass - UpdateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.UpdateServiceRequest").msgclass - DeleteServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.DeleteServiceRequest").msgclass - CreateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.CreateEndpointRequest").msgclass - ListEndpointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListEndpointsRequest").msgclass - ListEndpointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.ListEndpointsResponse").msgclass - GetEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.GetEndpointRequest").msgclass - UpdateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.UpdateEndpointRequest").msgclass - DeleteEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.DeleteEndpointRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb deleted file mode 100644 index b0459122277a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb +++ /dev/null @@ -1,95 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/servicedirectory/v1/registration_service.proto for package 'Google.Cloud.ServiceDirectory.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/servicedirectory/v1/registration_service_pb' - -module Google - module Cloud - module ServiceDirectory - module V1 - module RegistrationService - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # [Namespace][google.cloud.servicedirectory.v1.Namespace] - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # [Service][google.cloud.servicedirectory.v1.Service] resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # [Endpoint][google.cloud.servicedirectory.v1.Endpoint] - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.servicedirectory.v1.RegistrationService' - - # Creates a namespace, and returns the new namespace. - rpc :CreateNamespace, ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1::Namespace - # Lists all namespaces. - rpc :ListNamespaces, ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest, ::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse - # Gets a namespace. - rpc :GetNamespace, ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1::Namespace - # Updates a namespace. - rpc :UpdateNamespace, ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1::Namespace - # Deletes a namespace. This also deletes all services and endpoints in - # the namespace. - rpc :DeleteNamespace, ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest, ::Google::Protobuf::Empty - # Creates a service, and returns the new service. - rpc :CreateService, ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest, ::Google::Cloud::ServiceDirectory::V1::Service - # Lists all services belonging to a namespace. - rpc :ListServices, ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest, ::Google::Cloud::ServiceDirectory::V1::ListServicesResponse - # Gets a service. - rpc :GetService, ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest, ::Google::Cloud::ServiceDirectory::V1::Service - # Updates a service. - rpc :UpdateService, ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest, ::Google::Cloud::ServiceDirectory::V1::Service - # Deletes a service. This also deletes all endpoints associated with - # the service. - rpc :DeleteService, ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest, ::Google::Protobuf::Empty - # Creates an endpoint, and returns the new endpoint. - rpc :CreateEndpoint, ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest, ::Google::Cloud::ServiceDirectory::V1::Endpoint - # Lists all endpoints. - rpc :ListEndpoints, ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest, ::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse - # Gets an endpoint. - rpc :GetEndpoint, ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest, ::Google::Cloud::ServiceDirectory::V1::Endpoint - # Updates an endpoint. - rpc :UpdateEndpoint, ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest, ::Google::Cloud::ServiceDirectory::V1::Endpoint - # Deletes an endpoint. - rpc :DeleteEndpoint, ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest, ::Google::Protobuf::Empty - # Gets the IAM Policy for a resource (namespace or service only). - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the IAM Policy for a resource (namespace or service only). - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Tests IAM permissions for a resource (namespace or service only). - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/service_pb.rb deleted file mode 100644 index 1ff4ae69888a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/lib/google/cloud/servicedirectory/v1/service_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1/service.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/servicedirectory/v1/endpoint_pb' - - -descriptor_data = "\n.google/cloud/servicedirectory/v1/service.proto\x12 google.cloud.servicedirectory.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/servicedirectory/v1/endpoint.proto\"\xfd\x02\n\x07Service\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12T\n\x0b\x61nnotations\x18\x04 \x03(\x0b\x32:.google.cloud.servicedirectory.v1.Service.AnnotationsEntryB\x03\xe0\x41\x01\x12\x42\n\tendpoints\x18\x03 \x03(\x0b\x32*.google.cloud.servicedirectory.v1.EndpointB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x07 \x01(\tB\x03\xe0\x41\x03\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x7f\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}B\xf4\x01\n$com.google.cloud.servicedirectory.v1B\x0cServiceProtoP\x01ZPcloud.google.com/go/servicedirectory/apiv1/servicedirectorypb;servicedirectorypb\xaa\x02 Google.Cloud.ServiceDirectory.V1\xca\x02 Google\\Cloud\\ServiceDirectory\\V1\xea\x02#Google::Cloud::ServiceDirectory::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1 - Service = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1.Service").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/README.md deleted file mode 100644 index 01dcdec0b753..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Service Directory 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-service_directory-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/endpoint.rb deleted file mode 100644 index 4ee11e3d1a61..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/endpoint.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceDirectory - module V1 - # An individual endpoint that provides a - # {::Google::Cloud::ServiceDirectory::V1::Service service}. The service must - # already exist to create an endpoint. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name for the endpoint in the format - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # @!attribute [rw] address - # @return [::String] - # Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - # like: - # - # * `8.8.8` - # * `8.8.8.8:53` - # * `test:bad:address` - # * `[::1]` - # * `[::1]:8080` - # - # Limited to 45 characters. - # @!attribute [rw] port - # @return [::Integer] - # Optional. Service Directory rejects values outside of `[0, 65535]`. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations for the endpoint. This data can be consumed by - # service clients. - # - # Restrictions: - # - # * The entire annotations dictionary may contain up to 512 characters, - # spread accoss all key-value pairs. Annotations that go beyond this - # limit are rejected - # * Valid annotation keys have two segments: an optional prefix and name, - # separated by a slash (/). The name segment is required and must be 63 - # characters or less, beginning and ending with an alphanumeric character - # ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - # alphanumerics between. The prefix is optional. If specified, the prefix - # must be a DNS subdomain: a series of DNS labels separated by dots (.), - # not longer than 253 characters in total, followed by a slash (/) - # Annotations that fails to meet these requirements are rejected. - # - # Note: This field is equivalent to the `metadata` field in the v1beta1 API. - # They have the same syntax and read/write to the same location in Service - # Directory. - # @!attribute [rw] network - # @return [::String] - # Immutable. The Google Compute Engine network (VPC) of the endpoint in the - # format `projects//locations/global/networks/*`. - # - # The project must be specified by project number (project id is rejected). - # Incorrectly formatted networks are rejected, we also check to make sure - # that you have the servicedirectory.networks.attach permission on the - # project specified. - # @!attribute [r] uid - # @return [::String] - # Output only. The globally unique identifier of the endpoint in the UUID4 - # format. - class Endpoint - 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 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/lookup_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/lookup_service.rb deleted file mode 100644 index 9e859a550af2..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/lookup_service.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 ServiceDirectory - module V1 - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service LookupService.ResolveService}. - # Looks up a service by its name, returns the service and its endpoints. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the service to resolve. - # @!attribute [rw] max_endpoints - # @return [::Integer] - # Optional. The maximum number of endpoints to return. Defaults to 25. - # Maximum is 100. If a value less than one is specified, the Default is used. - # If a value greater than the Maximum is specified, the Maximum is used. - # @!attribute [rw] endpoint_filter - # @return [::String] - # Optional. The filter applied to the endpoints of the resolved service. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, or `annotations.` for - # map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `annotations.owner` returns endpoints that have a annotation with the - # key `owner`, this is the same as `annotations:owner` - # * `annotations.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * - # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - # returns the endpoint that has an endpoint_id equal to `ep-1` - # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - # have `owner` in annotation key but value is not `sd` AND have - # key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoint, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - class ResolveServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service LookupService.ResolveService}. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - class ResolveServiceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/namespace.rb deleted file mode 100644 index 6b3bcca2d4f5..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/namespace.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 ServiceDirectory - module V1 - # A container for {::Google::Cloud::ServiceDirectory::V1::Service services}. - # Namespaces allow administrators to group services together and define - # permissions for a collection of services. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name for the namespace in the format - # `projects/*/locations/*/namespaces/*`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Resource labels associated with this namespace. - # No more than 64 user labels can be associated with a given resource. Label - # keys and values can be no longer than 63 characters. - # @!attribute [r] uid - # @return [::String] - # Output only. The globally unique identifier of the namespace in the UUID4 - # format. - class Namespace - 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 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/registration_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/registration_service.rb deleted file mode 100644 index 45b348787942..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/registration_service.rb +++ /dev/null @@ -1,425 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceDirectory - module V1 - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_namespace RegistrationService.CreateNamespace}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project and location the namespace - # will be created in. - # @!attribute [rw] namespace_id - # @return [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @!attribute [rw] namespace - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # Required. A namespace with initial fields set. - class CreateNamespaceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces RegistrationService.ListNamespaces}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project and location whose namespaces - # you'd like to list. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name` or `labels.` for map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `labels.owner` returns namespaces that have a label with the key - # `owner`, this is the same as `labels:owner` - # * `labels.owner=sd` returns namespaces that have key/value - # `owner=sd` - # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - # returns namespaces that have name that is alphabetically later than the - # string, so "namespace-e" is returned but "namespace-a" is not - # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - # `owner` in label key but value is not `sd` AND have key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that namespace - # doesn't have a field called "doesnotexist". Since the filter does not - # match any namespaces, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @!attribute [rw] order_by - # @return [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - class ListNamespacesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces RegistrationService.ListNamespaces}. - # @!attribute [rw] namespaces - # @return [::Array<::Google::Cloud::ServiceDirectory::V1::Namespace>] - # The list of namespaces. - # @!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. - class ListNamespacesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_namespace RegistrationService.GetNamespace}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the namespace to retrieve. - class GetNamespaceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_namespace RegistrationService.UpdateNamespace}. - # @!attribute [rw] namespace - # @return [::Google::Cloud::ServiceDirectory::V1::Namespace] - # Required. The updated namespace. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateNamespaceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_namespace RegistrationService.DeleteNamespace}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the namespace to delete. - class DeleteNamespaceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_service RegistrationService.CreateService}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the namespace this service will belong to. - # @!attribute [rw] service_id - # @return [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # Required. A service with initial fields set. - class CreateServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services RegistrationService.ListServices}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the namespace whose services you'd - # like to list. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name` or `annotations.` for map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `annotations.owner` returns services that have a annotation with the - # key `owner`, this is the same as `annotations:owner` - # * `annotations.protocol=gRPC` returns services that have key/value - # `protocol=gRPC` - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - # returns services that have name that is alphabetically later than the - # string, so "service-e" is returned but "service-a" is not - # * `annotations.owner!=sd AND annotations.foo=bar` returns services that - # have `owner` in annotation key but value is not `sd` AND have - # key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that service - # doesn't have a field called "doesnotexist". Since the filter does not - # match any services, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @!attribute [rw] order_by - # @return [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - class ListServicesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services RegistrationService.ListServices}. - # @!attribute [rw] services - # @return [::Array<::Google::Cloud::ServiceDirectory::V1::Service>] - # The list of services. - # @!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. - class ListServicesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_service RegistrationService.GetService}. - # This should not be used for looking up a service. Instead, use the `resolve` - # method as it contains all endpoints and associated annotations. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the service to get. - class GetServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_service RegistrationService.UpdateService}. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceDirectory::V1::Service] - # Required. The updated service. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_service RegistrationService.DeleteService}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the service to delete. - class DeleteServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_endpoint RegistrationService.CreateEndpoint}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the service that this endpoint provides. - # @!attribute [rw] endpoint_id - # @return [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @!attribute [rw] endpoint - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # Required. A endpoint with initial fields set. - class CreateEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the service whose endpoints you'd like to - # list. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, or `annotations.` for - # map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `annotations.owner` returns endpoints that have a annotation with the - # key `owner`, this is the same as `annotations:owner` - # * `annotations.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that - # have `owner` in annotation key but value is not `sd` AND have - # key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoints, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @!attribute [rw] order_by - # @return [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows values: `name`, `address`, `port` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - class ListEndpointsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. - # @!attribute [rw] endpoints - # @return [::Array<::Google::Cloud::ServiceDirectory::V1::Endpoint>] - # The list of endpoints. - # @!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. - class ListEndpointsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_endpoint RegistrationService.GetEndpoint}. - # This should not be used to lookup endpoints at runtime. Instead, use - # the `resolve` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the endpoint to get. - class GetEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_endpoint RegistrationService.UpdateEndpoint}. - # @!attribute [rw] endpoint - # @return [::Google::Cloud::ServiceDirectory::V1::Endpoint] - # Required. The updated endpoint. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_endpoint RegistrationService.DeleteEndpoint}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the endpoint to delete. - class DeleteEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/service.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/service.rb deleted file mode 100644 index 0b8538d4fc4e..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/cloud/servicedirectory/v1/service.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 Cloud - module ServiceDirectory - module V1 - # An individual service. A service contains a name and optional metadata. - # A service must exist before - # {::Google::Cloud::ServiceDirectory::V1::Endpoint endpoints} can be - # added to it. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name for the service in the format - # `projects/*/locations/*/namespaces/*/services/*`. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Annotations for the service. This data can be consumed by service - # clients. - # - # Restrictions: - # - # * The entire annotations dictionary may contain up to 2000 characters, - # spread accoss all key-value pairs. Annotations that go beyond this - # limit are rejected - # * Valid annotation keys have two segments: an optional prefix and name, - # separated by a slash (/). The name segment is required and must be 63 - # characters or less, beginning and ending with an alphanumeric character - # ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - # alphanumerics between. The prefix is optional. If specified, the prefix - # must be a DNS subdomain: a series of DNS labels separated by dots (.), - # not longer than 253 characters in total, followed by a slash (/). - # Annotations that fails to meet these requirements are rejected - # - # Note: This field is equivalent to the `metadata` field in the v1beta1 API. - # They have the same syntax and read/write to the same location in Service - # Directory. - # @!attribute [r] endpoints - # @return [::Array<::Google::Cloud::ServiceDirectory::V1::Endpoint>] - # Output only. Endpoints associated with this service. Returned on - # {::Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service LookupService.ResolveService}. - # Control plane clients should use - # {::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. - # @!attribute [r] uid - # @return [::String] - # Output only. The globally unique identifier of the service in the UUID4 - # format. - class Service - 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 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-service_directory-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_directory-v1/snippets/Gemfile deleted file mode 100644 index e8fbbd9f688d..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1", path: "../" -else - gem "google-cloud-service_directory-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-service_directory-v1/snippets/lookup_service/resolve_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb deleted file mode 100644 index 42d41523aeb0..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_LookupService_ResolveService_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the resolve_service call in the LookupService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service. -# -def resolve_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::LookupService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new - - # Call the resolve_service method. - result = client.resolve_service request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse. - p result -end -# [END servicedirectory_v1_generated_LookupService_ResolveService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb deleted file mode 100644 index 6b362874d99c..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the create_endpoint call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_endpoint. -# -def create_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new - - # Call the create_endpoint method. - result = client.create_endpoint request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb deleted file mode 100644 index 9c1ca78aebfd..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the create_namespace call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_namespace. -# -def create_namespace - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new - - # Call the create_namespace method. - result = client.create_namespace request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb deleted file mode 100644 index c62abb5f64e0..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_CreateService_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the create_service call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_service. -# -def create_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new - - # Call the create_service method. - result = client.create_service request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_CreateService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb deleted file mode 100644 index 6640ad275320..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the delete_endpoint call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_endpoint. -# -def delete_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new - - # Call the delete_endpoint method. - result = client.delete_endpoint request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb deleted file mode 100644 index 973d1427f276..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the delete_namespace call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_namespace. -# -def delete_namespace - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new - - # Call the delete_namespace method. - result = client.delete_namespace request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb deleted file mode 100644 index 41c35556e4cf..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_DeleteService_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the delete_service call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_service. -# -def delete_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new - - # Call the delete_service method. - result = client.delete_service request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_DeleteService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb deleted file mode 100644 index 7c3a9036a8f0..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the get_endpoint call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_endpoint. -# -def get_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new - - # Call the get_endpoint method. - result = client.get_endpoint request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb deleted file mode 100644 index 3edcd0855cec..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the get_iam_policy call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb deleted file mode 100644 index 38a5886b9b20..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_GetNamespace_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the get_namespace call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_namespace. -# -def get_namespace - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new - - # Call the get_namespace method. - result = client.get_namespace request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_GetNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb deleted file mode 100644 index 8d9c8345bf13..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_GetService_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the get_service call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_service. -# -def get_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new - - # Call the get_service method. - result = client.get_service request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_GetService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb deleted file mode 100644 index 0144213ae217..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.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 servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the list_endpoints call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints. -# -def list_endpoints - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.new - - # Call the list_endpoints method. - result = client.list_endpoints request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Endpoint. - p item - end -end -# [END servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb deleted file mode 100644 index 181100cb1862..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.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 servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the list_namespaces call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces. -# -def list_namespaces - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.new - - # Call the list_namespaces method. - result = client.list_namespaces request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Namespace. - p item - end -end -# [END servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb deleted file mode 100644 index ff60767be1ea..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_ListServices_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the list_services call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services. -# -def list_services - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::ListServicesRequest.new - - # Call the list_services method. - result = client.list_services request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Service. - p item - end -end -# [END servicedirectory_v1_generated_RegistrationService_ListServices_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb deleted file mode 100644 index 6123a80d0ef7..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the set_iam_policy call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb deleted file mode 100644 index 3790cb0c71e0..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the test_iam_permissions call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb deleted file mode 100644 index dc43cb46df74..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the update_endpoint call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_endpoint. -# -def update_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new - - # Call the update_endpoint method. - result = client.update_endpoint request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb deleted file mode 100644 index 4a3b1c3523d0..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the update_namespace call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_namespace. -# -def update_namespace - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new - - # Call the update_namespace method. - result = client.update_namespace request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb b/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb deleted file mode 100644 index 967e62ebca9a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1_generated_RegistrationService_UpdateService_sync] -require "google/cloud/service_directory/v1" - -## -# Snippet for the update_service call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_service. -# -def update_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new - - # Call the update_service method. - result = client.update_service request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. - p result -end -# [END servicedirectory_v1_generated_RegistrationService_UpdateService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json b/owl-bot-staging/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json deleted file mode 100644 index 602d9485afe4..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json +++ /dev/null @@ -1,775 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-service_directory-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.servicedirectory.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "servicedirectory_v1_generated_LookupService_ResolveService_sync", - "title": "Snippet for the resolve_service call in the LookupService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service.", - "file": "lookup_service/resolve_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "resolve_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse", - "client": { - "short_name": "LookupService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::LookupService::Client" - }, - "method": { - "short_name": "ResolveService", - "full_name": "google.cloud.servicedirectory.v1.LookupService.ResolveService", - "service": { - "short_name": "LookupService", - "full_name": "google.cloud.servicedirectory.v1.LookupService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync", - "title": "Snippet for the create_namespace call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_namespace.", - "file": "registration_service/create_namespace.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_namespace", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_namespace", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::Namespace", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "CreateNamespace", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.CreateNamespace", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync", - "title": "Snippet for the list_namespaces call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces.", - "file": "registration_service/list_namespaces.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_namespaces", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "ListNamespaces", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.ListNamespaces", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_GetNamespace_sync", - "title": "Snippet for the get_namespace call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_namespace.", - "file": "registration_service/get_namespace.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_namespace", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_namespace", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::Namespace", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "GetNamespace", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.GetNamespace", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync", - "title": "Snippet for the update_namespace call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_namespace.", - "file": "registration_service/update_namespace.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_namespace", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_namespace", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::Namespace", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "UpdateNamespace", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.UpdateNamespace", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync", - "title": "Snippet for the delete_namespace call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_namespace.", - "file": "registration_service/delete_namespace.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_namespace", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_namespace", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "DeleteNamespace", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.DeleteNamespace", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_CreateService_sync", - "title": "Snippet for the create_service call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_service.", - "file": "registration_service/create_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::Service", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "CreateService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.CreateService", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_ListServices_sync", - "title": "Snippet for the list_services call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services.", - "file": "registration_service/list_services.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_services", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::ListServicesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::ListServicesResponse", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "ListServices", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.ListServices", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_GetService_sync", - "title": "Snippet for the get_service call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_service.", - "file": "registration_service/get_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::GetServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::Service", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "GetService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.GetService", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_UpdateService_sync", - "title": "Snippet for the update_service call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_service.", - "file": "registration_service/update_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::Service", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "UpdateService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.UpdateService", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_DeleteService_sync", - "title": "Snippet for the delete_service call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_service.", - "file": "registration_service/delete_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "DeleteService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.DeleteService", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync", - "title": "Snippet for the create_endpoint call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_endpoint.", - "file": "registration_service/create_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_endpoint", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::Endpoint", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "CreateEndpoint", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.CreateEndpoint", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync", - "title": "Snippet for the list_endpoints call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints.", - "file": "registration_service/list_endpoints.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_endpoints", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "ListEndpoints", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync", - "title": "Snippet for the get_endpoint call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_endpoint.", - "file": "registration_service/get_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_endpoint", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::Endpoint", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "GetEndpoint", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.GetEndpoint", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync", - "title": "Snippet for the update_endpoint call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_endpoint.", - "file": "registration_service/update_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_endpoint", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1::Endpoint", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "UpdateEndpoint", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.UpdateEndpoint", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync", - "title": "Snippet for the delete_endpoint call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_endpoint.", - "file": "registration_service/delete_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_endpoint", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "DeleteEndpoint", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.DeleteEndpoint", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_iam_policy.", - "file": "registration_service/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.GetIamPolicy", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#set_iam_policy.", - "file": "registration_service/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.SetIamPolicy", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#test_iam_permissions.", - "file": "registration_service/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService.TestIamPermissions", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1.RegistrationService" - } - } - }, - "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-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb deleted file mode 100644 index 2eda77de1994..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_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/service_directory/v1/lookup_service" - -class ::Google::Cloud::ServiceDirectory::V1::LookupService::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_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" - assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb deleted file mode 100644 index 869730c95a5e..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb +++ /dev/null @@ -1,155 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/servicedirectory/v1/lookup_service_pb" -require "google/cloud/service_directory/v1/lookup_service/rest" - - -class ::Google::Cloud::ServiceDirectory::V1::LookupService::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_resolve_service - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - max_endpoints = 42 - endpoint_filter = "hello world" - - resolve_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::ServiceStub.stub :transcode_resolve_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resolve_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resolve_service name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resolve_service ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resolve_service(::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resolve_service_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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::ServiceDirectory::V1::LookupService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb deleted file mode 100644 index 9d5e92ce315f..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb +++ /dev/null @@ -1,166 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/servicedirectory/v1/lookup_service_pb" -require "google/cloud/service_directory/v1/lookup_service" - -class ::Google::Cloud::ServiceDirectory::V1::LookupService::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_resolve_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - max_endpoints = 42 - endpoint_filter = "hello world" - - resolve_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resolve_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["max_endpoints"] - assert_equal "hello world", request["endpoint_filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resolve_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resolve_service name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resolve_service ::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resolve_service(::Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, resolve_service_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ServiceDirectory::V1::LookupService::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::ServiceDirectory::V1::LookupService::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::ServiceDirectory::V1::LookupService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::LookupService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb deleted file mode 100644 index a8dbd3c6867f..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/service_directory/v1/registration_service" - -class ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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_endpoint_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.endpoint_path project: "value0", location: "value1", namespace: "value2", service: "value3", endpoint: "value4" - assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3/endpoints/value4", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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_namespace_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.namespace_path project: "value0", location: "value1", namespace: "value2" - assert_equal "projects/value0/locations/value1/namespaces/value2", 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::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_path project: "value0", network: "value1" - assert_equal "projects/value0/locations/global/networks/value1", path - end - end - - def test_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" - assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb deleted file mode 100644 index 48555a3966c5..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb +++ /dev/null @@ -1,1096 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/servicedirectory/v1/registration_service_pb" -require "google/cloud/service_directory/v1/registration_service/rest" - - -class ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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_namespace - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::Namespace.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - namespace_id = "hello world" - namespace = {} - - create_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_create_namespace_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_namespace parent: parent, namespace_id: namespace_id, namespace: namespace do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_namespace ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_namespace(::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_namespace_client_stub.call_count - end - end - end - - def test_list_namespaces - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse.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_namespaces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_list_namespaces_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_namespaces_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_namespaces({ 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_namespaces 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_namespaces ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.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_namespaces({ 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_namespaces(::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.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_namespaces_client_stub.call_count - end - end - end - - def test_get_namespace - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::Namespace.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_get_namespace_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_namespace({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_namespace name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_namespace ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_namespace({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_namespace(::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_namespace_client_stub.call_count - end - end - end - - def test_update_namespace - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::Namespace.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - namespace = {} - update_mask = {} - - update_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_update_namespace_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_namespace({ namespace: namespace, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_namespace namespace: namespace, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_namespace ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new(namespace: namespace, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_namespace({ namespace: namespace, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_namespace(::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new(namespace: namespace, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_namespace_client_stub.call_count - end - end - end - - def test_delete_namespace - # 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_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_namespace_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_namespace({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_namespace name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_namespace ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_namespace({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_namespace(::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_namespace_client_stub.call_count - end - end - end - - def test_create_service - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::Service.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - service_id = "hello world" - service = {} - - create_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_create_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_service({ parent: parent, service_id: service_id, service: service }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_service parent: parent, service_id: service_id, service: service do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_service ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_service({ parent: parent, service_id: service_id, service: service }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_service(::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_service_client_stub.call_count - end - end - end - - def test_list_services - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::ListServicesResponse.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_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_list_services_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_services({ 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_services 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_services ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceDirectory::V1::ListServicesRequest.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_services_client_stub.call_count - end - end - end - - def test_get_service - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::Service.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_get_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_service({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_service name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_service ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_service({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_service(::Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_service_client_stub.call_count - end - end - end - - def test_update_service - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::Service.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service = {} - update_mask = {} - - update_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_update_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_service({ service: service, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_service service: service, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_service ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new(service: service, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_service({ service: service, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_service(::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new(service: service, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_service_client_stub.call_count - end - end - end - - def test_delete_service - # 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_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_service({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_service name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_service ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_service({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_service(::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_service_client_stub.call_count - end - end - end - - def test_create_endpoint - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - endpoint_id = "hello world" - endpoint = {} - - create_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_create_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_endpoint parent: parent, endpoint_id: endpoint_id, endpoint: endpoint do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_endpoint ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_endpoint(::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_endpoint_client_stub.call_count - end - end - end - - def test_list_endpoints - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse.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_endpoints_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_list_endpoints_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_endpoints_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_endpoints({ 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_endpoints 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_endpoints ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.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_endpoints({ 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_endpoints(::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.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_endpoints_client_stub.call_count - end - end - end - - def test_get_endpoint - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_get_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_endpoint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_endpoint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_endpoint ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_endpoint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_endpoint(::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_endpoint_client_stub.call_count - end - end - end - - def test_update_endpoint - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - endpoint = {} - update_mask = {} - - update_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_update_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_endpoint endpoint: endpoint, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_endpoint ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new(endpoint: endpoint, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_endpoint(::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new(endpoint: endpoint, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_endpoint_client_stub.call_count - end - end - end - - def test_delete_endpoint - # 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_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_endpoint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_endpoint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_endpoint ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_endpoint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_endpoint(::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_endpoint_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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::ServiceDirectory::V1::RegistrationService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb deleted file mode 100644 index 9ca3fd528e1b..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb +++ /dev/null @@ -1,1213 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/servicedirectory/v1/registration_service_pb" -require "google/cloud/service_directory/v1/registration_service" - -class ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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_namespace - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::Namespace.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - namespace_id = "hello world" - namespace = {} - - create_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_namespace, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["namespace_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Namespace), request["namespace"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_namespace parent: parent, namespace_id: namespace_id, namespace: namespace do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_namespace ::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_namespace(::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_namespace_client_stub.call_rpc_count - end - end - - def test_list_namespaces - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::ListNamespacesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_namespaces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_namespaces, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest, 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_namespaces_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_namespaces({ 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_namespaces 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_namespaces ::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.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_namespaces({ 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_namespaces(::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.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_namespaces_client_stub.call_rpc_count - end - end - - def test_get_namespace - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::Namespace.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_namespace, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_namespace({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_namespace name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_namespace ::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_namespace({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_namespace(::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_namespace_client_stub.call_rpc_count - end - end - - def test_update_namespace - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::Namespace.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - namespace = {} - update_mask = {} - - update_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_namespace, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Namespace), request["namespace"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_namespace({ namespace: namespace, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_namespace namespace: namespace, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_namespace ::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new(namespace: namespace, 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_namespace({ namespace: namespace, 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_namespace(::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new(namespace: namespace, 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_namespace_client_stub.call_rpc_count - end - end - - def test_delete_namespace - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_namespace, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_namespace({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_namespace name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_namespace ::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_namespace({ 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_namespace(::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new(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_namespace_client_stub.call_rpc_count - end - end - - def test_create_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::Service.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - service_id = "hello world" - service = {} - - create_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["service_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Service), request["service"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_service({ parent: parent, service_id: service_id, service: service }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_service parent: parent, service_id: service_id, service: service do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_service ::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_service({ parent: parent, service_id: service_id, service: service }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_service(::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_service_client_stub.call_rpc_count - end - end - - def test_list_services - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::ListServicesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_services, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest, 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_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_services({ 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_services 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_services ::Google::Cloud::ServiceDirectory::V1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceDirectory::V1::ListServicesRequest.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_services_client_stub.call_rpc_count - end - end - - def test_get_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::Service.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_service({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_service name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_service ::Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_service({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_service(::Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_service_client_stub.call_rpc_count - end - end - - def test_update_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::Service.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service = {} - update_mask = {} - - update_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Service), request["service"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_service({ service: service, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_service service: service, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_service ::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new(service: service, 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_service({ service: service, 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_service(::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new(service: service, 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_service_client_stub.call_rpc_count - end - end - - def test_delete_service - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_service({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_service name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_service ::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_service({ 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_service(::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new(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_service_client_stub.call_rpc_count - end - end - - def test_create_endpoint - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - endpoint_id = "hello world" - endpoint = {} - - create_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_endpoint, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["endpoint_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Endpoint), request["endpoint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_endpoint parent: parent, endpoint_id: endpoint_id, endpoint: endpoint do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_endpoint ::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_endpoint(::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_endpoint_client_stub.call_rpc_count - end - end - - def test_list_endpoints - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::ListEndpointsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_endpoints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_endpoints, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest, 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_endpoints_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_endpoints({ 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_endpoints 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_endpoints ::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.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_endpoints({ 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_endpoints(::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.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_endpoints_client_stub.call_rpc_count - end - end - - def test_get_endpoint - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_endpoint, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_endpoint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_endpoint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_endpoint ::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_endpoint({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_endpoint(::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_endpoint_client_stub.call_rpc_count - end - end - - def test_update_endpoint - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1::Endpoint.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - endpoint = {} - update_mask = {} - - update_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_endpoint, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1::Endpoint), request["endpoint"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_endpoint endpoint: endpoint, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_endpoint ::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new(endpoint: endpoint, 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_endpoint({ endpoint: endpoint, 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_endpoint(::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new(endpoint: endpoint, 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_endpoint_client_stub.call_rpc_count - end - end - - def test_delete_endpoint - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_endpoint, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_endpoint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_endpoint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_endpoint ::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_endpoint({ 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_endpoint(::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new(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_endpoint_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::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::ServiceDirectory::V1::RegistrationService::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::ServiceDirectory::V1::RegistrationService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_directory-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/.gitignore b/owl-bot-staging/google-cloud-service_directory-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_directory-v1beta1/.repo-metadata.json deleted file mode 100644 index 0344f921c12e..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "servicedirectory.googleapis.com", - "api_shortname": "servicedirectory", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1beta1/latest", - "distribution_name": "google-cloud-service_directory-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "servicedirectory", - "name_pretty": "Service Directory V1beta1 API", - "product_documentation": "https://cloud.google.com/service-directory", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Service directory is the single place to register, browse, and resolve application services. Note that google-cloud-service_directory-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_directory instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SERVICE_DIRECTORY", - "ruby-cloud-product-url": "https://cloud.google.com/service-directory", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-service_directory-v1beta1/.rubocop.yml deleted file mode 100644 index d1efd0d6f24d..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-service_directory-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-service_directory-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/.yardopts b/owl-bot-staging/google-cloud-service_directory-v1beta1/.yardopts deleted file mode 100644 index c2eb327a2a4b..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Service Directory 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-service_directory-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 6a7d3111b2f5..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-service_directory-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-service_directory-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/service_directory/v1beta1" - -client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/service_directory/v1beta1" - -::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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-service_directory-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/service_directory/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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-service_directory-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/Gemfile b/owl-bot-staging/google-cloud-service_directory-v1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/README.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/README.md deleted file mode 100644 index 8ad874720629..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Service Directory V1beta1 API - -Service Directory is a platform for discovering, publishing, and connecting services. - -Service directory is the single place to register, browse, and resolve application 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 Service Directory V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-service_directory](https://rubygems.org/gems/google-cloud-service_directory). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-service_directory-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/servicedirectory.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/service_directory/v1beta1" - -client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new -request = ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new # (request fields as keyword arguments...) -response = client.resolve_service request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/service-directory) -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/service_directory/v1beta1" -require "logger" - -client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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-service_directory`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-service_directory-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-service_directory`. -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-service_directory-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-service_directory-v1beta1/Rakefile b/owl-bot-staging/google-cloud-service_directory-v1beta1/Rakefile deleted file mode 100644 index 02b546ed1792..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SERVICE_DIRECTORY_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SERVICE_DIRECTORY_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SERVICE_DIRECTORY_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 SERVICE_DIRECTORY_TEST_PROJECT=test123 SERVICE_DIRECTORY_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/service_directory/v1beta1/lookup_service/credentials" - ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SERVICE_DIRECTORY_PROJECT"] = project - ENV["SERVICE_DIRECTORY_TEST_PROJECT"] = project - ENV["SERVICE_DIRECTORY_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-service_directory-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-service_directory-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-service_directory-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-service_directory-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-service_directory-v1beta1" - header "google-cloud-service_directory-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-service_directory-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-service_directory-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-service_directory-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-service_directory-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-service_directory-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_directory-v1beta1/gapic_metadata.json deleted file mode 100644 index 2ab2d2885e40..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.servicedirectory.v1beta1", - "libraryPackage": "::Google::Cloud::ServiceDirectory::V1beta1", - "services": { - "LookupService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client", - "rpcs": { - "ResolveService": { - "methods": [ - "resolve_service" - ] - } - } - } - } - }, - "RegistrationService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client", - "rpcs": { - "CreateNamespace": { - "methods": [ - "create_namespace" - ] - }, - "ListNamespaces": { - "methods": [ - "list_namespaces" - ] - }, - "GetNamespace": { - "methods": [ - "get_namespace" - ] - }, - "UpdateNamespace": { - "methods": [ - "update_namespace" - ] - }, - "DeleteNamespace": { - "methods": [ - "delete_namespace" - ] - }, - "CreateService": { - "methods": [ - "create_service" - ] - }, - "ListServices": { - "methods": [ - "list_services" - ] - }, - "GetService": { - "methods": [ - "get_service" - ] - }, - "UpdateService": { - "methods": [ - "update_service" - ] - }, - "DeleteService": { - "methods": [ - "delete_service" - ] - }, - "CreateEndpoint": { - "methods": [ - "create_endpoint" - ] - }, - "ListEndpoints": { - "methods": [ - "list_endpoints" - ] - }, - "GetEndpoint": { - "methods": [ - "get_endpoint" - ] - }, - "UpdateEndpoint": { - "methods": [ - "update_endpoint" - ] - }, - "DeleteEndpoint": { - "methods": [ - "delete_endpoint" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/google-cloud-service_directory-v1beta1.gemspec b/owl-bot-staging/google-cloud-service_directory-v1beta1/google-cloud-service_directory-v1beta1.gemspec deleted file mode 100644 index 3293eafe752e..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/google-cloud-service_directory-v1beta1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/service_directory/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-service_directory-v1beta1" - gem.version = Google::Cloud::ServiceDirectory::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Service directory is the single place to register, browse, and resolve application services. Note that google-cloud-service_directory-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_directory instead. See the readme for more details." - gem.summary = "Service Directory is a platform for discovering, publishing, and connecting services." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google-cloud-service_directory-v1beta1.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google-cloud-service_directory-v1beta1.rb deleted file mode 100644 index c08367906250..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google-cloud-service_directory-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/service_directory/v1beta1" diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1.rb deleted file mode 100644 index 6bcb343006c1..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1.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/service_directory/v1beta1/lookup_service" -require "google/cloud/service_directory/v1beta1/registration_service" -require "google/cloud/service_directory/v1beta1/version" - -module Google - module Cloud - module ServiceDirectory - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/service_directory/v1beta1" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/service_directory/v1beta1" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new - # - module V1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/service_directory/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/bindings_override.rb deleted file mode 100644 index 59fc75fb480d..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module ServiceDirectory - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/service_directory/v1beta1/rest" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new - # - module V1beta1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceDirectory"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service.rb deleted file mode 100644 index 79639aca3a89..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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/service_directory/v1beta1/version" - -require "google/cloud/service_directory/v1beta1/lookup_service/credentials" -require "google/cloud/service_directory/v1beta1/lookup_service/paths" -require "google/cloud/service_directory/v1beta1/lookup_service/client" -require "google/cloud/service_directory/v1beta1/lookup_service/rest" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - ## - # Service Directory API for looking up service data at runtime. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/service_directory/v1beta1/lookup_service" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/service_directory/v1beta1/lookup_service/rest" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new - # - module LookupService - end - end - end - end -end - -helper_path = ::File.join __dir__, "lookup_service", "helpers.rb" -require "google/cloud/service_directory/v1beta1/lookup_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb deleted file mode 100644 index fb69b5af313c..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb +++ /dev/null @@ -1,538 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/servicedirectory/v1beta1/lookup_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - module LookupService - ## - # Client for the LookupService service. - # - # Service Directory API for looking up service data at runtime. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :lookup_service_stub - - ## - # Configure the LookupService Client class. - # - # See {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all LookupService clients - # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceDirectory", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 15.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the LookupService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @lookup_service_stub.universe_domain - end - - ## - # Create a new LookupService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the LookupService 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/servicedirectory/v1beta1/lookup_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 - - @lookup_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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 - ) - - @lookup_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @lookup_service_stub.endpoint - config.universe_domain = @lookup_service_stub.universe_domain - config.logger = @lookup_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @lookup_service_stub.logger - end - - # Service calls - - ## - # Returns a {::Google::Cloud::ServiceDirectory::V1beta1::Service service} and its - # associated endpoints. - # Resolving a service is not considered an active developer method. - # - # @overload resolve_service(request, options = nil) - # Pass arguments to `resolve_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) - # Pass arguments to `resolve_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to resolve. - # @param max_endpoints [::Integer] - # Optional. The maximum number of endpoints to return. Defaults to 25. - # Maximum is 100. If a value less than one is specified, the Default is used. - # If a value greater than the Maximum is specified, the Maximum is used. - # @param endpoint_filter [::String] - # Optional. The filter applied to the endpoints of the resolved service. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, or `metadata.` for - # map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `metadata.owner` returns endpoints that have a annotation with the key - # `owner`, this is the same as `metadata:owner` - # * `metadata.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * - # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - # returns the endpoint that has an endpoint_id equal to `ep-1` - # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - # `owner` in annotation key but value is not `sd` AND have key/value - # `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoint, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new - # - # # Call the resolve_service method. - # result = client.resolve_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse. - # p result - # - def resolve_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.resolve_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.resolve_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resolve_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @lookup_service_stub.call_rpc :resolve_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the LookupService API. - # - # This class represents the configuration for LookupService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # resolve_service to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.resolve_service.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.resolve_service.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::ServiceDirectory::V1beta1::LookupService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the LookupService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `resolve_service` - # @return [::Gapic::Config::Method] - # - attr_reader :resolve_service - - # @private - def initialize parent_rpcs = nil - resolve_service_config = parent_rpcs.resolve_service if parent_rpcs.respond_to? :resolve_service - @resolve_service = ::Gapic::Config::Method.new resolve_service_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/credentials.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/credentials.rb deleted file mode 100644 index 53cdf629fbe5..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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 ServiceDirectory - module V1beta1 - module LookupService - # Credentials for the LookupService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SERVICE_DIRECTORY_CREDENTIALS", - "SERVICE_DIRECTORY_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SERVICE_DIRECTORY_CREDENTIALS_JSON", - "SERVICE_DIRECTORY_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-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/paths.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/paths.rb deleted file mode 100644 index 50d7bedddd03..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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 ServiceDirectory - module V1beta1 - module LookupService - # Path helper methods for the LookupService API. - module Paths - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, namespace:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest.rb deleted file mode 100644 index 8555356e42e7..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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/service_directory/v1beta1/version" -require "google/cloud/service_directory/v1beta1/bindings_override" - -require "google/cloud/service_directory/v1beta1/lookup_service/credentials" -require "google/cloud/service_directory/v1beta1/lookup_service/paths" -require "google/cloud/service_directory/v1beta1/lookup_service/rest/client" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - ## - # Service Directory API for looking up service data at runtime. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/service_directory/v1beta1/lookup_service/rest" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new - # - module LookupService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/service_directory/v1beta1/lookup_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb deleted file mode 100644 index 7e7765b5d44f..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/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/cloud/servicedirectory/v1beta1/lookup_service_pb" -require "google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - module LookupService - module Rest - ## - # REST client for the LookupService service. - # - # Service Directory API for looking up service data at runtime. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :lookup_service_stub - - ## - # Configure the LookupService Client class. - # - # See {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all LookupService clients - # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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", "ServiceDirectory", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 15.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the LookupService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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 - @lookup_service_stub.universe_domain - end - - ## - # Create a new LookupService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the LookupService 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 - - @lookup_service_stub = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @lookup_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @lookup_service_stub.endpoint - config.universe_domain = @lookup_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @lookup_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @lookup_service_stub.logger - end - - # Service calls - - ## - # Returns a {::Google::Cloud::ServiceDirectory::V1beta1::Service service} and its - # associated endpoints. - # Resolving a service is not considered an active developer method. - # - # @overload resolve_service(request, options = nil) - # Pass arguments to `resolve_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) - # Pass arguments to `resolve_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to resolve. - # @param max_endpoints [::Integer] - # Optional. The maximum number of endpoints to return. Defaults to 25. - # Maximum is 100. If a value less than one is specified, the Default is used. - # If a value greater than the Maximum is specified, the Maximum is used. - # @param endpoint_filter [::String] - # Optional. The filter applied to the endpoints of the resolved service. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, or `metadata.` for - # map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `metadata.owner` returns endpoints that have a annotation with the key - # `owner`, this is the same as `metadata:owner` - # * `metadata.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * - # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - # returns the endpoint that has an endpoint_id equal to `ep-1` - # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - # `owner` in annotation key but value is not `sd` AND have key/value - # `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoint, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new - # - # # Call the resolve_service method. - # result = client.resolve_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse. - # p result - # - def resolve_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.resolve_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.resolve_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resolve_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @lookup_service_stub.resolve_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the LookupService REST API. - # - # This class represents the configuration for LookupService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # resolve_service to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.resolve_service.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.resolve_service.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 LookupService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `resolve_service` - # @return [::Gapic::Config::Method] - # - attr_reader :resolve_service - - # @private - def initialize parent_rpcs = nil - resolve_service_config = parent_rpcs.resolve_service if parent_rpcs.respond_to? :resolve_service - @resolve_service = ::Gapic::Config::Method.new resolve_service_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb deleted file mode 100644 index b7c4ba7a4500..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_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/servicedirectory/v1beta1/lookup_service_pb" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - module LookupService - module Rest - ## - # REST service stub for the LookupService 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 resolve_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse] - # A result object deserialized from the server's reply - def resolve_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resolve_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "resolve_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse.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 resolve_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resolve_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:resolve", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service.rb deleted file mode 100644 index 7acfe52f8b07..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/service_directory/v1beta1/version" - -require "google/cloud/service_directory/v1beta1/registration_service/credentials" -require "google/cloud/service_directory/v1beta1/registration_service/paths" -require "google/cloud/service_directory/v1beta1/registration_service/client" -require "google/cloud/service_directory/v1beta1/registration_service/rest" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - ## - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Namespace Namespace} - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Service Service} resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint Endpoint} - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/service_directory/v1beta1/registration_service" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/service_directory/v1beta1/registration_service/rest" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - module RegistrationService - end - end - end - end -end - -helper_path = ::File.join __dir__, "registration_service", "helpers.rb" -require "google/cloud/service_directory/v1beta1/registration_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb deleted file mode 100644 index 50478f67a20e..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb +++ /dev/null @@ -1,2305 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/servicedirectory/v1beta1/registration_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - module RegistrationService - ## - # Client for the RegistrationService service. - # - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Namespace Namespace} - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Service Service} resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint Endpoint} - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :registration_service_stub - - ## - # Configure the RegistrationService Client class. - # - # See {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RegistrationService clients - # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceDirectory", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 15.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RegistrationService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @registration_service_stub.universe_domain - end - - ## - # Create a new RegistrationService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RegistrationService 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/servicedirectory/v1beta1/registration_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 - - @registration_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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 - ) - - @registration_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @registration_service_stub.endpoint - config.universe_domain = @registration_service_stub.universe_domain - config.logger = @registration_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @registration_service_stub.logger - end - - # Service calls - - ## - # Creates a namespace, and returns the new namespace. - # - # @overload create_namespace(request, options = nil) - # Pass arguments to `create_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_namespace(parent: nil, namespace_id: nil, namespace: nil) - # Pass arguments to `create_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project and location the namespace - # will be created in. - # @param namespace_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param namespace [::Google::Cloud::ServiceDirectory::V1beta1::Namespace, ::Hash] - # Required. A namespace with initial fields set. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new - # - # # Call the create_namespace method. - # result = client.create_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. - # p result - # - def create_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest - - # Converts hash and nil to 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_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_namespace.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :create_namespace, request, 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 namespaces. - # - # @overload list_namespaces(request, options = nil) - # Pass arguments to `list_namespaces` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_namespaces` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project and location whose namespaces - # you'd like to list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. The default value is 100. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `labels.` for map field, or - # `attributes.` for attributes field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `labels.owner` returns namespaces that have a label with the key - # `owner`, this is the same as `labels:owner` - # * `labels.owner=sd` returns namespaces that have key/value `owner=sd` - # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - # returns namespaces that have name that is alphabetically later than the - # string, so "namespace-e" is returned but "namespace-a" is not - # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - # `owner` in label key but value is not `sd` AND have key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that namespace - # doesn't have a field called "doesnotexist". Since the filter does not - # match any namespaces, it returns no results - # * `attributes.managed_registration=true` returns namespaces that are - # managed by a GCP product or service - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.new - # - # # Call the list_namespaces method. - # result = client.list_namespaces request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Namespace. - # p item - # end - # - def list_namespaces request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_namespaces.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_namespaces.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_namespaces.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :list_namespaces, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_namespaces, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a namespace. - # - # @overload get_namespace(request, options = nil) - # Pass arguments to `get_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_namespace(name: nil) - # Pass arguments to `get_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 namespace to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new - # - # # Call the get_namespace method. - # result = client.get_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. - # p result - # - def get_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_namespace.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :get_namespace, request, 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 namespace. - # - # @overload update_namespace(request, options = nil) - # Pass arguments to `update_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_namespace(namespace: nil, update_mask: nil) - # Pass arguments to `update_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param namespace [::Google::Cloud::ServiceDirectory::V1beta1::Namespace, ::Hash] - # Required. The updated namespace. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new - # - # # Call the update_namespace method. - # result = client.update_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. - # p result - # - def update_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest - - # Converts hash and nil to 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_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.namespace&.name - header_params["namespace.name"] = request.namespace.name - end - - request_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_namespace.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :update_namespace, request, 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 namespace. This also deletes all services and endpoints in - # the namespace. - # - # @overload delete_namespace(request, options = nil) - # Pass arguments to `delete_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_namespace(name: nil) - # Pass arguments to `delete_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 namespace to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new - # - # # Call the delete_namespace method. - # result = client.delete_namespace request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_namespace.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :delete_namespace, request, 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 service, and returns the new service. - # - # @overload create_service(request, options = nil) - # Pass arguments to `create_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_service(parent: nil, service_id: nil, service: nil) - # Pass arguments to `create_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the namespace this service will belong to. - # @param service_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param service [::Google::Cloud::ServiceDirectory::V1beta1::Service, ::Hash] - # Required. A service with initial fields set. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new - # - # # Call the create_service method. - # result = client.create_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. - # p result - # - def create_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest - - # Converts hash and nil to 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :create_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all services belonging to a namespace. - # - # @overload list_services(request, options = nil) - # Pass arguments to `list_services` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the namespace whose services you'd - # like to list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. The default value is 100. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name` or `metadata.` for map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `metadata.owner` returns services that have a metadata with the key - # `owner`, this is the same as `metadata:owner` - # * `metadata.protocol=gRPC` returns services that have key/value - # `protocol=gRPC` - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - # returns services that have name that is alphabetically later than the - # string, so "service-e" is returned but "service-a" is not - # * `metadata.owner!=sd AND metadata.foo=bar` returns services that have - # `owner` in metadata key but value is not `sd` AND have key/value - # `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that service - # doesn't have a field called "doesnotexist". Since the filter does not - # match any services, it returns no results - # * `attributes.managed_registration=true` returns services that are - # managed - # by a GCP product or service - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Service>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Service>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.new - # - # # Call the list_services method. - # result = client.list_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Service. - # p item - # end - # - def list_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_services.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :list_services, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_services, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a service. - # - # @overload get_service(request, options = nil) - # Pass arguments to `get_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_service(name: nil) - # Pass arguments to `get_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new - # - # # Call the get_service method. - # result = client.get_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. - # p result - # - def get_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :get_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a service. - # - # @overload update_service(request, options = nil) - # Pass arguments to `update_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_service(service: nil, update_mask: nil) - # Pass arguments to `update_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service [::Google::Cloud::ServiceDirectory::V1beta1::Service, ::Hash] - # Required. The updated service. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new - # - # # Call the update_service method. - # result = client.update_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. - # p result - # - def update_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest - - # Converts hash and nil to 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service&.name - header_params["service.name"] = request.service.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :update_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a service. This also deletes all endpoints associated with - # the service. - # - # @overload delete_service(request, options = nil) - # Pass arguments to `delete_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_service(name: nil) - # Pass arguments to `delete_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new - # - # # Call the delete_service method. - # result = client.delete_service request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :delete_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an endpoint, and returns the new endpoint. - # - # @overload create_endpoint(request, options = nil) - # Pass arguments to `create_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) - # Pass arguments to `create_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the service that this endpoint provides. - # @param endpoint_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param endpoint [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint, ::Hash] - # Required. A endpoint with initial fields set. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new - # - # # Call the create_endpoint method. - # result = client.create_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - # p result - # - def create_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest - - # Converts hash and nil to 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_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :create_endpoint, request, 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 endpoints. - # - # @overload list_endpoints(request, options = nil) - # Pass arguments to `list_endpoints` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_endpoints` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the service whose endpoints you'd like to - # list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. The default value is 100. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, `metadata.` for map - # field, or `attributes.` for attributes field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `metadata.owner` returns endpoints that have a metadata with the key - # `owner`, this is the same as `metadata:owner` - # * `metadata.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - # `owner` in metadata key but value is not `sd` AND have key/value - # `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoints, it returns no results - # * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ - # IP` returns endpoints with the corresponding kubernetes_resource_type - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows values: `name`, `address`, `port` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.new - # - # # Call the list_endpoints method. - # result = client.list_endpoints request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - # p item - # end - # - def list_endpoints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_endpoints.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_endpoints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :list_endpoints, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @registration_service_stub, :list_endpoints, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an endpoint. - # - # @overload get_endpoint(request, options = nil) - # Pass arguments to `get_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_endpoint(name: nil) - # Pass arguments to `get_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 endpoint to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new - # - # # Call the get_endpoint method. - # result = client.get_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - # p result - # - def get_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :get_endpoint, request, 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 endpoint. - # - # @overload update_endpoint(request, options = nil) - # Pass arguments to `update_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_endpoint(endpoint: nil, update_mask: nil) - # Pass arguments to `update_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param endpoint [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint, ::Hash] - # Required. The updated endpoint. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new - # - # # Call the update_endpoint method. - # result = client.update_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - # p result - # - def update_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest - - # Converts hash and nil to 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_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.endpoint&.name - header_params["endpoint.name"] = request.endpoint.name - end - - request_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_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :update_endpoint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an endpoint. - # - # @overload delete_endpoint(request, options = nil) - # Pass arguments to `delete_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_endpoint(name: nil) - # Pass arguments to `delete_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 endpoint to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new - # - # # Call the delete_endpoint method. - # result = client.delete_endpoint request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :delete_endpoint, request, 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 IAM Policy for a resource - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the IAM Policy for a resource - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Tests IAM permissions for a resource (namespace, service or - # service workload only). - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the RegistrationService API. - # - # This class represents the configuration for RegistrationService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_namespace to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_namespace.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_namespace.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the RegistrationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :create_namespace - ## - # RPC-specific configuration for `list_namespaces` - # @return [::Gapic::Config::Method] - # - attr_reader :list_namespaces - ## - # RPC-specific configuration for `get_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :get_namespace - ## - # RPC-specific configuration for `update_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :update_namespace - ## - # RPC-specific configuration for `delete_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_namespace - ## - # RPC-specific configuration for `create_service` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service - ## - # RPC-specific configuration for `list_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_services - ## - # RPC-specific configuration for `get_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service - ## - # RPC-specific configuration for `update_service` - # @return [::Gapic::Config::Method] - # - attr_reader :update_service - ## - # RPC-specific configuration for `delete_service` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_service - ## - # RPC-specific configuration for `create_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :create_endpoint - ## - # RPC-specific configuration for `list_endpoints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_endpoints - ## - # RPC-specific configuration for `get_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_endpoint - ## - # RPC-specific configuration for `update_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :update_endpoint - ## - # RPC-specific configuration for `delete_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_endpoint - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - create_namespace_config = parent_rpcs.create_namespace if parent_rpcs.respond_to? :create_namespace - @create_namespace = ::Gapic::Config::Method.new create_namespace_config - list_namespaces_config = parent_rpcs.list_namespaces if parent_rpcs.respond_to? :list_namespaces - @list_namespaces = ::Gapic::Config::Method.new list_namespaces_config - get_namespace_config = parent_rpcs.get_namespace if parent_rpcs.respond_to? :get_namespace - @get_namespace = ::Gapic::Config::Method.new get_namespace_config - update_namespace_config = parent_rpcs.update_namespace if parent_rpcs.respond_to? :update_namespace - @update_namespace = ::Gapic::Config::Method.new update_namespace_config - delete_namespace_config = parent_rpcs.delete_namespace if parent_rpcs.respond_to? :delete_namespace - @delete_namespace = ::Gapic::Config::Method.new delete_namespace_config - create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service - @create_service = ::Gapic::Config::Method.new create_service_config - list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services - @list_services = ::Gapic::Config::Method.new list_services_config - get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service - @get_service = ::Gapic::Config::Method.new get_service_config - update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service - @update_service = ::Gapic::Config::Method.new update_service_config - delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service - @delete_service = ::Gapic::Config::Method.new delete_service_config - create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint - @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config - list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints - @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config - get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint - @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config - update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint - @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config - delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint - @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/credentials.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/credentials.rb deleted file mode 100644 index d90bb79b2ad3..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_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 ServiceDirectory - module V1beta1 - module RegistrationService - # Credentials for the RegistrationService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SERVICE_DIRECTORY_CREDENTIALS", - "SERVICE_DIRECTORY_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SERVICE_DIRECTORY_CREDENTIALS_JSON", - "SERVICE_DIRECTORY_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-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/paths.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/paths.rb deleted file mode 100644 index 7d67a139666f..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/paths.rb +++ /dev/null @@ -1,130 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - module RegistrationService - # Path helper methods for the RegistrationService API. - module Paths - ## - # Create a fully-qualified Endpoint resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # @param service [String] - # @param endpoint [String] - # - # @return [::String] - def endpoint_path project:, location:, namespace:, service:, endpoint: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" - raise ::ArgumentError, "service cannot contain /" if service.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}/endpoints/#{endpoint}" - 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 Namespace resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # - # @return [::String] - def namespace_path project:, location:, namespace: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}" - end - - ## - # Create a fully-qualified Network resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/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}/locations/global/networks/#{network}" - end - - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, namespace:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest.rb deleted file mode 100644 index 3cf7fab4eda2..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/service_directory/v1beta1/version" -require "google/cloud/service_directory/v1beta1/bindings_override" - -require "google/cloud/service_directory/v1beta1/registration_service/credentials" -require "google/cloud/service_directory/v1beta1/registration_service/paths" -require "google/cloud/service_directory/v1beta1/registration_service/rest/client" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - ## - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Namespace Namespace} - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Service Service} resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint Endpoint} - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/service_directory/v1beta1/registration_service/rest" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - module RegistrationService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/service_directory/v1beta1/registration_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb deleted file mode 100644 index 389cc15802b4..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb +++ /dev/null @@ -1,2144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/servicedirectory/v1beta1/registration_service_pb" -require "google/cloud/service_directory/v1beta1/registration_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - module RegistrationService - module Rest - ## - # REST client for the RegistrationService service. - # - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Namespace Namespace} - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Service Service} resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint Endpoint} - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicedirectory.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :registration_service_stub - - ## - # Configure the RegistrationService Client class. - # - # See {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RegistrationService clients - # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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", "ServiceDirectory", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 15.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RegistrationService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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 - @registration_service_stub.universe_domain - end - - ## - # Create a new RegistrationService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RegistrationService 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 - - @registration_service_stub = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @registration_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @registration_service_stub.endpoint - config.universe_domain = @registration_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @registration_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @registration_service_stub.logger - end - - # Service calls - - ## - # Creates a namespace, and returns the new namespace. - # - # @overload create_namespace(request, options = nil) - # Pass arguments to `create_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_namespace(parent: nil, namespace_id: nil, namespace: nil) - # Pass arguments to `create_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project and location the namespace - # will be created in. - # @param namespace_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param namespace [::Google::Cloud::ServiceDirectory::V1beta1::Namespace, ::Hash] - # Required. A namespace with initial fields set. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new - # - # # Call the create_namespace method. - # result = client.create_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. - # p result - # - def create_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest - - # Converts hash and nil to an 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_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_namespace.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.create_namespace request, 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 namespaces. - # - # @overload list_namespaces(request, options = nil) - # Pass arguments to `list_namespaces` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_namespaces` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project and location whose namespaces - # you'd like to list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. The default value is 100. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `labels.` for map field, or - # `attributes.` for attributes field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `labels.owner` returns namespaces that have a label with the key - # `owner`, this is the same as `labels:owner` - # * `labels.owner=sd` returns namespaces that have key/value `owner=sd` - # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - # returns namespaces that have name that is alphabetically later than the - # string, so "namespace-e" is returned but "namespace-a" is not - # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - # `owner` in label key but value is not `sd` AND have key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that namespace - # doesn't have a field called "doesnotexist". Since the filter does not - # match any namespaces, it returns no results - # * `attributes.managed_registration=true` returns namespaces that are - # managed by a GCP product or service - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.new - # - # # Call the list_namespaces method. - # result = client.list_namespaces request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Namespace. - # p item - # end - # - def list_namespaces request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_namespaces.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_namespaces.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_namespaces.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.list_namespaces request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_namespaces, "namespaces", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a namespace. - # - # @overload get_namespace(request, options = nil) - # Pass arguments to `get_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_namespace(name: nil) - # Pass arguments to `get_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 namespace to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new - # - # # Call the get_namespace method. - # result = client.get_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. - # p result - # - def get_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_namespace.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.get_namespace request, 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 namespace. - # - # @overload update_namespace(request, options = nil) - # Pass arguments to `update_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_namespace(namespace: nil, update_mask: nil) - # Pass arguments to `update_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param namespace [::Google::Cloud::ServiceDirectory::V1beta1::Namespace, ::Hash] - # Required. The updated namespace. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new - # - # # Call the update_namespace method. - # result = client.update_namespace request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. - # p result - # - def update_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest - - # Converts hash and nil to an 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_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_namespace.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.update_namespace request, 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 namespace. This also deletes all services and endpoints in - # the namespace. - # - # @overload delete_namespace(request, options = nil) - # Pass arguments to `delete_namespace` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_namespace(name: nil) - # Pass arguments to `delete_namespace` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 namespace to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new - # - # # Call the delete_namespace method. - # result = client.delete_namespace request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_namespace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_namespace.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_namespace.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_namespace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.delete_namespace request, 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 service, and returns the new service. - # - # @overload create_service(request, options = nil) - # Pass arguments to `create_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_service(parent: nil, service_id: nil, service: nil) - # Pass arguments to `create_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the namespace this service will belong to. - # @param service_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param service [::Google::Cloud::ServiceDirectory::V1beta1::Service, ::Hash] - # Required. A service with initial fields set. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new - # - # # Call the create_service method. - # result = client.create_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. - # p result - # - def create_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest - - # Converts hash and nil to an 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.create_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all services belonging to a namespace. - # - # @overload list_services(request, options = nil) - # Pass arguments to `list_services` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the namespace whose services you'd - # like to list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. The default value is 100. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name` or `metadata.` for map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `metadata.owner` returns services that have a metadata with the key - # `owner`, this is the same as `metadata:owner` - # * `metadata.protocol=gRPC` returns services that have key/value - # `protocol=gRPC` - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - # returns services that have name that is alphabetically later than the - # string, so "service-e" is returned but "service-a" is not - # * `metadata.owner!=sd AND metadata.foo=bar` returns services that have - # `owner` in metadata key but value is not `sd` AND have key/value - # `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that service - # doesn't have a field called "doesnotexist". Since the filter does not - # match any services, it returns no results - # * `attributes.managed_registration=true` returns services that are - # managed - # by a GCP product or service - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Service>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Service>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.new - # - # # Call the list_services method. - # result = client.list_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Service. - # p item - # end - # - def list_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_services.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.list_services request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_services, "services", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a service. - # - # @overload get_service(request, options = nil) - # Pass arguments to `get_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_service(name: nil) - # Pass arguments to `get_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new - # - # # Call the get_service method. - # result = client.get_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. - # p result - # - def get_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.get_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a service. - # - # @overload update_service(request, options = nil) - # Pass arguments to `update_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_service(service: nil, update_mask: nil) - # Pass arguments to `update_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service [::Google::Cloud::ServiceDirectory::V1beta1::Service, ::Hash] - # Required. The updated service. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new - # - # # Call the update_service method. - # result = client.update_service request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. - # p result - # - def update_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest - - # Converts hash and nil to an 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.update_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a service. This also deletes all endpoints associated with - # the service. - # - # @overload delete_service(request, options = nil) - # Pass arguments to `delete_service` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_service(name: nil) - # Pass arguments to `delete_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the service to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new - # - # # Call the delete_service method. - # result = client.delete_service request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.delete_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an endpoint, and returns the new endpoint. - # - # @overload create_endpoint(request, options = nil) - # Pass arguments to `create_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) - # Pass arguments to `create_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the service that this endpoint provides. - # @param endpoint_id [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @param endpoint [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint, ::Hash] - # Required. A endpoint with initial fields set. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new - # - # # Call the create_endpoint method. - # result = client.create_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - # p result - # - def create_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest - - # Converts hash and nil to an 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_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.create_endpoint request, 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 endpoints. - # - # @overload list_endpoints(request, options = nil) - # Pass arguments to `list_endpoints` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_endpoints` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the service whose endpoints you'd like to - # list. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. The default value is 100. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @param filter [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, `metadata.` for map - # field, or `attributes.` for attributes field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `metadata.owner` returns endpoints that have a metadata with the key - # `owner`, this is the same as `metadata:owner` - # * `metadata.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - # `owner` in metadata key but value is not `sd` AND have key/value - # `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoints, it returns no results - # * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ - # IP` returns endpoints with the corresponding kubernetes_resource_type - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param order_by [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows values: `name`, `address`, `port` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.new - # - # # Call the list_endpoints method. - # result = client.list_endpoints request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - # p item - # end - # - def list_endpoints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_endpoints.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_endpoints.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_endpoints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.list_endpoints request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @registration_service_stub, :list_endpoints, "endpoints", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an endpoint. - # - # @overload get_endpoint(request, options = nil) - # Pass arguments to `get_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_endpoint(name: nil) - # Pass arguments to `get_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 endpoint to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new - # - # # Call the get_endpoint method. - # result = client.get_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - # p result - # - def get_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.get_endpoint request, 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 endpoint. - # - # @overload update_endpoint(request, options = nil) - # Pass arguments to `update_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_endpoint(endpoint: nil, update_mask: nil) - # Pass arguments to `update_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param endpoint [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint, ::Hash] - # Required. The updated endpoint. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new - # - # # Call the update_endpoint method. - # result = client.update_endpoint request - # - # # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - # p result - # - def update_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest - - # Converts hash and nil to an 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_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.update_endpoint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an endpoint. - # - # @overload delete_endpoint(request, options = nil) - # Pass arguments to `delete_endpoint` via a request object, either of type - # {::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_endpoint(name: nil) - # Pass arguments to `delete_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 endpoint to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new - # - # # Call the delete_endpoint method. - # result = client.delete_endpoint request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_endpoint.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.delete_endpoint request, 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 IAM Policy for a resource - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the IAM Policy for a resource - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Tests IAM permissions for a resource (namespace, service or - # service workload only). - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_directory/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceDirectory::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @registration_service_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the RegistrationService REST API. - # - # This class represents the configuration for RegistrationService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_namespace to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_namespace.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_namespace.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicedirectory.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 RegistrationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :create_namespace - ## - # RPC-specific configuration for `list_namespaces` - # @return [::Gapic::Config::Method] - # - attr_reader :list_namespaces - ## - # RPC-specific configuration for `get_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :get_namespace - ## - # RPC-specific configuration for `update_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :update_namespace - ## - # RPC-specific configuration for `delete_namespace` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_namespace - ## - # RPC-specific configuration for `create_service` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service - ## - # RPC-specific configuration for `list_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_services - ## - # RPC-specific configuration for `get_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service - ## - # RPC-specific configuration for `update_service` - # @return [::Gapic::Config::Method] - # - attr_reader :update_service - ## - # RPC-specific configuration for `delete_service` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_service - ## - # RPC-specific configuration for `create_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :create_endpoint - ## - # RPC-specific configuration for `list_endpoints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_endpoints - ## - # RPC-specific configuration for `get_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_endpoint - ## - # RPC-specific configuration for `update_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :update_endpoint - ## - # RPC-specific configuration for `delete_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_endpoint - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - create_namespace_config = parent_rpcs.create_namespace if parent_rpcs.respond_to? :create_namespace - @create_namespace = ::Gapic::Config::Method.new create_namespace_config - list_namespaces_config = parent_rpcs.list_namespaces if parent_rpcs.respond_to? :list_namespaces - @list_namespaces = ::Gapic::Config::Method.new list_namespaces_config - get_namespace_config = parent_rpcs.get_namespace if parent_rpcs.respond_to? :get_namespace - @get_namespace = ::Gapic::Config::Method.new get_namespace_config - update_namespace_config = parent_rpcs.update_namespace if parent_rpcs.respond_to? :update_namespace - @update_namespace = ::Gapic::Config::Method.new update_namespace_config - delete_namespace_config = parent_rpcs.delete_namespace if parent_rpcs.respond_to? :delete_namespace - @delete_namespace = ::Gapic::Config::Method.new delete_namespace_config - create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service - @create_service = ::Gapic::Config::Method.new create_service_config - list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services - @list_services = ::Gapic::Config::Method.new list_services_config - get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service - @get_service = ::Gapic::Config::Method.new get_service_config - update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service - @update_service = ::Gapic::Config::Method.new update_service_config - delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service - @delete_service = ::Gapic::Config::Method.new delete_service_config - create_endpoint_config = parent_rpcs.create_endpoint if parent_rpcs.respond_to? :create_endpoint - @create_endpoint = ::Gapic::Config::Method.new create_endpoint_config - list_endpoints_config = parent_rpcs.list_endpoints if parent_rpcs.respond_to? :list_endpoints - @list_endpoints = ::Gapic::Config::Method.new list_endpoints_config - get_endpoint_config = parent_rpcs.get_endpoint if parent_rpcs.respond_to? :get_endpoint - @get_endpoint = ::Gapic::Config::Method.new get_endpoint_config - update_endpoint_config = parent_rpcs.update_endpoint if parent_rpcs.respond_to? :update_endpoint - @update_endpoint = ::Gapic::Config::Method.new update_endpoint_config - delete_endpoint_config = parent_rpcs.delete_endpoint if parent_rpcs.respond_to? :delete_endpoint - @delete_endpoint = ::Gapic::Config::Method.new delete_endpoint_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb deleted file mode 100644 index c4fcd4b792c1..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb +++ /dev/null @@ -1,1236 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/servicedirectory/v1beta1/registration_service_pb" - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - module RegistrationService - module Rest - ## - # REST service stub for the RegistrationService 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_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # A result object deserialized from the server's reply - def create_namespace request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_namespace_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_namespace", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.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_namespaces REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse] - # A result object deserialized from the server's reply - def list_namespaces request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_namespaces_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_namespaces", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # A result object deserialized from the server's reply - def get_namespace request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_namespace_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_namespace", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.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_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # A result object deserialized from the server's reply - def update_namespace request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_namespace_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_namespace", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_namespace request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_namespace_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_namespace", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 create_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # A result object deserialized from the server's reply - def create_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.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_services REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse] - # A result object deserialized from the server's reply - def list_services request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_services_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_services", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # A result object deserialized from the server's reply - def get_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.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_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # A result object deserialized from the server's reply - def update_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 create_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # A result object deserialized from the server's reply - def create_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_endpoint_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.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_endpoints REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse] - # A result object deserialized from the server's reply - def list_endpoints request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_endpoints_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_endpoints", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # A result object deserialized from the server's reply - def get_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_endpoint_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.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_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # A result object deserialized from the server's reply - def update_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_endpoint_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_endpoint_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest] - # 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_namespace_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/namespaces", - body: "namespace", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_namespaces REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_namespaces_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/namespaces", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_namespace_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest] - # 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_namespace_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{namespace.name}", - body: "namespace", - matches: [ - ["namespace.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_namespace REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_namespace_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest] - # 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_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/services", - body: "service", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_services REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_services_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/services", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest] - # 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_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{service.name}", - body: "service", - matches: [ - ["service.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_service REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest] - # 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_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/endpoints", - body: "endpoint", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_endpoints REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_endpoints_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/endpoints", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest] - # 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_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{endpoint.name}", - body: "endpoint", - matches: [ - ["endpoint.name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_endpoint REST call - # - # @param request_pb [::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/endpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/services/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/namespaces/[^/]+/workloads/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/rest.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/rest.rb deleted file mode 100644 index 134b4ad50df3..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/service_directory/v1beta1/lookup_service/rest" -require "google/cloud/service_directory/v1beta1/registration_service/rest" -require "google/cloud/service_directory/v1beta1/bindings_override" -require "google/cloud/service_directory/v1beta1/version" - -module Google - module Cloud - module ServiceDirectory - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/service_directory/v1beta1/rest" - # client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new - # - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/version.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/version.rb deleted file mode 100644 index 36b1b4ea06f2..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/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 ServiceDirectory - module V1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/endpoint_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/endpoint_pb.rb deleted file mode 100644 index cfaf5542a650..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/endpoint_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1beta1/endpoint.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/servicedirectory/v1beta1/endpoint.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa6\x04\n\x08\x45ndpoint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04port\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12T\n\x08metadata\x18\x04 \x03(\x0b\x32=.google.cloud.servicedirectory.v1beta1.Endpoint.MetadataEntryB\x03\xe0\x41\x01\x12@\n\x07network\x18\x05 \x01(\tB/\xe0\x41\x05\xfa\x41)\n\'servicedirectory.googleapis.com/Network\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x08 \x01(\tB\x03\xe0\x41\x03\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x96\x01\xea\x41\x92\x01\n(servicedirectory.googleapis.com/Endpoint\x12\x66projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}B\xf2\x02\n)com.google.cloud.servicedirectory.v1beta1B\rEndpointProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1\xea\x41\x61\n\'servicedirectory.googleapis.com/Network\x12\x36projects/{project}/locations/global/networks/{network}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - Endpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.Endpoint").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_pb.rb deleted file mode 100644 index 02a971e3be35..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1beta1/lookup_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/servicedirectory/v1beta1/service_pb' - - -descriptor_data = "\n:google/cloud/servicedirectory/v1beta1/lookup_service.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/servicedirectory/v1beta1/service.proto\"\x90\x01\n\x15ResolveServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x1a\n\rmax_endpoints\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1c\n\x0f\x65ndpoint_filter\x18\x03 \x01(\tB\x03\xe0\x41\x01\"Y\n\x16ResolveServiceResponse\x12?\n\x07service\x18\x01 \x01(\x0b\x32..google.cloud.servicedirectory.v1beta1.Service2\xc7\x02\n\rLookupService\x12\xe0\x01\n\x0eResolveService\x12<.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest\x1a=.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse\"Q\x82\xd3\xe4\x93\x02K\"F/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve:\x01*\x1aS\xca\x41\x1fservicedirectory.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x93\x02\n)com.google.cloud.servicedirectory.v1beta1B\x12LookupServiceProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - ResolveServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ResolveServiceRequest").msgclass - ResolveServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ResolveServiceResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_services_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_services_pb.rb deleted file mode 100644 index dd25c43fecfb..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/lookup_service_services_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/servicedirectory/v1beta1/lookup_service.proto for package 'Google.Cloud.ServiceDirectory.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/servicedirectory/v1beta1/lookup_service_pb' - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - module LookupService - # Service Directory API for looking up service data at runtime. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.servicedirectory.v1beta1.LookupService' - - # Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its - # associated endpoints. - # Resolving a service is not considered an active developer method. - rpc :ResolveService, ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/namespace_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/namespace_pb.rb deleted file mode 100644 index 31939c1f5a8a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/namespace_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1beta1/namespace.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n5google/cloud/servicedirectory/v1beta1/namespace.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8e\x03\n\tNamespace\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12Q\n\x06labels\x18\x02 \x03(\x0b\x32<.google.cloud.servicedirectory.v1beta1.Namespace.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x06 \x01(\tB\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:n\xea\x41k\n)servicedirectory.googleapis.com/Namespace\x12>projects/{project}/locations/{location}/namespaces/{namespace}B\x8f\x02\n)com.google.cloud.servicedirectory.v1beta1B\x0eNamespaceProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - Namespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.Namespace").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_pb.rb deleted file mode 100644 index a9424447815d..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1beta1/registration_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/servicedirectory/v1beta1/endpoint_pb' -require 'google/cloud/servicedirectory/v1beta1/namespace_pb' -require 'google/cloud/servicedirectory/v1beta1/service_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n@google/cloud/servicedirectory/v1beta1/registration_service.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/servicedirectory/v1beta1/endpoint.proto\x1a\x35google/cloud/servicedirectory/v1beta1/namespace.proto\x1a\x33google/cloud/servicedirectory/v1beta1/service.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb8\x01\n\x16\x43reateNamespaceRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0cnamespace_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\tnamespace\x18\x03 \x01(\x0b\x32\x30.google.cloud.servicedirectory.v1beta1.NamespaceB\x03\xe0\x41\x02\"\xaf\x01\n\x15ListNamespacesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"w\n\x16ListNamespacesResponse\x12\x44\n\nnamespaces\x18\x01 \x03(\x0b\x32\x30.google.cloud.servicedirectory.v1beta1.Namespace\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x13GetNamespaceRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\"\x98\x01\n\x16UpdateNamespaceRequest\x12H\n\tnamespace\x18\x01 \x01(\x0b\x32\x30.google.cloud.servicedirectory.v1beta1.NamespaceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"Y\n\x16\x44\x65leteNamespaceRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\"\xb8\x01\n\x14\x43reateServiceRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\x12\x17\n\nservice_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x07service\x18\x03 \x01(\x0b\x32..google.cloud.servicedirectory.v1beta1.ServiceB\x03\xe0\x41\x02\"\xb5\x01\n\x13ListServicesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)servicedirectory.googleapis.com/Namespace\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\"q\n\x14ListServicesResponse\x12@\n\x08services\x18\x01 \x03(\x0b\x32..google.cloud.servicedirectory.v1beta1.Service\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x11GetServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\"\x92\x01\n\x14UpdateServiceRequest\x12\x44\n\x07service\x18\x01 \x01(\x0b\x32..google.cloud.servicedirectory.v1beta1.ServiceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"U\n\x14\x44\x65leteServiceRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\"\xba\x01\n\x15\x43reateEndpointRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x18\n\x0b\x65ndpoint_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\x08\x65ndpoint\x18\x03 \x01(\x0b\x32/.google.cloud.servicedirectory.v1beta1.EndpointB\x03\xe0\x41\x02\"\xb4\x01\n\x14ListEndpointsRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\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\"t\n\x15ListEndpointsResponse\x12\x42\n\tendpoints\x18\x01 \x03(\x0b\x32/.google.cloud.servicedirectory.v1beta1.Endpoint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x12GetEndpointRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(servicedirectory.googleapis.com/Endpoint\"\x95\x01\n\x15UpdateEndpointRequest\x12\x46\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32/.google.cloud.servicedirectory.v1beta1.EndpointB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"W\n\x15\x44\x65leteEndpointRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(servicedirectory.googleapis.com/Endpoint2\xda\"\n\x13RegistrationService\x12\xea\x01\n\x0f\x43reateNamespace\x12=.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest\x1a\x30.google.cloud.servicedirectory.v1beta1.Namespace\"f\xda\x41\x1dparent,namespace,namespace_id\x82\xd3\xe4\x93\x02@\"3/v1beta1/{parent=projects/*/locations/*}/namespaces:\tnamespace\x12\xd3\x01\n\x0eListNamespaces\x12<.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest\x1a=.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1beta1/{parent=projects/*/locations/*}/namespaces\x12\xc0\x01\n\x0cGetNamespace\x12:.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest\x1a\x30.google.cloud.servicedirectory.v1beta1.Namespace\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1beta1/{name=projects/*/locations/*/namespaces/*}\x12\xec\x01\n\x0fUpdateNamespace\x12=.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest\x1a\x30.google.cloud.servicedirectory.v1beta1.Namespace\"h\xda\x41\x15namespace,update_mask\x82\xd3\xe4\x93\x02J2=/v1beta1/{namespace.name=projects/*/locations/*/namespaces/*}:\tnamespace\x12\xac\x01\n\x0f\x44\x65leteNamespace\x12=.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1beta1/{name=projects/*/locations/*/namespaces/*}\x12\xe9\x01\n\rCreateService\x12;.google.cloud.servicedirectory.v1beta1.CreateServiceRequest\x1a..google.cloud.servicedirectory.v1beta1.Service\"k\xda\x41\x19parent,service,service_id\x82\xd3\xe4\x93\x02I\">/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services:\x07service\x12\xd8\x01\n\x0cListServices\x12:.google.cloud.servicedirectory.v1beta1.ListServicesRequest\x1a;.google.cloud.servicedirectory.v1beta1.ListServicesResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services\x12\xc5\x01\n\nGetService\x12\x38.google.cloud.servicedirectory.v1beta1.GetServiceRequest\x1a..google.cloud.servicedirectory.v1beta1.Service\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}\x12\xeb\x01\n\rUpdateService\x12;.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest\x1a..google.cloud.servicedirectory.v1beta1.Service\"m\xda\x41\x13service,update_mask\x82\xd3\xe4\x93\x02Q2F/v1beta1/{service.name=projects/*/locations/*/namespaces/*/services/*}:\x07service\x12\xb3\x01\n\rDeleteService\x12;.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest\x1a\x16.google.protobuf.Empty\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}\x12\xfb\x01\n\x0e\x43reateEndpoint\x12<.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest\x1a/.google.cloud.servicedirectory.v1beta1.Endpoint\"z\xda\x41\x1bparent,endpoint,endpoint_id\x82\xd3\xe4\x93\x02V\"J/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints:\x08\x65ndpoint\x12\xe7\x01\n\rListEndpoints\x12;.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest\x1a<.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse\"[\xda\x41\x06parent\x82\xd3\xe4\x93\x02L\x12J/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints\x12\xd4\x01\n\x0bGetEndpoint\x12\x39.google.cloud.servicedirectory.v1beta1.GetEndpointRequest\x1a/.google.cloud.servicedirectory.v1beta1.Endpoint\"Y\xda\x41\x04name\x82\xd3\xe4\x93\x02L\x12J/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}\x12\xfd\x01\n\x0eUpdateEndpoint\x12<.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest\x1a/.google.cloud.servicedirectory.v1beta1.Endpoint\"|\xda\x41\x14\x65ndpoint,update_mask\x82\xd3\xe4\x93\x02_2S/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}:\x08\x65ndpoint\x12\xc1\x01\n\x0e\x44\x65leteEndpoint\x12<.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest\x1a\x16.google.protobuf.Empty\"Y\xda\x41\x04name\x82\xd3\xe4\x93\x02L*J/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}\x12\xc9\x02\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xfd\x01\x82\xd3\xe4\x93\x02\xf6\x01\"D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy:\x01*ZT\"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy:\x01*ZU\"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:getIamPolicy:\x01*\x12\xc9\x02\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xfd\x01\x82\xd3\xe4\x93\x02\xf6\x01\"D/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy:\x01*ZT\"O/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy:\x01*ZU\"P/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:setIamPolicy:\x01*\x12\xfb\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\x8f\x02\x82\xd3\xe4\x93\x02\x88\x02\"J/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions:\x01*ZZ\"U/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions:\x01*Z[\"V/v1beta1/{resource=projects/*/locations/*/namespaces/*/workloads/*}:testIamPermissions:\x01*\x1aS\xca\x41\x1fservicedirectory.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x99\x02\n)com.google.cloud.servicedirectory.v1beta1B\x18RegistrationServiceProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - CreateNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest").msgclass - ListNamespacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListNamespacesRequest").msgclass - ListNamespacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListNamespacesResponse").msgclass - GetNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.GetNamespaceRequest").msgclass - UpdateNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest").msgclass - DeleteNamespaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest").msgclass - CreateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.CreateServiceRequest").msgclass - ListServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListServicesRequest").msgclass - ListServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListServicesResponse").msgclass - GetServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.GetServiceRequest").msgclass - UpdateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.UpdateServiceRequest").msgclass - DeleteServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.DeleteServiceRequest").msgclass - CreateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.CreateEndpointRequest").msgclass - ListEndpointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListEndpointsRequest").msgclass - ListEndpointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.ListEndpointsResponse").msgclass - GetEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.GetEndpointRequest").msgclass - UpdateEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest").msgclass - DeleteEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_services_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_services_pb.rb deleted file mode 100644 index 062c769d7350..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/registration_service_services_pb.rb +++ /dev/null @@ -1,96 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/servicedirectory/v1beta1/registration_service.proto for package 'Google.Cloud.ServiceDirectory.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/servicedirectory/v1beta1/registration_service_pb' - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - module RegistrationService - # Service Directory API for registering services. It defines the following - # resource model: - # - # - The API has a collection of - # [Namespace][google.cloud.servicedirectory.v1beta1.Namespace] - # resources, named `projects/*/locations/*/namespaces/*`. - # - # - Each Namespace has a collection of - # [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named - # `projects/*/locations/*/namespaces/*/services/*`. - # - # - Each Service has a collection of - # [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint] - # resources, named - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.servicedirectory.v1beta1.RegistrationService' - - # Creates a namespace, and returns the new namespace. - rpc :CreateNamespace, ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Namespace - # Lists all namespaces. - rpc :ListNamespaces, ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest, ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse - # Gets a namespace. - rpc :GetNamespace, ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Namespace - # Updates a namespace. - rpc :UpdateNamespace, ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Namespace - # Deletes a namespace. This also deletes all services and endpoints in - # the namespace. - rpc :DeleteNamespace, ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest, ::Google::Protobuf::Empty - # Creates a service, and returns the new service. - rpc :CreateService, ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Service - # Lists all services belonging to a namespace. - rpc :ListServices, ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest, ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse - # Gets a service. - rpc :GetService, ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Service - # Updates a service. - rpc :UpdateService, ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Service - # Deletes a service. This also deletes all endpoints associated with - # the service. - rpc :DeleteService, ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest, ::Google::Protobuf::Empty - # Creates an endpoint, and returns the new endpoint. - rpc :CreateEndpoint, ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint - # Lists all endpoints. - rpc :ListEndpoints, ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest, ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse - # Gets an endpoint. - rpc :GetEndpoint, ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint - # Updates an endpoint. - rpc :UpdateEndpoint, ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest, ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint - # Deletes an endpoint. - rpc :DeleteEndpoint, ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest, ::Google::Protobuf::Empty - # Gets the IAM Policy for a resource - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the IAM Policy for a resource - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Tests IAM permissions for a resource (namespace, service or - # service workload only). - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/service_pb.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/service_pb.rb deleted file mode 100644 index 9a7d25ed4376..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/lib/google/cloud/servicedirectory/v1beta1/service_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicedirectory/v1beta1/service.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/servicedirectory/v1beta1/endpoint_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n3google/cloud/servicedirectory/v1beta1/service.proto\x12%google.cloud.servicedirectory.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/servicedirectory/v1beta1/endpoint.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xea\x03\n\x07Service\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12S\n\x08metadata\x18\x02 \x03(\x0b\x32<.google.cloud.servicedirectory.v1beta1.Service.MetadataEntryB\x03\xe0\x41\x01\x12G\n\tendpoints\x18\x03 \x03(\x0b\x32/.google.cloud.servicedirectory.v1beta1.EndpointB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x08 \x01(\tB\x03\xe0\x41\x03\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x7f\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}B\x8d\x02\n)com.google.cloud.servicedirectory.v1beta1B\x0cServiceProtoP\x01ZUcloud.google.com/go/servicedirectory/apiv1beta1/servicedirectorypb;servicedirectorypb\xaa\x02%Google.Cloud.ServiceDirectory.V1Beta1\xca\x02%Google\\Cloud\\ServiceDirectory\\V1beta1\xea\x02(Google::Cloud::ServiceDirectory::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - Service = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicedirectory.v1beta1.Service").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/README.md deleted file mode 100644 index 93d67c3e7936..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Service Directory 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-service_directory-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/endpoint.rb deleted file mode 100644 index 711458f230d1..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/endpoint.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - # An individual endpoint that provides a - # {::Google::Cloud::ServiceDirectory::V1beta1::Service service}. The service must - # already exist to create an endpoint. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name for the endpoint in the format - # `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. - # @!attribute [rw] address - # @return [::String] - # Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses - # like: - # - # * `8.8.8` - # * `8.8.8.8:53` - # * `test:bad:address` - # * `[::1]` - # * `[::1]:8080` - # - # Limited to 45 characters. - # @!attribute [rw] port - # @return [::Integer] - # Optional. Service Directory rejects values outside of `[0, 65535]`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Metadata for the endpoint. This data can be consumed by service - # clients. - # - # Restrictions: - # - # * The entire metadata dictionary may contain up to 512 characters, - # spread accoss all key-value pairs. Metadata that goes beyond this - # limit are rejected - # * Valid metadata keys have two segments: an optional prefix and name, - # separated by a slash (/). The name segment is required and must be 63 - # characters or less, beginning and ending with an alphanumeric character - # ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - # alphanumerics between. The prefix is optional. If specified, the prefix - # must be a DNS subdomain: a series of DNS labels separated by dots (.), - # not longer than 253 characters in total, followed by a slash (/). - # Metadata that fails to meet these requirements are rejected - # - # Note: This field is equivalent to the `annotations` field in the v1 API. - # They have the same syntax and read/write to the same location in Service - # Directory. - # @!attribute [rw] network - # @return [::String] - # Immutable. The Google Compute Engine network (VPC) of the endpoint in the - # format `projects//locations/global/networks/*`. - # - # The project must be specified by project number (project id is rejected). - # Incorrectly formatted networks are rejected, but no other validation - # is performed on this field (ex. network or project existence, reachability, - # or permissions). - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the endpoint was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the endpoint was last updated. - # @!attribute [r] uid - # @return [::String] - # Output only. A globally unique identifier (in UUID4 format) for this - # endpoint. - class Endpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - 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-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/lookup_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/lookup_service.rb deleted file mode 100644 index 14fcc99f8faa..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/lookup_service.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 ServiceDirectory - module V1beta1 - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service LookupService.ResolveService}. - # Looks up a service by its name, returns the service and its endpoints. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the service to resolve. - # @!attribute [rw] max_endpoints - # @return [::Integer] - # Optional. The maximum number of endpoints to return. Defaults to 25. - # Maximum is 100. If a value less than one is specified, the Default is used. - # If a value greater than the Maximum is specified, the Maximum is used. - # @!attribute [rw] endpoint_filter - # @return [::String] - # Optional. The filter applied to the endpoints of the resolved service. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, or `metadata.` for - # map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `metadata.owner` returns endpoints that have a annotation with the key - # `owner`, this is the same as `metadata:owner` - # * `metadata.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * - # `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` - # returns the endpoint that has an endpoint_id equal to `ep-1` - # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - # `owner` in annotation key but value is not `sd` AND have key/value - # `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoint, it returns no results - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - class ResolveServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service LookupService.ResolveService}. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - class ResolveServiceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/namespace.rb deleted file mode 100644 index ccb58df1f634..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/namespace.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - # A container for {::Google::Cloud::ServiceDirectory::V1beta1::Service services}. - # Namespaces allow administrators to group services together and define - # permissions for a collection of services. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name for the namespace in the format - # `projects/*/locations/*/namespaces/*`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Resource labels associated with this namespace. - # No more than 64 user labels can be associated with a given resource. Label - # keys and values can be no longer than 63 characters. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the namespace was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the namespace was last updated. - # @!attribute [r] uid - # @return [::String] - # Output only. A globally unique identifier (in UUID4 format) for this - # namespace. - class Namespace - 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 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/registration_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/registration_service.rb deleted file mode 100644 index 6db231e8d14a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/registration_service.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! - - -module Google - module Cloud - module ServiceDirectory - module V1beta1 - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_namespace RegistrationService.CreateNamespace}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project and location the namespace - # will be created in. - # @!attribute [rw] namespace_id - # @return [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @!attribute [rw] namespace - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # Required. A namespace with initial fields set. - class CreateNamespaceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces RegistrationService.ListNamespaces}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project and location whose namespaces - # you'd like to list. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. The default value is 100. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `labels.` for map field, or - # `attributes.` for attributes field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `labels.owner` returns namespaces that have a label with the key - # `owner`, this is the same as `labels:owner` - # * `labels.owner=sd` returns namespaces that have key/value `owner=sd` - # * `name>projects/my-project/locations/us-east1/namespaces/namespace-c` - # returns namespaces that have name that is alphabetically later than the - # string, so "namespace-e" is returned but "namespace-a" is not - # * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have - # `owner` in label key but value is not `sd` AND have key/value `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that namespace - # doesn't have a field called "doesnotexist". Since the filter does not - # match any namespaces, it returns no results - # * `attributes.managed_registration=true` returns namespaces that are - # managed by a GCP product or service - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @!attribute [rw] order_by - # @return [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - class ListNamespacesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces RegistrationService.ListNamespaces}. - # @!attribute [rw] namespaces - # @return [::Array<::Google::Cloud::ServiceDirectory::V1beta1::Namespace>] - # The list of namespaces. - # @!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. - class ListNamespacesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_namespace RegistrationService.GetNamespace}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the namespace to retrieve. - class GetNamespaceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_namespace RegistrationService.UpdateNamespace}. - # @!attribute [rw] namespace - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Namespace] - # Required. The updated namespace. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateNamespaceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_namespace RegistrationService.DeleteNamespace}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the namespace to delete. - class DeleteNamespaceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_service RegistrationService.CreateService}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the namespace this service will belong to. - # @!attribute [rw] service_id - # @return [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # Required. A service with initial fields set. - class CreateServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services RegistrationService.ListServices}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the namespace whose services you'd - # like to list. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. The default value is 100. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name` or `metadata.` for map field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `metadata.owner` returns services that have a metadata with the key - # `owner`, this is the same as `metadata:owner` - # * `metadata.protocol=gRPC` returns services that have key/value - # `protocol=gRPC` - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` - # returns services that have name that is alphabetically later than the - # string, so "service-e" is returned but "service-a" is not - # * `metadata.owner!=sd AND metadata.foo=bar` returns services that have - # `owner` in metadata key but value is not `sd` AND have key/value - # `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that service - # doesn't have a field called "doesnotexist". Since the filter does not - # match any services, it returns no results - # * `attributes.managed_registration=true` returns services that are - # managed - # by a GCP product or service - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @!attribute [rw] order_by - # @return [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows value: `name` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - class ListServicesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services RegistrationService.ListServices}. - # @!attribute [rw] services - # @return [::Array<::Google::Cloud::ServiceDirectory::V1beta1::Service>] - # The list of services. - # @!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. - class ListServicesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_service RegistrationService.GetService}. - # This should not be used for looking up a service. Instead, use the `resolve` - # method as it contains all endpoints and associated metadata. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the service to get. - class GetServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_service RegistrationService.UpdateService}. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Service] - # Required. The updated service. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_service RegistrationService.DeleteService}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the service to delete. - class DeleteServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_endpoint RegistrationService.CreateEndpoint}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the service that this endpoint provides. - # @!attribute [rw] endpoint_id - # @return [::String] - # Required. The Resource ID must be 1-63 characters long, and comply with - # RFC1035. - # Specifically, the name must be 1-63 characters long and match the regular - # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first - # character must be a lowercase letter, and all following characters must - # be a dash, lowercase letter, or digit, except the last character, which - # cannot be a dash. - # @!attribute [rw] endpoint - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # Required. A endpoint with initial fields set. - class CreateEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the service whose endpoints you'd like to - # list. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. The default value is 100. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous List request, - # if any. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter to list results by. - # - # General `filter` string syntax: - # ` ()` - # - # * `` can be `name`, `address`, `port`, `metadata.` for map - # field, or `attributes.` for attributes field - # * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` - # means `HAS`, and is roughly the same as `=` - # * `` must be the same data type as field - # * `` can be `AND`, `OR`, `NOT` - # - # Examples of valid filters: - # - # * `metadata.owner` returns endpoints that have a metadata with the key - # `owner`, this is the same as `metadata:owner` - # * `metadata.protocol=gRPC` returns endpoints that have key/value - # `protocol=gRPC` - # * `address=192.108.1.105` returns endpoints that have this address - # * `port>8080` returns endpoints that have port number larger than 8080 - # * - # `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` - # returns endpoints that have name that is alphabetically later than the - # string, so "endpoint-e" is returned but "endpoint-a" is not - # * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have - # `owner` in metadata key but value is not `sd` AND have key/value - # `foo=bar` - # * `doesnotexist.foo=bar` returns an empty list. Note that endpoint - # doesn't have a field called "doesnotexist". Since the filter does not - # match any endpoints, it returns no results - # * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ - # IP` returns endpoints with the corresponding kubernetes_resource_type - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @!attribute [rw] order_by - # @return [::String] - # Optional. The order to list results by. - # - # General `order_by` string syntax: ` () (,)` - # - # * `` allows values: `name`, `address`, `port` - # * `` ascending or descending order by ``. If this is - # left blank, `asc` is used - # - # Note that an empty `order_by` string results in default order, which is - # order by `name` in ascending order. - class ListEndpointsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. - # @!attribute [rw] endpoints - # @return [::Array<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] - # The list of endpoints. - # @!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. - class ListEndpointsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_endpoint RegistrationService.GetEndpoint}. - # This should not be used to lookup endpoints at runtime. Instead, use - # the `resolve` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the endpoint to get. - class GetEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_endpoint RegistrationService.UpdateEndpoint}. - # @!attribute [rw] endpoint - # @return [::Google::Cloud::ServiceDirectory::V1beta1::Endpoint] - # Required. The updated endpoint. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated in this request. - class UpdateEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_endpoint RegistrationService.DeleteEndpoint}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the endpoint to delete. - class DeleteEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/service.rb deleted file mode 100644 index 0f5ce424212a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/cloud/servicedirectory/v1beta1/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 ServiceDirectory - module V1beta1 - # An individual service. A service contains a name and optional metadata. - # A service must exist before - # {::Google::Cloud::ServiceDirectory::V1beta1::Endpoint endpoints} can be - # added to it. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name for the service in the format - # `projects/*/locations/*/namespaces/*/services/*`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Metadata for the service. This data can be consumed by service - # clients. - # - # Restrictions: - # - # * The entire metadata dictionary may contain up to 2000 characters, - # spread accoss all key-value pairs. Metadata that goes beyond this - # limit are rejected - # * Valid metadata keys have two segments: an optional prefix and name, - # separated by a slash (/). The name segment is required and must be 63 - # characters or less, beginning and ending with an alphanumeric character - # ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and - # alphanumerics between. The prefix is optional. If specified, the prefix - # must be a DNS subdomain: a series of DNS labels separated by dots (.), - # not longer than 253 characters in total, followed by a slash (/). - # Metadata that fails to meet these requirements are rejected - # - # Note: This field is equivalent to the `annotations` field in the v1 API. - # They have the same syntax and read/write to the same location in Service - # Directory. - # @!attribute [r] endpoints - # @return [::Array<::Google::Cloud::ServiceDirectory::V1beta1::Endpoint>] - # Output only. Endpoints associated with this service. Returned on - # {::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service LookupService.ResolveService}. - # Control plane clients should use - # {::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints RegistrationService.ListEndpoints}. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the service was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the service was last updated. Note: - # endpoints being created/deleted/updated within the service are not - # considered service updates for the purpose of this timestamp. - # @!attribute [r] uid - # @return [::String] - # Output only. A globally unique identifier (in UUID4 format) for this - # service. - class Service - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - 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-service_directory-v1beta1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/Gemfile deleted file mode 100644 index 97414f0ec896..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-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-service_directory-v1beta1", path: "../" -else - gem "google-cloud-service_directory-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-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb deleted file mode 100644 index d71eb3c1791d..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_LookupService_ResolveService_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the resolve_service call in the LookupService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service. -# -def resolve_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new - - # Call the resolve_service method. - result = client.resolve_service request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse. - p result -end -# [END servicedirectory_v1beta1_generated_LookupService_ResolveService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb deleted file mode 100644 index 3e2ad8dfb2e1..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the create_endpoint call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_endpoint. -# -def create_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new - - # Call the create_endpoint method. - result = client.create_endpoint request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb deleted file mode 100644 index ec054cee82d0..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the create_namespace call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_namespace. -# -def create_namespace - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new - - # Call the create_namespace method. - result = client.create_namespace request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb deleted file mode 100644 index 25d40b538366..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the create_service call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_service. -# -def create_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new - - # Call the create_service method. - result = client.create_service request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb deleted file mode 100644 index a0f9e22f857a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the delete_endpoint call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_endpoint. -# -def delete_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new - - # Call the delete_endpoint method. - result = client.delete_endpoint request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb deleted file mode 100644 index 6571a245cbe3..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the delete_namespace call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_namespace. -# -def delete_namespace - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new - - # Call the delete_namespace method. - result = client.delete_namespace request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb deleted file mode 100644 index d078459a4702..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the delete_service call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_service. -# -def delete_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new - - # Call the delete_service method. - result = client.delete_service request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb deleted file mode 100644 index 54ec62254a8f..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the get_endpoint call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_endpoint. -# -def get_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new - - # Call the get_endpoint method. - result = client.get_endpoint request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb deleted file mode 100644 index 6c93e204b20f..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the get_iam_policy call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb deleted file mode 100644 index 5050a16a6530..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the get_namespace call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_namespace. -# -def get_namespace - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new - - # Call the get_namespace method. - result = client.get_namespace request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb deleted file mode 100644 index 275196ffb4e1..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_GetService_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the get_service call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_service. -# -def get_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new - - # Call the get_service method. - result = client.get_service request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_GetService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb deleted file mode 100644 index 4793441f9ebf..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.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 servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the list_endpoints call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints. -# -def list_endpoints - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.new - - # Call the list_endpoints method. - result = client.list_endpoints request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - p item - end -end -# [END servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb deleted file mode 100644 index 28f67143a5f7..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.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 servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the list_namespaces call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces. -# -def list_namespaces - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.new - - # Call the list_namespaces method. - result = client.list_namespaces request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Namespace. - p item - end -end -# [END servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb deleted file mode 100644 index feec94510bd4..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the list_services call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services. -# -def list_services - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.new - - # Call the list_services method. - result = client.list_services request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Service. - p item - end -end -# [END servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb deleted file mode 100644 index fa2aa1005639..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the set_iam_policy call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb deleted file mode 100644 index acb3050b1c96..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the test_iam_permissions call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb deleted file mode 100644 index 43c96f11aaef..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the update_endpoint call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_endpoint. -# -def update_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new - - # Call the update_endpoint method. - result = client.update_endpoint request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb deleted file mode 100644 index 6e2d2ebcd57f..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the update_namespace call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_namespace. -# -def update_namespace - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new - - # Call the update_namespace method. - result = client.update_namespace request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb deleted file mode 100644 index bd7b63693a51..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync] -require "google/cloud/service_directory/v1beta1" - -## -# Snippet for the update_service call in the RegistrationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_service. -# -def update_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new - - # Call the update_service method. - result = client.update_service request - - # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. - p result -end -# [END servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync] diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json b/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json deleted file mode 100644 index 3d9a66c9a57a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json +++ /dev/null @@ -1,775 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-service_directory-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.servicedirectory.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "servicedirectory_v1beta1_generated_LookupService_ResolveService_sync", - "title": "Snippet for the resolve_service call in the LookupService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service.", - "file": "lookup_service/resolve_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "resolve_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse", - "client": { - "short_name": "LookupService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client" - }, - "method": { - "short_name": "ResolveService", - "full_name": "google.cloud.servicedirectory.v1beta1.LookupService.ResolveService", - "service": { - "short_name": "LookupService", - "full_name": "google.cloud.servicedirectory.v1beta1.LookupService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync", - "title": "Snippet for the create_namespace call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_namespace.", - "file": "registration_service/create_namespace.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_namespace", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_namespace", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Namespace", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "CreateNamespace", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.CreateNamespace", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync", - "title": "Snippet for the list_namespaces call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces.", - "file": "registration_service/list_namespaces.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_namespaces", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "ListNamespaces", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync", - "title": "Snippet for the get_namespace call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_namespace.", - "file": "registration_service/get_namespace.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_namespace", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_namespace", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Namespace", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "GetNamespace", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.GetNamespace", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync", - "title": "Snippet for the update_namespace call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_namespace.", - "file": "registration_service/update_namespace.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_namespace", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_namespace", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Namespace", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "UpdateNamespace", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateNamespace", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync", - "title": "Snippet for the delete_namespace call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_namespace.", - "file": "registration_service/delete_namespace.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_namespace", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_namespace", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "DeleteNamespace", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteNamespace", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync", - "title": "Snippet for the create_service call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_service.", - "file": "registration_service/create_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Service", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "CreateService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.CreateService", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync", - "title": "Snippet for the list_services call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services.", - "file": "registration_service/list_services.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_services", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "ListServices", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_GetService_sync", - "title": "Snippet for the get_service call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_service.", - "file": "registration_service/get_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Service", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "GetService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.GetService", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync", - "title": "Snippet for the update_service call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_service.", - "file": "registration_service/update_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Service", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "UpdateService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateService", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync", - "title": "Snippet for the delete_service call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_service.", - "file": "registration_service/delete_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_service", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "DeleteService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteService", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync", - "title": "Snippet for the create_endpoint call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_endpoint.", - "file": "registration_service/create_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_endpoint", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Endpoint", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "CreateEndpoint", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.CreateEndpoint", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync", - "title": "Snippet for the list_endpoints call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints.", - "file": "registration_service/list_endpoints.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_endpoints", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "ListEndpoints", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync", - "title": "Snippet for the get_endpoint call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_endpoint.", - "file": "registration_service/get_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_endpoint", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Endpoint", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "GetEndpoint", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.GetEndpoint", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync", - "title": "Snippet for the update_endpoint call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_endpoint.", - "file": "registration_service/update_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_endpoint", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceDirectory::V1beta1::Endpoint", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "UpdateEndpoint", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateEndpoint", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync", - "title": "Snippet for the delete_endpoint call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_endpoint.", - "file": "registration_service/delete_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_endpoint", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "DeleteEndpoint", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteEndpoint", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_iam_policy.", - "file": "registration_service/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.GetIamPolicy", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#set_iam_policy.", - "file": "registration_service/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.SetIamPolicy", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the RegistrationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#test_iam_permissions.", - "file": "registration_service/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "RegistrationService::Client", - "full_name": "::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService.TestIamPermissions", - "service": { - "short_name": "RegistrationService", - "full_name": "google.cloud.servicedirectory.v1beta1.RegistrationService" - } - } - }, - "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-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb deleted file mode 100644 index 6353a46aff02..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_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/service_directory/v1beta1/lookup_service" - -class ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" - assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb deleted file mode 100644 index 6decc70066f0..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb +++ /dev/null @@ -1,155 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/servicedirectory/v1beta1/lookup_service_pb" -require "google/cloud/service_directory/v1beta1/lookup_service/rest" - - -class ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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_resolve_service - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - max_endpoints = 42 - endpoint_filter = "hello world" - - resolve_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::ServiceStub.stub :transcode_resolve_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resolve_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resolve_service name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resolve_service ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resolve_service(::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resolve_service_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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::ServiceDirectory::V1beta1::LookupService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb deleted file mode 100644 index 7fbc24e4356a..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb +++ /dev/null @@ -1,166 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/servicedirectory/v1beta1/lookup_service_pb" -require "google/cloud/service_directory/v1beta1/lookup_service" - -class ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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_resolve_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - max_endpoints = 42 - endpoint_filter = "hello world" - - resolve_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resolve_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["max_endpoints"] - assert_equal "hello world", request["endpoint_filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resolve_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resolve_service name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resolve_service ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resolve_service({ name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resolve_service(::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new(name: name, max_endpoints: max_endpoints, endpoint_filter: endpoint_filter), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, resolve_service_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::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::ServiceDirectory::V1beta1::LookupService::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::ServiceDirectory::V1beta1::LookupService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb deleted file mode 100644 index 37f95cd118d4..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/service_directory/v1beta1/registration_service" - -class ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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_endpoint_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.endpoint_path project: "value0", location: "value1", namespace: "value2", service: "value3", endpoint: "value4" - assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3/endpoints/value4", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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_namespace_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.namespace_path project: "value0", location: "value1", namespace: "value2" - assert_equal "projects/value0/locations/value1/namespaces/value2", 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::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_path project: "value0", network: "value1" - assert_equal "projects/value0/locations/global/networks/value1", path - end - end - - def test_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" - assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb deleted file mode 100644 index b5c2928a3a96..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb +++ /dev/null @@ -1,1096 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/servicedirectory/v1beta1/registration_service_pb" -require "google/cloud/service_directory/v1beta1/registration_service/rest" - - -class ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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_namespace - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - namespace_id = "hello world" - namespace = {} - - create_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_create_namespace_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_namespace parent: parent, namespace_id: namespace_id, namespace: namespace do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_namespace ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_namespace(::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_namespace_client_stub.call_count - end - end - end - - def test_list_namespaces - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse.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_namespaces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_list_namespaces_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_namespaces_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_namespaces({ 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_namespaces 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_namespaces ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.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_namespaces({ 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_namespaces(::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.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_namespaces_client_stub.call_count - end - end - end - - def test_get_namespace - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_get_namespace_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_namespace({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_namespace name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_namespace ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_namespace({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_namespace(::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_namespace_client_stub.call_count - end - end - end - - def test_update_namespace - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - namespace = {} - update_mask = {} - - update_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_update_namespace_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_namespace({ namespace: namespace, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_namespace namespace: namespace, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_namespace ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new(namespace: namespace, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_namespace({ namespace: namespace, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_namespace(::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new(namespace: namespace, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_namespace_client_stub.call_count - end - end - end - - def test_delete_namespace - # 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_namespace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_namespace_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_namespace({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_namespace name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_namespace ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_namespace({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_namespace(::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_namespace_client_stub.call_count - end - end - end - - def test_create_service - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - service_id = "hello world" - service = {} - - create_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_create_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_service({ parent: parent, service_id: service_id, service: service }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_service parent: parent, service_id: service_id, service: service do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_service ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_service({ parent: parent, service_id: service_id, service: service }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_service(::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_service_client_stub.call_count - end - end - end - - def test_list_services - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse.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_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_list_services_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_services({ 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_services 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_services ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.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_services_client_stub.call_count - end - end - end - - def test_get_service - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_get_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_service({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_service name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_service ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_service({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_service(::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_service_client_stub.call_count - end - end - end - - def test_update_service - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service = {} - update_mask = {} - - update_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_update_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_service({ service: service, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_service service: service, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_service ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new(service: service, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_service({ service: service, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_service(::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new(service: service, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_service_client_stub.call_count - end - end - end - - def test_delete_service - # 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_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_service({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_service name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_service ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_service({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_service(::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_service_client_stub.call_count - end - end - end - - def test_create_endpoint - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - endpoint_id = "hello world" - endpoint = {} - - create_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_create_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_endpoint parent: parent, endpoint_id: endpoint_id, endpoint: endpoint do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_endpoint_client_stub.call_count - end - end - end - - def test_list_endpoints - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse.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_endpoints_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_list_endpoints_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_endpoints_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_endpoints({ 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_endpoints 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_endpoints ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.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_endpoints({ 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_endpoints(::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.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_endpoints_client_stub.call_count - end - end - end - - def test_get_endpoint - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_get_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_endpoint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_endpoint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_endpoint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_endpoint_client_stub.call_count - end - end - end - - def test_update_endpoint - # Create test objects. - client_result = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - endpoint = {} - update_mask = {} - - update_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_update_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_endpoint endpoint: endpoint, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new(endpoint: endpoint, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new(endpoint: endpoint, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_endpoint_client_stub.call_count - end - end - end - - def test_delete_endpoint - # 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_endpoint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_delete_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_endpoint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_endpoint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_endpoint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_endpoint_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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::ServiceDirectory::V1beta1::RegistrationService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb deleted file mode 100644 index 5e2eac15feba..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb +++ /dev/null @@ -1,1213 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/servicedirectory/v1beta1/registration_service_pb" -require "google/cloud/service_directory/v1beta1/registration_service" - -class ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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_namespace - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - namespace_id = "hello world" - namespace = {} - - create_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_namespace, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["namespace_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Namespace), request["namespace"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_namespace parent: parent, namespace_id: namespace_id, namespace: namespace do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_namespace ::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_namespace({ parent: parent, namespace_id: namespace_id, namespace: namespace }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_namespace(::Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new(parent: parent, namespace_id: namespace_id, namespace: namespace), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_namespace_client_stub.call_rpc_count - end - end - - def test_list_namespaces - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_namespaces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_namespaces, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest, 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_namespaces_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_namespaces({ 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_namespaces 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_namespaces ::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.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_namespaces({ 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_namespaces(::Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.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_namespaces_client_stub.call_rpc_count - end - end - - def test_get_namespace - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_namespace, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_namespace({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_namespace name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_namespace ::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_namespace({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_namespace(::Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_namespace_client_stub.call_rpc_count - end - end - - def test_update_namespace - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Namespace.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - namespace = {} - update_mask = {} - - update_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_namespace, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Namespace), request["namespace"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_namespace({ namespace: namespace, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_namespace namespace: namespace, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_namespace ::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new(namespace: namespace, 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_namespace({ namespace: namespace, 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_namespace(::Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new(namespace: namespace, 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_namespace_client_stub.call_rpc_count - end - end - - def test_delete_namespace - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_namespace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_namespace, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_namespace_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_namespace({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_namespace name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_namespace ::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_namespace({ 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_namespace(::Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new(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_namespace_client_stub.call_rpc_count - end - end - - def test_create_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - service_id = "hello world" - service = {} - - create_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["service_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Service), request["service"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_service({ parent: parent, service_id: service_id, service: service }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_service parent: parent, service_id: service_id, service: service do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_service ::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_service({ parent: parent, service_id: service_id, service: service }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_service(::Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new(parent: parent, service_id: service_id, service: service), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_service_client_stub.call_rpc_count - end - end - - def test_list_services - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_services, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest, 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_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_services({ 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_services 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_services ::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.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_services_client_stub.call_rpc_count - end - end - - def test_get_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_service({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_service name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_service ::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_service({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_service(::Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_service_client_stub.call_rpc_count - end - end - - def test_update_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Service.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service = {} - update_mask = {} - - update_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Service), request["service"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_service({ service: service, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_service service: service, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_service ::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new(service: service, 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_service({ service: service, 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_service(::Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new(service: service, 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_service_client_stub.call_rpc_count - end - end - - def test_delete_service - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_service, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_service({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_service name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_service ::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_service({ 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_service(::Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new(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_service_client_stub.call_rpc_count - end - end - - def test_create_endpoint - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - endpoint_id = "hello world" - endpoint = {} - - create_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_endpoint, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["endpoint_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint), request["endpoint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_endpoint parent: parent, endpoint_id: endpoint_id, endpoint: endpoint do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_endpoint({ parent: parent, endpoint_id: endpoint_id, endpoint: endpoint }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new(parent: parent, endpoint_id: endpoint_id, endpoint: endpoint), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_endpoint_client_stub.call_rpc_count - end - end - - def test_list_endpoints - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_endpoints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_endpoints, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest, 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_endpoints_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_endpoints({ 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_endpoints 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_endpoints ::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.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_endpoints({ 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_endpoints(::Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.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_endpoints_client_stub.call_rpc_count - end - end - - def test_get_endpoint - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_endpoint, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_endpoint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_endpoint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_endpoint({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_endpoint_client_stub.call_rpc_count - end - end - - def test_update_endpoint - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - endpoint = {} - update_mask = {} - - update_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_endpoint, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint), request["endpoint"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_endpoint({ endpoint: endpoint, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_endpoint endpoint: endpoint, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new(endpoint: endpoint, 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_endpoint({ endpoint: endpoint, 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_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new(endpoint: endpoint, 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_endpoint_client_stub.call_rpc_count - end - end - - def test_delete_endpoint - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_endpoint, name - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_endpoint_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_endpoint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_endpoint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_endpoint ::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_endpoint({ 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_endpoint(::Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new(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_endpoint_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::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::ServiceDirectory::V1beta1::RegistrationService::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::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-service_directory-v1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-service_directory-v1beta1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_health-v1/.gitignore b/owl-bot-staging/google-cloud-service_health-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_health-v1/.repo-metadata.json deleted file mode 100644 index e5a8dac5c000..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "servicehealth.googleapis.com", - "api_shortname": "servicehealth", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_health-v1/latest", - "distribution_name": "google-cloud-service_health-v1", - "is_cloud": true, - "language": "ruby", - "name": "servicehealth", - "name_pretty": "Service Health V1 API", - "product_documentation": "https://cloud.google.com/service-health/docs/overview", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. Note that google-cloud-service_health-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_health instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/service-health/docs/overview", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-service_health-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_health-v1/.rubocop.yml deleted file mode 100644 index 292707c824d6..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-service_health-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-service_health-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_health-v1/.toys.rb b/owl-bot-staging/google-cloud-service_health-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1/.yardopts b/owl-bot-staging/google-cloud-service_health-v1/.yardopts deleted file mode 100644 index 26f81cadbdb8..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Service Health 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-service_health-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_health-v1/AUTHENTICATION.md deleted file mode 100644 index 48d8d8aa8f78..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-service_health-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-service_health-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/service_health/v1" - -client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/service_health/v1" - -::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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-service_health-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/service_health/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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-service_health-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_health-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-service_health-v1/Gemfile b/owl-bot-staging/google-cloud-service_health-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_health-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_health-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1/README.md b/owl-bot-staging/google-cloud-service_health-v1/README.md deleted file mode 100644 index 9f339ec88358..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Service Health V1 API - -Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. - -Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Service Health V1 API. Most users should consider using -the main client gem, -[google-cloud-service_health](https://rubygems.org/gems/google-cloud-service_health). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-service_health-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/servicehealth.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/service_health/v1" - -client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new -request = ::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new # (request fields as keyword arguments...) -response = client.list_events request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_health-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/service-health/docs/overview) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/service_health/v1" -require "logger" - -client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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-service_health`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-service_health-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-service_health`. -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-service_health-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-service_health-v1/Rakefile b/owl-bot-staging/google-cloud-service_health-v1/Rakefile deleted file mode 100644 index 516ae4796426..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-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/service_health/v1/service_health/credentials" - ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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-service_health-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-service_health-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-service_health-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-service_health-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-service_health-v1" - header "google-cloud-service_health-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-service_health-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-service_health-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-service_health-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-service_health-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-service_health-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_health-v1/gapic_metadata.json deleted file mode 100644 index f6d45dcb69e9..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/gapic_metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.servicehealth.v1", - "libraryPackage": "::Google::Cloud::ServiceHealth::V1", - "services": { - "ServiceHealth": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client", - "rpcs": { - "ListEvents": { - "methods": [ - "list_events" - ] - }, - "GetEvent": { - "methods": [ - "get_event" - ] - }, - "ListOrganizationEvents": { - "methods": [ - "list_organization_events" - ] - }, - "GetOrganizationEvent": { - "methods": [ - "get_organization_event" - ] - }, - "ListOrganizationImpacts": { - "methods": [ - "list_organization_impacts" - ] - }, - "GetOrganizationImpact": { - "methods": [ - "get_organization_impact" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-service_health-v1/google-cloud-service_health-v1.gemspec b/owl-bot-staging/google-cloud-service_health-v1/google-cloud-service_health-v1.gemspec deleted file mode 100644 index 04a2f2009352..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/google-cloud-service_health-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/service_health/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-service_health-v1" - gem.version = Google::Cloud::ServiceHealth::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. Note that google-cloud-service_health-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_health instead. See the readme for more details." - gem.summary = "Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google-cloud-service_health-v1.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google-cloud-service_health-v1.rb deleted file mode 100644 index 1fd09f220a8c..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google-cloud-service_health-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/service_health/v1" diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1.rb deleted file mode 100644 index 0450d1bde309..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/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/service_health/v1/service_health" -require "google/cloud/service_health/v1/version" - -module Google - module Cloud - module ServiceHealth - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/service_health/v1" - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/service_health/v1" - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/service_health/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/bindings_override.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/bindings_override.rb deleted file mode 100644 index 1d734180955c..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/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 ServiceHealth - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/service_health/v1/rest" - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceHealth"] - parent_config = while namespace.any? - parent_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-service_health-v1/lib/google/cloud/service_health/v1/rest.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/rest.rb deleted file mode 100644 index 7c4fab8806ab..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/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/service_health/v1/service_health/rest" -require "google/cloud/service_health/v1/bindings_override" -require "google/cloud/service_health/v1/version" - -module Google - module Cloud - module ServiceHealth - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/service_health/v1/rest" - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health.rb deleted file mode 100644 index e2ae0bacf94a..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health.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/service_health/v1/version" - -require "google/cloud/service_health/v1/service_health/credentials" -require "google/cloud/service_health/v1/service_health/paths" -require "google/cloud/service_health/v1/service_health/client" -require "google/cloud/service_health/v1/service_health/rest" - -module Google - module Cloud - module ServiceHealth - module V1 - ## - # Request service health events relevant to your Google Cloud project. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/service_health/v1/service_health" - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/service_health/v1/service_health/rest" - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - module ServiceHealth - end - end - end - end -end - -helper_path = ::File.join __dir__, "service_health", "helpers.rb" -require "google/cloud/service_health/v1/service_health/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/client.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/client.rb deleted file mode 100644 index 5c3313ddfc08..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/client.rb +++ /dev/null @@ -1,1142 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/servicehealth/v1/event_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module ServiceHealth - module V1 - module ServiceHealth - ## - # Client for the ServiceHealth service. - # - # Request service health events relevant to your Google Cloud project. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicehealth.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :service_health_stub - - ## - # Configure the ServiceHealth Client class. - # - # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServiceHealth clients - # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceHealth", "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_events.timeout = 60.0 - default_config.rpcs.list_events.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_event.timeout = 60.0 - default_config.rpcs.get_event.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_organization_events.timeout = 60.0 - default_config.rpcs.list_organization_events.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_organization_event.timeout = 60.0 - default_config.rpcs.get_organization_event.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_organization_impacts.timeout = 60.0 - default_config.rpcs.list_organization_impacts.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_organization_impact.timeout = 60.0 - default_config.rpcs.get_organization_impact.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 ServiceHealth Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @service_health_stub.universe_domain - end - - ## - # Create a new ServiceHealth client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServiceHealth 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/servicehealth/v1/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 - - @service_health_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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 - ) - - @service_health_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 = @service_health_stub.endpoint - config.universe_domain = @service_health_stub.universe_domain - config.logger = @service_health_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @service_health_stub.logger - end - - # Service calls - - ## - # Lists events under a given project and location. - # - # @overload list_events(request, options = nil) - # Pass arguments to `list_events` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::ListEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::ListEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) - # Pass arguments to `list_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. Parent value using the form - # `projects/{project_id}/locations/{location}/events`. - # - # `project_id` - ID of the project for which to list service health - # events. - # `location` - The location to get the service health events from. - # To retrieve service health events of category = INCIDENT, use `location` = - # `global`. - # @param page_size [::Integer] - # Optional. The maximum number of events that should be returned. Acceptable - # values are 1 to 100, inclusive. (The default value is 10.) If more results - # are available, the service returns a next_page_token that you can use to - # get the next page of results in subsequent list requests. The service may - # return fewer events than the requested page_size. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Provide Page token returned by a previous `ListEvents` call to retrieve the - # next page of results. When paginating, all other parameters provided to - # `ListEvents` must match the call that provided the page token. - # @param filter [::String] - # Optional. A filter expression that filters resources listed in the - # response. The expression takes the following forms:
- # * field=value for `category` and `state`
- # * field <, >, <=, or >= value for `update_time`
- # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"`, - # `event_impacts.product.product_name:"Eventarc"` - #
- # - # Multiple filter queries are separated by spaces. Example: - # `category=INCIDENT state=ACTIVE`. - # - # By default, each expression is an AND expression. However, you can include - # AND and OR expressions explicitly. - # - # Filter is supported for the following fields: `category`, `state`, - # `update_time`, `event_impacts.product.product_name` - # @param view [::Google::Cloud::ServiceHealth::V1::EventView] - # Optional. Event fields to include in response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::ListEventsRequest.new - # - # # Call the list_events method. - # result = client.list_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::ServiceHealth::V1::Event. - # p item - # end - # - def list_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_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::ServiceHealth::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.call_rpc :list_events, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @service_health_stub, :list_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 - - ## - # Retrieves a resource containing information about an event. - # - # @overload get_event(request, options = nil) - # Pass arguments to `get_event` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::GetEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::GetEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_event(name: nil) - # Pass arguments to `get_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 name [::String] - # Required. Unique name of the event in this scope including project - # and location using the form - # `projects/{project_id}/locations/{location}/events/{event_id}`. - # - # `project_id` - Project ID of the project that contains the event.
- # `location` - The location to get the service health events from.
- # `event_id` - Event ID to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceHealth::V1::Event] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceHealth::V1::Event] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::GetEventRequest.new - # - # # Call the get_event method. - # result = client.get_event request - # - # # The returned object is of type Google::Cloud::ServiceHealth::V1::Event. - # p result - # - def get_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetEventRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_event.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.call_rpc :get_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 - - ## - # Lists organization events under a given organization and location. - # - # @overload list_organization_events(request, options = nil) - # Pass arguments to `list_organization_events` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_organization_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) - # Pass arguments to `list_organization_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. Parent value using the form - # `organizations/{organization_id}/locations/{location}/organizationEvents`. - # - # `organization_id` - ID (number) of the project that contains the event. To - # get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `location` - The location to get the service health events from. To - # retrieve service health events of category = INCIDENT, use `location` = - # `global`. - # @param page_size [::Integer] - # Optional. The maximum number of events that should be returned. Acceptable - # values are `1` to `100`, inclusive. (The default value is `10`.) If more - # results are available, the service returns a `next_page_token` that you can - # use to get the next page of results in subsequent list requests. The - # service may return fewer events than the requested `page_size`. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # Provide Page token returned by a previous `ListOrganizationEvents` call to - # retrieve the next page of results. - # - # When paginating, all other parameters provided to - # `ListOrganizationEvents` must match the call that provided the page token. - # @param filter [::String] - # Optional. A filter expression that filters resources listed in the - # response. The expression takes the following forms: - # - # * field=value for `category` and `state` - # * field <, >, <=, or >= value for `update_time` - # - # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"` - # - # Multiple filter queries are space-separated. Example: - # `category=INCIDENT state=ACTIVE`. - # - # By default, each expression is an AND expression. However, you can include - # AND and OR expressions explicitly. - # - # Filter is supported for the following fields: `category`, `state`, - # `update_time` - # @param view [::Google::Cloud::ServiceHealth::V1::OrganizationEventView] - # Optional. OrganizationEvent fields to include in response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new - # - # # Call the list_organization_events method. - # result = client.list_organization_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::ServiceHealth::V1::OrganizationEvent. - # p item - # end - # - def list_organization_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_organization_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::ServiceHealth::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_organization_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_organization_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.call_rpc :list_organization_events, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @service_health_stub, :list_organization_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 - - ## - # Retrieves a resource containing information about an event affecting an - # organization . - # - # @overload get_organization_event(request, options = nil) - # Pass arguments to `get_organization_event` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_organization_event(name: nil) - # Pass arguments to `get_organization_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 name [::String] - # Required. Unique name of the event in this scope including organization and - # event ID using the form - # `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`. - # - # `organization_id` - ID (number) of the project that contains the event. To - # get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `event_id` - Organization event ID to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new - # - # # Call the get_organization_event method. - # result = client.get_organization_event request - # - # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationEvent. - # p result - # - def get_organization_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_organization_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::ServiceHealth::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_organization_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_organization_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.call_rpc :get_organization_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 - - ## - # Lists assets impacted by organization events under a given organization and - # location. - # - # @overload list_organization_impacts(request, options = nil) - # Pass arguments to `list_organization_impacts` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_organization_impacts(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_organization_impacts` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 using the form - # `organizations/{organization_id}/locations/{location}/organizationImpacts`. - # - # `organization_id` - ID (number) of the project that contains the event. To - # get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). - # @param page_size [::Integer] - # Optional. The maximum number of events that should be returned. Acceptable - # values are `1` to `100`, inclusive. The default value is `10`. - # - # If more results are available, the service returns a - # `next_page_token` that can be used to get the next page of results in - # subsequent list requests. The service may return fewer - # [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) - # than the requested `page_size`. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # Provide `page_token` returned by a previous `ListOrganizationImpacts` call - # to retrieve the next page of results. - # - # When paginating, all other parameters provided to `ListOrganizationImpacts` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. A filter expression that filters resources listed in the - # response. The expression is in the form of `field:value` for checking if a - # repeated field contains a value. - # - # Example: - # `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id` - # - # To get your `{organization_id}`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). - # - # Multiple filter queries are separated by spaces. - # - # By default, each expression is an AND expression. However, you can include - # AND and OR expressions explicitly. - # Filter is supported for the following fields: `events`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.new - # - # # Call the list_organization_impacts method. - # result = client.list_organization_impacts request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceHealth::V1::OrganizationImpact. - # p item - # end - # - def list_organization_impacts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_organization_impacts.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_organization_impacts.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_organization_impacts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.call_rpc :list_organization_impacts, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @service_health_stub, :list_organization_impacts, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a resource containing information about impact to an asset under - # an organization affected by a service health event. - # - # @overload get_organization_impact(request, options = nil) - # Pass arguments to `get_organization_impact` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_organization_impact(name: nil) - # Pass arguments to `get_organization_impact` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or 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 using the form - # `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`. - # - # `organization_id` - ID (number) of the organization that contains the - # event. To get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `organization_impact_id` - ID of the [OrganizationImpact - # resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new - # - # # Call the get_organization_impact method. - # result = client.get_organization_impact request - # - # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationImpact. - # p result - # - def get_organization_impact request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_organization_impact.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_organization_impact.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_organization_impact.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.call_rpc :get_organization_impact, request, 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 ServiceHealth API. - # - # This class represents the configuration for ServiceHealth, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_events to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_events.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_events.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::ServiceHealth::V1::ServiceHealth::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicehealth.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ServiceHealth API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_events - ## - # RPC-specific configuration for `get_event` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event - ## - # RPC-specific configuration for `list_organization_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_organization_events - ## - # RPC-specific configuration for `get_organization_event` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_event - ## - # RPC-specific configuration for `list_organization_impacts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_organization_impacts - ## - # RPC-specific configuration for `get_organization_impact` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_impact - - # @private - def initialize parent_rpcs = nil - list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events - @list_events = ::Gapic::Config::Method.new list_events_config - get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event - @get_event = ::Gapic::Config::Method.new get_event_config - list_organization_events_config = parent_rpcs.list_organization_events if parent_rpcs.respond_to? :list_organization_events - @list_organization_events = ::Gapic::Config::Method.new list_organization_events_config - get_organization_event_config = parent_rpcs.get_organization_event if parent_rpcs.respond_to? :get_organization_event - @get_organization_event = ::Gapic::Config::Method.new get_organization_event_config - list_organization_impacts_config = parent_rpcs.list_organization_impacts if parent_rpcs.respond_to? :list_organization_impacts - @list_organization_impacts = ::Gapic::Config::Method.new list_organization_impacts_config - get_organization_impact_config = parent_rpcs.get_organization_impact if parent_rpcs.respond_to? :get_organization_impact - @get_organization_impact = ::Gapic::Config::Method.new get_organization_impact_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/credentials.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/credentials.rb deleted file mode 100644 index 76ceb72eed21..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/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 ServiceHealth - module V1 - module ServiceHealth - # Credentials for the ServiceHealth 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-service_health-v1/lib/google/cloud/service_health/v1/service_health/paths.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/paths.rb deleted file mode 100644 index faffaa39fdf7..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/paths.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceHealth - module V1 - module ServiceHealth - # Path helper methods for the ServiceHealth API. - module Paths - ## - # Create a fully-qualified Event resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/events/{event}` - # - # @param project [String] - # @param location [String] - # @param event [String] - # - # @return [::String] - def event_path project:, location:, event: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/events/#{event}" - 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 OrganizationEvent resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/organizationEvents/{event}` - # - # @param organization [String] - # @param location [String] - # @param event [String] - # - # @return [::String] - def organization_event_path organization:, location:, event: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/organizationEvents/#{event}" - end - - ## - # Create a fully-qualified OrganizationImpact resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/organizationImpacts/{organization_impact}` - # - # @param organization [String] - # @param location [String] - # @param organization_impact [String] - # - # @return [::String] - def organization_impact_path organization:, location:, organization_impact: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/organizationImpacts/#{organization_impact}" - 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-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest.rb deleted file mode 100644 index 205266530be8..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/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/service_health/v1/version" -require "google/cloud/service_health/v1/bindings_override" - -require "google/cloud/service_health/v1/service_health/credentials" -require "google/cloud/service_health/v1/service_health/paths" -require "google/cloud/service_health/v1/service_health/rest/client" - -module Google - module Cloud - module ServiceHealth - module V1 - ## - # Request service health events relevant to your Google Cloud project. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/service_health/v1/service_health/rest" - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - module ServiceHealth - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/service_health/v1/service_health/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/client.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/client.rb deleted file mode 100644 index 8019a331dad4..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/client.rb +++ /dev/null @@ -1,1065 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/servicehealth/v1/event_service_pb" -require "google/cloud/service_health/v1/service_health/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module ServiceHealth - module V1 - module ServiceHealth - module Rest - ## - # REST client for the ServiceHealth service. - # - # Request service health events relevant to your Google Cloud project. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicehealth.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :service_health_stub - - ## - # Configure the ServiceHealth Client class. - # - # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServiceHealth clients - # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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", "ServiceHealth", "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_events.timeout = 60.0 - default_config.rpcs.list_events.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_event.timeout = 60.0 - default_config.rpcs.get_event.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_organization_events.timeout = 60.0 - default_config.rpcs.list_organization_events.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_organization_event.timeout = 60.0 - default_config.rpcs.get_organization_event.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_organization_impacts.timeout = 60.0 - default_config.rpcs.list_organization_impacts.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_organization_impact.timeout = 60.0 - default_config.rpcs.get_organization_impact.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 ServiceHealth Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::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 - @service_health_stub.universe_domain - end - - ## - # Create a new ServiceHealth REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServiceHealth 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 - - @service_health_stub = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @service_health_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 = @service_health_stub.endpoint - config.universe_domain = @service_health_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @service_health_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @service_health_stub.logger - end - - # Service calls - - ## - # Lists events under a given project and location. - # - # @overload list_events(request, options = nil) - # Pass arguments to `list_events` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::ListEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::ListEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) - # Pass arguments to `list_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. Parent value using the form - # `projects/{project_id}/locations/{location}/events`. - # - # `project_id` - ID of the project for which to list service health - # events. - # `location` - The location to get the service health events from. - # To retrieve service health events of category = INCIDENT, use `location` = - # `global`. - # @param page_size [::Integer] - # Optional. The maximum number of events that should be returned. Acceptable - # values are 1 to 100, inclusive. (The default value is 10.) If more results - # are available, the service returns a next_page_token that you can use to - # get the next page of results in subsequent list requests. The service may - # return fewer events than the requested page_size. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Provide Page token returned by a previous `ListEvents` call to retrieve the - # next page of results. When paginating, all other parameters provided to - # `ListEvents` must match the call that provided the page token. - # @param filter [::String] - # Optional. A filter expression that filters resources listed in the - # response. The expression takes the following forms:
- # * field=value for `category` and `state`
- # * field <, >, <=, or >= value for `update_time`
- # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"`, - # `event_impacts.product.product_name:"Eventarc"` - #
- # - # Multiple filter queries are separated by spaces. Example: - # `category=INCIDENT state=ACTIVE`. - # - # By default, each expression is an AND expression. However, you can include - # AND and OR expressions explicitly. - # - # Filter is supported for the following fields: `category`, `state`, - # `update_time`, `event_impacts.product.product_name` - # @param view [::Google::Cloud::ServiceHealth::V1::EventView] - # Optional. Event fields to include in response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::ListEventsRequest.new - # - # # Call the list_events method. - # result = client.list_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::ServiceHealth::V1::Event. - # p item - # end - # - def list_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_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::ServiceHealth::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.list_events request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @service_health_stub, :list_events, "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 - - ## - # Retrieves a resource containing information about an event. - # - # @overload get_event(request, options = nil) - # Pass arguments to `get_event` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::GetEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::GetEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_event(name: nil) - # Pass arguments to `get_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 name [::String] - # Required. Unique name of the event in this scope including project - # and location using the form - # `projects/{project_id}/locations/{location}/events/{event_id}`. - # - # `project_id` - Project ID of the project that contains the event.
- # `location` - The location to get the service health events from.
- # `event_id` - Event ID to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceHealth::V1::Event] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceHealth::V1::Event] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::GetEventRequest.new - # - # # Call the get_event method. - # result = client.get_event request - # - # # The returned object is of type Google::Cloud::ServiceHealth::V1::Event. - # p result - # - def get_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetEventRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_event.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.get_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 - - ## - # Lists organization events under a given organization and location. - # - # @overload list_organization_events(request, options = nil) - # Pass arguments to `list_organization_events` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_organization_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) - # Pass arguments to `list_organization_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. Parent value using the form - # `organizations/{organization_id}/locations/{location}/organizationEvents`. - # - # `organization_id` - ID (number) of the project that contains the event. To - # get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `location` - The location to get the service health events from. To - # retrieve service health events of category = INCIDENT, use `location` = - # `global`. - # @param page_size [::Integer] - # Optional. The maximum number of events that should be returned. Acceptable - # values are `1` to `100`, inclusive. (The default value is `10`.) If more - # results are available, the service returns a `next_page_token` that you can - # use to get the next page of results in subsequent list requests. The - # service may return fewer events than the requested `page_size`. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # Provide Page token returned by a previous `ListOrganizationEvents` call to - # retrieve the next page of results. - # - # When paginating, all other parameters provided to - # `ListOrganizationEvents` must match the call that provided the page token. - # @param filter [::String] - # Optional. A filter expression that filters resources listed in the - # response. The expression takes the following forms: - # - # * field=value for `category` and `state` - # * field <, >, <=, or >= value for `update_time` - # - # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"` - # - # Multiple filter queries are space-separated. Example: - # `category=INCIDENT state=ACTIVE`. - # - # By default, each expression is an AND expression. However, you can include - # AND and OR expressions explicitly. - # - # Filter is supported for the following fields: `category`, `state`, - # `update_time` - # @param view [::Google::Cloud::ServiceHealth::V1::OrganizationEventView] - # Optional. OrganizationEvent fields to include in response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new - # - # # Call the list_organization_events method. - # result = client.list_organization_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::ServiceHealth::V1::OrganizationEvent. - # p item - # end - # - def list_organization_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_organization_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::ServiceHealth::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_organization_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_organization_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.list_organization_events request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @service_health_stub, :list_organization_events, "organization_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 - - ## - # Retrieves a resource containing information about an event affecting an - # organization . - # - # @overload get_organization_event(request, options = nil) - # Pass arguments to `get_organization_event` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_organization_event(name: nil) - # Pass arguments to `get_organization_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 name [::String] - # Required. Unique name of the event in this scope including organization and - # event ID using the form - # `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`. - # - # `organization_id` - ID (number) of the project that contains the event. To - # get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `event_id` - Organization event ID to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new - # - # # Call the get_organization_event method. - # result = client.get_organization_event request - # - # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationEvent. - # p result - # - def get_organization_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_organization_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::ServiceHealth::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_organization_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_organization_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.get_organization_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 - - ## - # Lists assets impacted by organization events under a given organization and - # location. - # - # @overload list_organization_impacts(request, options = nil) - # Pass arguments to `list_organization_impacts` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_organization_impacts(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_organization_impacts` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 using the form - # `organizations/{organization_id}/locations/{location}/organizationImpacts`. - # - # `organization_id` - ID (number) of the project that contains the event. To - # get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). - # @param page_size [::Integer] - # Optional. The maximum number of events that should be returned. Acceptable - # values are `1` to `100`, inclusive. The default value is `10`. - # - # If more results are available, the service returns a - # `next_page_token` that can be used to get the next page of results in - # subsequent list requests. The service may return fewer - # [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) - # than the requested `page_size`. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # Provide `page_token` returned by a previous `ListOrganizationImpacts` call - # to retrieve the next page of results. - # - # When paginating, all other parameters provided to `ListOrganizationImpacts` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. A filter expression that filters resources listed in the - # response. The expression is in the form of `field:value` for checking if a - # repeated field contains a value. - # - # Example: - # `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id` - # - # To get your `{organization_id}`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). - # - # Multiple filter queries are separated by spaces. - # - # By default, each expression is an AND expression. However, you can include - # AND and OR expressions explicitly. - # Filter is supported for the following fields: `events`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.new - # - # # Call the list_organization_impacts method. - # result = client.list_organization_impacts request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceHealth::V1::OrganizationImpact. - # p item - # end - # - def list_organization_impacts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_organization_impacts.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_organization_impacts.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_organization_impacts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.list_organization_impacts request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @service_health_stub, :list_organization_impacts, "organization_impacts", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a resource containing information about impact to an asset under - # an organization affected by a service health event. - # - # @overload get_organization_impact(request, options = nil) - # Pass arguments to `get_organization_impact` via a request object, either of type - # {::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_organization_impact(name: nil) - # Pass arguments to `get_organization_impact` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or 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 using the form - # `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`. - # - # `organization_id` - ID (number) of the organization that contains the - # event. To get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `organization_impact_id` - ID of the [OrganizationImpact - # resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_health/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new - # - # # Call the get_organization_impact method. - # result = client.get_organization_impact request - # - # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationImpact. - # p result - # - def get_organization_impact request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_organization_impact.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_organization_impact.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_organization_impact.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_health_stub.get_organization_impact request, 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 ServiceHealth REST API. - # - # This class represents the configuration for ServiceHealth REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_events to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_events.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_events.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicehealth.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 ServiceHealth API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_events - ## - # RPC-specific configuration for `get_event` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event - ## - # RPC-specific configuration for `list_organization_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_organization_events - ## - # RPC-specific configuration for `get_organization_event` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_event - ## - # RPC-specific configuration for `list_organization_impacts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_organization_impacts - ## - # RPC-specific configuration for `get_organization_impact` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_impact - - # @private - def initialize parent_rpcs = nil - list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events - @list_events = ::Gapic::Config::Method.new list_events_config - get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event - @get_event = ::Gapic::Config::Method.new get_event_config - list_organization_events_config = parent_rpcs.list_organization_events if parent_rpcs.respond_to? :list_organization_events - @list_organization_events = ::Gapic::Config::Method.new list_organization_events_config - get_organization_event_config = parent_rpcs.get_organization_event if parent_rpcs.respond_to? :get_organization_event - @get_organization_event = ::Gapic::Config::Method.new get_organization_event_config - list_organization_impacts_config = parent_rpcs.list_organization_impacts if parent_rpcs.respond_to? :list_organization_impacts - @list_organization_impacts = ::Gapic::Config::Method.new list_organization_impacts_config - get_organization_impact_config = parent_rpcs.get_organization_impact if parent_rpcs.respond_to? :get_organization_impact - @get_organization_impact = ::Gapic::Config::Method.new get_organization_impact_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/service_stub.rb deleted file mode 100644 index 334b7953ff5e..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/service_health/rest/service_stub.rb +++ /dev/null @@ -1,447 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/servicehealth/v1/event_service_pb" - -module Google - module Cloud - module ServiceHealth - module V1 - module ServiceHealth - module Rest - ## - # REST service stub for the ServiceHealth 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_events REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListEventsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceHealth::V1::ListEventsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceHealth::V1::ListEventsResponse] - # A result object deserialized from the server's reply - def list_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_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_events", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceHealth::V1::ListEventsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_event REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetEventRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceHealth::V1::Event] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceHealth::V1::Event] - # A result object deserialized from the server's reply - def get_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_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: "get_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceHealth::V1::Event.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_organization_events REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse] - # A result object deserialized from the server's reply - def list_organization_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_organization_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_organization_events", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_organization_event REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent] - # A result object deserialized from the server's reply - def get_organization_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_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: "get_organization_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceHealth::V1::OrganizationEvent.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_organization_impacts REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse] - # A result object deserialized from the server's reply - def list_organization_impacts request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_organization_impacts_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_organization_impacts", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_organization_impact REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationImpact] - # A result object deserialized from the server's reply - def get_organization_impact request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_impact_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_organization_impact", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceHealth::V1::OrganizationImpact.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_events REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListEventsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/events", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_event REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetEventRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/events/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_organization_events REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_organization_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/organizationEvents", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_organization_event REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_organization_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/organizationEvents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_organization_impacts REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_organization_impacts_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/organizationImpacts", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_organization_impact REST call - # - # @param request_pb [::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_organization_impact_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/organizationImpacts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/version.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/v1/version.rb deleted file mode 100644 index 1a6b3fe921b3..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/service_health/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 ServiceHealth - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_resources_pb.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_resources_pb.rb deleted file mode 100644 index 0b6bc5e2a840..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_resources_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicehealth/v1/event_resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n3google/cloud/servicehealth/v1/event_resources.proto\x12\x1dgoogle.cloud.servicehealth.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x93\x0b\n\x05\x45vent\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12I\n\x08\x63\x61tegory\x18\x04 \x01(\x0e\x32\x32.google.cloud.servicehealth.v1.Event.EventCategoryB\x03\xe0\x41\x03\x12U\n\x11\x64\x65tailed_category\x18\x15 \x01(\x0e\x32\x35.google.cloud.servicehealth.v1.Event.DetailedCategoryB\x03\xe0\x41\x03\x12>\n\x05state\x18\x05 \x01(\x0e\x32*.google.cloud.servicehealth.v1.Event.StateB\x03\xe0\x41\x03\x12O\n\x0e\x64\x65tailed_state\x18\x13 \x01(\x0e\x32\x32.google.cloud.servicehealth.v1.Event.DetailedStateB\x03\xe0\x41\x03\x12\x41\n\revent_impacts\x18\x14 \x03(\x0b\x32*.google.cloud.servicehealth.v1.EventImpact\x12\x46\n\trelevance\x18\x08 \x01(\x0e\x32..google.cloud.servicehealth.v1.Event.RelevanceB\x03\xe0\x41\x03\x12@\n\x07updates\x18\t \x03(\x0b\x32*.google.cloud.servicehealth.v1.EventUpdateB\x03\xe0\x41\x03\x12\x19\n\x0cparent_event\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x10next_update_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"=\n\rEventCategory\x12\x1e\n\x1a\x45VENT_CATEGORY_UNSPECIFIED\x10\x00\x12\x0c\n\x08INCIDENT\x10\x02\"d\n\x10\x44\x65tailedCategory\x12!\n\x1d\x44\x45TAILED_CATEGORY_UNSPECIFIED\x10\x00\x12\x16\n\x12\x43ONFIRMED_INCIDENT\x10\x01\x12\x15\n\x11\x45MERGING_INCIDENT\x10\x02\"6\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\n\n\x06\x43LOSED\x10\x02\"\x8b\x01\n\rDetailedState\x12\x1e\n\x1a\x44\x45TAILED_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x45MERGING\x10\x01\x12\r\n\tCONFIRMED\x10\x02\x12\x0c\n\x08RESOLVED\x10\x03\x12\n\n\x06MERGED\x10\x04\x12\x0f\n\x0b\x41UTO_CLOSED\x10\t\x12\x12\n\x0e\x46\x41LSE_POSITIVE\x10\n\"w\n\tRelevance\x12\x19\n\x15RELEVANCE_UNSPECIFIED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x02\x12\x10\n\x0cNOT_IMPACTED\x10\x06\x12\x15\n\x11PARTIALLY_RELATED\x10\x07\x12\x0b\n\x07RELATED\x10\x08\x12\x0c\n\x08IMPACTED\x10\t:n\xea\x41k\n\"servicehealth.googleapis.com/Event\x12\x36projects/{project}/locations/{location}/events/{event}*\x06\x65vents2\x05\x65vent\"\xcf\n\n\x11OrganizationEvent\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12U\n\x08\x63\x61tegory\x18\x04 \x01(\x0e\x32>.google.cloud.servicehealth.v1.OrganizationEvent.EventCategoryB\x03\xe0\x41\x03\x12\x61\n\x11\x64\x65tailed_category\x18\x11 \x01(\x0e\x32\x41.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategoryB\x03\xe0\x41\x03\x12J\n\x05state\x18\x05 \x01(\x0e\x32\x36.google.cloud.servicehealth.v1.OrganizationEvent.StateB\x03\xe0\x41\x03\x12[\n\x0e\x64\x65tailed_state\x18\x10 \x01(\x0e\x32>.google.cloud.servicehealth.v1.OrganizationEvent.DetailedStateB\x03\xe0\x41\x03\x12\x46\n\revent_impacts\x18\x0f \x03(\x0b\x32*.google.cloud.servicehealth.v1.EventImpactB\x03\xe0\x41\x03\x12@\n\x07updates\x18\x08 \x03(\x0b\x32*.google.cloud.servicehealth.v1.EventUpdateB\x03\xe0\x41\x03\x12\x19\n\x0cparent_event\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x10next_update_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"=\n\rEventCategory\x12\x1e\n\x1a\x45VENT_CATEGORY_UNSPECIFIED\x10\x00\x12\x0c\n\x08INCIDENT\x10\x02\"d\n\x10\x44\x65tailedCategory\x12!\n\x1d\x44\x45TAILED_CATEGORY_UNSPECIFIED\x10\x00\x12\x16\n\x12\x43ONFIRMED_INCIDENT\x10\x01\x12\x15\n\x11\x45MERGING_INCIDENT\x10\x02\"6\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\n\n\x06\x43LOSED\x10\x02\"\x8b\x01\n\rDetailedState\x12\x1e\n\x1a\x44\x45TAILED_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x45MERGING\x10\x01\x12\r\n\tCONFIRMED\x10\x02\x12\x0c\n\x08RESOLVED\x10\x03\x12\n\n\x06MERGED\x10\x04\x12\x0f\n\x0b\x41UTO_CLOSED\x10\t\x12\x12\n\x0e\x46\x41LSE_POSITIVE\x10\n:\xa9\x01\xea\x41\xa5\x01\n.servicehealth.googleapis.com/OrganizationEvent\x12Lorganizations/{organization}/locations/{location}/organizationEvents/{event}*\x12organizationEvents2\x11organizationEvent\"\xa0\x01\n\x0b\x45ventUpdate\x12\x34\n\x0bupdate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07symptom\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nworkaround\x18\x05 \x01(\tB\x03\xe0\x41\x03\"!\n\x08Location\x12\x15\n\rlocation_name\x18\x01 \x01(\t\"+\n\x07Product\x12\x14\n\x0cproduct_name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\"\x81\x01\n\x0b\x45ventImpact\x12\x37\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.servicehealth.v1.Product\x12\x39\n\x08location\x18\x02 \x01(\x0b\x32\'.google.cloud.servicehealth.v1.Location\"\x94\x03\n\x12OrganizationImpact\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12:\n\x06\x65vents\x18\x02 \x03(\tB*\xe0\x41\x03\xfa\x41$\n\"servicehealth.googleapis.com/Event\x12\x38\n\x05\x61sset\x18\x03 \x01(\x0b\x32$.google.cloud.servicehealth.v1.AssetB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xbb\x01\xea\x41\xb7\x01\n/servicehealth.googleapis.com/OrganizationImpact\x12[organizations/{organization}/locations/{location}/organizationImpacts/{organization_impact}*\x13organizationImpacts2\x12organizationImpact\"9\n\x05\x41sset\x12\x17\n\nasset_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nasset_type\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xd2\x01\n\x11ListEventsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"servicehealth.googleapis.com/Event\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;\n\x04view\x18\x06 \x01(\x0e\x32(.google.cloud.servicehealth.v1.EventViewB\x03\xe0\x41\x01\"\x87\x01\n\x12ListEventsResponse\x12\x39\n\x06\x65vents\x18\x01 \x03(\x0b\x32$.google.cloud.servicehealth.v1.EventB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"K\n\x0fGetEventRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"servicehealth.googleapis.com/Event\"\xf6\x01\n\x1dListOrganizationEventsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.servicehealth.googleapis.com/OrganizationEvent\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\x12G\n\x04view\x18\x06 \x01(\x0e\x32\x34.google.cloud.servicehealth.v1.OrganizationEventViewB\x03\xe0\x41\x01\"\xac\x01\n\x1eListOrganizationEventsResponse\x12R\n\x13organization_events\x18\x01 \x03(\x0b\x32\x30.google.cloud.servicehealth.v1.OrganizationEventB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"c\n\x1bGetOrganizationEventRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.servicehealth.googleapis.com/OrganizationEvent\"\xaf\x01\n\x1eListOrganizationImpactsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\x12/servicehealth.googleapis.com/OrganizationImpact\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\"\xaf\x01\n\x1fListOrganizationImpactsResponse\x12T\n\x14organization_impacts\x18\x01 \x03(\x0b\x32\x31.google.cloud.servicehealth.v1.OrganizationImpactB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"e\n\x1cGetOrganizationImpactRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/servicehealth.googleapis.com/OrganizationImpact*R\n\tEventView\x12\x1a\n\x16\x45VENT_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45VENT_VIEW_BASIC\x10\x01\x12\x13\n\x0f\x45VENT_VIEW_FULL\x10\x02*\x85\x01\n\x15OrganizationEventView\x12\'\n#ORGANIZATION_EVENT_VIEW_UNSPECIFIED\x10\x00\x12!\n\x1dORGANIZATION_EVENT_VIEW_BASIC\x10\x01\x12 \n\x1cORGANIZATION_EVENT_VIEW_FULL\x10\x02\x42\xcf\x02\n!com.google.cloud.servicehealth.v1B\x13\x45ventResourcesProtoP\x01ZGcloud.google.com/go/servicehealth/apiv1/servicehealthpb;servicehealthpb\xaa\x02\x1dGoogle.Cloud.ServiceHealth.V1\xca\x02\x1dGoogle\\Cloud\\ServiceHealth\\V1\xea\x02 Google::Cloud::ServiceHealth::V1\xea\x41\x66\n1servicehealth.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceHealth - module V1 - Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event").msgclass - Event::EventCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.EventCategory").enummodule - Event::DetailedCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.DetailedCategory").enummodule - Event::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.State").enummodule - Event::DetailedState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.DetailedState").enummodule - Event::Relevance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Event.Relevance").enummodule - OrganizationEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent").msgclass - OrganizationEvent::EventCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent.EventCategory").enummodule - OrganizationEvent::DetailedCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory").enummodule - OrganizationEvent::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent.State").enummodule - OrganizationEvent::DetailedState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEvent.DetailedState").enummodule - EventUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.EventUpdate").msgclass - Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Location").msgclass - Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Product").msgclass - EventImpact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.EventImpact").msgclass - OrganizationImpact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationImpact").msgclass - Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.Asset").msgclass - ListEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListEventsRequest").msgclass - ListEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListEventsResponse").msgclass - GetEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.GetEventRequest").msgclass - ListOrganizationEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListOrganizationEventsRequest").msgclass - ListOrganizationEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListOrganizationEventsResponse").msgclass - GetOrganizationEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.GetOrganizationEventRequest").msgclass - ListOrganizationImpactsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListOrganizationImpactsRequest").msgclass - ListOrganizationImpactsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.ListOrganizationImpactsResponse").msgclass - GetOrganizationImpactRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.GetOrganizationImpactRequest").msgclass - EventView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.EventView").enummodule - OrganizationEventView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.servicehealth.v1.OrganizationEventView").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_pb.rb b/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_pb.rb deleted file mode 100644 index f23b23184afe..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/lib/google/cloud/servicehealth/v1/event_service_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/servicehealth/v1/event_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/cloud/servicehealth/v1/event_resources_pb' - - -descriptor_data = "\n1google/cloud/servicehealth/v1/event_service.proto\x12\x1dgoogle.cloud.servicehealth.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x33google/cloud/servicehealth/v1/event_resources.proto2\xaa\n\n\rServiceHealth\x12\xae\x01\n\nListEvents\x12\x30.google.cloud.servicehealth.v1.ListEventsRequest\x1a\x31.google.cloud.servicehealth.v1.ListEventsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/events\x12\x9b\x01\n\x08GetEvent\x12..google.cloud.servicehealth.v1.GetEventRequest\x1a$.google.cloud.servicehealth.v1.Event\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/events/*}\x12\xe3\x01\n\x16ListOrganizationEvents\x12<.google.cloud.servicehealth.v1.ListOrganizationEventsRequest\x1a=.google.cloud.servicehealth.v1.ListOrganizationEventsResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1/{parent=organizations/*/locations/*}/organizationEvents\x12\xd0\x01\n\x14GetOrganizationEvent\x12:.google.cloud.servicehealth.v1.GetOrganizationEventRequest\x1a\x30.google.cloud.servicehealth.v1.OrganizationEvent\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1/{name=organizations/*/locations/*/organizationEvents/*}\x12\xe7\x01\n\x17ListOrganizationImpacts\x12=.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest\x1a>.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/cloud/servicehealth/v1/event_resources.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/cloud/servicehealth/v1/event_resources.rb deleted file mode 100644 index 60b89ba52554..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/cloud/servicehealth/v1/event_resources.rb +++ /dev/null @@ -1,718 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceHealth - module V1 - # Represents service health events that may affect Google Cloud products. - # Event resource is a read-only view and does not allow any modifications. All - # fields are output only. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. Name of the event. Unique name of the event in - # this scope including project and location using the form - # `projects/{project_id}/locations/{location}/events/{event_id}`. - # @!attribute [r] title - # @return [::String] - # Output only. Brief description for the event. - # @!attribute [r] description - # @return [::String] - # Output only. Free-form, human-readable description. - # @!attribute [r] category - # @return [::Google::Cloud::ServiceHealth::V1::Event::EventCategory] - # Output only. The category of the event. - # @!attribute [r] detailed_category - # @return [::Google::Cloud::ServiceHealth::V1::Event::DetailedCategory] - # Output only. The detailed category of the event. - # @!attribute [r] state - # @return [::Google::Cloud::ServiceHealth::V1::Event::State] - # Output only. The current state of the event. - # @!attribute [r] detailed_state - # @return [::Google::Cloud::ServiceHealth::V1::Event::DetailedState] - # Output only. The current detailed state of the incident. - # @!attribute [rw] event_impacts - # @return [::Array<::Google::Cloud::ServiceHealth::V1::EventImpact>] - # Google Cloud products and locations impacted by the event. - # @!attribute [r] relevance - # @return [::Google::Cloud::ServiceHealth::V1::Event::Relevance] - # Output only. Communicates why a given event is deemed relevant in the - # context of a given project. - # @!attribute [r] updates - # @return [::Array<::Google::Cloud::ServiceHealth::V1::EventUpdate>] - # Output only. Event updates are correspondence from Google. - # @!attribute [r] parent_event - # @return [::String] - # Output only. When `detailed_state`=`MERGED`, `parent_event` contains the - # name of the parent event. All further updates will be published to the - # parent event. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the event was last modified. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The start time of the event, if applicable. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The end time of the event, if applicable. - # @!attribute [r] next_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the next update can be expected. - class Event - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The category of the event. This enum lists all possible categories of - # event. - module EventCategory - # Unspecified category. - EVENT_CATEGORY_UNSPECIFIED = 0 - - # Event category for service outage or degradation. - INCIDENT = 2 - end - - # The detailed category of an event. Contains all possible states for all - # event categories. - module DetailedCategory - # Unspecified detailed category. - DETAILED_CATEGORY_UNSPECIFIED = 0 - - # Indicates an event with category INCIDENT has a confirmed impact to at - # least one Google Cloud product. - CONFIRMED_INCIDENT = 1 - - # Indicates an event with category INCIDENT is under investigation to - # determine if it has a confirmed impact on any Google Cloud products. - EMERGING_INCIDENT = 2 - end - - # The state of the event. This enum lists all possible states of event. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # Event is actively affecting a Google Cloud product and will continue to - # receive updates. - ACTIVE = 1 - - # Event is no longer affecting the Google Cloud product or has been merged - # with another event. - CLOSED = 2 - end - - # The detailed state of the incident. This enum lists all possible detailed - # states of an incident. - module DetailedState - # Unspecified detail state. - DETAILED_STATE_UNSPECIFIED = 0 - - # Google engineers are actively investigating the event to determine the - # impact. - EMERGING = 1 - - # The incident is confirmed and impacting at least one Google Cloud - # product. Ongoing status updates will be provided until it is resolved. - CONFIRMED = 2 - - # The incident is no longer affecting any Google Cloud product, and there - # will be no further updates. - RESOLVED = 3 - - # The incident was merged into a parent incident. All further updates will - # be published to the parent only. The `parent_event` field contains the - # name of the parent. - MERGED = 4 - - # The incident was automatically closed because of the following reasons: - # - # * The impact of the incident could not be confirmed. - # * The incident was intermittent or resolved itself. - # - # The incident does not have a resolution because no action or - # investigation happened. If it is intermittent, the incident may reopen. - AUTO_CLOSED = 9 - - # Upon investigation, Google engineers concluded that the incident is not - # affecting a Google Cloud product. This state can change if the incident - # is reviewed again. - FALSE_POSITIVE = 10 - end - - # Communicates why a given incident is deemed relevant in the context of a - # given project. This enum lists all possible detailed states of relevance. - module Relevance - # Unspecified relevance. - RELEVANCE_UNSPECIFIED = 0 - - # The relevance of the incident to the project is unknown. - UNKNOWN = 2 - - # The incident does not impact the project. - NOT_IMPACTED = 6 - - # The incident is associated with a Google Cloud product your project uses, - # but the incident may not be impacting your project. For example, the - # incident may be impacting a Google Cloud product that your project uses, - # but in a location that your project does not use. - PARTIALLY_RELATED = 7 - - # The incident has a direct connection with your project and impacts a - # Google Cloud product in a location your project uses. - RELATED = 8 - - # The incident is verified to be impacting your project. - IMPACTED = 9 - end - end - - # Represents service health events that may affect Google Cloud products used - # across the organization. It is a read-only view and does not allow any - # modifications. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. Name of the event. Unique name of the event in - # this scope including organization ID and location using the form - # `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`. - # - # `organization_id` - see [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `location` - The location to get the service health events from.
- # `event_id` - Organization event ID to retrieve. - # @!attribute [r] title - # @return [::String] - # Output only. Brief description for the event. - # @!attribute [r] description - # @return [::String] - # Output only. Free-form, human-readable description. - # @!attribute [r] category - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent::EventCategory] - # Output only. The category of the event. - # @!attribute [r] detailed_category - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent::DetailedCategory] - # Output only. The detailed category of the event. - # @!attribute [r] state - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent::State] - # Output only. The current state of the event. - # @!attribute [r] detailed_state - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent::DetailedState] - # Output only. The current detailed state of the incident. - # @!attribute [r] event_impacts - # @return [::Array<::Google::Cloud::ServiceHealth::V1::EventImpact>] - # Output only. Represents the Google Cloud products and locations impacted by - # the event. - # @!attribute [r] updates - # @return [::Array<::Google::Cloud::ServiceHealth::V1::EventUpdate>] - # Output only. Incident-only field. Event updates are correspondence from - # Google. - # @!attribute [r] parent_event - # @return [::String] - # Output only. When `detailed_state`=`MERGED`, `parent_event` contains the - # name of the parent event. All further updates will be published to the - # parent event. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the update was posted. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The start time of the event, if applicable. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The end time of the event, if applicable. - # @!attribute [r] next_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Incident-only field. The time when the next update can be - # expected. - class OrganizationEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The category of the event. This enum lists all possible categories of - # event. - module EventCategory - # Unspecified category. - EVENT_CATEGORY_UNSPECIFIED = 0 - - # Event category for service outage or degradation. - INCIDENT = 2 - end - - # The detailed category of an event. Contains all possible states for all - # event categories. - module DetailedCategory - # Unspecified detailed category. - DETAILED_CATEGORY_UNSPECIFIED = 0 - - # Indicates an event with category INCIDENT has a confirmed impact to at - # least one Google Cloud product. - CONFIRMED_INCIDENT = 1 - - # Indicates an event with category INCIDENT is under investigation to - # determine if it has a confirmed impact on any Google Cloud products. - EMERGING_INCIDENT = 2 - end - - # The state of the organization event. This enum lists all possible states of - # event. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # Event is actively affecting a Google Cloud product and will continue to - # receive updates. - ACTIVE = 1 - - # Event is no longer affecting the Google Cloud product or has been merged - # with another event. - CLOSED = 2 - end - - # The detailed state of the incident. This enum lists all possible detailed - # states of an incident. - module DetailedState - # Unspecified detail state. - DETAILED_STATE_UNSPECIFIED = 0 - - # Google engineers are actively investigating the incident to determine the - # impact. - EMERGING = 1 - - # The incident is confirmed and impacting at least one Google Cloud - # product. Ongoing status updates will be provided until it is resolved. - CONFIRMED = 2 - - # The incident is no longer affecting any Google Cloud product, and there - # will be no further updates. - RESOLVED = 3 - - # The incident was merged into a parent event. All further updates will be - # published to the parent only. The `parent_event` contains the name of the - # parent. - MERGED = 4 - - # The incident was automatically closed because of the following reasons: - # - # * The impact of the incident could not be confirmed. - # * The incident was intermittent or resolved itself. - # - # The incident does not have a resolution because no action or - # investigation happened. If it is intermittent, the incident may reopen. - AUTO_CLOSED = 9 - - # Upon investigation, Google engineers concluded that the incident is not - # affecting a Google Cloud product. This state can change if the incident - # is reviewed again. - FALSE_POSITIVE = 10 - end - end - - # Records an update made to the event. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the update was posted. - # @!attribute [r] title - # @return [::String] - # Output only. Brief title for the event. - # @!attribute [r] description - # @return [::String] - # Output only. Free-form, human-readable description. - # @!attribute [r] symptom - # @return [::String] - # Output only. Symptoms of the event, if available. - # @!attribute [r] workaround - # @return [::String] - # Output only. Workaround steps to remediate the event impact, if available. - class EventUpdate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the locations impacted by the event. - # @!attribute [rw] location_name - # @return [::String] - # Location impacted by the event. Example: `"us-central1"` - class Location - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the Google Cloud product impacted by the event. - # @!attribute [rw] product_name - # @return [::String] - # Google Cloud product impacted by the event. Example: `"Google Cloud SQL"` - # @!attribute [rw] id - # @return [::String] - # Unique identifier for the product. - class Product - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the Google Cloud products and locations impacted by the event. - # @!attribute [rw] product - # @return [::Google::Cloud::ServiceHealth::V1::Product] - # Google Cloud product impacted by the event. - # @!attribute [rw] location - # @return [::Google::Cloud::ServiceHealth::V1::Location] - # Location impacted by the event. - class EventImpact - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents impact to assets at organizational level. It is a read-only view - # and does not allow any modifications. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. Unique name of the organization impact in this - # scope including organization and location using the form - # `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`. - # - # `organization_id` - ID (number) of the organization that contains the - # event. To get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `organization_impact_id` - ID of the [OrganizationImpact - # resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). - # @!attribute [r] events - # @return [::Array<::String>] - # Output only. A list of event names impacting the asset. - # @!attribute [r] asset - # @return [::Google::Cloud::ServiceHealth::V1::Asset] - # Output only. Google Cloud asset possibly impacted by the specified events. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the affected project was last modified. - class OrganizationImpact - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the asset impacted by the events. - # @!attribute [r] asset_name - # @return [::String] - # Output only. Full name of the resource as defined in - # [Resource - # Names](https://cloud.google.com/apis/design/resource_names#full_resource_name). - # @!attribute [r] asset_type - # @return [::String] - # Output only. Type of the asset. Example: - # `"cloudresourcemanager.googleapis.com/Project"` - class Asset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Requests list of events. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value using the form - # `projects/{project_id}/locations/{location}/events`. - # - # `project_id` - ID of the project for which to list service health - # events. - # `location` - The location to get the service health events from. - # To retrieve service health events of category = INCIDENT, use `location` = - # `global`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of events that should be returned. Acceptable - # values are 1 to 100, inclusive. (The default value is 10.) If more results - # are available, the service returns a next_page_token that you can use to - # get the next page of results in subsequent list requests. The service may - # return fewer events than the requested page_size. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # Provide Page token returned by a previous `ListEvents` call to retrieve the - # next page of results. When paginating, all other parameters provided to - # `ListEvents` must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter expression that filters resources listed in the - # response. The expression takes the following forms:
- # * field=value for `category` and `state`
- # * field <, >, <=, or >= value for `update_time`
- # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"`, - # `event_impacts.product.product_name:"Eventarc"` - #
- # - # Multiple filter queries are separated by spaces. Example: - # `category=INCIDENT state=ACTIVE`. - # - # By default, each expression is an AND expression. However, you can include - # AND and OR expressions explicitly. - # - # Filter is supported for the following fields: `category`, `state`, - # `update_time`, `event_impacts.product.product_name` - # @!attribute [rw] view - # @return [::Google::Cloud::ServiceHealth::V1::EventView] - # Optional. Event fields to include in response. - class ListEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to request for listing events. - # @!attribute [r] events - # @return [::Array<::Google::Cloud::ServiceHealth::V1::Event>] - # Output only. List of events. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. The continuation token, used to page through large result - # sets. Provide this value in a subsequent request as page_token to retrieve - # the next page. - # - # If this field is not present, there are no subsequent results. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Gets information about a specific event. - # @!attribute [rw] name - # @return [::String] - # Required. Unique name of the event in this scope including project - # and location using the form - # `projects/{project_id}/locations/{location}/events/{event_id}`. - # - # `project_id` - Project ID of the project that contains the event.
- # `location` - The location to get the service health events from.
- # `event_id` - Event ID to retrieve. - class GetEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Requests list of events that affect an organization. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value using the form - # `organizations/{organization_id}/locations/{location}/organizationEvents`. - # - # `organization_id` - ID (number) of the project that contains the event. To - # get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `location` - The location to get the service health events from. To - # retrieve service health events of category = INCIDENT, use `location` = - # `global`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of events that should be returned. Acceptable - # values are `1` to `100`, inclusive. (The default value is `10`.) If more - # results are available, the service returns a `next_page_token` that you can - # use to get the next page of results in subsequent list requests. The - # service may return fewer events than the requested `page_size`. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # - # Provide Page token returned by a previous `ListOrganizationEvents` call to - # retrieve the next page of results. - # - # When paginating, all other parameters provided to - # `ListOrganizationEvents` must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter expression that filters resources listed in the - # response. The expression takes the following forms: - # - # * field=value for `category` and `state` - # * field <, >, <=, or >= value for `update_time` - # - # Examples: `category=INCIDENT`, `update_time>="2000-01-01T11:30:00-04:00"` - # - # Multiple filter queries are space-separated. Example: - # `category=INCIDENT state=ACTIVE`. - # - # By default, each expression is an AND expression. However, you can include - # AND and OR expressions explicitly. - # - # Filter is supported for the following fields: `category`, `state`, - # `update_time` - # @!attribute [rw] view - # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEventView] - # Optional. OrganizationEvent fields to include in response. - class ListOrganizationEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to request for listing organization events. - # @!attribute [r] organization_events - # @return [::Array<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>] - # Output only. List of organization events affecting an organization. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. The continuation token, used to page through large result - # sets. Provide this value in a subsequent request as `page_token` to - # retrieve the next page. - # - # If this field is not present, there are no subsequent results. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListOrganizationEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Gets information about a specific event affecting an organization. - # @!attribute [rw] name - # @return [::String] - # Required. Unique name of the event in this scope including organization and - # event ID using the form - # `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`. - # - # `organization_id` - ID (number) of the project that contains the event. To - # get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `event_id` - Organization event ID to retrieve. - class GetOrganizationEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Requests list of projects under an organization affected by an event. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value using the form - # `organizations/{organization_id}/locations/{location}/organizationImpacts`. - # - # `organization_id` - ID (number) of the project that contains the event. To - # get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of events that should be returned. Acceptable - # values are `1` to `100`, inclusive. The default value is `10`. - # - # If more results are available, the service returns a - # `next_page_token` that can be used to get the next page of results in - # subsequent list requests. The service may return fewer - # [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) - # than the requested `page_size`. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # - # Provide `page_token` returned by a previous `ListOrganizationImpacts` call - # to retrieve the next page of results. - # - # When paginating, all other parameters provided to `ListOrganizationImpacts` - # must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter expression that filters resources listed in the - # response. The expression is in the form of `field:value` for checking if a - # repeated field contains a value. - # - # Example: - # `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id` - # - # To get your `{organization_id}`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). - # - # Multiple filter queries are separated by spaces. - # - # By default, each expression is an AND expression. However, you can include - # AND and OR expressions explicitly. - # Filter is supported for the following fields: `events`. - class ListOrganizationImpactsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to request for listing projects under an organization affected by an - # event. - # @!attribute [r] organization_impacts - # @return [::Array<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>] - # Output only. List of - # [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) - # for an organization affected by service health events. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. The continuation token, used to page through large result - # sets. Provide this value in a subsequent request as `page_token` to - # retrieve the next page. - # - # If this field is not present, there are no subsequent results. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListOrganizationImpactsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Gets information about an event that affects a project under an organization. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource using the form - # `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`. - # - # `organization_id` - ID (number) of the organization that contains the - # event. To get your `organization_id`, see - # [Getting your organization resource - # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
- # `organization_impact_id` - ID of the [OrganizationImpact - # resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). - class GetOrganizationImpactRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The event fields to include in ListEvents API response. This enum lists all - # possible event views. - module EventView - # Unspecified event view. Default to `EVENT_VIEW_BASIC`. - EVENT_VIEW_UNSPECIFIED = 0 - - # Includes all fields except `updates`. This view is the default for - # ListEvents API. - EVENT_VIEW_BASIC = 1 - - # Includes all event fields. - EVENT_VIEW_FULL = 2 - end - - # The organization event fields to include in ListOrganizationEvents API - # response. This enum lists all possible organization event views. - module OrganizationEventView - # Unspecified event view. Default to `ORGANIZATION_EVENT_VIEW_BASIC`. - ORGANIZATION_EVENT_VIEW_UNSPECIFIED = 0 - - # Includes all organization event fields except `updates`. This view is the - # default for ListOrganizationEvents API. - ORGANIZATION_EVENT_VIEW_BASIC = 1 - - # Includes all organization event fields. - ORGANIZATION_EVENT_VIEW_FULL = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-service_health-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_health-v1/snippets/Gemfile deleted file mode 100644 index 299f6cda7aba..000000000000 --- a/owl-bot-staging/google-cloud-service_health-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-service_health-v1", path: "../" -else - gem "google-cloud-service_health-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-service_health-v1/snippets/service_health/get_event.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_event.rb deleted file mode 100644 index 23479740a8e0..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_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 servicehealth_v1_generated_ServiceHealth_GetEvent_sync] -require "google/cloud/service_health/v1" - -## -# Snippet for the get_event call in the ServiceHealth service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_event. -# -def get_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceHealth::V1::GetEventRequest.new - - # Call the get_event method. - result = client.get_event request - - # The returned object is of type Google::Cloud::ServiceHealth::V1::Event. - p result -end -# [END servicehealth_v1_generated_ServiceHealth_GetEvent_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_event.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_event.rb deleted file mode 100644 index df9646decbc0..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_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 servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_sync] -require "google/cloud/service_health/v1" - -## -# Snippet for the get_organization_event call in the ServiceHealth service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_event. -# -def get_organization_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new - - # Call the get_organization_event method. - result = client.get_organization_event request - - # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationEvent. - p result -end -# [END servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_impact.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_impact.rb deleted file mode 100644 index f0a376741737..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/get_organization_impact.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_sync] -require "google/cloud/service_health/v1" - -## -# Snippet for the get_organization_impact call in the ServiceHealth service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_impact. -# -def get_organization_impact - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new - - # Call the get_organization_impact method. - result = client.get_organization_impact request - - # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationImpact. - p result -end -# [END servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_events.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_events.rb deleted file mode 100644 index 53e9fc3e5458..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_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 servicehealth_v1_generated_ServiceHealth_ListEvents_sync] -require "google/cloud/service_health/v1" - -## -# Snippet for the list_events call in the ServiceHealth service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_events. -# -def list_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceHealth::V1::ListEventsRequest.new - - # Call the list_events method. - result = client.list_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::ServiceHealth::V1::Event. - p item - end -end -# [END servicehealth_v1_generated_ServiceHealth_ListEvents_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_events.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_events.rb deleted file mode 100644 index 9d25933b9164..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_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 servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_sync] -require "google/cloud/service_health/v1" - -## -# Snippet for the list_organization_events call in the ServiceHealth service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_events. -# -def list_organization_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new - - # Call the list_organization_events method. - result = client.list_organization_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::ServiceHealth::V1::OrganizationEvent. - p item - end -end -# [END servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_impacts.rb b/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_impacts.rb deleted file mode 100644 index 2fdbd490e47d..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/snippets/service_health/list_organization_impacts.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 servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_sync] -require "google/cloud/service_health/v1" - -## -# Snippet for the list_organization_impacts call in the ServiceHealth service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_impacts. -# -def list_organization_impacts - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.new - - # Call the list_organization_impacts method. - result = client.list_organization_impacts request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceHealth::V1::OrganizationImpact. - p item - end -end -# [END servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_sync] diff --git a/owl-bot-staging/google-cloud-service_health-v1/snippets/snippet_metadata_google.cloud.servicehealth.v1.json b/owl-bot-staging/google-cloud-service_health-v1/snippets/snippet_metadata_google.cloud.servicehealth.v1.json deleted file mode 100644 index 64879231d0a8..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/snippets/snippet_metadata_google.cloud.servicehealth.v1.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-service_health-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.servicehealth.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "servicehealth_v1_generated_ServiceHealth_ListEvents_sync", - "title": "Snippet for the list_events call in the ServiceHealth service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_events.", - "file": "service_health/list_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_events", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceHealth::V1::ListEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceHealth::V1::ListEventsResponse", - "client": { - "short_name": "ServiceHealth::Client", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" - }, - "method": { - "short_name": "ListEvents", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth.ListEvents", - "service": { - "short_name": "ServiceHealth", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicehealth_v1_generated_ServiceHealth_GetEvent_sync", - "title": "Snippet for the get_event call in the ServiceHealth service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_event.", - "file": "service_health/get_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_event", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceHealth::V1::GetEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceHealth::V1::Event", - "client": { - "short_name": "ServiceHealth::Client", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" - }, - "method": { - "short_name": "GetEvent", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth.GetEvent", - "service": { - "short_name": "ServiceHealth", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_sync", - "title": "Snippet for the list_organization_events call in the ServiceHealth service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_events.", - "file": "service_health/list_organization_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_organization_events", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse", - "client": { - "short_name": "ServiceHealth::Client", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" - }, - "method": { - "short_name": "ListOrganizationEvents", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth.ListOrganizationEvents", - "service": { - "short_name": "ServiceHealth", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_sync", - "title": "Snippet for the get_organization_event call in the ServiceHealth service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_event.", - "file": "service_health/get_organization_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_organization_event", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceHealth::V1::OrganizationEvent", - "client": { - "short_name": "ServiceHealth::Client", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" - }, - "method": { - "short_name": "GetOrganizationEvent", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth.GetOrganizationEvent", - "service": { - "short_name": "ServiceHealth", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_sync", - "title": "Snippet for the list_organization_impacts call in the ServiceHealth service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_impacts.", - "file": "service_health/list_organization_impacts.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_organization_impacts", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#list_organization_impacts", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse", - "client": { - "short_name": "ServiceHealth::Client", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" - }, - "method": { - "short_name": "ListOrganizationImpacts", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth.ListOrganizationImpacts", - "service": { - "short_name": "ServiceHealth", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_sync", - "title": "Snippet for the get_organization_impact call in the ServiceHealth service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_impact.", - "file": "service_health/get_organization_impact.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_organization_impact", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client#get_organization_impact", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceHealth::V1::OrganizationImpact", - "client": { - "short_name": "ServiceHealth::Client", - "full_name": "::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client" - }, - "method": { - "short_name": "GetOrganizationImpact", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth.GetOrganizationImpact", - "service": { - "short_name": "ServiceHealth", - "full_name": "google.cloud.servicehealth.v1.ServiceHealth" - } - } - }, - "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-service_health-v1/test/google/cloud/service_health/v1/service_health_paths_test.rb b/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_paths_test.rb deleted file mode 100644 index 230902f0df17..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/service_health/v1/service_health" - -class ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.event_path project: "value0", location: "value1", event: "value2" - assert_equal "projects/value0/locations/value1/events/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::ServiceHealth::V1::ServiceHealth::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_event_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_event_path organization: "value0", location: "value1", event: "value2" - assert_equal "organizations/value0/locations/value1/organizationEvents/value2", path - end - end - - def test_organization_impact_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_impact_path organization: "value0", location: "value1", organization_impact: "value2" - assert_equal "organizations/value0/locations/value1/organizationImpacts/value2", 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::ServiceHealth::V1::ServiceHealth::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-service_health-v1/test/google/cloud/service_health/v1/service_health_rest_test.rb b/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_rest_test.rb deleted file mode 100644 index 81636a4468ad..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_rest_test.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 "helper" -require "gapic/rest" -require "google/cloud/servicehealth/v1/event_service_pb" -require "google/cloud/service_health/v1/service_health/rest" - - -class ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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_events - # Create test objects. - client_result = ::Google::Cloud::ServiceHealth::V1::ListEventsResponse.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" - view = :EVENT_VIEW_UNSPECIFIED - - list_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::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_list_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_events_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_events ::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_events(::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_events_client_stub.call_count - end - end - end - - def test_get_event - # Create test objects. - client_result = ::Google::Cloud::ServiceHealth::V1::Event.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_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::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_get_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_event_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_event({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_event name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_event ::Google::Cloud::ServiceHealth::V1::GetEventRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_event({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_event(::Google::Cloud::ServiceHealth::V1::GetEventRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_event_client_stub.call_count - end - end - end - - def test_list_organization_events - # Create test objects. - client_result = ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse.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" - view = :ORGANIZATION_EVENT_VIEW_UNSPECIFIED - - list_organization_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::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_list_organization_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_organization_events_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_organization_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_organization_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_organization_events ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_organization_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_organization_events(::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_organization_events_client_stub.call_count - end - end - end - - def test_get_organization_event - # Create test objects. - client_result = ::Google::Cloud::ServiceHealth::V1::OrganizationEvent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_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::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_get_organization_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_organization_event_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_organization_event({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_organization_event name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_organization_event ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_organization_event({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_organization_event(::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_organization_event_client_stub.call_count - end - end - end - - def test_list_organization_impacts - # Create test objects. - client_result = ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse.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_organization_impacts_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_list_organization_impacts_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_organization_impacts_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_organization_impacts({ 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_organization_impacts 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_organization_impacts ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.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_organization_impacts({ 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_organization_impacts(::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.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_organization_impacts_client_stub.call_count - end - end - end - - def test_get_organization_impact - # Create test objects. - client_result = ::Google::Cloud::ServiceHealth::V1::OrganizationImpact.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_impact_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::ServiceStub.stub :transcode_get_organization_impact_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_organization_impact_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_organization_impact({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_organization_impact name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_organization_impact ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_organization_impact({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_organization_impact(::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_organization_impact_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::ServiceHealth::V1::ServiceHealth::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::ServiceHealth::V1::ServiceHealth::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_test.rb b/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_test.rb deleted file mode 100644 index 9eeb54f0d278..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/test/google/cloud/service_health/v1/service_health_test.rb +++ /dev/null @@ -1,489 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/servicehealth/v1/event_service_pb" -require "google/cloud/service_health/v1/service_health" - -class ::Google::Cloud::ServiceHealth::V1::ServiceHealth::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_events - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceHealth::V1::ListEventsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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" - view = :EVENT_VIEW_UNSPECIFIED - - list_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_events, name - assert_kind_of ::Google::Cloud::ServiceHealth::V1::ListEventsRequest, 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 :EVENT_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_events_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_events ::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_events(::Google::Cloud::ServiceHealth::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_events_client_stub.call_rpc_count - end - end - - def test_get_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceHealth::V1::Event.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_event, name - assert_kind_of ::Google::Cloud::ServiceHealth::V1::GetEventRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_event_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_event({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_event name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_event ::Google::Cloud::ServiceHealth::V1::GetEventRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_event({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_event(::Google::Cloud::ServiceHealth::V1::GetEventRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_event_client_stub.call_rpc_count - end - end - - def test_list_organization_events - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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" - view = :ORGANIZATION_EVENT_VIEW_UNSPECIFIED - - list_organization_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_organization_events, name - assert_kind_of ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest, 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 :ORGANIZATION_EVENT_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_organization_events_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_organization_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_organization_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_organization_events ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_organization_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_organization_events(::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, view: view), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_organization_events_client_stub.call_rpc_count - end - end - - def test_get_organization_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceHealth::V1::OrganizationEvent.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_organization_event, name - assert_kind_of ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_organization_event_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_organization_event({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_organization_event name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_organization_event ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_organization_event({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_organization_event(::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_organization_event_client_stub.call_rpc_count - end - end - - def test_list_organization_impacts - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_organization_impacts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_organization_impacts, name - assert_kind_of ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest, 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_organization_impacts_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_organization_impacts({ 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_organization_impacts 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_organization_impacts ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.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_organization_impacts({ 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_organization_impacts(::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.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_organization_impacts_client_stub.call_rpc_count - end - end - - def test_get_organization_impact - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceHealth::V1::OrganizationImpact.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_impact_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_organization_impact, name - assert_kind_of ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_organization_impact_client_stub do - # Create client - client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_organization_impact({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_organization_impact name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_organization_impact ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_organization_impact({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_organization_impact(::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_organization_impact_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceHealth::V1::ServiceHealth::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::ServiceHealth::V1::ServiceHealth::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::ServiceHealth::V1::ServiceHealth::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-service_health-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_health-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-service_health-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_management-v1/.gitignore b/owl-bot-staging/google-cloud-service_management-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-service_management-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_management-v1/.repo-metadata.json deleted file mode 100644 index 966c229fd1cf..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "servicemanagement.googleapis.com", - "api_shortname": "servicemanagement", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_management-v1/latest", - "distribution_name": "google-cloud-service_management-v1", - "is_cloud": true, - "language": "ruby", - "name": "servicemanagement", - "name_pretty": "Service Management V1 API", - "product_documentation": "https://cloud.google.com/service-infrastructure/docs/overview/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers. Note that google-cloud-service_management-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_management instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SERVICE_MANAGEMENT", - "ruby-cloud-product-url": "https://cloud.google.com/service-infrastructure/docs/overview/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-service_management-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_management-v1/.rubocop.yml deleted file mode 100644 index af3b43f29aeb..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-service_management-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-service_management-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_management-v1/.toys.rb b/owl-bot-staging/google-cloud-service_management-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/.yardopts b/owl-bot-staging/google-cloud-service_management-v1/.yardopts deleted file mode 100644 index 50c42b3fcd2e..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Service Management V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-service_management-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_management-v1/AUTHENTICATION.md deleted file mode 100644 index cf5a3d474532..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-service_management-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-service_management-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/service_management/v1" - -client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/service_management/v1" - -::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::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-service_management-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/service_management/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::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-service_management-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_management-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-service_management-v1/Gemfile b/owl-bot-staging/google-cloud-service_management-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_management-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_management-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-service_management-v1/README.md b/owl-bot-staging/google-cloud-service_management-v1/README.md deleted file mode 100644 index aab331fb4c41..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Service Management V1 API - -Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Service Management V1 API. Most users should consider using -the main client gem, -[google-cloud-service_management](https://rubygems.org/gems/google-cloud-service_management). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-service_management-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/servicemanagement.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/service_management/v1" - -client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -request = ::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new # (request fields as keyword arguments...) -response = client.list_services request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_management-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/service-infrastructure/docs/overview/) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/service_management/v1" -require "logger" - -client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::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-service_management`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-service_management-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-service_management`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-service_management-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-service_management-v1/Rakefile b/owl-bot-staging/google-cloud-service_management-v1/Rakefile deleted file mode 100644 index 2de06523c37d..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-service_management-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SERVICE_MANAGEMENT_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SERVICE_MANAGEMENT_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SERVICE_MANAGEMENT_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 SERVICE_MANAGEMENT_TEST_PROJECT=test123 SERVICE_MANAGEMENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/service_management/v1/service_manager/credentials" - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SERVICE_MANAGEMENT_PROJECT"] = project - ENV["SERVICE_MANAGEMENT_TEST_PROJECT"] = project - ENV["SERVICE_MANAGEMENT_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-service_management-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-service_management-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-service_management-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-service_management-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-service_management-v1" - header "google-cloud-service_management-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-service_management-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-service_management-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-service_management-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-service_management-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_management-v1/gapic_metadata.json deleted file mode 100644 index 329aa618c796..000000000000 --- a/owl-bot-staging/google-cloud-service_management-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.api.servicemanagement.v1", - "libraryPackage": "::Google::Cloud::ServiceManagement::V1", - "services": { - "ServiceManager": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client", - "rpcs": { - "ListServices": { - "methods": [ - "list_services" - ] - }, - "GetService": { - "methods": [ - "get_service" - ] - }, - "CreateService": { - "methods": [ - "create_service" - ] - }, - "DeleteService": { - "methods": [ - "delete_service" - ] - }, - "UndeleteService": { - "methods": [ - "undelete_service" - ] - }, - "ListServiceConfigs": { - "methods": [ - "list_service_configs" - ] - }, - "GetServiceConfig": { - "methods": [ - "get_service_config" - ] - }, - "CreateServiceConfig": { - "methods": [ - "create_service_config" - ] - }, - "SubmitConfigSource": { - "methods": [ - "submit_config_source" - ] - }, - "ListServiceRollouts": { - "methods": [ - "list_service_rollouts" - ] - }, - "GetServiceRollout": { - "methods": [ - "get_service_rollout" - ] - }, - "CreateServiceRollout": { - "methods": [ - "create_service_rollout" - ] - }, - "GenerateConfigReport": { - "methods": [ - "generate_config_report" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-service_management-v1/google-cloud-service_management-v1.gemspec b/owl-bot-staging/google-cloud-service_management-v1/google-cloud-service_management-v1.gemspec deleted file mode 100644 index 41e459073fea..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/google-cloud-service_management-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/service_management/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-service_management-v1" - gem.version = Google::Cloud::ServiceManagement::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers. Note that google-cloud-service_management-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_management instead. See the readme for more details." - gem.summary = "Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-iam-v1", "~> 1.3" -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google-cloud-service_management-v1.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google-cloud-service_management-v1.rb deleted file mode 100644 index 49cad33ce88e..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google-cloud-service_management-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/service_management/v1" diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/resources_pb.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/resources_pb.rb deleted file mode 100644 index 314a07cea044..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/resources_pb.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicemanagement/v1/resources.proto - -require 'google/protobuf' - -require 'google/api/config_change_pb' -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/api/servicemanagement/v1/resources.proto\x12\x1fgoogle.api.servicemanagement.v1\x1a\x1egoogle/api/config_change.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"C\n\x0eManagedService\x12\x14\n\x0cservice_name\x18\x02 \x01(\t\x12\x1b\n\x13producer_project_id\x18\x03 \x01(\t\"\x91\x03\n\x11OperationMetadata\x12\x16\n\x0eresource_names\x18\x01 \x03(\t\x12\x46\n\x05steps\x18\x02 \x03(\x0b\x32\x37.google.api.servicemanagement.v1.OperationMetadata.Step\x12\x1b\n\x13progress_percentage\x18\x03 \x01(\x05\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x66\n\x04Step\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12I\n\x06status\x18\x04 \x01(\x0e\x32\x39.google.api.servicemanagement.v1.OperationMetadata.Status\"g\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x08\n\x04\x44ONE\x10\x01\x12\x0f\n\x0bNOT_STARTED\x10\x02\x12\x0f\n\x0bIN_PROGRESS\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\x8f\x01\n\nDiagnostic\x12\x10\n\x08location\x18\x01 \x01(\t\x12>\n\x04kind\x18\x02 \x01(\x0e\x32\x30.google.api.servicemanagement.v1.Diagnostic.Kind\x12\x0f\n\x07message\x18\x03 \x01(\t\"\x1e\n\x04Kind\x12\x0b\n\x07WARNING\x10\x00\x12\t\n\x05\x45RROR\x10\x01\"V\n\x0c\x43onfigSource\x12\n\n\x02id\x18\x05 \x01(\t\x12:\n\x05\x66iles\x18\x02 \x03(\x0b\x32+.google.api.servicemanagement.v1.ConfigFile\"\x95\x02\n\nConfigFile\x12\x11\n\tfile_path\x18\x01 \x01(\t\x12\x15\n\rfile_contents\x18\x03 \x01(\x0c\x12G\n\tfile_type\x18\x04 \x01(\x0e\x32\x34.google.api.servicemanagement.v1.ConfigFile.FileType\"\x93\x01\n\x08\x46ileType\x12\x19\n\x15\x46ILE_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13SERVICE_CONFIG_YAML\x10\x01\x12\x11\n\rOPEN_API_JSON\x10\x02\x12\x11\n\rOPEN_API_YAML\x10\x03\x12\x1d\n\x19\x46ILE_DESCRIPTOR_SET_PROTO\x10\x04\x12\x0e\n\nPROTO_FILE\x10\x06\"\x19\n\tConfigRef\x12\x0c\n\x04name\x18\x01 \x01(\t\"@\n\x0c\x43hangeReport\x12\x30\n\x0e\x63onfig_changes\x18\x01 \x03(\x0b\x32\x18.google.api.ConfigChange\"\xf9\x05\n\x07Rollout\x12\x17\n\nrollout_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\ncreated_by\x18\x03 \x01(\t\x12\x46\n\x06status\x18\x04 \x01(\x0e\x32\x36.google.api.servicemanagement.v1.Rollout.RolloutStatus\x12\x63\n\x18traffic_percent_strategy\x18\x05 \x01(\x0b\x32?.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategyH\x00\x12\x62\n\x17\x64\x65lete_service_strategy\x18\xc8\x01 \x01(\x0b\x32>.google.api.servicemanagement.v1.Rollout.DeleteServiceStrategyH\x00\x12\x14\n\x0cservice_name\x18\x08 \x01(\t\x1a\xb3\x01\n\x16TrafficPercentStrategy\x12\x65\n\x0bpercentages\x18\x01 \x03(\x0b\x32P.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.PercentagesEntry\x1a\x32\n\x10PercentagesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x17\n\x15\x44\x65leteServiceStrategy\"\x8d\x01\n\rRolloutStatus\x12\x1e\n\x1aROLLOUT_STATUS_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\x0b\n\x07SUCCESS\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0b\n\x07PENDING\x10\x05\x12\x16\n\x12\x46\x41ILED_ROLLED_BACK\x10\x06\x42\n\n\x08strategyB\x82\x02\n#com.google.api.servicemanagement.v1B\x0eResourcesProtoP\x01ZScloud.google.com/go/servicemanagement/apiv1/servicemanagementpb;servicemanagementpb\xa2\x02\x04GASM\xaa\x02!Google.Cloud.ServiceManagement.V1\xca\x02!Google\\Cloud\\ServiceManagement\\V1\xea\x02$Google::Cloud::ServiceManagement::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceManagement - module V1 - ManagedService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ManagedService").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.OperationMetadata").msgclass - OperationMetadata::Step = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.OperationMetadata.Step").msgclass - OperationMetadata::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.OperationMetadata.Status").enummodule - Diagnostic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Diagnostic").msgclass - Diagnostic::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Diagnostic.Kind").enummodule - ConfigSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ConfigSource").msgclass - ConfigFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ConfigFile").msgclass - ConfigFile::FileType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ConfigFile.FileType").enummodule - ConfigRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ConfigRef").msgclass - ChangeReport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ChangeReport").msgclass - Rollout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Rollout").msgclass - Rollout::TrafficPercentStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy").msgclass - Rollout::DeleteServiceStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Rollout.DeleteServiceStrategy").msgclass - Rollout::RolloutStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.Rollout.RolloutStatus").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_pb.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_pb.rb deleted file mode 100644 index 6e78a42d7363..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/servicemanagement/v1/servicemanager.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/service_pb' -require 'google/api/servicemanagement/v1/resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/any_pb' -require 'google/protobuf/empty_pb' - - -descriptor_data = "\n4google/api/servicemanagement/v1/servicemanager.proto\x12\x1fgoogle.api.servicemanagement.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/api/service.proto\x1a/google/api/servicemanagement/v1/resources.proto\x1a#google/longrunning/operations.proto\x1a\x19google/protobuf/any.proto\x1a\x1bgoogle/protobuf/empty.proto\"r\n\x13ListServicesRequest\x12\x1b\n\x13producer_project_id\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\x12\x17\n\x0b\x63onsumer_id\x18\x07 \x01(\tB\x02\x18\x01\"r\n\x14ListServicesResponse\x12\x41\n\x08services\x18\x01 \x03(\x0b\x32/.google.api.servicemanagement.v1.ManagedService\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\".\n\x11GetServiceRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"]\n\x14\x43reateServiceRequest\x12\x45\n\x07service\x18\x01 \x01(\x0b\x32/.google.api.servicemanagement.v1.ManagedServiceB\x03\xe0\x41\x02\"1\n\x14\x44\x65leteServiceRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"3\n\x16UndeleteServiceRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"[\n\x17UndeleteServiceResponse\x12@\n\x07service\x18\x01 \x01(\x0b\x32/.google.api.servicemanagement.v1.ManagedService\"\xc2\x01\n\x17GetServiceConfigRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tconfig_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Q\n\x04view\x18\x03 \x01(\x0e\x32\x43.google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView\"!\n\nConfigView\x12\t\n\x05\x42\x41SIC\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\"]\n\x19ListServiceConfigsRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"c\n\x1aListServiceConfigsResponse\x12,\n\x0fservice_configs\x18\x01 \x03(\x0b\x32\x13.google.api.Service\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"i\n\x1a\x43reateServiceConfigRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x30\n\x0eservice_config\x18\x02 \x01(\x0b\x32\x13.google.api.ServiceB\x03\xe0\x41\x02\"\x9d\x01\n\x19SubmitConfigSourceRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12I\n\rconfig_source\x18\x02 \x01(\x0b\x32-.google.api.servicemanagement.v1.ConfigSourceB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"I\n\x1aSubmitConfigSourceResponse\x12+\n\x0eservice_config\x18\x01 \x01(\x0b\x32\x13.google.api.Service\"x\n\x1b\x43reateServiceRolloutRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12>\n\x07rollout\x18\x02 \x01(\x0b\x32(.google.api.servicemanagement.v1.RolloutB\x03\xe0\x41\x02\"s\n\x1aListServiceRolloutsRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x02\"r\n\x1bListServiceRolloutsResponse\x12:\n\x08rollouts\x18\x01 \x03(\x0b\x32(.google.api.servicemanagement.v1.Rollout\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x18GetServiceRolloutRequest\x12\x19\n\x0cservice_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrollout_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x17\n\x15\x45nableServiceResponse\"{\n\x1bGenerateConfigReportRequest\x12-\n\nnew_config\x18\x01 \x01(\x0b\x32\x14.google.protobuf.AnyB\x03\xe0\x41\x02\x12-\n\nold_config\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyB\x03\xe0\x41\x01\"\xc9\x01\n\x1cGenerateConfigReportResponse\x12\x14\n\x0cservice_name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x45\n\x0e\x63hange_reports\x18\x03 \x03(\x0b\x32-.google.api.servicemanagement.v1.ChangeReport\x12@\n\x0b\x64iagnostics\x18\x04 \x03(\x0b\x32+.google.api.servicemanagement.v1.Diagnostic2\xc8\x19\n\x0eServiceManager\x12\xb3\x01\n\x0cListServices\x12\x34.google.api.servicemanagement.v1.ListServicesRequest\x1a\x35.google.api.servicemanagement.v1.ListServicesResponse\"6\xda\x41\x1fproducer_project_id,consumer_id\x82\xd3\xe4\x93\x02\x0e\x12\x0c/v1/services\x12\xa5\x01\n\nGetService\x12\x32.google.api.servicemanagement.v1.GetServiceRequest\x1a/.google.api.servicemanagement.v1.ManagedService\"2\xda\x41\x0cservice_name\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/services/{service_name}\x12\xf5\x01\n\rCreateService\x12\x35.google.api.servicemanagement.v1.CreateServiceRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41\x63\n.google.api.servicemanagement.v1.ManagedService\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41\x07service\x82\xd3\xe4\x93\x02\x17\"\x0c/v1/services:\x07service\x12\xe6\x01\n\rDeleteService\x12\x35.google.api.servicemanagement.v1.DeleteServiceRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41J\n\x15google.protobuf.Empty\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41\x0cservice_name\x82\xd3\xe4\x93\x02\x1d*\x1b/v1/services/{service_name}\x12\x96\x02\n\x0fUndeleteService\x12\x37.google.api.servicemanagement.v1.UndeleteServiceRequest\x1a\x1d.google.longrunning.Operation\"\xaa\x01\xca\x41l\n7google.api.servicemanagement.v1.UndeleteServiceResponse\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41\x0cservice_name\x82\xd3\xe4\x93\x02&\"$/v1/services/{service_name}:undelete\x12\xc9\x01\n\x12ListServiceConfigs\x12:.google.api.servicemanagement.v1.ListServiceConfigsRequest\x1a;.google.api.servicemanagement.v1.ListServiceConfigsResponse\":\xda\x41\x0cservice_name\x82\xd3\xe4\x93\x02%\x12#/v1/services/{service_name}/configs\x12\xde\x01\n\x10GetServiceConfig\x12\x38.google.api.servicemanagement.v1.GetServiceConfigRequest\x1a\x13.google.api.Service\"{\xda\x41\x1bservice_name,config_id,view\x82\xd3\xe4\x93\x02W\x12//v1/services/{service_name}/configs/{config_id}Z$\x12\"/v1/services/{service_name}/config\x12\xc2\x01\n\x13\x43reateServiceConfig\x12;.google.api.servicemanagement.v1.CreateServiceConfigRequest\x1a\x13.google.api.Service\"Y\xda\x41\x1bservice_name,service_config\x82\xd3\xe4\x93\x02\x35\"#/v1/services/{service_name}/configs:\x0eservice_config\x12\xc4\x02\n\x12SubmitConfigSource\x12:.google.api.servicemanagement.v1.SubmitConfigSourceRequest\x1a\x1d.google.longrunning.Operation\"\xd2\x01\xca\x41o\n:google.api.servicemanagement.v1.SubmitConfigSourceResponse\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41(service_name,config_source,validate_only\x82\xd3\xe4\x93\x02/\"*/v1/services/{service_name}/configs:submit:\x01*\x12\xd4\x01\n\x13ListServiceRollouts\x12;.google.api.servicemanagement.v1.ListServiceRolloutsRequest\x1a<.google.api.servicemanagement.v1.ListServiceRolloutsResponse\"B\xda\x41\x13service_name,filter\x82\xd3\xe4\x93\x02&\x12$/v1/services/{service_name}/rollouts\x12\xcd\x01\n\x11GetServiceRollout\x12\x39.google.api.servicemanagement.v1.GetServiceRolloutRequest\x1a(.google.api.servicemanagement.v1.Rollout\"S\xda\x41\x17service_name,rollout_id\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/services/{service_name}/rollouts/{rollout_id}\x12\xa1\x02\n\x14\x43reateServiceRollout\x12<.google.api.servicemanagement.v1.CreateServiceRolloutRequest\x1a\x1d.google.longrunning.Operation\"\xab\x01\xca\x41\\\n\'google.api.servicemanagement.v1.Rollout\x12\x31google.api.servicemanagement.v1.OperationMetadata\xda\x41\x14service_name,rollout\x82\xd3\xe4\x93\x02/\"$/v1/services/{service_name}/rollouts:\x07rollout\x12\xd9\x01\n\x14GenerateConfigReport\x12<.google.api.servicemanagement.v1.GenerateConfigReportRequest\x1a=.google.api.servicemanagement.v1.GenerateConfigReportResponse\"D\xda\x41\x15new_config,old_config\x82\xd3\xe4\x93\x02&\"!/v1/services:generateConfigReport:\x01*\x1a\xfd\x01\xca\x41 servicemanagement.googleapis.com\xd2\x41\xd6\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/service.management,https://www.googleapis.com/auth/service.management.readonlyB\x87\x02\n#com.google.api.servicemanagement.v1B\x13ServiceManagerProtoP\x01ZScloud.google.com/go/servicemanagement/apiv1/servicemanagementpb;servicemanagementpb\xa2\x02\x04GASM\xaa\x02!Google.Cloud.ServiceManagement.V1\xca\x02!Google\\Cloud\\ServiceManagement\\V1\xea\x02$Google::Cloud::ServiceManagement::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceManagement - module V1 - ListServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServicesRequest").msgclass - ListServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServicesResponse").msgclass - GetServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GetServiceRequest").msgclass - CreateServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.CreateServiceRequest").msgclass - DeleteServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.DeleteServiceRequest").msgclass - UndeleteServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.UndeleteServiceRequest").msgclass - UndeleteServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.UndeleteServiceResponse").msgclass - GetServiceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GetServiceConfigRequest").msgclass - GetServiceConfigRequest::ConfigView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GetServiceConfigRequest.ConfigView").enummodule - ListServiceConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceConfigsRequest").msgclass - ListServiceConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceConfigsResponse").msgclass - CreateServiceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.CreateServiceConfigRequest").msgclass - SubmitConfigSourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.SubmitConfigSourceRequest").msgclass - SubmitConfigSourceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.SubmitConfigSourceResponse").msgclass - CreateServiceRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.CreateServiceRolloutRequest").msgclass - ListServiceRolloutsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceRolloutsRequest").msgclass - ListServiceRolloutsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.ListServiceRolloutsResponse").msgclass - GetServiceRolloutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GetServiceRolloutRequest").msgclass - EnableServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.EnableServiceResponse").msgclass - GenerateConfigReportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GenerateConfigReportRequest").msgclass - GenerateConfigReportResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.servicemanagement.v1.GenerateConfigReportResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_services_pb.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_services_pb.rb deleted file mode 100644 index 12d089c4f77e..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/api/servicemanagement/v1/servicemanager_services_pb.rb +++ /dev/null @@ -1,143 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/api/servicemanagement/v1/servicemanager.proto for package 'Google.Cloud.ServiceManagement.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/api/servicemanagement/v1/servicemanager_pb' - -module Google - module Cloud - module ServiceManagement - module V1 - module ServiceManager - # [Google Service Management - # API](https://cloud.google.com/service-infrastructure/docs/overview) - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.api.servicemanagement.v1.ServiceManager' - - # Lists managed services. - # - # Returns all public services. For authenticated users, also returns all - # services the calling user has "servicemanagement.services.get" permission - # for. - rpc :ListServices, ::Google::Cloud::ServiceManagement::V1::ListServicesRequest, ::Google::Cloud::ServiceManagement::V1::ListServicesResponse - # Gets a managed service. Authentication is required unless the service is - # public. - rpc :GetService, ::Google::Cloud::ServiceManagement::V1::GetServiceRequest, ::Google::Cloud::ServiceManagement::V1::ManagedService - # Creates a new managed service. - # - # A managed service is immutable, and is subject to mandatory 30-day - # data retention. You cannot move a service or recreate it within 30 days - # after deletion. - # - # One producer project can own no more than 500 services. For security and - # reliability purposes, a production service should be hosted in a - # dedicated producer project. - # - # Operation - rpc :CreateService, ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, ::Google::Longrunning::Operation - # Deletes a managed service. This method will change the service to the - # `Soft-Delete` state for 30 days. Within this period, service producers may - # call - # [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] - # to restore the service. After 30 days, the service will be permanently - # deleted. - # - # Operation - rpc :DeleteService, ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, ::Google::Longrunning::Operation - # Revives a previously deleted managed service. The method restores the - # service using the configuration at the time the service was deleted. - # The target service must exist and must have been deleted within the - # last 30 days. - # - # Operation - rpc :UndeleteService, ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, ::Google::Longrunning::Operation - # Lists the history of the service configuration for a managed service, - # from the newest to the oldest. - rpc :ListServiceConfigs, ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse - # Gets a service configuration (version) for a managed service. - rpc :GetServiceConfig, ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, ::Google::Api::Service - # Creates a new service configuration (version) for a managed service. - # This method only stores the service configuration. To roll out the service - # configuration to backend systems please call - # [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. - # - # Only the 100 most recent service configurations and ones referenced by - # existing rollouts are kept for each service. The rest will be deleted - # eventually. - rpc :CreateServiceConfig, ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, ::Google::Api::Service - # Creates a new service configuration (version) for a managed service based - # on - # user-supplied configuration source files (for example: OpenAPI - # Specification). This method stores the source configurations as well as the - # generated service configuration. To rollout the service configuration to - # other services, - # please call - # [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. - # - # Only the 100 most recent configuration sources and ones referenced by - # existing service configurtions are kept for each service. The rest will be - # deleted eventually. - # - # Operation - rpc :SubmitConfigSource, ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, ::Google::Longrunning::Operation - # Lists the history of the service configuration rollouts for a managed - # service, from the newest to the oldest. - rpc :ListServiceRollouts, ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse - # Gets a service configuration - # [rollout][google.api.servicemanagement.v1.Rollout]. - rpc :GetServiceRollout, ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, ::Google::Cloud::ServiceManagement::V1::Rollout - # Creates a new service configuration rollout. Based on rollout, the - # Google Service Management will roll out the service configurations to - # different backend services. For example, the logging configuration will be - # pushed to Google Cloud Logging. - # - # Please note that any previous pending and running Rollouts and associated - # Operations will be automatically cancelled so that the latest Rollout will - # not be blocked by previous Rollouts. - # - # Only the 100 most recent (in any state) and the last 10 successful (if not - # already part of the set of 100 most recent) rollouts are kept for each - # service. The rest will be deleted eventually. - # - # Operation - rpc :CreateServiceRollout, ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, ::Google::Longrunning::Operation - # Generates and returns a report (errors, warnings and changes from - # existing configurations) associated with - # GenerateConfigReportRequest.new_value - # - # If GenerateConfigReportRequest.old_value is specified, - # GenerateConfigReportRequest will contain a single ChangeReport based on the - # comparison between GenerateConfigReportRequest.new_value and - # GenerateConfigReportRequest.old_value. - # If GenerateConfigReportRequest.old_value is not specified, this method - # will compare GenerateConfigReportRequest.new_value with the last pushed - # service configuration. - rpc :GenerateConfigReport, ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1.rb deleted file mode 100644 index 741429ff6b3d..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/service_management/v1/service_manager" -require "google/cloud/service_management/v1/version" - -module Google - module Cloud - module ServiceManagement - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/service_management/v1" - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/service_management/v1" - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/service_management/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/bindings_override.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/bindings_override.rb deleted file mode 100644 index 8f225f8662b6..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/bindings_override.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! - -require "gapic/rest" - -module Google - module Cloud - module ServiceManagement - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/service_management/v1/rest" - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceManagement"] - parent_config = while namespace.any? - parent_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.iam.v1.IAMPolicy.GetIamPolicy"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^services/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^services/[^/]+/consumers/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^services/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^services/[^/]+/consumers/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^services/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^services/[^/]+/consumers/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/rest.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/rest.rb deleted file mode 100644 index 76294f210607..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/service_management/v1/service_manager/rest" -require "google/cloud/service_management/v1/bindings_override" -require "google/cloud/service_management/v1/version" - -module Google - module Cloud - module ServiceManagement - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/service_management/v1/rest" - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager.rb deleted file mode 100644 index 675475e70222..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager.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/service_management/v1/version" - -require "google/cloud/service_management/v1/service_manager/credentials" -require "google/cloud/service_management/v1/service_manager/operations" -require "google/cloud/service_management/v1/service_manager/client" -require "google/cloud/service_management/v1/service_manager/rest" - -module Google - module Cloud - module ServiceManagement - module V1 - ## - # [Google Service Management - # API](https://cloud.google.com/service-infrastructure/docs/overview) - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/service_management/v1/service_manager" - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/service_management/v1/service_manager/rest" - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - module ServiceManager - end - end - end - end -end - -helper_path = ::File.join __dir__, "service_manager", "helpers.rb" -require "google/cloud/service_management/v1/service_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb deleted file mode 100644 index 213d744ba0b7..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb +++ /dev/null @@ -1,1809 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/api/servicemanagement/v1/servicemanager_pb" -require "google/iam/v1" - -module Google - module Cloud - module ServiceManagement - module V1 - module ServiceManager - ## - # Client for the ServiceManager service. - # - # [Google Service Management - # API](https://cloud.google.com/service-infrastructure/docs/overview) - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicemanagement.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :service_manager_stub - - ## - # Configure the ServiceManager Client class. - # - # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServiceManager clients - # ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceManagement", "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 = 10.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServiceManager Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @service_manager_stub.universe_domain - end - - ## - # Create a new ServiceManager client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServiceManager 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/api/servicemanagement/v1/servicemanager_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 - - @service_manager_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ServiceManagement::V1::ServiceManager::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 - ) - - @service_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 - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @service_manager_stub.endpoint - config.universe_domain = @service_manager_stub.universe_domain - config.logger = @service_manager_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ServiceManagement::V1::ServiceManager::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @service_manager_stub.logger - end - - # Service calls - - ## - # Lists managed services. - # - # Returns all public services. For authenticated users, also returns all - # services the calling user has "servicemanagement.services.get" permission - # for. - # - # @overload list_services(request, options = nil) - # Pass arguments to `list_services` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::ListServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::ListServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_services(producer_project_id: nil, page_size: nil, page_token: nil, consumer_id: nil) - # Pass arguments to `list_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param producer_project_id [::String] - # Include services produced by the specified project. - # @param page_size [::Integer] - # The max number of items to include in the response list. Page size is 50 - # if not specified. Maximum value is 500. - # @param page_token [::String] - # Token identifying which result to start with; returned by a previous list - # call. - # @param consumer_id [::String] - # Include services consumed by the specified consumer. - # - # The Google Service Management implementation accepts the following - # forms: - # - project: - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::ListServicesRequest.new - # - # # Call the list_services method. - # result = client.list_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceManagement::V1::ManagedService. - # p item - # end - # - def list_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_services.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :list_services, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @service_manager_stub, :list_services, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a managed service. Authentication is required unless the service is - # public. - # - # @overload get_service(request, options = nil) - # Pass arguments to `get_service` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::GetServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_service(service_name: nil) - # Pass arguments to `get_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the `ServiceManager` overview for - # naming requirements. For example: `example.googleapis.com`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceManagement::V1::ManagedService] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::GetServiceRequest.new - # - # # Call the get_service method. - # result = client.get_service request - # - # # The returned object is of type Google::Cloud::ServiceManagement::V1::ManagedService. - # p result - # - def get_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :get_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new managed service. - # - # A managed service is immutable, and is subject to mandatory 30-day - # data retention. You cannot move a service or recreate it within 30 days - # after deletion. - # - # One producer project can own no more than 500 services. For security and - # reliability purposes, a production service should be hosted in a - # dedicated producer project. - # - # Operation - # - # @overload create_service(request, options = nil) - # Pass arguments to `create_service` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::CreateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_service(service: nil) - # Pass arguments to `create_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service [::Google::Cloud::ServiceManagement::V1::ManagedService, ::Hash] - # Required. Initial values for the service 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/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new - # - # # Call the create_service method. - # result = client.create_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest - - # Converts hash and nil to 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :create_service, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 managed service. This method will change the service to the - # `Soft-Delete` state for 30 days. Within this period, service producers may - # call - # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service UndeleteService} - # to restore the service. After 30 days, the service will be permanently - # deleted. - # - # Operation - # - # @overload delete_service(request, options = nil) - # Pass arguments to `delete_service` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_service(service_name: nil) - # Pass arguments to `delete_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new - # - # # Call the delete_service method. - # result = client.delete_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :delete_service, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Revives a previously deleted managed service. The method restores the - # service using the configuration at the time the service was deleted. - # The target service must exist and must have been deleted within the - # last 30 days. - # - # Operation - # - # @overload undelete_service(request, options = nil) - # Pass arguments to `undelete_service` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_service(service_name: nil) - # Pass arguments to `undelete_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new - # - # # Call the undelete_service method. - # result = client.undelete_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.undelete_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.undelete_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :undelete_service, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 the history of the service configuration for a managed service, - # from the newest to the oldest. - # - # @overload list_service_configs(request, options = nil) - # Pass arguments to `list_service_configs` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_service_configs(service_name: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_service_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param page_token [::String] - # The token of the page to retrieve. - # @param page_size [::Integer] - # The max number of items to include in the response list. Page size is 50 - # if not specified. Maximum value is 100. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Api::Service>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Api::Service>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new - # - # # Call the list_service_configs method. - # result = client.list_service_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Api::Service. - # p item - # end - # - def list_service_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_service_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_service_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_service_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :list_service_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @service_manager_stub, :list_service_configs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a service configuration (version) for a managed service. - # - # @overload get_service_config(request, options = nil) - # Pass arguments to `get_service_config` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_service_config(service_name: nil, config_id: nil, view: nil) - # Pass arguments to `get_service_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 service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param config_id [::String] - # Required. The id of the service configuration resource. - # - # This field must be specified for the server to return all fields, including - # `SourceInfo`. - # @param view [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest::ConfigView] - # Specifies which parts of the Service Config should be returned in the - # response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Api::Service] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Api::Service] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new - # - # # Call the get_service_config method. - # result = client.get_service_config request - # - # # The returned object is of type Google::Api::Service. - # p result - # - def get_service_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_service_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::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - if request.config_id - header_params["config_id"] = request.config_id - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_service_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_service_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :get_service_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new service configuration (version) for a managed service. - # This method only stores the service configuration. To roll out the service - # configuration to backend systems please call - # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout CreateServiceRollout}. - # - # Only the 100 most recent service configurations and ones referenced by - # existing rollouts are kept for each service. The rest will be deleted - # eventually. - # - # @overload create_service_config(request, options = nil) - # Pass arguments to `create_service_config` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_service_config(service_name: nil, service_config: nil) - # Pass arguments to `create_service_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 service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param service_config [::Google::Api::Service, ::Hash] - # Required. The service configuration resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Api::Service] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Api::Service] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new - # - # # Call the create_service_config method. - # result = client.create_service_config request - # - # # The returned object is of type Google::Api::Service. - # p result - # - def create_service_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest - - # Converts hash and nil to 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_service_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::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_service_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_service_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :create_service_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new service configuration (version) for a managed service based - # on - # user-supplied configuration source files (for example: OpenAPI - # Specification). This method stores the source configurations as well as the - # generated service configuration. To rollout the service configuration to - # other services, - # please call - # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout CreateServiceRollout}. - # - # Only the 100 most recent configuration sources and ones referenced by - # existing service configurtions are kept for each service. The rest will be - # deleted eventually. - # - # Operation - # - # @overload submit_config_source(request, options = nil) - # Pass arguments to `submit_config_source` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload submit_config_source(service_name: nil, config_source: nil, validate_only: nil) - # Pass arguments to `submit_config_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param config_source [::Google::Cloud::ServiceManagement::V1::ConfigSource, ::Hash] - # Required. The source configuration for the service. - # @param validate_only [::Boolean] - # Optional. If set, this will result in the generation of a - # `google.api.Service` configuration based on the `ConfigSource` provided, - # but the generated config and the sources will NOT be persisted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new - # - # # Call the submit_config_source method. - # result = client.submit_config_source request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def submit_config_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.submit_config_source.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.submit_config_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.submit_config_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :submit_config_source, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 the history of the service configuration rollouts for a managed - # service, from the newest to the oldest. - # - # @overload list_service_rollouts(request, options = nil) - # Pass arguments to `list_service_rollouts` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_service_rollouts(service_name: nil, page_token: nil, page_size: nil, filter: nil) - # Pass arguments to `list_service_rollouts` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param page_token [::String] - # The token of the page to retrieve. - # @param page_size [::Integer] - # The max number of items to include in the response list. Page size is 50 - # if not specified. Maximum value is 100. - # @param filter [::String] - # Required. Use `filter` to return subset of rollouts. - # The following filters are supported: - # - # -- By [status] - # [google.api.servicemanagement.v1.Rollout.RolloutStatus]. For example, - # `filter='status=SUCCESS'` - # - # -- By [strategy] - # [google.api.servicemanagement.v1.Rollout.strategy]. For example, - # `filter='strategy=TrafficPercentStrategy'` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new - # - # # Call the list_service_rollouts method. - # result = client.list_service_rollouts request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceManagement::V1::Rollout. - # p item - # end - # - def list_service_rollouts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_service_rollouts.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_service_rollouts.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_service_rollouts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :list_service_rollouts, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @service_manager_stub, :list_service_rollouts, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a service configuration - # {::Google::Cloud::ServiceManagement::V1::Rollout rollout}. - # - # @overload get_service_rollout(request, options = nil) - # Pass arguments to `get_service_rollout` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_service_rollout(service_name: nil, rollout_id: nil) - # Pass arguments to `get_service_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param rollout_id [::String] - # Required. The id of the rollout resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceManagement::V1::Rollout] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceManagement::V1::Rollout] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new - # - # # Call the get_service_rollout method. - # result = client.get_service_rollout request - # - # # The returned object is of type Google::Cloud::ServiceManagement::V1::Rollout. - # p result - # - def get_service_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_service_rollout.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - if request.rollout_id - header_params["rollout_id"] = request.rollout_id - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_service_rollout.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_service_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :get_service_rollout, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new service configuration rollout. Based on rollout, the - # Google Service Management will roll out the service configurations to - # different backend services. For example, the logging configuration will be - # pushed to Google Cloud Logging. - # - # Please note that any previous pending and running Rollouts and associated - # Operations will be automatically cancelled so that the latest Rollout will - # not be blocked by previous Rollouts. - # - # Only the 100 most recent (in any state) and the last 10 successful (if not - # already part of the set of 100 most recent) rollouts are kept for each - # service. The rest will be deleted eventually. - # - # Operation - # - # @overload create_service_rollout(request, options = nil) - # Pass arguments to `create_service_rollout` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_service_rollout(service_name: nil, rollout: nil) - # Pass arguments to `create_service_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param rollout [::Google::Cloud::ServiceManagement::V1::Rollout, ::Hash] - # Required. The rollout resource. The `service_name` field is output only. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new - # - # # Call the create_service_rollout method. - # result = client.create_service_rollout request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_service_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest - - # Converts hash and nil to 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_service_rollout.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.service_name - header_params["service_name"] = request.service_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_service_rollout.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_service_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :create_service_rollout, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Generates and returns a report (errors, warnings and changes from - # existing configurations) associated with - # GenerateConfigReportRequest.new_value - # - # If GenerateConfigReportRequest.old_value is specified, - # GenerateConfigReportRequest will contain a single ChangeReport based on the - # comparison between GenerateConfigReportRequest.new_value and - # GenerateConfigReportRequest.old_value. - # If GenerateConfigReportRequest.old_value is not specified, this method - # will compare GenerateConfigReportRequest.new_value with the last pushed - # service configuration. - # - # @overload generate_config_report(request, options = nil) - # Pass arguments to `generate_config_report` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload generate_config_report(new_config: nil, old_config: nil) - # Pass arguments to `generate_config_report` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param new_config [::Google::Protobuf::Any, ::Hash] - # Required. Service configuration for which we want to generate the report. - # For this version of API, the supported types are - # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, - # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, - # and {::Google::Api::Service google.api.Service} - # @param old_config [::Google::Protobuf::Any, ::Hash] - # Optional. Service configuration against which the comparison will be done. - # For this version of API, the supported types are - # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, - # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, - # and {::Google::Api::Service google.api.Service} - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new - # - # # Call the generate_config_report method. - # result = client.generate_config_report request - # - # # The returned object is of type Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse. - # p result - # - def generate_config_report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.generate_config_report.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::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.generate_config_report.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_config_report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.call_rpc :generate_config_report, request, 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 ServiceManager API. - # - # This class represents the configuration for ServiceManager, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_services to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_services.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_services.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::ServiceManagement::V1::ServiceManager::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicemanagement.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ServiceManager API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_services - ## - # RPC-specific configuration for `get_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service - ## - # RPC-specific configuration for `create_service` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service - ## - # RPC-specific configuration for `delete_service` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_service - ## - # RPC-specific configuration for `undelete_service` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_service - ## - # RPC-specific configuration for `list_service_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_service_configs - ## - # RPC-specific configuration for `get_service_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service_config - ## - # RPC-specific configuration for `create_service_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service_config - ## - # RPC-specific configuration for `submit_config_source` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_config_source - ## - # RPC-specific configuration for `list_service_rollouts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_service_rollouts - ## - # RPC-specific configuration for `get_service_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service_rollout - ## - # RPC-specific configuration for `create_service_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service_rollout - ## - # RPC-specific configuration for `generate_config_report` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_config_report - - # @private - def initialize parent_rpcs = nil - list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services - @list_services = ::Gapic::Config::Method.new list_services_config - get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service - @get_service = ::Gapic::Config::Method.new get_service_config - create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service - @create_service = ::Gapic::Config::Method.new create_service_config - delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service - @delete_service = ::Gapic::Config::Method.new delete_service_config - undelete_service_config = parent_rpcs.undelete_service if parent_rpcs.respond_to? :undelete_service - @undelete_service = ::Gapic::Config::Method.new undelete_service_config - list_service_configs_config = parent_rpcs.list_service_configs if parent_rpcs.respond_to? :list_service_configs - @list_service_configs = ::Gapic::Config::Method.new list_service_configs_config - get_service_config_config = parent_rpcs.get_service_config if parent_rpcs.respond_to? :get_service_config - @get_service_config = ::Gapic::Config::Method.new get_service_config_config - create_service_config_config = parent_rpcs.create_service_config if parent_rpcs.respond_to? :create_service_config - @create_service_config = ::Gapic::Config::Method.new create_service_config_config - submit_config_source_config = parent_rpcs.submit_config_source if parent_rpcs.respond_to? :submit_config_source - @submit_config_source = ::Gapic::Config::Method.new submit_config_source_config - list_service_rollouts_config = parent_rpcs.list_service_rollouts if parent_rpcs.respond_to? :list_service_rollouts - @list_service_rollouts = ::Gapic::Config::Method.new list_service_rollouts_config - get_service_rollout_config = parent_rpcs.get_service_rollout if parent_rpcs.respond_to? :get_service_rollout - @get_service_rollout = ::Gapic::Config::Method.new get_service_rollout_config - create_service_rollout_config = parent_rpcs.create_service_rollout if parent_rpcs.respond_to? :create_service_rollout - @create_service_rollout = ::Gapic::Config::Method.new create_service_rollout_config - generate_config_report_config = parent_rpcs.generate_config_report if parent_rpcs.respond_to? :generate_config_report - @generate_config_report = ::Gapic::Config::Method.new generate_config_report_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/credentials.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/credentials.rb deleted file mode 100644 index a4c9815cf939..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/credentials.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ServiceManagement - module V1 - module ServiceManager - # Credentials for the ServiceManager API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management", - "https://www.googleapis.com/auth/service.management.readonly" - ] - self.env_vars = [ - "SERVICE_MANAGEMENT_CREDENTIALS", - "SERVICE_MANAGEMENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SERVICE_MANAGEMENT_CREDENTIALS_JSON", - "SERVICE_MANAGEMENT_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-service_management-v1/lib/google/cloud/service_management/v1/service_manager/operations.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/operations.rb deleted file mode 100644 index 317a9ec8ac81..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/operations.rb +++ /dev/null @@ -1,833 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 ServiceManagement - module V1 - module ServiceManager - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicemanagement.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ServiceManager 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 ServiceManager 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::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_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::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::ServiceManagement::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::ServiceManagement::V1::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 = "servicemanagement.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest.rb deleted file mode 100644 index 7c6d55e49768..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/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/service_management/v1/version" -require "google/cloud/service_management/v1/bindings_override" - -require "google/cloud/service_management/v1/service_manager/credentials" -require "google/cloud/service_management/v1/service_manager/rest/operations" -require "google/cloud/service_management/v1/service_manager/rest/client" - -module Google - module Cloud - module ServiceManagement - module V1 - ## - # [Google Service Management - # API](https://cloud.google.com/service-infrastructure/docs/overview) - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/service_management/v1/service_manager/rest" - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - module ServiceManager - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/service_management/v1/service_manager/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb deleted file mode 100644 index 66dbe7e1c257..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb +++ /dev/null @@ -1,1701 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/api/servicemanagement/v1/servicemanager_pb" -require "google/cloud/service_management/v1/service_manager/rest/service_stub" -require "google/iam/v1/rest" - -module Google - module Cloud - module ServiceManagement - module V1 - module ServiceManager - module Rest - ## - # REST client for the ServiceManager service. - # - # [Google Service Management - # API](https://cloud.google.com/service-infrastructure/docs/overview) - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicemanagement.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :service_manager_stub - - ## - # Configure the ServiceManager Client class. - # - # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServiceManager clients - # ::Google::Cloud::ServiceManagement::V1::ServiceManager::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", "ServiceManagement", "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 = 10.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServiceManager Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::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 - @service_manager_stub.universe_domain - end - - ## - # Create a new ServiceManager REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServiceManager 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::ServiceManagement::V1::ServiceManager::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 - - @service_manager_stub = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @service_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 - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @service_manager_stub.endpoint - config.universe_domain = @service_manager_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @service_manager_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @service_manager_stub.logger - end - - # Service calls - - ## - # Lists managed services. - # - # Returns all public services. For authenticated users, also returns all - # services the calling user has "servicemanagement.services.get" permission - # for. - # - # @overload list_services(request, options = nil) - # Pass arguments to `list_services` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::ListServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::ListServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_services(producer_project_id: nil, page_size: nil, page_token: nil, consumer_id: nil) - # Pass arguments to `list_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param producer_project_id [::String] - # Include services produced by the specified project. - # @param page_size [::Integer] - # The max number of items to include in the response list. Page size is 50 - # if not specified. Maximum value is 500. - # @param page_token [::String] - # Token identifying which result to start with; returned by a previous list - # call. - # @param consumer_id [::String] - # Include services consumed by the specified consumer. - # - # The Google Service Management implementation accepts the following - # forms: - # - project: - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::ListServicesRequest.new - # - # # Call the list_services method. - # result = client.list_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceManagement::V1::ManagedService. - # p item - # end - # - def list_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_services.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.list_services request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @service_manager_stub, :list_services, "services", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a managed service. Authentication is required unless the service is - # public. - # - # @overload get_service(request, options = nil) - # Pass arguments to `get_service` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::GetServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_service(service_name: nil) - # Pass arguments to `get_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the `ServiceManager` overview for - # naming requirements. For example: `example.googleapis.com`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ManagedService] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::GetServiceRequest.new - # - # # Call the get_service method. - # result = client.get_service request - # - # # The returned object is of type Google::Cloud::ServiceManagement::V1::ManagedService. - # p result - # - def get_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.get_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new managed service. - # - # A managed service is immutable, and is subject to mandatory 30-day - # data retention. You cannot move a service or recreate it within 30 days - # after deletion. - # - # One producer project can own no more than 500 services. For security and - # reliability purposes, a production service should be hosted in a - # dedicated producer project. - # - # Operation - # - # @overload create_service(request, options = nil) - # Pass arguments to `create_service` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::CreateServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_service(service: nil) - # Pass arguments to `create_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service [::Google::Cloud::ServiceManagement::V1::ManagedService, ::Hash] - # Required. Initial values for the service 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/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new - # - # # Call the create_service method. - # result = client.create_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest - - # Converts hash and nil to an 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_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.create_service request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 managed service. This method will change the service to the - # `Soft-Delete` state for 30 days. Within this period, service producers may - # call - # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client#undelete_service UndeleteService} - # to restore the service. After 30 days, the service will be permanently - # deleted. - # - # Operation - # - # @overload delete_service(request, options = nil) - # Pass arguments to `delete_service` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_service(service_name: nil) - # Pass arguments to `delete_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new - # - # # Call the delete_service method. - # result = client.delete_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.delete_service request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Revives a previously deleted managed service. The method restores the - # service using the configuration at the time the service was deleted. - # The target service must exist and must have been deleted within the - # last 30 days. - # - # Operation - # - # @overload undelete_service(request, options = nil) - # Pass arguments to `undelete_service` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_service(service_name: nil) - # Pass arguments to `undelete_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new - # - # # Call the undelete_service method. - # result = client.undelete_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.undelete_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.undelete_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.undelete_service request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the history of the service configuration for a managed service, - # from the newest to the oldest. - # - # @overload list_service_configs(request, options = nil) - # Pass arguments to `list_service_configs` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_service_configs(service_name: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_service_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param page_token [::String] - # The token of the page to retrieve. - # @param page_size [::Integer] - # The max number of items to include in the response list. Page size is 50 - # if not specified. Maximum value is 100. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Api::Service>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Api::Service>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new - # - # # Call the list_service_configs method. - # result = client.list_service_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Api::Service. - # p item - # end - # - def list_service_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_service_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_service_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_service_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.list_service_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @service_manager_stub, :list_service_configs, "service_configs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a service configuration (version) for a managed service. - # - # @overload get_service_config(request, options = nil) - # Pass arguments to `get_service_config` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_service_config(service_name: nil, config_id: nil, view: nil) - # Pass arguments to `get_service_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 service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param config_id [::String] - # Required. The id of the service configuration resource. - # - # This field must be specified for the server to return all fields, including - # `SourceInfo`. - # @param view [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest::ConfigView] - # Specifies which parts of the Service Config should be returned in the - # response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Api::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Api::Service] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new - # - # # Call the get_service_config method. - # result = client.get_service_config request - # - # # The returned object is of type Google::Api::Service. - # p result - # - def get_service_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_service_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::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_service_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_service_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.get_service_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new service configuration (version) for a managed service. - # This method only stores the service configuration. To roll out the service - # configuration to backend systems please call - # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client#create_service_rollout CreateServiceRollout}. - # - # Only the 100 most recent service configurations and ones referenced by - # existing rollouts are kept for each service. The rest will be deleted - # eventually. - # - # @overload create_service_config(request, options = nil) - # Pass arguments to `create_service_config` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_service_config(service_name: nil, service_config: nil) - # Pass arguments to `create_service_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 service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param service_config [::Google::Api::Service, ::Hash] - # Required. The service configuration resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Api::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Api::Service] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new - # - # # Call the create_service_config method. - # result = client.create_service_config request - # - # # The returned object is of type Google::Api::Service. - # p result - # - def create_service_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest - - # Converts hash and nil to an 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_service_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::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_service_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_service_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.create_service_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new service configuration (version) for a managed service based - # on - # user-supplied configuration source files (for example: OpenAPI - # Specification). This method stores the source configurations as well as the - # generated service configuration. To rollout the service configuration to - # other services, - # please call - # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client#create_service_rollout CreateServiceRollout}. - # - # Only the 100 most recent configuration sources and ones referenced by - # existing service configurtions are kept for each service. The rest will be - # deleted eventually. - # - # Operation - # - # @overload submit_config_source(request, options = nil) - # Pass arguments to `submit_config_source` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload submit_config_source(service_name: nil, config_source: nil, validate_only: nil) - # Pass arguments to `submit_config_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param config_source [::Google::Cloud::ServiceManagement::V1::ConfigSource, ::Hash] - # Required. The source configuration for the service. - # @param validate_only [::Boolean] - # Optional. If set, this will result in the generation of a - # `google.api.Service` configuration based on the `ConfigSource` provided, - # but the generated config and the sources will NOT be persisted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new - # - # # Call the submit_config_source method. - # result = client.submit_config_source request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def submit_config_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.submit_config_source.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.submit_config_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.submit_config_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.submit_config_source request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the history of the service configuration rollouts for a managed - # service, from the newest to the oldest. - # - # @overload list_service_rollouts(request, options = nil) - # Pass arguments to `list_service_rollouts` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_service_rollouts(service_name: nil, page_token: nil, page_size: nil, filter: nil) - # Pass arguments to `list_service_rollouts` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param page_token [::String] - # The token of the page to retrieve. - # @param page_size [::Integer] - # The max number of items to include in the response list. Page size is 50 - # if not specified. Maximum value is 100. - # @param filter [::String] - # Required. Use `filter` to return subset of rollouts. - # The following filters are supported: - # - # -- By [status] - # [google.api.servicemanagement.v1.Rollout.RolloutStatus]. For example, - # `filter='status=SUCCESS'` - # - # -- By [strategy] - # [google.api.servicemanagement.v1.Rollout.strategy]. For example, - # `filter='strategy=TrafficPercentStrategy'` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new - # - # # Call the list_service_rollouts method. - # result = client.list_service_rollouts request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceManagement::V1::Rollout. - # p item - # end - # - def list_service_rollouts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_service_rollouts.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_service_rollouts.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_service_rollouts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.list_service_rollouts request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @service_manager_stub, :list_service_rollouts, "rollouts", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a service configuration - # {::Google::Cloud::ServiceManagement::V1::Rollout rollout}. - # - # @overload get_service_rollout(request, options = nil) - # Pass arguments to `get_service_rollout` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_service_rollout(service_name: nil, rollout_id: nil) - # Pass arguments to `get_service_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param rollout_id [::String] - # Required. The id of the rollout resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceManagement::V1::Rollout] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceManagement::V1::Rollout] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new - # - # # Call the get_service_rollout method. - # result = client.get_service_rollout request - # - # # The returned object is of type Google::Cloud::ServiceManagement::V1::Rollout. - # p result - # - def get_service_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_service_rollout.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_service_rollout.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_service_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.get_service_rollout request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new service configuration rollout. Based on rollout, the - # Google Service Management will roll out the service configurations to - # different backend services. For example, the logging configuration will be - # pushed to Google Cloud Logging. - # - # Please note that any previous pending and running Rollouts and associated - # Operations will be automatically cancelled so that the latest Rollout will - # not be blocked by previous Rollouts. - # - # Only the 100 most recent (in any state) and the last 10 successful (if not - # already part of the set of 100 most recent) rollouts are kept for each - # service. The rest will be deleted eventually. - # - # Operation - # - # @overload create_service_rollout(request, options = nil) - # Pass arguments to `create_service_rollout` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_service_rollout(service_name: nil, rollout: nil) - # Pass arguments to `create_service_rollout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param service_name [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @param rollout [::Google::Cloud::ServiceManagement::V1::Rollout, ::Hash] - # Required. The rollout resource. The `service_name` field is output only. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new - # - # # Call the create_service_rollout method. - # result = client.create_service_rollout request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_service_rollout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest - - # Converts hash and nil to an 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_service_rollout.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_service_rollout.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_service_rollout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.create_service_rollout request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Generates and returns a report (errors, warnings and changes from - # existing configurations) associated with - # GenerateConfigReportRequest.new_value - # - # If GenerateConfigReportRequest.old_value is specified, - # GenerateConfigReportRequest will contain a single ChangeReport based on the - # comparison between GenerateConfigReportRequest.new_value and - # GenerateConfigReportRequest.old_value. - # If GenerateConfigReportRequest.old_value is not specified, this method - # will compare GenerateConfigReportRequest.new_value with the last pushed - # service configuration. - # - # @overload generate_config_report(request, options = nil) - # Pass arguments to `generate_config_report` via a request object, either of type - # {::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload generate_config_report(new_config: nil, old_config: nil) - # Pass arguments to `generate_config_report` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param new_config [::Google::Protobuf::Any, ::Hash] - # Required. Service configuration for which we want to generate the report. - # For this version of API, the supported types are - # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, - # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, - # and {::Google::Api::Service google.api.Service} - # @param old_config [::Google::Protobuf::Any, ::Hash] - # Optional. Service configuration against which the comparison will be done. - # For this version of API, the supported types are - # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, - # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, - # and {::Google::Api::Service google.api.Service} - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_management/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new - # - # # Call the generate_config_report method. - # result = client.generate_config_report request - # - # # The returned object is of type Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse. - # p result - # - def generate_config_report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.generate_config_report.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.generate_config_report.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_config_report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_manager_stub.generate_config_report request, 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 ServiceManager REST API. - # - # This class represents the configuration for ServiceManager REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_services to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_services.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_services.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "servicemanagement.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 ServiceManager API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_services - ## - # RPC-specific configuration for `get_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service - ## - # RPC-specific configuration for `create_service` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service - ## - # RPC-specific configuration for `delete_service` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_service - ## - # RPC-specific configuration for `undelete_service` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_service - ## - # RPC-specific configuration for `list_service_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_service_configs - ## - # RPC-specific configuration for `get_service_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service_config - ## - # RPC-specific configuration for `create_service_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service_config - ## - # RPC-specific configuration for `submit_config_source` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_config_source - ## - # RPC-specific configuration for `list_service_rollouts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_service_rollouts - ## - # RPC-specific configuration for `get_service_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service_rollout - ## - # RPC-specific configuration for `create_service_rollout` - # @return [::Gapic::Config::Method] - # - attr_reader :create_service_rollout - ## - # RPC-specific configuration for `generate_config_report` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_config_report - - # @private - def initialize parent_rpcs = nil - list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services - @list_services = ::Gapic::Config::Method.new list_services_config - get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service - @get_service = ::Gapic::Config::Method.new get_service_config - create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service - @create_service = ::Gapic::Config::Method.new create_service_config - delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service - @delete_service = ::Gapic::Config::Method.new delete_service_config - undelete_service_config = parent_rpcs.undelete_service if parent_rpcs.respond_to? :undelete_service - @undelete_service = ::Gapic::Config::Method.new undelete_service_config - list_service_configs_config = parent_rpcs.list_service_configs if parent_rpcs.respond_to? :list_service_configs - @list_service_configs = ::Gapic::Config::Method.new list_service_configs_config - get_service_config_config = parent_rpcs.get_service_config if parent_rpcs.respond_to? :get_service_config - @get_service_config = ::Gapic::Config::Method.new get_service_config_config - create_service_config_config = parent_rpcs.create_service_config if parent_rpcs.respond_to? :create_service_config - @create_service_config = ::Gapic::Config::Method.new create_service_config_config - submit_config_source_config = parent_rpcs.submit_config_source if parent_rpcs.respond_to? :submit_config_source - @submit_config_source = ::Gapic::Config::Method.new submit_config_source_config - list_service_rollouts_config = parent_rpcs.list_service_rollouts if parent_rpcs.respond_to? :list_service_rollouts - @list_service_rollouts = ::Gapic::Config::Method.new list_service_rollouts_config - get_service_rollout_config = parent_rpcs.get_service_rollout if parent_rpcs.respond_to? :get_service_rollout - @get_service_rollout = ::Gapic::Config::Method.new get_service_rollout_config - create_service_rollout_config = parent_rpcs.create_service_rollout if parent_rpcs.respond_to? :create_service_rollout - @create_service_rollout = ::Gapic::Config::Method.new create_service_rollout_config - generate_config_report_config = parent_rpcs.generate_config_report if parent_rpcs.respond_to? :generate_config_report - @generate_config_report = ::Gapic::Config::Method.new generate_config_report_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/operations.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/operations.rb deleted file mode 100644 index 980113f33e0a..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/operations.rb +++ /dev/null @@ -1,923 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module ServiceManagement - module V1 - module ServiceManager - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "servicemanagement.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ServiceManager 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 ServiceManager 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::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceManagement::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "servicemanagement.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_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/operations", - matches: [] - ) - 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{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb deleted file mode 100644 index 7f7177af359f..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.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 "google/api/servicemanagement/v1/servicemanager_pb" - -module Google - module Cloud - module ServiceManagement - module V1 - module ServiceManager - module Rest - ## - # REST service stub for the ServiceManager 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_services REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServicesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ListServicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceManagement::V1::ListServicesResponse] - # A result object deserialized from the server's reply - def list_services request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_services_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_services", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceManagement::V1::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_service REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ManagedService] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] - # A result object deserialized from the server's reply - def get_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceManagement::V1::ManagedService.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_service REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_service REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the undelete_service REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def undelete_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "undelete_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_service_configs REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse] - # A result object deserialized from the server's reply - def list_service_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_service_configs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_service_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_service_config REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Api::Service] - # A result object deserialized from the server's reply - def get_service_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_service_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_service_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Api::Service.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_service_config REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Api::Service] - # A result object deserialized from the server's reply - def create_service_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_service_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_service_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Api::Service.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the submit_config_source REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def submit_config_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_submit_config_source_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "submit_config_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_service_rollouts REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse] - # A result object deserialized from the server's reply - def list_service_rollouts request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_service_rollouts_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_service_rollouts", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_service_rollout REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceManagement::V1::Rollout] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceManagement::V1::Rollout] - # A result object deserialized from the server's reply - def get_service_rollout request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_service_rollout_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_service_rollout", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceManagement::V1::Rollout.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_service_rollout REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_service_rollout request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_service_rollout_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_service_rollout", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the generate_config_report REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] - # A result object deserialized from the server's reply - def generate_config_report request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_config_report_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "generate_config_report", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse.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_services REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServicesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_services_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/services", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_service REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/services/{service_name}", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_service REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceRequest] - # 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_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/services", - body: "service", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_service REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/services/{service_name}", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_service REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/services/{service_name}:undelete", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_service_configs REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_service_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/services/{service_name}/configs", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_service_config REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_service_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/services/{service_name}/configs/{config_id}", - matches: [ - ["service_name", %r{^[^/]+/?$}, false], - ["config_id", %r{^[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/services/{service_name}/config", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_service_config REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest] - # 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_service_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/services/{service_name}/configs", - body: "service_config", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the submit_config_source REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_submit_config_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/services/{service_name}/configs:submit", - body: "*", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_service_rollouts REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_service_rollouts_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/services/{service_name}/rollouts", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_service_rollout REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_service_rollout_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/services/{service_name}/rollouts/{rollout_id}", - matches: [ - ["service_name", %r{^[^/]+/?$}, false], - ["rollout_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_service_rollout REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest] - # 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_service_rollout_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/services/{service_name}/rollouts", - body: "rollout", - matches: [ - ["service_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_config_report REST call - # - # @param request_pb [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_generate_config_report_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/services:generateConfigReport", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/version.rb b/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/version.rb deleted file mode 100644 index b07821095257..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceManagement - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/README.md deleted file mode 100644 index b2331f606235..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Service Management 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-service_management-v1/proto_docs/google/api/auth.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/auth.rb deleted file mode 100644 index 2f1afd9a7f19..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/auth.rb +++ /dev/null @@ -1,259 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # `Authentication` defines the authentication configuration for API methods - # provided by an API service. - # - # Example: - # - # name: calendar.googleapis.com - # authentication: - # providers: - # - id: google_calendar_auth - # jwks_uri: https://www.googleapis.com/oauth2/v1/certs - # issuer: https://securetoken.google.com - # rules: - # - selector: "*" - # requirements: - # provider_id: google_calendar_auth - # - selector: google.calendar.Delegate - # oauth: - # canonical_scopes: https://www.googleapis.com/auth/calendar.read - # @!attribute [rw] rules - # @return [::Array<::Google::Api::AuthenticationRule>] - # A list of authentication rules that apply to individual API methods. - # - # **NOTE:** All service configuration rules follow "last one wins" order. - # @!attribute [rw] providers - # @return [::Array<::Google::Api::AuthProvider>] - # Defines a set of authentication providers that a service supports. - class Authentication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Authentication rules for the service. - # - # By default, if a method has any authentication requirements, every request - # must include a valid credential matching one of the requirements. - # It's an error to include more than one kind of credential in a single - # request. - # - # If a method doesn't have any auth requirements, request credentials will be - # ignored. - # @!attribute [rw] selector - # @return [::String] - # Selects the methods to which this rule applies. - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # @!attribute [rw] oauth - # @return [::Google::Api::OAuthRequirements] - # The requirements for OAuth credentials. - # @!attribute [rw] allow_without_credential - # @return [::Boolean] - # If true, the service accepts API keys without any other credential. - # This flag only applies to HTTP and gRPC requests. - # @!attribute [rw] requirements - # @return [::Array<::Google::Api::AuthRequirement>] - # Requirements for additional authentication providers. - class AuthenticationRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies a location to extract JWT from an API request. - # @!attribute [rw] header - # @return [::String] - # Specifies HTTP header name to extract JWT token. - # - # Note: The following fields are mutually exclusive: `header`, `query`, `cookie`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] query - # @return [::String] - # Specifies URL query parameter name to extract JWT token. - # - # Note: The following fields are mutually exclusive: `query`, `header`, `cookie`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] cookie - # @return [::String] - # Specifies cookie name to extract JWT token. - # - # Note: The following fields are mutually exclusive: `cookie`, `header`, `query`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] value_prefix - # @return [::String] - # The value prefix. The value format is "value_prefix\\{token}" - # Only applies to "in" header type. Must be empty for "in" query type. - # If not empty, the header value has to match (case sensitive) this prefix. - # If not matched, JWT will not be extracted. If matched, JWT will be - # extracted after the prefix is removed. - # - # For example, for "Authorization: Bearer \\{JWT}", - # value_prefix="Bearer " with a space at the end. - class JwtLocation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for an authentication provider, including support for - # [JSON Web Token - # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - # @!attribute [rw] id - # @return [::String] - # The unique identifier of the auth provider. It will be referred to by - # `AuthRequirement.provider_id`. - # - # Example: "bookstore_auth". - # @!attribute [rw] issuer - # @return [::String] - # Identifies the principal that issued the JWT. See - # https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 - # Usually a URL or an email address. - # - # Example: https://securetoken.google.com - # Example: 1234567-compute@developer.gserviceaccount.com - # @!attribute [rw] jwks_uri - # @return [::String] - # URL of the provider's public key set to validate signature of the JWT. See - # [OpenID - # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). - # Optional if the key set document: - # - can be retrieved from - # [OpenID - # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - # of the issuer. - # - can be inferred from the email domain of the issuer (e.g. a Google - # service account). - # - # Example: https://www.googleapis.com/oauth2/v1/certs - # @!attribute [rw] audiences - # @return [::String] - # The list of JWT - # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - # that are allowed to access. A JWT containing any of these audiences will - # be accepted. When this setting is absent, JWTs with audiences: - # - "https://[service.name]/[google.protobuf.Api.name]" - # - "https://[service.name]/" - # will be accepted. - # For example, if no audiences are in the setting, LibraryService API will - # accept JWTs with the following audiences: - # - - # https://library-example.googleapis.com/google.example.library.v1.LibraryService - # - https://library-example.googleapis.com/ - # - # Example: - # - # audiences: bookstore_android.apps.googleusercontent.com, - # bookstore_web.apps.googleusercontent.com - # @!attribute [rw] authorization_url - # @return [::String] - # Redirect URL if JWT token is required but not present or is expired. - # Implement authorizationUrl of securityDefinitions in OpenAPI spec. - # @!attribute [rw] jwt_locations - # @return [::Array<::Google::Api::JwtLocation>] - # Defines the locations to extract the JWT. For now it is only used by the - # Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] - # (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) - # - # JWT locations can be one of HTTP headers, URL query parameters or - # cookies. The rule is that the first match wins. - # - # If not specified, default to use following 3 locations: - # 1) Authorization: Bearer - # 2) x-goog-iap-jwt-assertion - # 3) access_token query parameter - # - # Default locations can be specified as followings: - # jwt_locations: - # - header: Authorization - # value_prefix: "Bearer " - # - header: x-goog-iap-jwt-assertion - # - query: access_token - class AuthProvider - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # OAuth scopes are a way to define data and permissions on data. For example, - # there are scopes defined for "Read-only access to Google Calendar" and - # "Access to Cloud Platform". Users can consent to a scope for an application, - # giving it permission to access that data on their behalf. - # - # OAuth scope specifications should be fairly coarse grained; a user will need - # to see and understand the text description of what your scope means. - # - # In most cases: use one or at most two OAuth scopes for an entire family of - # products. If your product has multiple APIs, you should probably be sharing - # the OAuth scope across all of those APIs. - # - # When you need finer grained OAuth consent screens: talk with your product - # management about how developers will use them in practice. - # - # Please note that even though each of the canonical scopes is enough for a - # request to be accepted and passed to the backend, a request can still fail - # due to the backend requiring additional scopes or permissions. - # @!attribute [rw] canonical_scopes - # @return [::String] - # The list of publicly documented OAuth scopes that are allowed access. An - # OAuth token containing any of these scopes will be accepted. - # - # - # Example: - # - # canonical_scopes: https://www.googleapis.com/auth/calendar, - # https://www.googleapis.com/auth/calendar.read - class OAuthRequirements - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # User-defined authentication requirements, including support for - # [JSON Web Token - # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - # @!attribute [rw] provider_id - # @return [::String] - # {::Google::Api::AuthProvider#id id} from authentication provider. - # - # Example: - # - # provider_id: bookstore_auth - # @!attribute [rw] audiences - # @return [::String] - # NOTE: This will be deprecated soon, once AuthProvider.audiences is - # implemented and accepted in all the runtime components. - # - # The list of JWT - # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - # that are allowed to access. A JWT containing any of these audiences will - # be accepted. When this setting is absent, only JWTs with audience - # "https://{::Google::Api::Service#name Service_name}/{::Google::Protobuf::Api#name API_name}" - # will be accepted. For example, if no audiences are in the setting, - # LibraryService API will only accept JWTs with the following audience - # "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - # - # Example: - # - # audiences: bookstore_android.apps.googleusercontent.com, - # bookstore_web.apps.googleusercontent.com - class AuthRequirement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/backend.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/backend.rb deleted file mode 100644 index 7d69596fe349..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/backend.rb +++ /dev/null @@ -1,199 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # `Backend` defines the backend configuration for a service. - # @!attribute [rw] rules - # @return [::Array<::Google::Api::BackendRule>] - # A list of API backend rules that apply to individual API methods. - # - # **NOTE:** All service configuration rules follow "last one wins" order. - class Backend - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A backend rule provides configuration for an individual API element. - # @!attribute [rw] selector - # @return [::String] - # Selects the methods to which this rule applies. - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # @!attribute [rw] address - # @return [::String] - # The address of the API backend. - # - # The scheme is used to determine the backend protocol and security. - # The following schemes are accepted: - # - # SCHEME PROTOCOL SECURITY - # http:// HTTP None - # https:// HTTP TLS - # grpc:// gRPC None - # grpcs:// gRPC TLS - # - # It is recommended to explicitly include a scheme. Leaving out the scheme - # may cause constrasting behaviors across platforms. - # - # If the port is unspecified, the default is: - # - 80 for schemes without TLS - # - 443 for schemes with TLS - # - # For HTTP backends, use {::Google::Api::BackendRule#protocol protocol} - # to specify the protocol version. - # @!attribute [rw] deadline - # @return [::Float] - # The number of seconds to wait for a response from a request. The default - # varies based on the request protocol and deployment environment. - # @!attribute [rw] min_deadline - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Float] - # Deprecated, do not use. - # @!attribute [rw] operation_deadline - # @return [::Float] - # The number of seconds to wait for the completion of a long running - # operation. The default is no deadline. - # @!attribute [rw] path_translation - # @return [::Google::Api::BackendRule::PathTranslation] - # Path translation specifies how to combine the backend address with the - # request path in order to produce the appropriate forwarding URL for the - # request. See {::Google::Api::BackendRule::PathTranslation PathTranslation} for - # more details. - # @!attribute [rw] jwt_audience - # @return [::String] - # The JWT audience is used when generating a JWT ID token for the backend. - # This ID token will be added in the HTTP "authorization" header, and sent - # to the backend. - # - # Note: The following fields are mutually exclusive: `jwt_audience`, `disable_auth`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] disable_auth - # @return [::Boolean] - # When disable_auth is true, a JWT ID token won't be generated and the - # original "Authorization" HTTP header will be preserved. If the header is - # used to carry the original token and is expected by the backend, this - # field must be set to true to preserve the header. - # - # Note: The following fields are mutually exclusive: `disable_auth`, `jwt_audience`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] protocol - # @return [::String] - # The protocol used for sending a request to the backend. - # The supported values are "http/1.1" and "h2". - # - # The default value is inferred from the scheme in the - # {::Google::Api::BackendRule#address address} field: - # - # SCHEME PROTOCOL - # http:// http/1.1 - # https:// http/1.1 - # grpc:// h2 - # grpcs:// h2 - # - # For secure HTTP backends (https://) that support HTTP/2, set this field - # to "h2" for improved performance. - # - # Configuring this field to non-default values is only supported for secure - # HTTP backends. This field will be ignored for all other backends. - # - # See - # https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids - # for more details on the supported values. - # @!attribute [rw] overrides_by_request_protocol - # @return [::Google::Protobuf::Map{::String => ::Google::Api::BackendRule}] - # The map between request protocol and the backend address. - # @!attribute [rw] load_balancing_policy - # @return [::String] - # The load balancing policy used for connection to the application backend. - # - # Defined as an arbitrary string to accomondate custom load balancing - # policies supported by the underlying channel, but suggest most users use - # one of the standard policies, such as the default, "RoundRobin". - class BackendRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Api::BackendRule] - class OverridesByRequestProtocolEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Path Translation specifies how to combine the backend address with the - # request path in order to produce the appropriate forwarding URL for the - # request. - # - # Path Translation is applicable only to HTTP-based backends. Backends which - # do not accept requests over HTTP/HTTPS should leave `path_translation` - # unspecified. - module PathTranslation - PATH_TRANSLATION_UNSPECIFIED = 0 - - # Use the backend address as-is, with no modification to the path. If the - # URL pattern contains variables, the variable names and values will be - # appended to the query string. If a query string parameter and a URL - # pattern variable have the same name, this may result in duplicate keys in - # the query string. - # - # # Examples - # - # Given the following operation config: - # - # Method path: /api/company/{cid}/user/{uid} - # Backend address: https://example.cloudfunctions.net/getUser - # - # Requests to the following request paths will call the backend at the - # translated path: - # - # Request path: /api/company/widgetworks/user/johndoe - # Translated: - # https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe - # - # Request path: /api/company/widgetworks/user/johndoe?timezone=EST - # Translated: - # https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe - CONSTANT_ADDRESS = 1 - - # The request path will be appended to the backend address. - # - # # Examples - # - # Given the following operation config: - # - # Method path: /api/company/{cid}/user/{uid} - # Backend address: https://example.appspot.com - # - # Requests to the following request paths will call the backend at the - # translated path: - # - # Request path: /api/company/widgetworks/user/johndoe - # Translated: - # https://example.appspot.com/api/company/widgetworks/user/johndoe - # - # Request path: /api/company/widgetworks/user/johndoe?timezone=EST - # Translated: - # https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST - APPEND_PATH_TO_ADDRESS = 2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/billing.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/billing.rb deleted file mode 100644 index 75d55089e3a3..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/billing.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Billing related configuration of the service. - # - # The following example shows how to configure monitored resources and metrics - # for billing, `consumer_destinations` is the only supported destination and - # the monitored resources need at least one label key - # `cloud.googleapis.com/location` to indicate the location of the billing - # usage, using different monitored resources between monitoring and billing is - # recommended so they can be evolved independently: - # - # - # monitored_resources: - # - type: library.googleapis.com/billing_branch - # labels: - # - key: cloud.googleapis.com/location - # description: | - # Predefined label to support billing location restriction. - # - key: city - # description: | - # Custom label to define the city where the library branch is located - # in. - # - key: name - # description: Custom label to define the name of the library branch. - # metrics: - # - name: library.googleapis.com/book/borrowed_count - # metric_kind: DELTA - # value_type: INT64 - # unit: "1" - # billing: - # consumer_destinations: - # - monitored_resource: library.googleapis.com/billing_branch - # metrics: - # - library.googleapis.com/book/borrowed_count - # @!attribute [rw] consumer_destinations - # @return [::Array<::Google::Api::Billing::BillingDestination>] - # Billing configurations for sending metrics to the consumer project. - # There can be multiple consumer destinations per service, each one must have - # a different monitored resource type. A metric can be used in at most - # one consumer destination. - class Billing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration of a specific billing destination (Currently only support - # bill against consumer project). - # @!attribute [rw] monitored_resource - # @return [::String] - # The monitored resource type. The type must be defined in - # {::Google::Api::Service#monitored_resources Service.monitored_resources} - # section. - # @!attribute [rw] metrics - # @return [::Array<::String>] - # Names of the metrics to report to this billing destination. - # Each name must be defined in - # {::Google::Api::Service#metrics Service.metrics} section. - class BillingDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/config_change.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/config_change.rb deleted file mode 100644 index ca20a231d6b4..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/config_change.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 Api - # Output generated from semantically comparing two versions of a service - # configuration. - # - # Includes detailed information about a field that have changed with - # applicable advice about potential consequences for the change, such as - # backwards-incompatibility. - # @!attribute [rw] element - # @return [::String] - # Object hierarchy path to the change, with levels separated by a '.' - # character. For repeated fields, an applicable unique identifier field is - # used for the index (usually selector, name, or id). For maps, the term - # 'key' is used. If the field has no unique identifier, the numeric index - # is used. - # Examples: - # - visibility.rules[selector=="google.LibraryService.ListBooks"].restriction - # - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value - # - logging.producer_destinations[0] - # @!attribute [rw] old_value - # @return [::String] - # Value of the changed object in the old Service configuration, - # in JSON format. This field will not be populated if ChangeType == ADDED. - # @!attribute [rw] new_value - # @return [::String] - # Value of the changed object in the new Service configuration, - # in JSON format. This field will not be populated if ChangeType == REMOVED. - # @!attribute [rw] change_type - # @return [::Google::Api::ChangeType] - # The type for this change, either ADDED, REMOVED, or MODIFIED. - # @!attribute [rw] advices - # @return [::Array<::Google::Api::Advice>] - # Collection of advice provided for this change, useful for determining the - # possible impact of this change. - class ConfigChange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Generated advice about this change, used for providing more - # information about how a change will affect the existing service. - # @!attribute [rw] description - # @return [::String] - # Useful description for why this advice was applied and what actions should - # be taken to mitigate any implied risks. - class Advice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Classifies set of possible modifications to an object in the service - # configuration. - module ChangeType - # No value was provided. - CHANGE_TYPE_UNSPECIFIED = 0 - - # The changed object exists in the 'new' service configuration, but not - # in the 'old' service configuration. - ADDED = 1 - - # The changed object exists in the 'old' service configuration, but not - # in the 'new' service configuration. - REMOVED = 2 - - # The changed object exists in both service configurations, but its value - # is different. - MODIFIED = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/context.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/context.rb deleted file mode 100644 index 871ef9830982..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/context.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # `Context` defines which contexts an API requests. - # - # Example: - # - # context: - # rules: - # - selector: "*" - # requested: - # - google.rpc.context.ProjectContext - # - google.rpc.context.OriginContext - # - # The above specifies that all methods in the API request - # `google.rpc.context.ProjectContext` and - # `google.rpc.context.OriginContext`. - # - # Available context types are defined in package - # `google.rpc.context`. - # - # This also provides mechanism to allowlist any protobuf message extension that - # can be sent in grpc metadata using “x-goog-ext--bin” and - # “x-goog-ext--jspb” format. For example, list any service - # specific protobuf types that can appear in grpc metadata as follows in your - # yaml file: - # - # Example: - # - # context: - # rules: - # - selector: "google.example.library.v1.LibraryService.CreateBook" - # allowed_request_extensions: - # - google.foo.v1.NewExtension - # allowed_response_extensions: - # - google.foo.v1.NewExtension - # - # You can also specify extension ID instead of fully qualified extension name - # here. - # @!attribute [rw] rules - # @return [::Array<::Google::Api::ContextRule>] - # A list of RPC context rules that apply to individual API methods. - # - # **NOTE:** All service configuration rules follow "last one wins" order. - class Context - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A context rule provides information about the context for an individual API - # element. - # @!attribute [rw] selector - # @return [::String] - # Selects the methods to which this rule applies. - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # @!attribute [rw] requested - # @return [::Array<::String>] - # A list of full type names of requested contexts, only the requested context - # will be made available to the backend. - # @!attribute [rw] provided - # @return [::Array<::String>] - # A list of full type names of provided contexts. It is used to support - # propagating HTTP headers and ETags from the response extension. - # @!attribute [rw] allowed_request_extensions - # @return [::Array<::String>] - # A list of full type names or extension IDs of extensions allowed in grpc - # side channel from client to backend. - # @!attribute [rw] allowed_response_extensions - # @return [::Array<::String>] - # A list of full type names or extension IDs of extensions allowed in grpc - # side channel from backend to client. - class ContextRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/control.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/control.rb deleted file mode 100644 index ad857f7a1157..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/control.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Selects and configures the service controller used by the service. - # - # Example: - # - # control: - # environment: servicecontrol.googleapis.com - # @!attribute [rw] environment - # @return [::String] - # The service controller environment to use. If empty, no control plane - # features (like quota and billing) will be enabled. The recommended value - # for most services is servicecontrol.googleapis.com. - # @!attribute [rw] method_policies - # @return [::Array<::Google::Api::MethodPolicy>] - # Defines policies applying to the API methods of the service. - class Control - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb deleted file mode 100644 index ccefcdf22809..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/documentation.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! - - -module Google - module Api - # `Documentation` provides the information for describing a service. - # - # Example: - #
documentation:
-    #   summary: >
-    #     The Google Calendar API gives access
-    #     to most calendar features.
-    #   pages:
-    #   - name: Overview
-    #     content: (== include google/foo/overview.md ==)
-    #   - name: Tutorial
-    #     content: (== include google/foo/tutorial.md ==)
-    #     subpages:
-    #     - name: Java
-    #       content: (== include google/foo/tutorial_java.md ==)
-    #   rules:
-    #   - selector: google.calendar.Calendar.Get
-    #     description: >
-    #       ...
-    #   - selector: google.calendar.Calendar.Put
-    #     description: >
-    #       ...
-    # 
- # Documentation is provided in markdown syntax. In addition to - # standard markdown features, definition lists, tables and fenced - # code blocks are supported. Section headers can be provided and are - # interpreted relative to the section nesting of the context where - # a documentation fragment is embedded. - # - # Documentation from the IDL is merged with documentation defined - # via the config at normalization time, where documentation provided - # by config rules overrides IDL provided. - # - # A number of constructs specific to the API platform are supported - # in documentation text. - # - # In order to reference a proto element, the following - # notation can be used: - #
[fully.qualified.proto.name][]
- # To override the display text used for the link, this can be used: - #
[display text][fully.qualified.proto.name]
- # Text can be excluded from doc using the following notation: - #
(-- internal comment --)
- # - # A few directives are available in documentation. Note that - # directives must appear on a single line to be properly - # identified. The `include` directive includes a markdown file from - # an external source: - #
(== include path/to/file ==)
- # The `resource_for` directive marks a message to be the resource of - # a collection in REST view. If it is not specified, tools attempt - # to infer the resource from the operations in a collection: - #
(== resource_for v1.shelves.books ==)
- # The directive `suppress_warning` does not directly affect documentation - # and is documented together with service config validation. - # @!attribute [rw] summary - # @return [::String] - # A short description of what the service does. The summary must be plain - # text. It becomes the overview of the service displayed in Google Cloud - # Console. - # NOTE: This field is equivalent to the standard field `description`. - # @!attribute [rw] pages - # @return [::Array<::Google::Api::Page>] - # The top level pages for the documentation set. - # @!attribute [rw] rules - # @return [::Array<::Google::Api::DocumentationRule>] - # A list of documentation rules that apply to individual API elements. - # - # **NOTE:** All service configuration rules follow "last one wins" order. - # @!attribute [rw] documentation_root_url - # @return [::String] - # The URL to the root of documentation. - # @!attribute [rw] service_root_url - # @return [::String] - # Specifies the service root url if the default one (the service name - # from the yaml file) is not suitable. This can be seen in any fully - # specified service urls as well as sections that show a base that other - # urls are relative to. - # @!attribute [rw] overview - # @return [::String] - # Declares a single overview page. For example: - #
documentation:
-    #       summary: ...
-    #       overview: (== include overview.md ==)
-    #     
- # This is a shortcut for the following declaration (using pages style): - #
documentation:
-    #       summary: ...
-    #       pages:
-    #       - name: Overview
-    #         content: (== include overview.md ==)
-    #     
- # Note: you cannot specify both `overview` field and `pages` field. - class Documentation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A documentation rule provides information about individual API elements. - # @!attribute [rw] selector - # @return [::String] - # The selector is a comma-separated list of patterns for any element such as - # a method, a field, an enum value. Each pattern is a qualified name of the - # element which may end in "*", indicating a wildcard. Wildcards are only - # allowed at the end and for a whole component of the qualified name, - # i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match - # one or more components. To specify a default for all applicable elements, - # the whole pattern "*" is used. - # @!attribute [rw] description - # @return [::String] - # Description of the selected proto element (e.g. a message, a method, a - # 'service' definition, or a field). Defaults to leading & trailing comments - # taken from the proto source definition of the proto element. - # @!attribute [rw] deprecation_description - # @return [::String] - # Deprecation description of the selected element(s). It can be provided if - # an element is marked as `deprecated`. - class DocumentationRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a documentation page. A page can contain subpages to represent - # nested documentation set structure. - # @!attribute [rw] name - # @return [::String] - # The name of the page. It will be used as an identity of the page to - # generate URI of the page, text of the link to this page in navigation, - # etc. The full page name (start from the root page name to this page - # concatenated with `.`) can be used as reference to the page in your - # documentation. For example: - #
pages:
-    #     - name: Tutorial
-    #       content: (== include tutorial.md ==)
-    #       subpages:
-    #       - name: Java
-    #         content: (== include tutorial_java.md ==)
-    #     
- # You can reference `Java` page using Markdown reference link syntax: - # `[Java][Tutorial.Java]`. - # @!attribute [rw] content - # @return [::String] - # The Markdown content of the page. You can use ```(== include {path} - # ==)``` to include content from a Markdown file. The content can be used - # to produce the documentation page such as HTML format page. - # @!attribute [rw] subpages - # @return [::Array<::Google::Api::Page>] - # Subpages of this page. The order of subpages specified here will be - # honored in the generated docset. - class Page - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb deleted file mode 100644 index 57d040a793ab..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/endpoint.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 - # `Endpoint` describes a network address of a service that serves a set of - # APIs. It is commonly known as a service endpoint. A service may expose - # any number of service endpoints, and all service endpoints share the same - # service definition, such as quota limits and monitoring metrics. - # - # Example: - # - # type: google.api.Service - # name: library-example.googleapis.com - # endpoints: - # # Declares network address `https://library-example.googleapis.com` - # # for service `library-example.googleapis.com`. The `https` scheme - # # is implicit for all service endpoints. Other schemes may be - # # supported in the future. - # - name: library-example.googleapis.com - # allow_cors: false - # - name: content-staging-library-example.googleapis.com - # # Allows HTTP OPTIONS calls to be passed to the API frontend, for it - # # to decide whether the subsequent cross-origin request is allowed - # # to proceed. - # allow_cors: true - # @!attribute [rw] name - # @return [::String] - # The canonical name of this endpoint. - # @!attribute [rw] aliases - # @return [::Array<::String>] - # Aliases for this endpoint, these will be served by the same UrlMap as the - # parent endpoint, and will be provisioned in the GCP stack for the Regional - # Endpoints. - # @!attribute [rw] target - # @return [::String] - # The specification of an Internet routable address of API frontend that will - # handle requests to this [API - # Endpoint](https://cloud.google.com/apis/design/glossary). It should be - # either a valid IPv4 address or a fully-qualified domain name. For example, - # "8.8.8.8" or "myservice.appspot.com". - # @!attribute [rw] allow_cors - # @return [::Boolean] - # Allowing - # [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka - # cross-domain traffic, would allow the backends served from this endpoint to - # receive and respond to HTTP OPTIONS requests. The response will be used by - # the browser to determine whether the subsequent cross-origin request is - # allowed to proceed. - class Endpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/label.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/label.rb deleted file mode 100644 index 02d2f8d451f9..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/label.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 Api - # A description of a label. - # @!attribute [rw] key - # @return [::String] - # The label key. - # @!attribute [rw] value_type - # @return [::Google::Api::LabelDescriptor::ValueType] - # The type of data that can be assigned to the label. - # @!attribute [rw] description - # @return [::String] - # A human-readable description for the label. - class LabelDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Value types that can be used as label values. - module ValueType - # A variable-length string. This is the default. - STRING = 0 - - # Boolean; true or false. - BOOL = 1 - - # A 64-bit signed integer. - INT64 = 2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/log.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/log.rb deleted file mode 100644 index e977a6844da3..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/log.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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 description of a log type. Example in YAML format: - # - # - name: library.googleapis.com/activity_history - # description: The history of borrowing and returning library items. - # display_name: Activity - # labels: - # - key: /customer_id - # description: Identifier of a library customer - # @!attribute [rw] name - # @return [::String] - # The name of the log. It must be less than 512 characters long and can - # include the following characters: upper- and lower-case alphanumeric - # characters [A-Za-z0-9], and punctuation characters including - # slash, underscore, hyphen, period [/_-.]. - # @!attribute [rw] labels - # @return [::Array<::Google::Api::LabelDescriptor>] - # The set of labels that are available to describe a specific log entry. - # Runtime requests that contain labels not specified here are - # considered invalid. - # @!attribute [rw] description - # @return [::String] - # A human-readable description of this log. This information appears in - # the documentation and can contain details. - # @!attribute [rw] display_name - # @return [::String] - # The human-readable name for this log. This information appears on - # the user interface and should be concise. - class LogDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/logging.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/logging.rb deleted file mode 100644 index 7a784dd32332..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/logging.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Logging configuration of the service. - # - # The following example shows how to configure logs to be sent to the - # producer and consumer projects. In the example, the `activity_history` - # log is sent to both the producer and consumer projects, whereas the - # `purchase_history` log is only sent to the producer project. - # - # monitored_resources: - # - type: library.googleapis.com/branch - # labels: - # - key: /city - # description: The city where the library branch is located in. - # - key: /name - # description: The name of the branch. - # logs: - # - name: activity_history - # labels: - # - key: /customer_id - # - name: purchase_history - # logging: - # producer_destinations: - # - monitored_resource: library.googleapis.com/branch - # logs: - # - activity_history - # - purchase_history - # consumer_destinations: - # - monitored_resource: library.googleapis.com/branch - # logs: - # - activity_history - # @!attribute [rw] producer_destinations - # @return [::Array<::Google::Api::Logging::LoggingDestination>] - # Logging configurations for sending logs to the producer project. - # There can be multiple producer destinations, each one must have a - # different monitored resource type. A log can be used in at most - # one producer destination. - # @!attribute [rw] consumer_destinations - # @return [::Array<::Google::Api::Logging::LoggingDestination>] - # Logging configurations for sending logs to the consumer project. - # There can be multiple consumer destinations, each one must have a - # different monitored resource type. A log can be used in at most - # one consumer destination. - class Logging - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration of a specific logging destination (the producer project - # or the consumer project). - # @!attribute [rw] monitored_resource - # @return [::String] - # The monitored resource type. The type must be defined in the - # {::Google::Api::Service#monitored_resources Service.monitored_resources} - # section. - # @!attribute [rw] logs - # @return [::Array<::String>] - # Names of the logs to be sent to this destination. Each name must - # be defined in the {::Google::Api::Service#logs Service.logs} section. If the - # log name is not a domain scoped name, it will be automatically prefixed - # with the service name followed by "/". - class LoggingDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/metric.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/metric.rb deleted file mode 100644 index 329058c374d6..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/metric.rb +++ /dev/null @@ -1,299 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Defines a metric type and its schema. Once a metric descriptor is created, - # deleting or altering it stops data collection and makes the metric type's - # existing data unusable. - # @!attribute [rw] name - # @return [::String] - # The resource name of the metric descriptor. - # @!attribute [rw] type - # @return [::String] - # The metric type, including its DNS name prefix. The type is not - # URL-encoded. All user-defined metric types have the DNS name - # `custom.googleapis.com` or `external.googleapis.com`. Metric types should - # use a natural hierarchical grouping. For example: - # - # "custom.googleapis.com/invoice/paid/amount" - # "external.googleapis.com/prometheus/up" - # "appengine.googleapis.com/http/server/response_latencies" - # @!attribute [rw] labels - # @return [::Array<::Google::Api::LabelDescriptor>] - # The set of labels that can be used to describe a specific - # instance of this metric type. For example, the - # `appengine.googleapis.com/http/server/response_latencies` metric - # type has a label for the HTTP response code, `response_code`, so - # you can look at latencies for successful responses or just - # for responses that failed. - # @!attribute [rw] metric_kind - # @return [::Google::Api::MetricDescriptor::MetricKind] - # Whether the metric records instantaneous values, changes to a value, etc. - # Some combinations of `metric_kind` and `value_type` might not be supported. - # @!attribute [rw] value_type - # @return [::Google::Api::MetricDescriptor::ValueType] - # Whether the measurement is an integer, a floating-point number, etc. - # Some combinations of `metric_kind` and `value_type` might not be supported. - # @!attribute [rw] unit - # @return [::String] - # The units in which the metric value is reported. It is only applicable - # if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` - # defines the representation of the stored metric values. - # - # Different systems might scale the values to be more easily displayed (so a - # value of `0.02kBy` _might_ be displayed as `20By`, and a value of - # `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is - # `kBy`, then the value of the metric is always in thousands of bytes, no - # matter how it might be displayed. - # - # If you want a custom metric to record the exact number of CPU-seconds used - # by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is - # `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 - # CPU-seconds, then the value is written as `12005`. - # - # Alternatively, if you want a custom metric to record data in a more - # granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is - # `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), - # or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). - # - # The supported units are a subset of [The Unified Code for Units of - # Measure](https://unitsofmeasure.org/ucum.html) standard: - # - # **Basic units (UNIT)** - # - # * `bit` bit - # * `By` byte - # * `s` second - # * `min` minute - # * `h` hour - # * `d` day - # * `1` dimensionless - # - # **Prefixes (PREFIX)** - # - # * `k` kilo (10^3) - # * `M` mega (10^6) - # * `G` giga (10^9) - # * `T` tera (10^12) - # * `P` peta (10^15) - # * `E` exa (10^18) - # * `Z` zetta (10^21) - # * `Y` yotta (10^24) - # - # * `m` milli (10^-3) - # * `u` micro (10^-6) - # * `n` nano (10^-9) - # * `p` pico (10^-12) - # * `f` femto (10^-15) - # * `a` atto (10^-18) - # * `z` zepto (10^-21) - # * `y` yocto (10^-24) - # - # * `Ki` kibi (2^10) - # * `Mi` mebi (2^20) - # * `Gi` gibi (2^30) - # * `Ti` tebi (2^40) - # * `Pi` pebi (2^50) - # - # **Grammar** - # - # The grammar also includes these connectors: - # - # * `/` division or ratio (as an infix operator). For examples, - # `kBy/{email}` or `MiBy/10ms` (although you should almost never - # have `/s` in a metric `unit`; rates should always be computed at - # query time from the underlying cumulative or delta value). - # * `.` multiplication or composition (as an infix operator). For - # examples, `GBy.d` or `k{watt}.h`. - # - # The grammar for a unit is as follows: - # - # Expression = Component { "." Component } { "/" Component } ; - # - # Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - # | Annotation - # | "1" - # ; - # - # Annotation = "{" NAME "}" ; - # - # Notes: - # - # * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - # is used alone, then the unit is equivalent to `1`. For examples, - # `{request}/s == 1/s`, `By{transmitted}/s == By/s`. - # * `NAME` is a sequence of non-blank printable ASCII characters not - # containing `{` or `}`. - # * `1` represents a unitary [dimensionless - # unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - # as in `1/s`. It is typically used when none of the basic units are - # appropriate. For example, "new users per day" can be represented as - # `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - # users). Alternatively, "thousands of page views per day" would be - # represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - # value of `5.3` would mean "5300 page views per day"). - # * `%` represents dimensionless value of 1/100, and annotates values giving - # a percentage (so the metric values are typically in the range of 0..100, - # and a metric value `3` means "3 percent"). - # * `10^2.%` indicates a metric contains a ratio, typically in the range - # 0..1, that will be multiplied by 100 and displayed as a percentage - # (so a metric value `0.03` means "3 percent"). - # @!attribute [rw] description - # @return [::String] - # A detailed description of the metric, which can be used in documentation. - # @!attribute [rw] display_name - # @return [::String] - # A concise name for the metric, which can be displayed in user interfaces. - # Use sentence case without an ending period, for example "Request count". - # This field is optional but it is recommended to be set for any metrics - # associated with user-visible concepts, such as Quota. - # @!attribute [rw] metadata - # @return [::Google::Api::MetricDescriptor::MetricDescriptorMetadata] - # Optional. Metadata which can be used to guide usage of the metric. - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Optional. The launch stage of the metric definition. - # @!attribute [rw] monitored_resource_types - # @return [::Array<::String>] - # Read-only. If present, then a [time - # series][google.monitoring.v3.TimeSeries], which is identified partially by - # a metric type and a - # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor}, that - # is associated with this metric type can only be associated with one of the - # monitored resource types listed here. - class MetricDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Additional annotations that can be used to guide the usage of a metric. - # @!attribute [rw] launch_stage - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Api::LaunchStage] - # Deprecated. Must use the - # {::Google::Api::MetricDescriptor#launch_stage MetricDescriptor.launch_stage} - # instead. - # @!attribute [rw] sample_period - # @return [::Google::Protobuf::Duration] - # The sampling period of metric data points. For metrics which are written - # periodically, consecutive data points are stored at this time interval, - # excluding data loss due to errors. Metrics with a higher granularity have - # a smaller sampling period. - # @!attribute [rw] ingest_delay - # @return [::Google::Protobuf::Duration] - # The delay of data points caused by ingestion. Data points older than this - # age are guaranteed to be ingested and available to be read, excluding - # data loss due to errors. - # @!attribute [rw] time_series_resource_hierarchy_level - # @return [::Array<::Google::Api::MetricDescriptor::MetricDescriptorMetadata::TimeSeriesResourceHierarchyLevel>] - # The scope of the timeseries data of the metric. - class MetricDescriptorMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The resource hierarchy level of the timeseries data of a metric. - module TimeSeriesResourceHierarchyLevel - # Do not use this default value. - TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0 - - # Scopes a metric to a project. - PROJECT = 1 - - # Scopes a metric to an organization. - ORGANIZATION = 2 - - # Scopes a metric to a folder. - FOLDER = 3 - end - end - - # The kind of measurement. It describes how the data is reported. - # For information on setting the start time and end time based on - # the MetricKind, see [TimeInterval][google.monitoring.v3.TimeInterval]. - module MetricKind - # Do not use this default value. - METRIC_KIND_UNSPECIFIED = 0 - - # An instantaneous measurement of a value. - GAUGE = 1 - - # The change in a value during a time interval. - DELTA = 2 - - # A value accumulated over a time interval. Cumulative - # measurements in a time series should have the same start time - # and increasing end times, until an event resets the cumulative - # value to zero and sets a new start time for the following - # points. - CUMULATIVE = 3 - end - - # The value type of a metric. - module ValueType - # Do not use this default value. - VALUE_TYPE_UNSPECIFIED = 0 - - # The value is a boolean. - # This value type can be used only if the metric kind is `GAUGE`. - BOOL = 1 - - # The value is a signed 64-bit integer. - INT64 = 2 - - # The value is a double precision floating point number. - DOUBLE = 3 - - # The value is a text string. - # This value type can be used only if the metric kind is `GAUGE`. - STRING = 4 - - # The value is a [`Distribution`][google.api.Distribution]. - DISTRIBUTION = 5 - - # The value is money. - MONEY = 6 - end - end - - # A specific metric, identified by specifying values for all of the - # labels of a {::Google::Api::MetricDescriptor `MetricDescriptor`}. - # @!attribute [rw] type - # @return [::String] - # An existing metric type, see - # {::Google::Api::MetricDescriptor google.api.MetricDescriptor}. For example, - # `custom.googleapis.com/invoice/paid/amount`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The set of label values that uniquely identify this metric. All - # labels listed in the `MetricDescriptor` must be assigned values. - class Metric - 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 - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb deleted file mode 100644 index 4d1ec410ddac..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb +++ /dev/null @@ -1,150 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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 object that describes the schema of a - # {::Google::Api::MonitoredResource MonitoredResource} object using a type name - # and a set of labels. For example, the monitored resource descriptor for - # Google Compute Engine VM instances has a type of - # `"gce_instance"` and specifies the use of the labels `"instance_id"` and - # `"zone"` to identify particular VM instances. - # - # Different APIs can support different monitored resource types. APIs generally - # provide a `list` method that returns the monitored resource descriptors used - # by the API. - # @!attribute [rw] name - # @return [::String] - # Optional. The resource name of the monitored resource descriptor: - # `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where - # \\{type} is the value of the `type` field in this object and - # \\{project_id} is a project ID that provides API-specific context for - # accessing the type. APIs that do not use project information can use the - # resource name format `"monitoredResourceDescriptors/{type}"`. - # @!attribute [rw] type - # @return [::String] - # Required. The monitored resource type. For example, the type - # `"cloudsql_database"` represents databases in Google Cloud SQL. - # For a list of types, see [Monitored resource - # types](https://cloud.google.com/monitoring/api/resources) - # and [Logging resource - # types](https://cloud.google.com/logging/docs/api/v2/resource-list). - # @!attribute [rw] display_name - # @return [::String] - # Optional. A concise name for the monitored resource type that might be - # displayed in user interfaces. It should be a Title Cased Noun Phrase, - # without any article or other determiners. For example, - # `"Google Cloud SQL Database"`. - # @!attribute [rw] description - # @return [::String] - # Optional. A detailed description of the monitored resource type that might - # be used in documentation. - # @!attribute [rw] labels - # @return [::Array<::Google::Api::LabelDescriptor>] - # Required. A set of labels used to describe instances of this monitored - # resource type. For example, an individual Google Cloud SQL database is - # identified by values for the labels `"database_id"` and `"zone"`. - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Optional. The launch stage of the monitored resource definition. - class MonitoredResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An object representing a resource that can be used for monitoring, logging, - # billing, or other purposes. Examples include virtual machine instances, - # databases, and storage devices such as disks. The `type` field identifies a - # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} object - # that describes the resource's schema. Information in the `labels` field - # identifies the actual resource and its attributes according to the schema. - # For example, a particular Compute Engine VM instance could be represented by - # the following object, because the - # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} for - # `"gce_instance"` has labels - # `"project_id"`, `"instance_id"` and `"zone"`: - # - # { "type": "gce_instance", - # "labels": { "project_id": "my-project", - # "instance_id": "12345678901234", - # "zone": "us-central1-a" }} - # @!attribute [rw] type - # @return [::String] - # Required. The monitored resource type. This field must match - # the `type` field of a - # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} - # object. For example, the type of a Compute Engine VM instance is - # `gce_instance`. Some descriptors include the service name in the type; for - # example, the type of a Datastream stream is - # `datastream.googleapis.com/Stream`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Required. Values for all of the labels listed in the associated monitored - # resource descriptor. For example, Compute Engine VM instances use the - # labels `"project_id"`, `"instance_id"`, and `"zone"`. - class MonitoredResource - 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 - - # Auxiliary metadata for a {::Google::Api::MonitoredResource MonitoredResource} - # object. {::Google::Api::MonitoredResource MonitoredResource} objects contain the - # minimum set of information to uniquely identify a monitored resource - # instance. There is some other useful auxiliary metadata. Monitoring and - # Logging use an ingestion pipeline to extract metadata for cloud resources of - # all types, and store the metadata in this message. - # @!attribute [rw] system_labels - # @return [::Google::Protobuf::Struct] - # Output only. Values for predefined system metadata labels. - # System labels are a kind of metadata extracted by Google, including - # "machine_image", "vpc", "subnet_id", - # "security_group", "name", etc. - # System label values can be only strings, Boolean values, or a list of - # strings. For example: - # - # { "name": "my-test-instance", - # "security_group": ["a", "b", "c"], - # "spot_instance": false } - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. A map of user-defined metadata labels. - class MonitoredResourceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitoring.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitoring.rb deleted file mode 100644 index 09aaf1885816..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/monitoring.rb +++ /dev/null @@ -1,112 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Monitoring configuration of the service. - # - # The example below shows how to configure monitored resources and metrics - # for monitoring. In the example, a monitored resource and two metrics are - # defined. The `library.googleapis.com/book/returned_count` metric is sent - # to both producer and consumer projects, whereas the - # `library.googleapis.com/book/num_overdue` metric is only sent to the - # consumer project. - # - # monitored_resources: - # - type: library.googleapis.com/Branch - # display_name: "Library Branch" - # description: "A branch of a library." - # launch_stage: GA - # labels: - # - key: resource_container - # description: "The Cloud container (ie. project id) for the Branch." - # - key: location - # description: "The location of the library branch." - # - key: branch_id - # description: "The id of the branch." - # metrics: - # - name: library.googleapis.com/book/returned_count - # display_name: "Books Returned" - # description: "The count of books that have been returned." - # launch_stage: GA - # metric_kind: DELTA - # value_type: INT64 - # unit: "1" - # labels: - # - key: customer_id - # description: "The id of the customer." - # - name: library.googleapis.com/book/num_overdue - # display_name: "Books Overdue" - # description: "The current number of overdue books." - # launch_stage: GA - # metric_kind: GAUGE - # value_type: INT64 - # unit: "1" - # labels: - # - key: customer_id - # description: "The id of the customer." - # monitoring: - # producer_destinations: - # - monitored_resource: library.googleapis.com/Branch - # metrics: - # - library.googleapis.com/book/returned_count - # consumer_destinations: - # - monitored_resource: library.googleapis.com/Branch - # metrics: - # - library.googleapis.com/book/returned_count - # - library.googleapis.com/book/num_overdue - # @!attribute [rw] producer_destinations - # @return [::Array<::Google::Api::Monitoring::MonitoringDestination>] - # Monitoring configurations for sending metrics to the producer project. - # There can be multiple producer destinations. A monitored resource type may - # appear in multiple monitoring destinations if different aggregations are - # needed for different sets of metrics associated with that monitored - # resource type. A monitored resource and metric pair may only be used once - # in the Monitoring configuration. - # @!attribute [rw] consumer_destinations - # @return [::Array<::Google::Api::Monitoring::MonitoringDestination>] - # Monitoring configurations for sending metrics to the consumer project. - # There can be multiple consumer destinations. A monitored resource type may - # appear in multiple monitoring destinations if different aggregations are - # needed for different sets of metrics associated with that monitored - # resource type. A monitored resource and metric pair may only be used once - # in the Monitoring configuration. - class Monitoring - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration of a specific monitoring destination (the producer project - # or the consumer project). - # @!attribute [rw] monitored_resource - # @return [::String] - # The monitored resource type. The type must be defined in - # {::Google::Api::Service#monitored_resources Service.monitored_resources} - # section. - # @!attribute [rw] metrics - # @return [::Array<::String>] - # Types of the metrics to report to this monitoring destination. - # Each type must be defined in - # {::Google::Api::Service#metrics Service.metrics} section. - class MonitoringDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/policy.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/policy.rb deleted file mode 100644 index eb5db26fc933..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/policy.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 Api - # Google API Policy Annotation - # - # This message defines a simple API policy annotation that can be used to - # annotate API request and response message fields with applicable policies. - # One field may have multiple applicable policies that must all be satisfied - # before a request can be processed. This policy annotation is used to - # generate the overall policy that will be used for automatic runtime - # policy enforcement and documentation generation. - # @!attribute [rw] selector - # @return [::String] - # Selects one or more request or response message fields to apply this - # `FieldPolicy`. - # - # When a `FieldPolicy` is used in proto annotation, the selector must - # be left as empty. The service config generator will automatically fill - # the correct value. - # - # When a `FieldPolicy` is used in service config, the selector must be a - # comma-separated string with valid request or response field paths, - # such as "foo.bar" or "foo.bar,foo.baz". - # @!attribute [rw] resource_permission - # @return [::String] - # Specifies the required permission(s) for the resource referred to by the - # field. It requires the field contains a valid resource reference, and - # the request must pass the permission checks to proceed. For example, - # "resourcemanager.projects.get". - # @!attribute [rw] resource_type - # @return [::String] - # Specifies the resource type for the resource referred to by the field. - class FieldPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines policies applying to an RPC method. - # @!attribute [rw] selector - # @return [::String] - # Selects a method to which these policies should be enforced, for example, - # "google.pubsub.v1.Subscriber.CreateSubscription". - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # - # NOTE: This field must not be set in the proto annotation. It will be - # automatically filled by the service config compiler . - # @!attribute [rw] request_policies - # @return [::Array<::Google::Api::FieldPolicy>] - # Policies that are applicable to the request message. - class MethodPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/quota.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/quota.rb deleted file mode 100644 index 606c3036c888..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/quota.rb +++ /dev/null @@ -1,208 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Quota configuration helps to achieve fairness and budgeting in service - # usage. - # - # The metric based quota configuration works this way: - # - The service configuration defines a set of metrics. - # - For API calls, the quota.metric_rules maps methods to metrics with - # corresponding costs. - # - The quota.limits defines limits on the metrics, which will be used for - # quota checks at runtime. - # - # An example quota configuration in yaml format: - # - # quota: - # limits: - # - # - name: apiWriteQpsPerProject - # metric: library.googleapis.com/write_calls - # unit: "1/min/\\{project}" # rate limit for consumer projects - # values: - # STANDARD: 10000 - # - # - # (The metric rules bind all methods to the read_calls metric, - # except for the UpdateBook and DeleteBook methods. These two methods - # are mapped to the write_calls metric, with the UpdateBook method - # consuming at twice rate as the DeleteBook method.) - # metric_rules: - # - selector: "*" - # metric_costs: - # library.googleapis.com/read_calls: 1 - # - selector: google.example.library.v1.LibraryService.UpdateBook - # metric_costs: - # library.googleapis.com/write_calls: 2 - # - selector: google.example.library.v1.LibraryService.DeleteBook - # metric_costs: - # library.googleapis.com/write_calls: 1 - # - # Corresponding Metric definition: - # - # metrics: - # - name: library.googleapis.com/read_calls - # display_name: Read requests - # metric_kind: DELTA - # value_type: INT64 - # - # - name: library.googleapis.com/write_calls - # display_name: Write requests - # metric_kind: DELTA - # value_type: INT64 - # @!attribute [rw] limits - # @return [::Array<::Google::Api::QuotaLimit>] - # List of QuotaLimit definitions for the service. - # @!attribute [rw] metric_rules - # @return [::Array<::Google::Api::MetricRule>] - # List of MetricRule definitions, each one mapping a selected method to one - # or more metrics. - class Quota - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Bind API methods to metrics. Binding a method to a metric causes that - # metric's configured quota behaviors to apply to the method call. - # @!attribute [rw] selector - # @return [::String] - # Selects the methods to which this rule applies. - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # @!attribute [rw] metric_costs - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # Metrics to update when the selected methods are called, and the associated - # cost applied to each metric. - # - # The key of the map is the metric name, and the values are the amount - # increased for the metric against which the quota limits are defined. - # The value must not be negative. - class MetricRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class MetricCostsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `QuotaLimit` defines a specific limit that applies over a specified duration - # for a limit type. There can be at most one limit for a duration and limit - # type combination defined within a `QuotaGroup`. - # @!attribute [rw] name - # @return [::String] - # Name of the quota limit. - # - # The name must be provided, and it must be unique within the service. The - # name can only include alphanumeric characters as well as '-'. - # - # The maximum length of the limit name is 64 characters. - # @!attribute [rw] description - # @return [::String] - # Optional. User-visible, extended description for this quota limit. - # Should be used only when more context is needed to understand this limit - # than provided by the limit's display name (see: `display_name`). - # @!attribute [rw] default_limit - # @return [::Integer] - # Default number of tokens that can be consumed during the specified - # duration. This is the number of tokens assigned when a client - # application developer activates the service for his/her project. - # - # Specifying a value of 0 will block all requests. This can be used if you - # are provisioning quota to selected consumers and blocking others. - # Similarly, a value of -1 will indicate an unlimited quota. No other - # negative values are allowed. - # - # Used by group-based quotas only. - # @!attribute [rw] max_limit - # @return [::Integer] - # Maximum number of tokens that can be consumed during the specified - # duration. Client application developers can override the default limit up - # to this maximum. If specified, this value cannot be set to a value less - # than the default limit. If not specified, it is set to the default limit. - # - # To allow clients to apply overrides with no upper bound, set this to -1, - # indicating unlimited maximum quota. - # - # Used by group-based quotas only. - # @!attribute [rw] free_tier - # @return [::Integer] - # Free tier value displayed in the Developers Console for this limit. - # The free tier is the number of tokens that will be subtracted from the - # billed amount when billing is enabled. - # This field can only be set on a limit with duration "1d", in a billable - # group; it is invalid on any other limit. If this field is not set, it - # defaults to 0, indicating that there is no free tier for this service. - # - # Used by group-based quotas only. - # @!attribute [rw] duration - # @return [::String] - # Duration of this limit in textual notation. Must be "100s" or "1d". - # - # Used by group-based quotas only. - # @!attribute [rw] metric - # @return [::String] - # The name of the metric this quota limit applies to. The quota limits with - # the same metric will be checked together during runtime. The metric must be - # defined within the service config. - # @!attribute [rw] unit - # @return [::String] - # Specify the unit of the quota limit. It uses the same syntax as - # {::Google::Api::MetricDescriptor#unit MetricDescriptor.unit}. The supported - # unit kinds are determined by the quota backend system. - # - # Here are some examples: - # * "1/min/\\{project}" for quota per minute per project. - # - # Note: the order of unit components is insignificant. - # The "1" at the beginning is required to follow the metric unit syntax. - # @!attribute [rw] values - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # Tiered limit values. You must specify this as a key:value pair, with an - # integer value that is the maximum number of requests allowed for the - # specified unit. Currently only STANDARD is supported. - # @!attribute [rw] display_name - # @return [::String] - # User-visible display name for this limit. - # Optional. If not set, the UI will provide a default display name based on - # the quota configuration. This field can be used to override the default - # display name generated from the configuration. - class QuotaLimit - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class ValuesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/service.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/service.rb deleted file mode 100644 index 49f36f188207..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/service.rb +++ /dev/null @@ -1,170 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # `Service` is the root object of Google API service configuration (service - # config). It describes the basic information about a logical service, - # such as the service name and the user-facing title, and delegates other - # aspects to sub-sections. Each sub-section is either a proto message or a - # repeated proto message that configures a specific aspect, such as auth. - # For more information, see each proto message definition. - # - # Example: - # - # type: google.api.Service - # name: calendar.googleapis.com - # title: Google Calendar API - # apis: - # - name: google.calendar.v3.Calendar - # - # visibility: - # rules: - # - selector: "google.calendar.v3.*" - # restriction: PREVIEW - # backend: - # rules: - # - selector: "google.calendar.v3.*" - # address: calendar.example.com - # - # authentication: - # providers: - # - id: google_calendar_auth - # jwks_uri: https://www.googleapis.com/oauth2/v1/certs - # issuer: https://securetoken.google.com - # rules: - # - selector: "*" - # requirements: - # provider_id: google_calendar_auth - # @!attribute [rw] name - # @return [::String] - # The service name, which is a DNS-like logical identifier for the - # service, such as `calendar.googleapis.com`. The service name - # typically goes through DNS verification to make sure the owner - # of the service also owns the DNS name. - # @!attribute [rw] title - # @return [::String] - # The product title for this service, it is the name displayed in Google - # Cloud Console. - # @!attribute [rw] producer_project_id - # @return [::String] - # The Google project that owns this service. - # @!attribute [rw] id - # @return [::String] - # A unique ID for a specific instance of this message, typically assigned - # by the client for tracking purpose. Must be no longer than 63 characters - # and only lower case letters, digits, '.', '_' and '-' are allowed. If - # empty, the server may choose to generate one instead. - # @!attribute [rw] apis - # @return [::Array<::Google::Protobuf::Api>] - # A list of API interfaces exported by this service. Only the `name` field - # of the {::Google::Protobuf::Api google.protobuf.Api} needs to be provided by - # the configuration author, as the remaining fields will be derived from the - # IDL during the normalization process. It is an error to specify an API - # interface here which cannot be resolved against the associated IDL files. - # @!attribute [rw] types - # @return [::Array<::Google::Protobuf::Type>] - # A list of all proto message types included in this API service. - # Types referenced directly or indirectly by the `apis` are automatically - # included. Messages which are not referenced but shall be included, such as - # types used by the `google.protobuf.Any` type, should be listed here by - # name by the configuration author. Example: - # - # types: - # - name: google.protobuf.Int32 - # @!attribute [rw] enums - # @return [::Array<::Google::Protobuf::Enum>] - # A list of all enum types included in this API service. Enums referenced - # directly or indirectly by the `apis` are automatically included. Enums - # which are not referenced but shall be included should be listed here by - # name by the configuration author. Example: - # - # enums: - # - name: google.someapi.v1.SomeEnum - # @!attribute [rw] documentation - # @return [::Google::Api::Documentation] - # Additional API documentation. - # @!attribute [rw] backend - # @return [::Google::Api::Backend] - # API backend configuration. - # @!attribute [rw] http - # @return [::Google::Api::Http] - # HTTP configuration. - # @!attribute [rw] quota - # @return [::Google::Api::Quota] - # Quota configuration. - # @!attribute [rw] authentication - # @return [::Google::Api::Authentication] - # Auth configuration. - # @!attribute [rw] context - # @return [::Google::Api::Context] - # Context configuration. - # @!attribute [rw] usage - # @return [::Google::Api::Usage] - # Configuration controlling usage of this service. - # @!attribute [rw] endpoints - # @return [::Array<::Google::Api::Endpoint>] - # Configuration for network endpoints. If this is empty, then an endpoint - # with the same name as the service is automatically generated to service all - # defined APIs. - # @!attribute [rw] control - # @return [::Google::Api::Control] - # Configuration for the service control plane. - # @!attribute [rw] logs - # @return [::Array<::Google::Api::LogDescriptor>] - # Defines the logs used by this service. - # @!attribute [rw] metrics - # @return [::Array<::Google::Api::MetricDescriptor>] - # Defines the metrics used by this service. - # @!attribute [rw] monitored_resources - # @return [::Array<::Google::Api::MonitoredResourceDescriptor>] - # Defines the monitored resources used by this service. This is required - # by the `Service.monitoring` and `Service.logging` configurations. - # @!attribute [rw] billing - # @return [::Google::Api::Billing] - # Billing configuration. - # @!attribute [rw] logging - # @return [::Google::Api::Logging] - # Logging configuration. - # @!attribute [rw] monitoring - # @return [::Google::Api::Monitoring] - # Monitoring configuration. - # @!attribute [rw] system_parameters - # @return [::Google::Api::SystemParameters] - # System parameter configuration. - # @!attribute [rw] source_info - # @return [::Google::Api::SourceInfo] - # Output only. The source information for this configuration if available. - # @!attribute [rw] publishing - # @return [::Google::Api::Publishing] - # Settings for [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from APIs defined as protocol buffers. - # @!attribute [rw] config_version - # @return [::Google::Protobuf::UInt32Value] - # Obsolete. Do not use. - # - # This field has no semantic meaning. The service config compiler always - # sets this field to `3`. - class Service - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/resources.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/resources.rb deleted file mode 100644 index a314ecbf57fa..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/resources.rb +++ /dev/null @@ -1,332 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceManagement - module V1 - # The full representation of a Service that is managed by - # Google Service Management. - # @!attribute [rw] service_name - # @return [::String] - # The name of the service. See the - # [overview](https://cloud.google.com/service-infrastructure/docs/overview) - # for naming requirements. - # @!attribute [rw] producer_project_id - # @return [::String] - # ID of the project that produces and owns this service. - class ManagedService - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The metadata associated with a long running operation resource. - # @!attribute [rw] resource_names - # @return [::Array<::String>] - # The full name of the resources that this operation is directly - # associated with. - # @!attribute [rw] steps - # @return [::Array<::Google::Cloud::ServiceManagement::V1::OperationMetadata::Step>] - # Detailed status information for each step. The order is undetermined. - # @!attribute [rw] progress_percentage - # @return [::Integer] - # Percentage of completion of this operation, ranging from 0 to 100. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The start time of the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the status of one operation step. - # @!attribute [rw] description - # @return [::String] - # The short description of the step. - # @!attribute [rw] status - # @return [::Google::Cloud::ServiceManagement::V1::OperationMetadata::Status] - # The status code. - class Step - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Code describes the status of the operation (or one of its steps). - module Status - # Unspecifed code. - STATUS_UNSPECIFIED = 0 - - # The operation or step has completed without errors. - DONE = 1 - - # The operation or step has not started yet. - NOT_STARTED = 2 - - # The operation or step is in progress. - IN_PROGRESS = 3 - - # The operation or step has completed with errors. If the operation is - # rollbackable, the rollback completed with errors too. - FAILED = 4 - - # The operation or step has completed with cancellation. - CANCELLED = 5 - end - end - - # Represents a diagnostic message (error or warning) - # @!attribute [rw] location - # @return [::String] - # File name and line number of the error or warning. - # @!attribute [rw] kind - # @return [::Google::Cloud::ServiceManagement::V1::Diagnostic::Kind] - # The kind of diagnostic information provided. - # @!attribute [rw] message - # @return [::String] - # Message describing the error or warning. - class Diagnostic - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The kind of diagnostic information possible. - module Kind - # Warnings and errors - WARNING = 0 - - # Only errors - ERROR = 1 - end - end - - # Represents a source file which is used to generate the service configuration - # defined by `google.api.Service`. - # @!attribute [rw] id - # @return [::String] - # A unique ID for a specific instance of this message, typically assigned - # by the client for tracking purpose. If empty, the server may choose to - # generate one instead. - # @!attribute [rw] files - # @return [::Array<::Google::Cloud::ServiceManagement::V1::ConfigFile>] - # Set of source configuration files that are used to generate a service - # configuration (`google.api.Service`). - class ConfigSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Generic specification of a source configuration file - # @!attribute [rw] file_path - # @return [::String] - # The file name of the configuration file (full or relative path). - # @!attribute [rw] file_contents - # @return [::String] - # The bytes that constitute the file. - # @!attribute [rw] file_type - # @return [::Google::Cloud::ServiceManagement::V1::ConfigFile::FileType] - # The type of configuration file this represents. - class ConfigFile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - module FileType - # Unknown file type. - FILE_TYPE_UNSPECIFIED = 0 - - # YAML-specification of service. - SERVICE_CONFIG_YAML = 1 - - # OpenAPI specification, serialized in JSON. - OPEN_API_JSON = 2 - - # OpenAPI specification, serialized in YAML. - OPEN_API_YAML = 3 - - # FileDescriptorSet, generated by protoc. - # - # To generate, use protoc with imports and source info included. - # For an example test.proto file, the following command would put the value - # in a new file named out.pb. - # - # $protoc --include_imports --include_source_info test.proto -o out.pb - FILE_DESCRIPTOR_SET_PROTO = 4 - - # Uncompiled Proto file. Used for storage and display purposes only, - # currently server-side compilation is not supported. Should match the - # inputs to 'protoc' command used to generated FILE_DESCRIPTOR_SET_PROTO. A - # file of this type can only be included if at least one file of type - # FILE_DESCRIPTOR_SET_PROTO is included. - PROTO_FILE = 6 - end - end - - # Represents a service configuration with its name and id. - # @!attribute [rw] name - # @return [::String] - # Resource name of a service config. It must have the following - # format: "services/\\{service name}/configs/\\{config id}". - class ConfigRef - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Change report associated with a particular service configuration. - # - # It contains a list of ConfigChanges based on the comparison between - # two service configurations. - # @!attribute [rw] config_changes - # @return [::Array<::Google::Api::ConfigChange>] - # List of changes between two service configurations. - # The changes will be alphabetically sorted based on the identifier - # of each change. - # A ConfigChange identifier is a dot separated path to the configuration. - # Example: visibility.rules[selector='LibraryService.CreateBook'].restriction - class ChangeReport - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A rollout resource that defines how service configuration versions are pushed - # to control plane systems. Typically, you create a new version of the - # service config, and then create a Rollout to push the service config. - # @!attribute [rw] rollout_id - # @return [::String] - # Optional. Unique identifier of this Rollout. Must be no longer than 63 - # characters and only lower case letters, digits, '.', '_' and '-' are - # allowed. - # - # If not specified by client, the server will generate one. The generated id - # will have the form of , where "date" is the create - # date in ISO 8601 format. "revision number" is a monotonically increasing - # positive number that is reset every day for each service. - # An example of the generated rollout_id is '2016-02-16r1' - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Creation time of the rollout. Readonly. - # @!attribute [rw] created_by - # @return [::String] - # The user who created the Rollout. Readonly. - # @!attribute [rw] status - # @return [::Google::Cloud::ServiceManagement::V1::Rollout::RolloutStatus] - # The status of this rollout. Readonly. In case of a failed rollout, - # the system will automatically rollback to the current Rollout - # version. Readonly. - # @!attribute [rw] traffic_percent_strategy - # @return [::Google::Cloud::ServiceManagement::V1::Rollout::TrafficPercentStrategy] - # Google Service Control selects service configurations based on - # traffic percentage. - # - # Note: The following fields are mutually exclusive: `traffic_percent_strategy`, `delete_service_strategy`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_service_strategy - # @return [::Google::Cloud::ServiceManagement::V1::Rollout::DeleteServiceStrategy] - # The strategy associated with a rollout to delete a `ManagedService`. - # Readonly. - # - # Note: The following fields are mutually exclusive: `delete_service_strategy`, `traffic_percent_strategy`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] service_name - # @return [::String] - # The name of the service associated with this Rollout. - class Rollout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Strategy that specifies how clients of Google Service Controller want to - # send traffic to use different config versions. This is generally - # used by API proxy to split traffic based on your configured percentage for - # each config version. - # - # One example of how to gradually rollout a new service configuration using - # this - # strategy: - # Day 1 - # - # Rollout { - # id: "example.googleapis.com/rollout_20160206" - # traffic_percent_strategy { - # percentages: { - # "example.googleapis.com/20160201": 70.00 - # "example.googleapis.com/20160206": 30.00 - # } - # } - # } - # - # Day 2 - # - # Rollout { - # id: "example.googleapis.com/rollout_20160207" - # traffic_percent_strategy: { - # percentages: { - # "example.googleapis.com/20160206": 100.00 - # } - # } - # } - # @!attribute [rw] percentages - # @return [::Google::Protobuf::Map{::String => ::Float}] - # Maps service configuration IDs to their corresponding traffic percentage. - # Key is the service configuration ID, Value is the traffic percentage - # which must be greater than 0.0 and the sum must equal to 100.0. - class TrafficPercentStrategy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Float] - class PercentagesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Strategy used to delete a service. This strategy is a placeholder only - # used by the system generated rollout to delete a service. - class DeleteServiceStrategy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Status of a Rollout. - module RolloutStatus - # No status specified. - ROLLOUT_STATUS_UNSPECIFIED = 0 - - # The Rollout is in progress. - IN_PROGRESS = 1 - - # The Rollout has completed successfully. - SUCCESS = 2 - - # The Rollout has been cancelled. This can happen if you have overlapping - # Rollout pushes, and the previous ones will be cancelled. - CANCELLED = 3 - - # The Rollout has failed and the rollback attempt has failed too. - FAILED = 4 - - # The Rollout has not started yet and is pending for execution. - PENDING = 5 - - # The Rollout has failed and rolled back to the previous successful - # Rollout. - FAILED_ROLLED_BACK = 6 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/servicemanager.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/servicemanager.rb deleted file mode 100644 index 8d0f61c93e76..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/servicemanagement/v1/servicemanager.rb +++ /dev/null @@ -1,334 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceManagement - module V1 - # Request message for `ListServices` method. - # @!attribute [rw] producer_project_id - # @return [::String] - # Include services produced by the specified project. - # @!attribute [rw] page_size - # @return [::Integer] - # The max number of items to include in the response list. Page size is 50 - # if not specified. Maximum value is 500. - # @!attribute [rw] page_token - # @return [::String] - # Token identifying which result to start with; returned by a previous list - # call. - # @!attribute [rw] consumer_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Include services consumed by the specified consumer. - # - # The Google Service Management implementation accepts the following - # forms: - # - project: - class ListServicesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `ListServices` method. - # @!attribute [rw] services - # @return [::Array<::Google::Cloud::ServiceManagement::V1::ManagedService>] - # The returned services will only have the name field set. - # @!attribute [rw] next_page_token - # @return [::String] - # Token that can be passed to `ListServices` to resume a paginated query. - class ListServicesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetService` method. - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the `ServiceManager` overview for - # naming requirements. For example: `example.googleapis.com`. - class GetServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateService method. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] - # Required. Initial values for the service resource. - class CreateServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteService method. - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - class DeleteServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UndeleteService method. - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - class UndeleteServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for UndeleteService method. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceManagement::V1::ManagedService] - # Revived service resource. - class UndeleteServiceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetServiceConfig method. - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @!attribute [rw] config_id - # @return [::String] - # Required. The id of the service configuration resource. - # - # This field must be specified for the server to return all fields, including - # `SourceInfo`. - # @!attribute [rw] view - # @return [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest::ConfigView] - # Specifies which parts of the Service Config should be returned in the - # response. - class GetServiceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - module ConfigView - # Server response includes all fields except SourceInfo. - BASIC = 0 - - # Server response includes all fields including SourceInfo. - # SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile' - # and are only available for configs created using the - # SubmitConfigSource method. - FULL = 1 - end - end - - # Request message for ListServiceConfigs method. - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @!attribute [rw] page_token - # @return [::String] - # The token of the page to retrieve. - # @!attribute [rw] page_size - # @return [::Integer] - # The max number of items to include in the response list. Page size is 50 - # if not specified. Maximum value is 100. - class ListServiceConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListServiceConfigs method. - # @!attribute [rw] service_configs - # @return [::Array<::Google::Api::Service>] - # The list of service configuration resources. - # @!attribute [rw] next_page_token - # @return [::String] - # The token of the next page of results. - class ListServiceConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateServiceConfig method. - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @!attribute [rw] service_config - # @return [::Google::Api::Service] - # Required. The service configuration resource. - class CreateServiceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for SubmitConfigSource method. - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @!attribute [rw] config_source - # @return [::Google::Cloud::ServiceManagement::V1::ConfigSource] - # Required. The source configuration for the service. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, this will result in the generation of a - # `google.api.Service` configuration based on the `ConfigSource` provided, - # but the generated config and the sources will NOT be persisted. - class SubmitConfigSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for SubmitConfigSource method. - # @!attribute [rw] service_config - # @return [::Google::Api::Service] - # The generated service configuration. - class SubmitConfigSourceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateServiceRollout' - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @!attribute [rw] rollout - # @return [::Google::Cloud::ServiceManagement::V1::Rollout] - # Required. The rollout resource. The `service_name` field is output only. - class CreateServiceRolloutRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListServiceRollouts' - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @!attribute [rw] page_token - # @return [::String] - # The token of the page to retrieve. - # @!attribute [rw] page_size - # @return [::Integer] - # The max number of items to include in the response list. Page size is 50 - # if not specified. Maximum value is 100. - # @!attribute [rw] filter - # @return [::String] - # Required. Use `filter` to return subset of rollouts. - # The following filters are supported: - # - # -- By [status] - # [google.api.servicemanagement.v1.Rollout.RolloutStatus]. For example, - # `filter='status=SUCCESS'` - # - # -- By [strategy] - # [google.api.servicemanagement.v1.Rollout.strategy]. For example, - # `filter='strategy=TrafficPercentStrategy'` - class ListServiceRolloutsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListServiceRollouts method. - # @!attribute [rw] rollouts - # @return [::Array<::Google::Cloud::ServiceManagement::V1::Rollout>] - # The list of rollout resources. - # @!attribute [rw] next_page_token - # @return [::String] - # The token of the next page of results. - class ListServiceRolloutsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetServiceRollout method. - # @!attribute [rw] service_name - # @return [::String] - # Required. The name of the service. See the - # [overview](https://cloud.google.com/service-management/overview) for naming - # requirements. For example: `example.googleapis.com`. - # @!attribute [rw] rollout_id - # @return [::String] - # Required. The id of the rollout resource. - class GetServiceRolloutRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Operation payload for EnableService method. - class EnableServiceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GenerateConfigReport method. - # @!attribute [rw] new_config - # @return [::Google::Protobuf::Any] - # Required. Service configuration for which we want to generate the report. - # For this version of API, the supported types are - # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, - # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, - # and {::Google::Api::Service google.api.Service} - # @!attribute [rw] old_config - # @return [::Google::Protobuf::Any] - # Optional. Service configuration against which the comparison will be done. - # For this version of API, the supported types are - # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, - # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, - # and {::Google::Api::Service google.api.Service} - class GenerateConfigReportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for GenerateConfigReport method. - # @!attribute [rw] service_name - # @return [::String] - # Name of the service this report belongs to. - # @!attribute [rw] id - # @return [::String] - # ID of the service configuration this report belongs to. - # @!attribute [rw] change_reports - # @return [::Array<::Google::Cloud::ServiceManagement::V1::ChangeReport>] - # list of ChangeReport, each corresponding to comparison between two - # service configurations. - # @!attribute [rw] diagnostics - # @return [::Array<::Google::Cloud::ServiceManagement::V1::Diagnostic>] - # Errors / Linter warnings associated with the service definition this - # report - # belongs to. - class GenerateConfigReportResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/source_info.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/source_info.rb deleted file mode 100644 index c7bfc8db0769..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/source_info.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Source information used to create a Service Config - # @!attribute [rw] source_files - # @return [::Array<::Google::Protobuf::Any>] - # All files used during config generation. - class SourceInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/system_parameter.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/system_parameter.rb deleted file mode 100644 index 4bb72da7b22c..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/system_parameter.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # ### System parameter configuration - # - # A system parameter is a special kind of parameter defined by the API - # system, not by an individual API. It is typically mapped to an HTTP header - # and/or a URL query parameter. This configuration specifies which methods - # change the names of the system parameters. - # @!attribute [rw] rules - # @return [::Array<::Google::Api::SystemParameterRule>] - # Define system parameters. - # - # The parameters defined here will override the default parameters - # implemented by the system. If this field is missing from the service - # config, default system parameters will be used. Default system parameters - # and names is implementation-dependent. - # - # Example: define api key for all methods - # - # system_parameters - # rules: - # - selector: "*" - # parameters: - # - name: api_key - # url_query_parameter: api_key - # - # - # Example: define 2 api key names for a specific method. - # - # system_parameters - # rules: - # - selector: "/ListShelves" - # parameters: - # - name: api_key - # http_header: Api-Key1 - # - name: api_key - # http_header: Api-Key2 - # - # **NOTE:** All service configuration rules follow "last one wins" order. - class SystemParameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Define a system parameter rule mapping system parameter definitions to - # methods. - # @!attribute [rw] selector - # @return [::String] - # Selects the methods to which this rule applies. Use '*' to indicate all - # methods in all APIs. - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # @!attribute [rw] parameters - # @return [::Array<::Google::Api::SystemParameter>] - # Define parameters. Multiple names may be defined for a parameter. - # For a given method call, only one of them should be used. If multiple - # names are used the behavior is implementation-dependent. - # If none of the specified names are present the behavior is - # parameter-dependent. - class SystemParameterRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Define a parameter's name and location. The parameter may be passed as either - # an HTTP header or a URL query parameter, and if both are passed the behavior - # is implementation-dependent. - # @!attribute [rw] name - # @return [::String] - # Define the name of the parameter, such as "api_key" . It is case sensitive. - # @!attribute [rw] http_header - # @return [::String] - # Define the HTTP header name to use for the parameter. It is case - # insensitive. - # @!attribute [rw] url_query_parameter - # @return [::String] - # Define the URL query parameter name to use for the parameter. It is case - # sensitive. - class SystemParameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/usage.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/usage.rb deleted file mode 100644 index 42ed23536d71..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/api/usage.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Configuration controlling usage of a service. - # @!attribute [rw] requirements - # @return [::Array<::String>] - # Requirements that must be satisfied before a consumer project can use the - # service. Each requirement is of the form /; - # for example 'serviceusage.googleapis.com/billing-enabled'. - # - # For Google APIs, a Terms of Service requirement must be included here. - # Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". - # Other Google APIs should include - # "serviceusage.googleapis.com/tos/universal". Additional ToS can be - # included based on the business needs. - # @!attribute [rw] rules - # @return [::Array<::Google::Api::UsageRule>] - # A list of usage rules that apply to individual API methods. - # - # **NOTE:** All service configuration rules follow "last one wins" order. - # @!attribute [rw] producer_notification_channel - # @return [::String] - # The full resource name of a channel used for sending notifications to the - # service producer. - # - # Google Service Management currently only supports - # [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification - # channel. To use Google Cloud Pub/Sub as the channel, this must be the name - # of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format - # documented in https://cloud.google.com/pubsub/docs/overview. - class Usage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Usage configuration rules for the service. - # @!attribute [rw] selector - # @return [::String] - # Selects the methods to which this rule applies. Use '*' to indicate all - # methods in all APIs. - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # @!attribute [rw] allow_unregistered_calls - # @return [::Boolean] - # Use this rule to configure unregistered calls for the service. Unregistered - # calls are calls that do not contain consumer project identity. - # (Example: calls that do not contain an API key). - # - # WARNING: By default, API methods do not allow unregistered calls, and each - # method call must be identified by a consumer project identity. - # @!attribute [rw] skip_service_control - # @return [::Boolean] - # If true, the selected method should skip service control and the control - # plane features, such as quota and billing, will not be available. - # This flag is used by Google Cloud Endpoints to bypass checks for internal - # methods, such as service health check methods. - class UsageRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-service_management-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-service_management-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/api.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/api.rb deleted file mode 100644 index 9817de10b446..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/api.rb +++ /dev/null @@ -1,194 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Api is a light-weight descriptor for an API Interface. - # - # Interfaces are also described as "protocol buffer services" in some contexts, - # such as by the "service" keyword in a .proto file, but they are different - # from API Services, which represent a concrete implementation of an interface - # as opposed to simply a description of methods and bindings. They are also - # sometimes simply referred to as "APIs" in other contexts, such as the name of - # this message itself. See https://cloud.google.com/apis/design/glossary for - # detailed terminology. - # @!attribute [rw] name - # @return [::String] - # The fully qualified name of this interface, including package name - # followed by the interface's simple name. - # @!attribute [rw] methods - # @return [::Array<::Google::Protobuf::Method>] - # The methods of this interface, in unspecified order. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # Any metadata attached to the interface. - # @!attribute [rw] version - # @return [::String] - # A version string for this interface. If specified, must have the form - # `major-version.minor-version`, as in `1.10`. If the minor version is - # omitted, it defaults to zero. If the entire version field is empty, the - # major version is derived from the package name, as outlined below. If the - # field is not empty, the version in the package name will be verified to be - # consistent with what is provided here. - # - # The versioning schema uses [semantic - # versioning](http://semver.org) where the major version number - # indicates a breaking change and the minor version an additive, - # non-breaking change. Both version numbers are signals to users - # what to expect from different versions, and should be carefully - # chosen based on the product plan. - # - # The major version is also reflected in the package name of the - # interface, which must end in `v`, as in - # `google.feature.v1`. For major versions 0 and 1, the suffix can - # be omitted. Zero major versions must only be used for - # experimental, non-GA interfaces. - # @!attribute [rw] source_context - # @return [::Google::Protobuf::SourceContext] - # Source context for the protocol buffer service represented by this - # message. - # @!attribute [rw] mixins - # @return [::Array<::Google::Protobuf::Mixin>] - # Included interfaces. See [Mixin][]. - # @!attribute [rw] syntax - # @return [::Google::Protobuf::Syntax] - # The source syntax of the service. - class Api - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Method represents a method of an API interface. - # @!attribute [rw] name - # @return [::String] - # The simple name of this method. - # @!attribute [rw] request_type_url - # @return [::String] - # A URL of the input message type. - # @!attribute [rw] request_streaming - # @return [::Boolean] - # If true, the request is streamed. - # @!attribute [rw] response_type_url - # @return [::String] - # The URL of the output message type. - # @!attribute [rw] response_streaming - # @return [::Boolean] - # If true, the response is streamed. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # Any metadata attached to the method. - # @!attribute [rw] syntax - # @return [::Google::Protobuf::Syntax] - # The source syntax of this method. - class Method - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Declares an API Interface to be included in this interface. The including - # interface must redeclare all the methods from the included interface, but - # documentation and options are inherited as follows: - # - # - If after comment and whitespace stripping, the documentation - # string of the redeclared method is empty, it will be inherited - # from the original method. - # - # - Each annotation belonging to the service config (http, - # visibility) which is not set in the redeclared method will be - # inherited. - # - # - If an http annotation is inherited, the path pattern will be - # modified as follows. Any version prefix will be replaced by the - # version of the including interface plus the [root][] path if - # specified. - # - # Example of a simple mixin: - # - # package google.acl.v1; - # service AccessControl { - # // Get the underlying ACL object. - # rpc GetAcl(GetAclRequest) returns (Acl) { - # option (google.api.http).get = "/v1/{resource=**}:getAcl"; - # } - # } - # - # package google.storage.v2; - # service Storage { - # rpc GetAcl(GetAclRequest) returns (Acl); - # - # // Get a data record. - # rpc GetData(GetDataRequest) returns (Data) { - # option (google.api.http).get = "/v2/{resource=**}"; - # } - # } - # - # Example of a mixin configuration: - # - # apis: - # - name: google.storage.v2.Storage - # mixins: - # - name: google.acl.v1.AccessControl - # - # The mixin construct implies that all methods in `AccessControl` are - # also declared with same name and request/response types in - # `Storage`. A documentation generator or annotation processor will - # see the effective `Storage.GetAcl` method after inheriting - # documentation and annotations as follows: - # - # service Storage { - # // Get the underlying ACL object. - # rpc GetAcl(GetAclRequest) returns (Acl) { - # option (google.api.http).get = "/v2/{resource=**}:getAcl"; - # } - # ... - # } - # - # Note how the version in the path pattern changed from `v1` to `v2`. - # - # If the `root` field in the mixin is specified, it should be a - # relative path under which inherited HTTP paths are placed. Example: - # - # apis: - # - name: google.storage.v2.Storage - # mixins: - # - name: google.acl.v1.AccessControl - # root: acls - # - # This implies the following inherited HTTP annotation: - # - # service Storage { - # // Get the underlying ACL object. - # rpc GetAcl(GetAclRequest) returns (Acl) { - # option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; - # } - # ... - # } - # @!attribute [rw] name - # @return [::String] - # The fully qualified name of the interface which is included. - # @!attribute [rw] root - # @return [::String] - # If non-empty specifies a path under which inherited HTTP paths - # are rooted. - class Mixin - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/source_context.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/source_context.rb deleted file mode 100644 index 1bc7c0900aec..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/source_context.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `SourceContext` represents information about the source of a - # protobuf element, like the file in which it is defined. - # @!attribute [rw] file_name - # @return [::String] - # The path-qualified name of the .proto file that contained the associated - # protobuf element. For example: `"google/protobuf/source_context.proto"`. - class SourceContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/type.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/type.rb deleted file mode 100644 index f61674e32d16..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/type.rb +++ /dev/null @@ -1,232 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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 protocol buffer message type. - # @!attribute [rw] name - # @return [::String] - # The fully qualified message name. - # @!attribute [rw] fields - # @return [::Array<::Google::Protobuf::Field>] - # The list of fields. - # @!attribute [rw] oneofs - # @return [::Array<::String>] - # The list of types appearing in `oneof` definitions in this type. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # The protocol buffer options. - # @!attribute [rw] source_context - # @return [::Google::Protobuf::SourceContext] - # The source context. - # @!attribute [rw] syntax - # @return [::Google::Protobuf::Syntax] - # The source syntax. - # @!attribute [rw] edition - # @return [::String] - # The source edition string, only valid when syntax is SYNTAX_EDITIONS. - class Type - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A single field of a message type. - # @!attribute [rw] kind - # @return [::Google::Protobuf::Field::Kind] - # The field type. - # @!attribute [rw] cardinality - # @return [::Google::Protobuf::Field::Cardinality] - # The field cardinality. - # @!attribute [rw] number - # @return [::Integer] - # The field number. - # @!attribute [rw] name - # @return [::String] - # The field name. - # @!attribute [rw] type_url - # @return [::String] - # The field type URL, without the scheme, for message or enumeration - # types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - # @!attribute [rw] oneof_index - # @return [::Integer] - # The index of the field type in `Type.oneofs`, for message or enumeration - # types. The first type has index 1; zero means the type is not in the list. - # @!attribute [rw] packed - # @return [::Boolean] - # Whether to use alternative packed wire representation. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # The protocol buffer options. - # @!attribute [rw] json_name - # @return [::String] - # The field JSON name. - # @!attribute [rw] default_value - # @return [::String] - # The string value of the default value of this field. Proto2 syntax only. - class Field - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Basic field types. - module Kind - # Field type unknown. - TYPE_UNKNOWN = 0 - - # Field type double. - TYPE_DOUBLE = 1 - - # Field type float. - TYPE_FLOAT = 2 - - # Field type int64. - TYPE_INT64 = 3 - - # Field type uint64. - TYPE_UINT64 = 4 - - # Field type int32. - TYPE_INT32 = 5 - - # Field type fixed64. - TYPE_FIXED64 = 6 - - # Field type fixed32. - TYPE_FIXED32 = 7 - - # Field type bool. - TYPE_BOOL = 8 - - # Field type string. - TYPE_STRING = 9 - - # Field type group. Proto2 syntax only, and deprecated. - TYPE_GROUP = 10 - - # Field type message. - TYPE_MESSAGE = 11 - - # Field type bytes. - TYPE_BYTES = 12 - - # Field type uint32. - TYPE_UINT32 = 13 - - # Field type enum. - TYPE_ENUM = 14 - - # Field type sfixed32. - TYPE_SFIXED32 = 15 - - # Field type sfixed64. - TYPE_SFIXED64 = 16 - - # Field type sint32. - TYPE_SINT32 = 17 - - # Field type sint64. - TYPE_SINT64 = 18 - end - - # Whether a field is optional, required, or repeated. - module Cardinality - # For fields with unknown cardinality. - CARDINALITY_UNKNOWN = 0 - - # For optional fields. - CARDINALITY_OPTIONAL = 1 - - # For required fields. Proto2 syntax only. - CARDINALITY_REQUIRED = 2 - - # For repeated fields. - CARDINALITY_REPEATED = 3 - end - end - - # Enum type definition. - # @!attribute [rw] name - # @return [::String] - # Enum type name. - # @!attribute [rw] enumvalue - # @return [::Array<::Google::Protobuf::EnumValue>] - # Enum value definitions. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # Protocol buffer options. - # @!attribute [rw] source_context - # @return [::Google::Protobuf::SourceContext] - # The source context. - # @!attribute [rw] syntax - # @return [::Google::Protobuf::Syntax] - # The source syntax. - # @!attribute [rw] edition - # @return [::String] - # The source edition string, only valid when syntax is SYNTAX_EDITIONS. - class Enum - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enum value definition. - # @!attribute [rw] name - # @return [::String] - # Enum value name. - # @!attribute [rw] number - # @return [::Integer] - # Enum value number. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # Protocol buffer options. - class EnumValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A protocol buffer option, which can be attached to a message, field, - # enumeration, etc. - # @!attribute [rw] name - # @return [::String] - # The option's name. For protobuf built-in options (options defined in - # descriptor.proto), this is the short name. For example, `"map_entry"`. - # For custom options, it should be the fully-qualified name. For example, - # `"google.api.http"`. - # @!attribute [rw] value - # @return [::Google::Protobuf::Any] - # The option's value packed in an Any message. If the value is a primitive, - # the corresponding wrapper type defined in google/protobuf/wrappers.proto - # should be used. If the value is an enum, it should be stored as an int32 - # value using the google.protobuf.Int32Value type. - class Option - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The syntax in which a protocol buffer element is defined. - module Syntax - # Syntax `proto2`. - SYNTAX_PROTO2 = 0 - - # Syntax `proto3`. - SYNTAX_PROTO3 = 1 - - # Syntax `editions`. - SYNTAX_EDITIONS = 2 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 9a7c0269fa42..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_management-v1/snippets/Gemfile deleted file mode 100644 index c216e7e1548e..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-service_management-v1", path: "../" -else - gem "google-cloud-service_management-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service.rb deleted file mode 100644 index 1c68ff74701c..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_CreateService_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the create_service call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service. -# -def create_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new - - # Call the create_service method. - result = client.create_service request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END servicemanagement_v1_generated_ServiceManager_CreateService_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb deleted file mode 100644 index 11c36e9ef1af..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_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 servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the create_service_config call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_config. -# -def create_service_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new - - # Call the create_service_config method. - result = client.create_service_config request - - # The returned object is of type Google::Api::Service. - p result -end -# [END servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb deleted file mode 100644 index 3676dfc62845..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the create_service_rollout call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout. -# -def create_service_rollout - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new - - # Call the create_service_rollout method. - result = client.create_service_rollout request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb deleted file mode 100644 index 510fb8a4ad39..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_DeleteService_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the delete_service call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#delete_service. -# -def delete_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new - - # Call the delete_service method. - result = client.delete_service request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END servicemanagement_v1_generated_ServiceManager_DeleteService_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb deleted file mode 100644 index 842fe0c160e1..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the generate_config_report call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#generate_config_report. -# -def generate_config_report - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new - - # Call the generate_config_report method. - result = client.generate_config_report request - - # The returned object is of type Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse. - p result -end -# [END servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service.rb deleted file mode 100644 index 467349ad1ee9..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_GetService_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the get_service call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service. -# -def get_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::GetServiceRequest.new - - # Call the get_service method. - result = client.get_service request - - # The returned object is of type Google::Cloud::ServiceManagement::V1::ManagedService. - p result -end -# [END servicemanagement_v1_generated_ServiceManager_GetService_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb deleted file mode 100644 index 610df5b47573..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_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 servicemanagement_v1_generated_ServiceManager_GetServiceConfig_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the get_service_config call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_config. -# -def get_service_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new - - # Call the get_service_config method. - result = client.get_service_config request - - # The returned object is of type Google::Api::Service. - p result -end -# [END servicemanagement_v1_generated_ServiceManager_GetServiceConfig_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb deleted file mode 100644 index 3dda230e49fb..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_GetServiceRollout_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the get_service_rollout call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_rollout. -# -def get_service_rollout - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new - - # Call the get_service_rollout method. - result = client.get_service_rollout request - - # The returned object is of type Google::Cloud::ServiceManagement::V1::Rollout. - p result -end -# [END servicemanagement_v1_generated_ServiceManager_GetServiceRollout_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb deleted file mode 100644 index eeb38ca2aff8..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the list_service_configs call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_configs. -# -def list_service_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new - - # Call the list_service_configs method. - result = client.list_service_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Api::Service. - p item - end -end -# [END servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb deleted file mode 100644 index 589785deffe7..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the list_service_rollouts call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_rollouts. -# -def list_service_rollouts - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new - - # Call the list_service_rollouts method. - result = client.list_service_rollouts request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceManagement::V1::Rollout. - p item - end -end -# [END servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_services.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_services.rb deleted file mode 100644 index eb978eb8fc46..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/list_services.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_ListServices_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the list_services call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_services. -# -def list_services - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::ListServicesRequest.new - - # Call the list_services method. - result = client.list_services request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceManagement::V1::ManagedService. - p item - end -end -# [END servicemanagement_v1_generated_ServiceManager_ListServices_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb deleted file mode 100644 index 329b0d68e2f1..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the submit_config_source call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#submit_config_source. -# -def submit_config_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new - - # Call the submit_config_source method. - result = client.submit_config_source request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb b/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb deleted file mode 100644 index e6831d656f74..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START servicemanagement_v1_generated_ServiceManager_UndeleteService_sync] -require "google/cloud/service_management/v1" - -## -# Snippet for the undelete_service call in the ServiceManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service. -# -def undelete_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new - - # Call the undelete_service method. - result = client.undelete_service request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END servicemanagement_v1_generated_ServiceManager_UndeleteService_sync] diff --git a/owl-bot-staging/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json b/owl-bot-staging/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json deleted file mode 100644 index 6e3a8680e282..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json +++ /dev/null @@ -1,535 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-service_management-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.api.servicemanagement.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_ListServices_sync", - "title": "Snippet for the list_services call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_services.", - "file": "service_manager/list_services.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_services", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_services", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::ListServicesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceManagement::V1::ListServicesResponse", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "ListServices", - "full_name": "google.api.servicemanagement.v1.ServiceManager.ListServices", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_GetService_sync", - "title": "Snippet for the get_service call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service.", - "file": "service_manager/get_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_service", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::GetServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceManagement::V1::ManagedService", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "GetService", - "full_name": "google.api.servicemanagement.v1.ServiceManager.GetService", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_CreateService_sync", - "title": "Snippet for the create_service call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service.", - "file": "service_manager/create_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_service", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::CreateServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "CreateService", - "full_name": "google.api.servicemanagement.v1.ServiceManager.CreateService", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_DeleteService_sync", - "title": "Snippet for the delete_service call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#delete_service.", - "file": "service_manager/delete_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_service", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#delete_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "DeleteService", - "full_name": "google.api.servicemanagement.v1.ServiceManager.DeleteService", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_UndeleteService_sync", - "title": "Snippet for the undelete_service call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service.", - "file": "service_manager/undelete_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_service", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "UndeleteService", - "full_name": "google.api.servicemanagement.v1.ServiceManager.UndeleteService", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_sync", - "title": "Snippet for the list_service_configs call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_configs.", - "file": "service_manager/list_service_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_service_configs", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "ListServiceConfigs", - "full_name": "google.api.servicemanagement.v1.ServiceManager.ListServiceConfigs", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_GetServiceConfig_sync", - "title": "Snippet for the get_service_config call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_config.", - "file": "service_manager/get_service_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_service_config", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Api::Service", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "GetServiceConfig", - "full_name": "google.api.servicemanagement.v1.ServiceManager.GetServiceConfig", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_sync", - "title": "Snippet for the create_service_config call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_config.", - "file": "service_manager/create_service_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_service_config", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Api::Service", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "CreateServiceConfig", - "full_name": "google.api.servicemanagement.v1.ServiceManager.CreateServiceConfig", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_sync", - "title": "Snippet for the submit_config_source call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#submit_config_source.", - "file": "service_manager/submit_config_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "submit_config_source", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#submit_config_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "SubmitConfigSource", - "full_name": "google.api.servicemanagement.v1.ServiceManager.SubmitConfigSource", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_sync", - "title": "Snippet for the list_service_rollouts call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_rollouts.", - "file": "service_manager/list_service_rollouts.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_service_rollouts", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_rollouts", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "ListServiceRollouts", - "full_name": "google.api.servicemanagement.v1.ServiceManager.ListServiceRollouts", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_GetServiceRollout_sync", - "title": "Snippet for the get_service_rollout call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_rollout.", - "file": "service_manager/get_service_rollout.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_service_rollout", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_rollout", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceManagement::V1::Rollout", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "GetServiceRollout", - "full_name": "google.api.servicemanagement.v1.ServiceManager.GetServiceRollout", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_sync", - "title": "Snippet for the create_service_rollout call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout.", - "file": "service_manager/create_service_rollout.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_service_rollout", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "CreateServiceRollout", - "full_name": "google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_sync", - "title": "Snippet for the generate_config_report call in the ServiceManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceManagement::V1::ServiceManager::Client#generate_config_report.", - "file": "service_manager/generate_config_report.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_config_report", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#generate_config_report", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse", - "client": { - "short_name": "ServiceManager::Client", - "full_name": "::Google::Cloud::ServiceManagement::V1::ServiceManager::Client" - }, - "method": { - "short_name": "GenerateConfigReport", - "full_name": "google.api.servicemanagement.v1.ServiceManager.GenerateConfigReport", - "service": { - "short_name": "ServiceManager", - "full_name": "google.api.servicemanagement.v1.ServiceManager" - } - } - }, - "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-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb b/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb deleted file mode 100644 index ccf9ee00c27f..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_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/api/servicemanagement/v1/servicemanager_pb" -require "google/api/servicemanagement/v1/servicemanager_services_pb" -require "google/cloud/service_management/v1/service_manager" - -class ::Google::Cloud::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb b/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb deleted file mode 100644 index 7f671841fe11..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb +++ /dev/null @@ -1,817 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/api/servicemanagement/v1/servicemanager_pb" -require "google/cloud/service_management/v1/service_manager/rest" - - -class ::Google::Cloud::ServiceManagement::V1::ServiceManager::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_services - # Create test objects. - client_result = ::Google::Cloud::ServiceManagement::V1::ListServicesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - producer_project_id = "hello world" - page_size = 42 - page_token = "hello world" - consumer_id = "hello world" - - list_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_list_services_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_services({ producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_services producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_services ::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new(producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_services({ producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_services(::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new(producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_services_client_stub.call_count - end - end - end - - def test_get_service - # Create test objects. - client_result = ::Google::Cloud::ServiceManagement::V1::ManagedService.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - - get_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_get_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_service({ service_name: service_name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_service service_name: service_name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_service ::Google::Cloud::ServiceManagement::V1::GetServiceRequest.new(service_name: service_name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_service({ service_name: service_name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_service(::Google::Cloud::ServiceManagement::V1::GetServiceRequest.new(service_name: service_name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_service_client_stub.call_count - end - end - end - - def test_create_service - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service = {} - - create_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_create_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_service({ service: service }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_service service: service do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_service ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new(service: service) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_service({ service: service }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_service(::Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new(service: service), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_service_client_stub.call_count - end - end - end - - def test_delete_service - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - - delete_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_delete_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_service({ service_name: service_name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_service service_name: service_name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_service ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new(service_name: service_name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_service({ service_name: service_name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_service(::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new(service_name: service_name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_service_client_stub.call_count - end - end - end - - def test_undelete_service - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - - undelete_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_undelete_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_service({ service_name: service_name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_service service_name: service_name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_service ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new(service_name: service_name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_service({ service_name: service_name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_service(::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new(service_name: service_name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_service_client_stub.call_count - end - end - end - - def test_list_service_configs - # Create test objects. - client_result = ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - page_token = "hello world" - page_size = 42 - - list_service_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_list_service_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_service_configs_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_service_configs({ service_name: service_name, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_service_configs service_name: service_name, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_service_configs ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_service_configs({ service_name: service_name, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_service_configs(::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_service_configs_client_stub.call_count - end - end - end - - def test_get_service_config - # Create test objects. - client_result = ::Google::Api::Service.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - config_id = "hello world" - view = :BASIC - - get_service_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::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_get_service_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_service_config_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_service_config({ service_name: service_name, config_id: config_id, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_service_config service_name: service_name, config_id: config_id, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_service_config ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new(service_name: service_name, config_id: config_id, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_service_config({ service_name: service_name, config_id: config_id, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_service_config(::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new(service_name: service_name, config_id: config_id, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_service_config_client_stub.call_count - end - end - end - - def test_create_service_config - # Create test objects. - client_result = ::Google::Api::Service.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - service_config = {} - - create_service_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::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_create_service_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_service_config_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_service_config({ service_name: service_name, service_config: service_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_service_config service_name: service_name, service_config: service_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_service_config ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new(service_name: service_name, service_config: service_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_service_config({ service_name: service_name, service_config: service_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_service_config(::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new(service_name: service_name, service_config: service_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_service_config_client_stub.call_count - end - end - end - - def test_submit_config_source - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - config_source = {} - validate_only = true - - submit_config_source_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_submit_config_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, submit_config_source_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.submit_config_source({ service_name: service_name, config_source: config_source, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.submit_config_source service_name: service_name, config_source: config_source, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.submit_config_source ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new(service_name: service_name, config_source: config_source, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.submit_config_source({ service_name: service_name, config_source: config_source, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.submit_config_source(::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new(service_name: service_name, config_source: config_source, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, submit_config_source_client_stub.call_count - end - end - end - - def test_list_service_rollouts - # Create test objects. - client_result = ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - page_token = "hello world" - page_size = 42 - filter = "hello world" - - list_service_rollouts_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_list_service_rollouts_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_service_rollouts_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_service_rollouts({ service_name: service_name, page_token: page_token, page_size: page_size, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_service_rollouts service_name: service_name, page_token: page_token, page_size: page_size, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_service_rollouts ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_service_rollouts({ service_name: service_name, page_token: page_token, page_size: page_size, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_service_rollouts(::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_service_rollouts_client_stub.call_count - end - end - end - - def test_get_service_rollout - # Create test objects. - client_result = ::Google::Cloud::ServiceManagement::V1::Rollout.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - rollout_id = "hello world" - - get_service_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_get_service_rollout_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_service_rollout_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_service_rollout({ service_name: service_name, rollout_id: rollout_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_service_rollout service_name: service_name, rollout_id: rollout_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_service_rollout ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new(service_name: service_name, rollout_id: rollout_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_service_rollout({ service_name: service_name, rollout_id: rollout_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_service_rollout(::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new(service_name: service_name, rollout_id: rollout_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_service_rollout_client_stub.call_count - end - end - end - - def test_create_service_rollout - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - rollout = {} - - create_service_rollout_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_create_service_rollout_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_service_rollout_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_service_rollout({ service_name: service_name, rollout: rollout }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_service_rollout service_name: service_name, rollout: rollout do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_service_rollout ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new(service_name: service_name, rollout: rollout) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_service_rollout({ service_name: service_name, rollout: rollout }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_service_rollout(::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new(service_name: service_name, rollout: rollout), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_service_rollout_client_stub.call_count - end - end - end - - def test_generate_config_report - # Create test objects. - client_result = ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - new_config = {} - old_config = {} - - generate_config_report_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.stub :transcode_generate_config_report_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_config_report_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_config_report({ new_config: new_config, old_config: old_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_config_report new_config: new_config, old_config: old_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_config_report ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new(new_config: new_config, old_config: old_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_config_report({ new_config: new_config, old_config: old_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_config_report(::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new(new_config: new_config, old_config: old_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_config_report_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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb b/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb deleted file mode 100644 index 6c812136dedd..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb +++ /dev/null @@ -1,944 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/api/servicemanagement/v1/servicemanager_pb" -require "google/cloud/service_management/v1/service_manager" - -class ::Google::Cloud::ServiceManagement::V1::ServiceManager::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_services - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceManagement::V1::ListServicesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - producer_project_id = "hello world" - page_size = 42 - page_token = "hello world" - consumer_id = "hello world" - - list_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_services, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::ListServicesRequest, request - assert_equal "hello world", request["producer_project_id"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["consumer_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_services({ producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_services producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_services ::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new(producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_services({ producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_services(::Google::Cloud::ServiceManagement::V1::ListServicesRequest.new(producer_project_id: producer_project_id, page_size: page_size, page_token: page_token, consumer_id: consumer_id), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_services_client_stub.call_rpc_count - end - end - - def test_get_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceManagement::V1::ManagedService.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - - get_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_service, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::GetServiceRequest, request - assert_equal "hello world", request["service_name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_service({ service_name: service_name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_service service_name: service_name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_service ::Google::Cloud::ServiceManagement::V1::GetServiceRequest.new(service_name: service_name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_service({ service_name: service_name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_service(::Google::Cloud::ServiceManagement::V1::GetServiceRequest.new(service_name: service_name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_service_client_stub.call_rpc_count - end - end - - def test_create_service - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service = {} - - create_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_service, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceManagement::V1::ManagedService), request["service"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_service({ service: service }) do |response, 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_service service: service do |response, 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_service ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new(service: service) do |response, operation| - assert_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_service({ service: service }, grpc_options) do |response, operation| - assert_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_service(::Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new(service: service), grpc_options) do |response, operation| - assert_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_service_client_stub.call_rpc_count - end - end - - def test_delete_service - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - - delete_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_service, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, request - assert_equal "hello world", request["service_name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_service({ service_name: service_name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_service service_name: service_name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_service ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new(service_name: service_name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_service({ service_name: service_name }, grpc_options) do |response, operation| - assert_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_service(::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new(service_name: service_name), grpc_options) do |response, operation| - assert_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_service_client_stub.call_rpc_count - end - end - - def test_undelete_service - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - - undelete_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_service, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, request - assert_equal "hello world", request["service_name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_service({ service_name: service_name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undelete_service service_name: service_name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undelete_service ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new(service_name: service_name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undelete_service({ service_name: service_name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undelete_service(::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new(service_name: service_name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, undelete_service_client_stub.call_rpc_count - end - end - - def test_list_service_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - page_token = "hello world" - page_size = 42 - - list_service_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_service_configs, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, request - assert_equal "hello world", request["service_name"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_service_configs_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_service_configs({ service_name: service_name, page_token: page_token, page_size: page_size }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_service_configs service_name: service_name, page_token: page_token, page_size: page_size do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_service_configs ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_service_configs({ service_name: service_name, page_token: page_token, page_size: page_size }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_service_configs(::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_service_configs_client_stub.call_rpc_count - end - end - - def test_get_service_config - # Create GRPC objects. - grpc_response = ::Google::Api::Service.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - config_id = "hello world" - view = :BASIC - - get_service_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_service_config, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, request - assert_equal "hello world", request["service_name"] - assert_equal "hello world", request["config_id"] - assert_equal :BASIC, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_service_config_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_service_config({ service_name: service_name, config_id: config_id, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_service_config service_name: service_name, config_id: config_id, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_service_config ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new(service_name: service_name, config_id: config_id, view: view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_service_config({ service_name: service_name, config_id: config_id, view: view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_service_config(::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new(service_name: service_name, config_id: config_id, view: view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_service_config_client_stub.call_rpc_count - end - end - - def test_create_service_config - # Create GRPC objects. - grpc_response = ::Google::Api::Service.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - service_config = {} - - create_service_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_service_config, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, request - assert_equal "hello world", request["service_name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Api::Service), request["service_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_service_config_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_service_config({ service_name: service_name, service_config: service_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_service_config service_name: service_name, service_config: service_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_service_config ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new(service_name: service_name, service_config: service_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_service_config({ service_name: service_name, service_config: service_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_service_config(::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new(service_name: service_name, service_config: service_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_service_config_client_stub.call_rpc_count - end - end - - def test_submit_config_source - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - config_source = {} - validate_only = true - - submit_config_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :submit_config_source, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, request - assert_equal "hello world", request["service_name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceManagement::V1::ConfigSource), request["config_source"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, submit_config_source_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.submit_config_source({ service_name: service_name, config_source: config_source, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.submit_config_source service_name: service_name, config_source: config_source, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.submit_config_source ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new(service_name: service_name, config_source: config_source, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.submit_config_source({ service_name: service_name, config_source: config_source, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.submit_config_source(::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new(service_name: service_name, config_source: config_source, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, submit_config_source_client_stub.call_rpc_count - end - end - - def test_list_service_rollouts - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - page_token = "hello world" - page_size = 42 - filter = "hello world" - - list_service_rollouts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_service_rollouts, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, request - assert_equal "hello world", request["service_name"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_service_rollouts_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_service_rollouts({ service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts({ service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts(::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new(service_name: service_name, page_token: page_token, page_size: page_size, 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_service_rollouts_client_stub.call_rpc_count - end - end - - def test_get_service_rollout - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceManagement::V1::Rollout.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - rollout_id = "hello world" - - get_service_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_service_rollout, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, request - assert_equal "hello world", request["service_name"] - assert_equal "hello world", request["rollout_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_service_rollout_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_service_rollout({ service_name: service_name, rollout_id: rollout_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_service_rollout service_name: service_name, rollout_id: rollout_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_service_rollout ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new(service_name: service_name, rollout_id: rollout_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_service_rollout({ service_name: service_name, rollout_id: rollout_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_service_rollout(::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new(service_name: service_name, rollout_id: rollout_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_service_rollout_client_stub.call_rpc_count - end - end - - def test_create_service_rollout - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - service_name = "hello world" - rollout = {} - - create_service_rollout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_service_rollout, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, request - assert_equal "hello world", request["service_name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::ServiceManagement::V1::Rollout), request["rollout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_service_rollout_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_service_rollout({ service_name: service_name, rollout: rollout }) do |response, 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_service_rollout service_name: service_name, rollout: rollout do |response, 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_service_rollout ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new(service_name: service_name, rollout: rollout) do |response, operation| - assert_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_service_rollout({ service_name: service_name, rollout: rollout }, grpc_options) do |response, operation| - assert_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_service_rollout(::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new(service_name: service_name, rollout: rollout), grpc_options) do |response, operation| - assert_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_service_rollout_client_stub.call_rpc_count - end - end - - def test_generate_config_report - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - new_config = {} - old_config = {} - - generate_config_report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_config_report, name - assert_kind_of ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Any), request["new_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Any), request["old_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_config_report_client_stub do - # Create client - client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_config_report({ new_config: new_config, old_config: old_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_config_report new_config: new_config, old_config: old_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_config_report ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new(new_config: new_config, old_config: old_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_config_report({ new_config: new_config, old_config: old_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_config_report(::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new(new_config: new_config, old_config: old_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_config_report_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ServiceManagement::V1::ServiceManager::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::ServiceManagement::V1::ServiceManager::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::ServiceManagement::V1::ServiceManager::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-service_management-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_management-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-service_management-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-service_usage-v1/.gitignore b/owl-bot-staging/google-cloud-service_usage-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-service_usage-v1/.repo-metadata.json deleted file mode 100644 index 8e59ad13577b..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "serviceusage.googleapis.com", - "api_shortname": "serviceusage", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-service_usage-v1/latest", - "distribution_name": "google-cloud-service_usage-v1", - "is_cloud": true, - "language": "ruby", - "name": "serviceusage", - "name_pretty": "Service Usage V1 API", - "product_documentation": "https://cloud.google.com/service-usage/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Service Usage is an infrastructure service of Google Cloud that lets you list and manage other APIs and services in your Cloud projects. You can list and manage Google Cloud services and their APIs, as well as services created using Cloud Endpoints. Note that google-cloud-service_usage-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_usage instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SERVICE_USAGE", - "ruby-cloud-product-url": "https://cloud.google.com/service-usage/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-service_usage-v1/.rubocop.yml b/owl-bot-staging/google-cloud-service_usage-v1/.rubocop.yml deleted file mode 100644 index e4a9da8eab3b..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-service_usage-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-service_usage-v1.rb" diff --git a/owl-bot-staging/google-cloud-service_usage-v1/.toys.rb b/owl-bot-staging/google-cloud-service_usage-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/.yardopts b/owl-bot-staging/google-cloud-service_usage-v1/.yardopts deleted file mode 100644 index 082c42437dcc..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Service Usage 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-service_usage-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-service_usage-v1/AUTHENTICATION.md deleted file mode 100644 index ac6fd4e7ead4..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-service_usage-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-service_usage-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/service_usage/v1" - -client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/service_usage/v1" - -::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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-service_usage-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/service_usage/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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-service_usage-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-service_usage-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-service_usage-v1/Gemfile b/owl-bot-staging/google-cloud-service_usage-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-service_usage-v1/LICENSE.md b/owl-bot-staging/google-cloud-service_usage-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/README.md b/owl-bot-staging/google-cloud-service_usage-v1/README.md deleted file mode 100644 index 29cfef487663..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Service Usage V1 API - -Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use. - -Service Usage is an infrastructure service of Google Cloud that lets you list and manage other APIs and services in your Cloud projects. You can list and manage Google Cloud services and their APIs, as well as services created using Cloud Endpoints. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Service Usage V1 API. Most users should consider using -the main client gem, -[google-cloud-service_usage](https://rubygems.org/gems/google-cloud-service_usage). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-service_usage-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/serviceusage.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/service_usage/v1" - -client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new -request = ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new # (request fields as keyword arguments...) -response = client.enable_service request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-service_usage-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/service-usage/) -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/service_usage/v1" -require "logger" - -client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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-service_usage`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-service_usage-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-service_usage`. -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-service_usage-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-service_usage-v1/Rakefile b/owl-bot-staging/google-cloud-service_usage-v1/Rakefile deleted file mode 100644 index aa26e213bd12..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SERVICE_USAGE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SERVICE_USAGE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SERVICE_USAGE_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 SERVICE_USAGE_TEST_PROJECT=test123 SERVICE_USAGE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/service_usage/v1/service_usage/credentials" - ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SERVICE_USAGE_PROJECT"] = project - ENV["SERVICE_USAGE_TEST_PROJECT"] = project - ENV["SERVICE_USAGE_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-service_usage-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-service_usage-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-service_usage-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-service_usage-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-service_usage-v1" - header "google-cloud-service_usage-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-service_usage-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-service_usage-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-service_usage-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-service_usage-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-service_usage-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-service_usage-v1/gapic_metadata.json deleted file mode 100644 index 343aa839bde6..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/gapic_metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.api.serviceusage.v1", - "libraryPackage": "::Google::Cloud::ServiceUsage::V1", - "services": { - "ServiceUsage": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client", - "rpcs": { - "EnableService": { - "methods": [ - "enable_service" - ] - }, - "DisableService": { - "methods": [ - "disable_service" - ] - }, - "GetService": { - "methods": [ - "get_service" - ] - }, - "ListServices": { - "methods": [ - "list_services" - ] - }, - "BatchEnableServices": { - "methods": [ - "batch_enable_services" - ] - }, - "BatchGetServices": { - "methods": [ - "batch_get_services" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-service_usage-v1/google-cloud-service_usage-v1.gemspec b/owl-bot-staging/google-cloud-service_usage-v1/google-cloud-service_usage-v1.gemspec deleted file mode 100644 index 419faf5175ef..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/google-cloud-service_usage-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/service_usage/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-service_usage-v1" - gem.version = Google::Cloud::ServiceUsage::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Service Usage is an infrastructure service of Google Cloud that lets you list and manage other APIs and services in your Cloud projects. You can list and manage Google Cloud services and their APIs, as well as services created using Cloud Endpoints. Note that google-cloud-service_usage-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-service_usage instead. See the readme for more details." - gem.summary = "Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google-cloud-service_usage-v1.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google-cloud-service_usage-v1.rb deleted file mode 100644 index 024e67974bb5..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google-cloud-service_usage-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/service_usage/v1" diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/resources_pb.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/resources_pb.rb deleted file mode 100644 index 9c7b8777ba6e..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/resources_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/serviceusage/v1/resources.proto - -require 'google/protobuf' - -require 'google/api/auth_pb' -require 'google/api/documentation_pb' -require 'google/api/endpoint_pb' -require 'google/api/monitored_resource_pb' -require 'google/api/monitoring_pb' -require 'google/api/quota_pb' -require 'google/api/resource_pb' -require 'google/api/usage_pb' -require 'google/protobuf/api_pb' - - -descriptor_data = "\n*google/api/serviceusage/v1/resources.proto\x12\x1agoogle.api.serviceusage.v1\x1a\x15google/api/auth.proto\x1a\x1egoogle/api/documentation.proto\x1a\x19google/api/endpoint.proto\x1a#google/api/monitored_resource.proto\x1a\x1bgoogle/api/monitoring.proto\x1a\x16google/api/quota.proto\x1a\x19google/api/resource.proto\x1a\x16google/api/usage.proto\x1a\x19google/protobuf/api.proto\"\xbd\x02\n\x07Service\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12\x39\n\x06\x63onfig\x18\x02 \x01(\x0b\x32).google.api.serviceusage.v1.ServiceConfig\x12\x30\n\x05state\x18\x04 \x01(\x0e\x32!.google.api.serviceusage.v1.State:\xa6\x01\xea\x41\xa2\x01\n#serviceusage.googleapis.com/Service\x12%projects/{project}/services/{service}\x12#folders/{folder}/services/{service}\x12/organizations/{organization}/services/{service}\"\x95\x03\n\rServiceConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\"\n\x04\x61pis\x18\x03 \x03(\x0b\x32\x14.google.protobuf.Api\x12\x30\n\rdocumentation\x18\x06 \x01(\x0b\x32\x19.google.api.Documentation\x12 \n\x05quota\x18\n \x01(\x0b\x32\x11.google.api.Quota\x12\x32\n\x0e\x61uthentication\x18\x0b \x01(\x0b\x32\x1a.google.api.Authentication\x12 \n\x05usage\x18\x0f \x01(\x0b\x32\x11.google.api.Usage\x12\'\n\tendpoints\x18\x12 \x03(\x0b\x32\x14.google.api.Endpoint\x12\x44\n\x13monitored_resources\x18\x19 \x03(\x0b\x32\'.google.api.MonitoredResourceDescriptor\x12*\n\nmonitoring\x18\x1c \x01(\x0b\x32\x16.google.api.Monitoring\"+\n\x11OperationMetadata\x12\x16\n\x0eresource_names\x18\x02 \x03(\t*9\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x42\xd8\x01\n\x1e\x63om.google.api.serviceusage.v1B\x0eResourcesProtoP\x01ZDcloud.google.com/go/serviceusage/apiv1/serviceusagepb;serviceusagepb\xaa\x02\x1cGoogle.Cloud.ServiceUsage.V1\xca\x02\x1cGoogle\\Cloud\\ServiceUsage\\V1\xea\x02\x1fGoogle::Cloud::ServiceUsage::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceUsage - module V1 - Service = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.Service").msgclass - ServiceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.ServiceConfig").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.OperationMetadata").msgclass - State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_pb.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_pb.rb deleted file mode 100644 index 3a926161d952..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_pb.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/serviceusage/v1/serviceusage.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/serviceusage/v1/resources_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n-google/api/serviceusage/v1/serviceusage.proto\x12\x1agoogle.api.serviceusage.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a*google/api/serviceusage/v1/resources.proto\x1a#google/longrunning/operations.proto\"$\n\x14\x45nableServiceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"M\n\x15\x45nableServiceResponse\x12\x34\n\x07service\x18\x01 \x01(\x0b\x32#.google.api.serviceusage.v1.Service\"\x92\x02\n\x15\x44isableServiceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\"\n\x1a\x64isable_dependent_services\x18\x02 \x01(\x08\x12l\n\x1a\x63heck_if_service_has_usage\x18\x03 \x01(\x0e\x32H.google.api.serviceusage.v1.DisableServiceRequest.CheckIfServiceHasUsage\"Y\n\x16\x43heckIfServiceHasUsage\x12*\n&CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED\x10\x00\x12\x08\n\x04SKIP\x10\x01\x12\t\n\x05\x43HECK\x10\x02\"N\n\x16\x44isableServiceResponse\x12\x34\n\x07service\x18\x01 \x01(\x0b\x32#.google.api.serviceusage.v1.Service\"!\n\x11GetServiceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\\\n\x13ListServicesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\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\"f\n\x14ListServicesResponse\x12\x35\n\x08services\x18\x01 \x03(\x0b\x32#.google.api.serviceusage.v1.Service\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"A\n\x1a\x42\x61tchEnableServicesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x13\n\x0bservice_ids\x18\x02 \x03(\t\"\xe9\x01\n\x1b\x42\x61tchEnableServicesResponse\x12\x35\n\x08services\x18\x01 \x03(\x0b\x32#.google.api.serviceusage.v1.Service\x12W\n\x08\x66\x61ilures\x18\x02 \x03(\x0b\x32\x45.google.api.serviceusage.v1.BatchEnableServicesResponse.EnableFailure\x1a:\n\rEnableFailure\x12\x12\n\nservice_id\x18\x01 \x01(\t\x12\x15\n\rerror_message\x18\x02 \x01(\t\"8\n\x17\x42\x61tchGetServicesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\r\n\x05names\x18\x02 \x03(\t\"Q\n\x18\x42\x61tchGetServicesResponse\x12\x35\n\x08services\x18\x01 \x03(\x0b\x32#.google.api.serviceusage.v1.Service2\xe8\t\n\x0cServiceUsage\x12\xba\x01\n\rEnableService\x12\x30.google.api.serviceusage.v1.EnableServiceRequest\x1a\x1d.google.longrunning.Operation\"X\xca\x41*\n\x15\x45nableServiceResponse\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02%\" /v1/{name=*/*/services/*}:enable:\x01*\x12\xbe\x01\n\x0e\x44isableService\x12\x31.google.api.serviceusage.v1.DisableServiceRequest\x1a\x1d.google.longrunning.Operation\"Z\xca\x41+\n\x16\x44isableServiceResponse\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02&\"!/v1/{name=*/*/services/*}:disable:\x01*\x12\x83\x01\n\nGetService\x12-.google.api.serviceusage.v1.GetServiceRequest\x1a#.google.api.serviceusage.v1.Service\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/{name=*/*/services/*}\x12\x94\x01\n\x0cListServices\x12/.google.api.serviceusage.v1.ListServicesRequest\x1a\x30.google.api.serviceusage.v1.ListServicesResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/{parent=*/*}/services\x12\xd1\x01\n\x13\x42\x61tchEnableServices\x12\x36.google.api.serviceusage.v1.BatchEnableServicesRequest\x1a\x1d.google.longrunning.Operation\"c\xca\x41\x30\n\x1b\x42\x61tchEnableServicesResponse\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02*\"%/v1/{parent=*/*}/services:batchEnable:\x01*\x12\xa9\x01\n\x10\x42\x61tchGetServices\x12\x33.google.api.serviceusage.v1.BatchGetServicesRequest\x1a\x34.google.api.serviceusage.v1.BatchGetServicesResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v1/{parent=*/*}/services:batchGet\x1a\xbc\x01\xca\x41\x1bserviceusage.googleapis.com\xd2\x41\x9a\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/service.managementB\xdb\x01\n\x1e\x63om.google.api.serviceusage.v1B\x11ServiceUsageProtoP\x01ZDcloud.google.com/go/serviceusage/apiv1/serviceusagepb;serviceusagepb\xaa\x02\x1cGoogle.Cloud.ServiceUsage.V1\xca\x02\x1cGoogle\\Cloud\\ServiceUsage\\V1\xea\x02\x1fGoogle::Cloud::ServiceUsage::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module ServiceUsage - module V1 - EnableServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.EnableServiceRequest").msgclass - EnableServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.EnableServiceResponse").msgclass - DisableServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.DisableServiceRequest").msgclass - DisableServiceRequest::CheckIfServiceHasUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.DisableServiceRequest.CheckIfServiceHasUsage").enummodule - DisableServiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.DisableServiceResponse").msgclass - GetServiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.GetServiceRequest").msgclass - ListServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.ListServicesRequest").msgclass - ListServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.ListServicesResponse").msgclass - BatchEnableServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchEnableServicesRequest").msgclass - BatchEnableServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchEnableServicesResponse").msgclass - BatchEnableServicesResponse::EnableFailure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchEnableServicesResponse.EnableFailure").msgclass - BatchGetServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchGetServicesRequest").msgclass - BatchGetServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.api.serviceusage.v1.BatchGetServicesResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_services_pb.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_services_pb.rb deleted file mode 100644 index 77a57299004d..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/api/serviceusage/v1/serviceusage_services_pb.rb +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/api/serviceusage/v1/serviceusage.proto for package 'Google.Cloud.ServiceUsage.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/api/serviceusage/v1/serviceusage_pb' - -module Google - module Cloud - module ServiceUsage - module V1 - module ServiceUsage - # Enables services that service consumers want to use on Google Cloud Platform, - # lists the available or enabled services, or disables services that service - # consumers no longer use. - # - # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.api.serviceusage.v1.ServiceUsage' - - # Enable a service so that it can be used with a project. - rpc :EnableService, ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest, ::Google::Longrunning::Operation - # Disable a service so that it can no longer be used with a project. - # This prevents unintended usage that may cause unexpected billing - # charges or security leaks. - # - # It is not valid to call the disable method on a service that is not - # currently enabled. Callers will receive a `FAILED_PRECONDITION` status if - # the target service is not currently enabled. - rpc :DisableService, ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest, ::Google::Longrunning::Operation - # Returns the service configuration and enabled state for a given service. - rpc :GetService, ::Google::Cloud::ServiceUsage::V1::GetServiceRequest, ::Google::Cloud::ServiceUsage::V1::Service - # List all services available to the specified project, and the current - # state of those services with respect to the project. The list includes - # all public services, all services for which the calling user has the - # `servicemanagement.services.bind` permission, and all services that have - # already been enabled on the project. The list can be filtered to - # only include services in a specific state, for example to only include - # services enabled on the project. - # - # WARNING: If you need to query enabled services frequently or across - # an organization, you should use - # [Cloud Asset Inventory - # API](https://cloud.google.com/asset-inventory/docs/apis), which provides - # higher throughput and richer filtering capability. - rpc :ListServices, ::Google::Cloud::ServiceUsage::V1::ListServicesRequest, ::Google::Cloud::ServiceUsage::V1::ListServicesResponse - # Enable multiple services on a project. The operation is atomic: if enabling - # any service fails, then the entire batch fails, and no state changes occur. - # To enable a single service, use the `EnableService` method instead. - rpc :BatchEnableServices, ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest, ::Google::Longrunning::Operation - # Returns the service configurations and enabled states for a given list of - # services. - rpc :BatchGetServices, ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest, ::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1.rb deleted file mode 100644 index 6574d05185b2..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/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/service_usage/v1/service_usage" -require "google/cloud/service_usage/v1/version" - -module Google - module Cloud - module ServiceUsage - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/service_usage/v1" - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/service_usage/v1" - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/service_usage/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/rest.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/rest.rb deleted file mode 100644 index 30771378b1cd..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/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/service_usage/v1/service_usage/rest" -require "google/cloud/service_usage/v1/version" - -module Google - module Cloud - module ServiceUsage - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/service_usage/v1/rest" - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage.rb deleted file mode 100644 index 47ad7fc9b613..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage.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/service_usage/v1/version" - -require "google/cloud/service_usage/v1/service_usage/credentials" -require "google/cloud/service_usage/v1/service_usage/operations" -require "google/cloud/service_usage/v1/service_usage/client" -require "google/cloud/service_usage/v1/service_usage/rest" - -module Google - module Cloud - module ServiceUsage - module V1 - ## - # Enables services that service consumers want to use on Google Cloud Platform, - # lists the available or enabled services, or disables services that service - # consumers no longer use. - # - # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/service_usage/v1/service_usage" - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/service_usage/v1/service_usage/rest" - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - module ServiceUsage - end - end - end - end -end - -helper_path = ::File.join __dir__, "service_usage", "helpers.rb" -require "google/cloud/service_usage/v1/service_usage/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/client.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/client.rb deleted file mode 100644 index e6a65a0df8cb..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/client.rb +++ /dev/null @@ -1,1075 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/api/serviceusage/v1/serviceusage_pb" - -module Google - module Cloud - module ServiceUsage - module V1 - module ServiceUsage - ## - # Client for the ServiceUsage service. - # - # Enables services that service consumers want to use on Google Cloud Platform, - # lists the available or enabled services, or disables services that service - # consumers no longer use. - # - # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "serviceusage.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :service_usage_stub - - ## - # Configure the ServiceUsage Client class. - # - # See {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServiceUsage clients - # ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "ServiceUsage", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServiceUsage Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @service_usage_stub.universe_domain - end - - ## - # Create a new ServiceUsage client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServiceUsage 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/api/serviceusage/v1/serviceusage_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 - - @service_usage_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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 - ) - - @service_usage_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::ServiceUsage::V1::ServiceUsage::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @service_usage_stub.logger - end - - # Service calls - - ## - # Enable a service so that it can be used with a project. - # - # @overload enable_service(request, options = nil) - # Pass arguments to `enable_service` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::EnableServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::EnableServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload enable_service(name: nil) - # Pass arguments to `enable_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the consumer and service to enable the service on. - # - # The `EnableService` and `DisableService` methods currently only support - # projects. - # - # Enabling a service requires that the service is public or is shared with - # the user enabling the service. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new - # - # # Call the enable_service method. - # result = client.enable_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def enable_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.enable_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.call_rpc :enable_service, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disable a service so that it can no longer be used with a project. - # This prevents unintended usage that may cause unexpected billing - # charges or security leaks. - # - # It is not valid to call the disable method on a service that is not - # currently enabled. Callers will receive a `FAILED_PRECONDITION` status if - # the target service is not currently enabled. - # - # @overload disable_service(request, options = nil) - # Pass arguments to `disable_service` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::DisableServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_service(name: nil, disable_dependent_services: nil, check_if_service_has_usage: nil) - # Pass arguments to `disable_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the consumer and service to disable the service on. - # - # The enable and disable methods currently only support projects. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # @param disable_dependent_services [::Boolean] - # Indicates if services that are enabled and which depend on this service - # should also be disabled. If not set, an error will be generated if any - # enabled services depend on the service to be disabled. When set, the - # service, and any enabled services that depend on it, will be disabled - # together. - # @param check_if_service_has_usage [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest::CheckIfServiceHasUsage] - # Defines the behavior for checking service usage when disabling a service. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new - # - # # Call the disable_service method. - # result = client.disable_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def disable_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.call_rpc :disable_service, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the service configuration and enabled state for a given service. - # - # @overload get_service(request, options = nil) - # Pass arguments to `get_service` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::GetServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::GetServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_service(name: nil) - # Pass arguments to `get_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the consumer and service to get the `ConsumerState` for. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceUsage::V1::Service] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceUsage::V1::Service] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::GetServiceRequest.new - # - # # Call the get_service method. - # result = client.get_service request - # - # # The returned object is of type Google::Cloud::ServiceUsage::V1::Service. - # p result - # - def get_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::GetServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_service.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.call_rpc :get_service, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all services available to the specified project, and the current - # state of those services with respect to the project. The list includes - # all public services, all services for which the calling user has the - # `servicemanagement.services.bind` permission, and all services that have - # already been enabled on the project. The list can be filtered to - # only include services in a specific state, for example to only include - # services enabled on the project. - # - # WARNING: If you need to query enabled services frequently or across - # an organization, you should use - # [Cloud Asset Inventory - # API](https://cloud.google.com/asset-inventory/docs/apis), which provides - # higher throughput and richer filtering capability. - # - # @overload list_services(request, options = nil) - # Pass arguments to `list_services` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::ListServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::ListServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent to search for services on. - # - # An example name would be: - # `projects/123` where `123` is the project number. - # @param page_size [::Integer] - # Requested size of the next page of data. - # Requested page size cannot exceed 200. - # If not set, the default page size is 50. - # @param page_token [::String] - # Token identifying which result to start with, which is returned by a - # previous list call. - # @param filter [::String] - # Only list services that conform to the given filter. - # The allowed filter strings are `state:ENABLED` and `state:DISABLED`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceUsage::V1::Service>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceUsage::V1::Service>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::ListServicesRequest.new - # - # # Call the list_services method. - # result = client.list_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceUsage::V1::Service. - # p item - # end - # - def list_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::ListServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_services.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.call_rpc :list_services, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @service_usage_stub, :list_services, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enable multiple services on a project. The operation is atomic: if enabling - # any service fails, then the entire batch fails, and no state changes occur. - # To enable a single service, use the `EnableService` method instead. - # - # @overload batch_enable_services(request, options = nil) - # Pass arguments to `batch_enable_services` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_enable_services(parent: nil, service_ids: nil) - # Pass arguments to `batch_enable_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent to enable services on. - # - # An example name would be: - # `projects/123` where `123` is the project number. - # - # The `BatchEnableServices` method currently only supports projects. - # @param service_ids [::Array<::String>] - # The identifiers of the services to enable on the project. - # - # A valid identifier would be: - # serviceusage.googleapis.com - # - # Enabling services requires that each service is public or is shared with - # the user enabling the service. - # - # A single request can enable a maximum of 20 services at a time. If more - # than 20 services are specified, the request will fail, and no state changes - # will occur. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new - # - # # Call the batch_enable_services method. - # result = client.batch_enable_services request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_enable_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_enable_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_enable_services.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_enable_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.call_rpc :batch_enable_services, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the service configurations and enabled states for a given list of - # services. - # - # @overload batch_get_services(request, options = nil) - # Pass arguments to `batch_get_services` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_get_services(parent: nil, names: nil) - # Pass arguments to `batch_get_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent to retrieve services from. - # If this is set, the parent of all of the services specified in `names` must - # match this field. An example name would be: `projects/123` where `123` is - # the project number. The `BatchGetServices` method currently only supports - # projects. - # @param names [::Array<::String>] - # Names of the services to retrieve. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # A single request can get a maximum of 30 services at a time. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new - # - # # Call the batch_get_services method. - # result = client.batch_get_services request - # - # # The returned object is of type Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse. - # p result - # - def batch_get_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_get_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_get_services.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_get_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.call_rpc :batch_get_services, request, 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 ServiceUsage API. - # - # This class represents the configuration for ServiceUsage, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # enable_service to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.enable_service.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.enable_service.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::ServiceUsage::V1::ServiceUsage::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "serviceusage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ServiceUsage API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `enable_service` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_service - ## - # RPC-specific configuration for `disable_service` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_service - ## - # RPC-specific configuration for `get_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service - ## - # RPC-specific configuration for `list_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_services - ## - # RPC-specific configuration for `batch_enable_services` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_enable_services - ## - # RPC-specific configuration for `batch_get_services` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_get_services - - # @private - def initialize parent_rpcs = nil - enable_service_config = parent_rpcs.enable_service if parent_rpcs.respond_to? :enable_service - @enable_service = ::Gapic::Config::Method.new enable_service_config - disable_service_config = parent_rpcs.disable_service if parent_rpcs.respond_to? :disable_service - @disable_service = ::Gapic::Config::Method.new disable_service_config - get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service - @get_service = ::Gapic::Config::Method.new get_service_config - list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services - @list_services = ::Gapic::Config::Method.new list_services_config - batch_enable_services_config = parent_rpcs.batch_enable_services if parent_rpcs.respond_to? :batch_enable_services - @batch_enable_services = ::Gapic::Config::Method.new batch_enable_services_config - batch_get_services_config = parent_rpcs.batch_get_services if parent_rpcs.respond_to? :batch_get_services - @batch_get_services = ::Gapic::Config::Method.new batch_get_services_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/credentials.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/credentials.rb deleted file mode 100644 index d29b072c389d..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/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 ServiceUsage - module V1 - module ServiceUsage - # Credentials for the ServiceUsage API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/service.management" - ] - self.env_vars = [ - "SERVICE_USAGE_CREDENTIALS", - "SERVICE_USAGE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SERVICE_USAGE_CREDENTIALS_JSON", - "SERVICE_USAGE_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-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/operations.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/operations.rb deleted file mode 100644 index 9fa297e0d3da..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/operations.rb +++ /dev/null @@ -1,833 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 ServiceUsage - module V1 - module ServiceUsage - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "serviceusage.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ServiceUsage 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 ServiceUsage 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::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_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::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::ServiceUsage::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::ServiceUsage::V1::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 = "serviceusage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest.rb deleted file mode 100644 index 33ff36f88f2c..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/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/service_usage/v1/version" - -require "google/cloud/service_usage/v1/service_usage/credentials" -require "google/cloud/service_usage/v1/service_usage/rest/operations" -require "google/cloud/service_usage/v1/service_usage/rest/client" - -module Google - module Cloud - module ServiceUsage - module V1 - ## - # Enables services that service consumers want to use on Google Cloud Platform, - # lists the available or enabled services, or disables services that service - # consumers no longer use. - # - # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/service_usage/v1/service_usage/rest" - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - module ServiceUsage - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/service_usage/v1/service_usage/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/client.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/client.rb deleted file mode 100644 index f4ccd17b3e88..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/client.rb +++ /dev/null @@ -1,990 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/api/serviceusage/v1/serviceusage_pb" -require "google/cloud/service_usage/v1/service_usage/rest/service_stub" - -module Google - module Cloud - module ServiceUsage - module V1 - module ServiceUsage - module Rest - ## - # REST client for the ServiceUsage service. - # - # Enables services that service consumers want to use on Google Cloud Platform, - # lists the available or enabled services, or disables services that service - # consumers no longer use. - # - # See [Service Usage API](https://cloud.google.com/service-usage/docs/overview) - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "serviceusage.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :service_usage_stub - - ## - # Configure the ServiceUsage Client class. - # - # See {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServiceUsage clients - # ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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", "ServiceUsage", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServiceUsage Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::ServiceUsage::V1::ServiceUsage::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 - @service_usage_stub.universe_domain - end - - ## - # Create a new ServiceUsage REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServiceUsage 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::ServiceUsage::V1::ServiceUsage::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 - - @service_usage_stub = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @service_usage_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::ServiceUsage::V1::ServiceUsage::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @service_usage_stub.logger - end - - # Service calls - - ## - # Enable a service so that it can be used with a project. - # - # @overload enable_service(request, options = nil) - # Pass arguments to `enable_service` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::EnableServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::EnableServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload enable_service(name: nil) - # Pass arguments to `enable_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the consumer and service to enable the service on. - # - # The `EnableService` and `DisableService` methods currently only support - # projects. - # - # Enabling a service requires that the service is public or is shared with - # the user enabling the service. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new - # - # # Call the enable_service method. - # result = client.enable_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def enable_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.enable_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.enable_service request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disable a service so that it can no longer be used with a project. - # This prevents unintended usage that may cause unexpected billing - # charges or security leaks. - # - # It is not valid to call the disable method on a service that is not - # currently enabled. Callers will receive a `FAILED_PRECONDITION` status if - # the target service is not currently enabled. - # - # @overload disable_service(request, options = nil) - # Pass arguments to `disable_service` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::DisableServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload disable_service(name: nil, disable_dependent_services: nil, check_if_service_has_usage: nil) - # Pass arguments to `disable_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the consumer and service to disable the service on. - # - # The enable and disable methods currently only support projects. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # @param disable_dependent_services [::Boolean] - # Indicates if services that are enabled and which depend on this service - # should also be disabled. If not set, an error will be generated if any - # enabled services depend on the service to be disabled. When set, the - # service, and any enabled services that depend on it, will be disabled - # together. - # @param check_if_service_has_usage [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest::CheckIfServiceHasUsage] - # Defines the behavior for checking service usage when disabling a service. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new - # - # # Call the disable_service method. - # result = client.disable_service request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def disable_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.disable_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.disable_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.disable_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.disable_service request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the service configuration and enabled state for a given service. - # - # @overload get_service(request, options = nil) - # Pass arguments to `get_service` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::GetServiceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::GetServiceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_service(name: nil) - # Pass arguments to `get_service` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the consumer and service to get the `ConsumerState` for. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceUsage::V1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceUsage::V1::Service] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::GetServiceRequest.new - # - # # Call the get_service method. - # result = client.get_service request - # - # # The returned object is of type Google::Cloud::ServiceUsage::V1::Service. - # p result - # - def get_service request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::GetServiceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_service.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_service.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_service.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.get_service request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all services available to the specified project, and the current - # state of those services with respect to the project. The list includes - # all public services, all services for which the calling user has the - # `servicemanagement.services.bind` permission, and all services that have - # already been enabled on the project. The list can be filtered to - # only include services in a specific state, for example to only include - # services enabled on the project. - # - # WARNING: If you need to query enabled services frequently or across - # an organization, you should use - # [Cloud Asset Inventory - # API](https://cloud.google.com/asset-inventory/docs/apis), which provides - # higher throughput and richer filtering capability. - # - # @overload list_services(request, options = nil) - # Pass arguments to `list_services` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::ListServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::ListServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_services(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent to search for services on. - # - # An example name would be: - # `projects/123` where `123` is the project number. - # @param page_size [::Integer] - # Requested size of the next page of data. - # Requested page size cannot exceed 200. - # If not set, the default page size is 50. - # @param page_token [::String] - # Token identifying which result to start with, which is returned by a - # previous list call. - # @param filter [::String] - # Only list services that conform to the given filter. - # The allowed filter strings are `state:ENABLED` and `state:DISABLED`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceUsage::V1::Service>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceUsage::V1::Service>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::ListServicesRequest.new - # - # # Call the list_services method. - # result = client.list_services request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::ServiceUsage::V1::Service. - # p item - # end - # - def list_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::ListServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_services.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.list_services request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @service_usage_stub, :list_services, "services", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enable multiple services on a project. The operation is atomic: if enabling - # any service fails, then the entire batch fails, and no state changes occur. - # To enable a single service, use the `EnableService` method instead. - # - # @overload batch_enable_services(request, options = nil) - # Pass arguments to `batch_enable_services` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_enable_services(parent: nil, service_ids: nil) - # Pass arguments to `batch_enable_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent to enable services on. - # - # An example name would be: - # `projects/123` where `123` is the project number. - # - # The `BatchEnableServices` method currently only supports projects. - # @param service_ids [::Array<::String>] - # The identifiers of the services to enable on the project. - # - # A valid identifier would be: - # serviceusage.googleapis.com - # - # Enabling services requires that each service is public or is shared with - # the user enabling the service. - # - # A single request can enable a maximum of 20 services at a time. If more - # than 20 services are specified, the request will fail, and no state changes - # will occur. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new - # - # # Call the batch_enable_services method. - # result = client.batch_enable_services request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_enable_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_enable_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_enable_services.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_enable_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.batch_enable_services request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the service configurations and enabled states for a given list of - # services. - # - # @overload batch_get_services(request, options = nil) - # Pass arguments to `batch_get_services` via a request object, either of type - # {::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_get_services(parent: nil, names: nil) - # Pass arguments to `batch_get_services` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent to retrieve services from. - # If this is set, the parent of all of the services specified in `names` must - # match this field. An example name would be: `projects/123` where `123` is - # the project number. The `BatchGetServices` method currently only supports - # projects. - # @param names [::Array<::String>] - # Names of the services to retrieve. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # A single request can get a maximum of 30 services at a time. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/service_usage/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new - # - # # Call the batch_get_services method. - # result = client.batch_get_services request - # - # # The returned object is of type Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse. - # p result - # - def batch_get_services request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_get_services.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_get_services.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_get_services.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @service_usage_stub.batch_get_services request, 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 ServiceUsage REST API. - # - # This class represents the configuration for ServiceUsage REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # enable_service to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.enable_service.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.enable_service.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "serviceusage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the ServiceUsage API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `enable_service` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_service - ## - # RPC-specific configuration for `disable_service` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_service - ## - # RPC-specific configuration for `get_service` - # @return [::Gapic::Config::Method] - # - attr_reader :get_service - ## - # RPC-specific configuration for `list_services` - # @return [::Gapic::Config::Method] - # - attr_reader :list_services - ## - # RPC-specific configuration for `batch_enable_services` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_enable_services - ## - # RPC-specific configuration for `batch_get_services` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_get_services - - # @private - def initialize parent_rpcs = nil - enable_service_config = parent_rpcs.enable_service if parent_rpcs.respond_to? :enable_service - @enable_service = ::Gapic::Config::Method.new enable_service_config - disable_service_config = parent_rpcs.disable_service if parent_rpcs.respond_to? :disable_service - @disable_service = ::Gapic::Config::Method.new disable_service_config - get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service - @get_service = ::Gapic::Config::Method.new get_service_config - list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services - @list_services = ::Gapic::Config::Method.new list_services_config - batch_enable_services_config = parent_rpcs.batch_enable_services if parent_rpcs.respond_to? :batch_enable_services - @batch_enable_services = ::Gapic::Config::Method.new batch_enable_services_config - batch_get_services_config = parent_rpcs.batch_get_services if parent_rpcs.respond_to? :batch_get_services - @batch_get_services = ::Gapic::Config::Method.new batch_get_services_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/operations.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/operations.rb deleted file mode 100644 index af0e31380254..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/operations.rb +++ /dev/null @@ -1,923 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module ServiceUsage - module V1 - module ServiceUsage - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "serviceusage.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ServiceUsage 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 ServiceUsage 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::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::ServiceUsage::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "serviceusage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_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/operations", - matches: [] - ) - 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{^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-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb deleted file mode 100644 index c4a05bd4b705..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/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/api/serviceusage/v1/serviceusage_pb" - -module Google - module Cloud - module ServiceUsage - module V1 - module ServiceUsage - module Rest - ## - # REST service stub for the ServiceUsage 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 enable_service REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::EnableServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def enable_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "enable_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the disable_service REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def disable_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_disable_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "disable_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_service REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::GetServiceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceUsage::V1::Service] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceUsage::V1::Service] - # A result object deserialized from the server's reply - def get_service request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_service_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_service", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceUsage::V1::Service.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_services REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::ListServicesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceUsage::V1::ListServicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceUsage::V1::ListServicesResponse] - # A result object deserialized from the server's reply - def list_services request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_services_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_services", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceUsage::V1::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_enable_services REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_enable_services request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_enable_services_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_enable_services", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_get_services REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse] - # A result object deserialized from the server's reply - def batch_get_services request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_get_services_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_get_services", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse.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 enable_service REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::EnableServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:enable", - body: "*", - matches: [ - ["name", %r{^[^/]+/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the disable_service REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_disable_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:disable", - body: "*", - matches: [ - ["name", %r{^[^/]+/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_service REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::GetServiceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_service_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^[^/]+/[^/]+/services/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_services REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::ListServicesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_services_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/services", - matches: [ - ["parent", %r{^[^/]+/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_enable_services REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_enable_services_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/services:batchEnable", - body: "*", - matches: [ - ["parent", %r{^[^/]+/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_get_services REST call - # - # @param request_pb [::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_get_services_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/services:batchGet", - matches: [ - ["parent", %r{^[^/]+/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/version.rb b/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/version.rb deleted file mode 100644 index 6a3e3ab95ccd..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/lib/google/cloud/service_usage/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 ServiceUsage - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/README.md deleted file mode 100644 index a60825fd97db..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Service Usage 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-service_usage-v1/proto_docs/google/api/auth.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb deleted file mode 100644 index c71d3c7421d7..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb +++ /dev/null @@ -1,259 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # `Authentication` defines the authentication configuration for API methods - # provided by an API service. - # - # Example: - # - # name: calendar.googleapis.com - # authentication: - # providers: - # - id: google_calendar_auth - # jwks_uri: https://www.googleapis.com/oauth2/v1/certs - # issuer: https://securetoken.google.com - # rules: - # - selector: "*" - # requirements: - # provider_id: google_calendar_auth - # - selector: google.calendar.Delegate - # oauth: - # canonical_scopes: https://www.googleapis.com/auth/calendar.read - # @!attribute [rw] rules - # @return [::Array<::Google::Api::AuthenticationRule>] - # A list of authentication rules that apply to individual API methods. - # - # **NOTE:** All service configuration rules follow "last one wins" order. - # @!attribute [rw] providers - # @return [::Array<::Google::Api::AuthProvider>] - # Defines a set of authentication providers that a service supports. - class Authentication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Authentication rules for the service. - # - # By default, if a method has any authentication requirements, every request - # must include a valid credential matching one of the requirements. - # It's an error to include more than one kind of credential in a single - # request. - # - # If a method doesn't have any auth requirements, request credentials will be - # ignored. - # @!attribute [rw] selector - # @return [::String] - # Selects the methods to which this rule applies. - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # @!attribute [rw] oauth - # @return [::Google::Api::OAuthRequirements] - # The requirements for OAuth credentials. - # @!attribute [rw] allow_without_credential - # @return [::Boolean] - # If true, the service accepts API keys without any other credential. - # This flag only applies to HTTP and gRPC requests. - # @!attribute [rw] requirements - # @return [::Array<::Google::Api::AuthRequirement>] - # Requirements for additional authentication providers. - class AuthenticationRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies a location to extract JWT from an API request. - # @!attribute [rw] header - # @return [::String] - # Specifies HTTP header name to extract JWT token. - # - # Note: The following fields are mutually exclusive: `header`, `query`, `cookie`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] query - # @return [::String] - # Specifies URL query parameter name to extract JWT token. - # - # Note: The following fields are mutually exclusive: `query`, `header`, `cookie`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] cookie - # @return [::String] - # Specifies cookie name to extract JWT token. - # - # Note: The following fields are mutually exclusive: `cookie`, `header`, `query`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] value_prefix - # @return [::String] - # The value prefix. The value format is "value_prefix\\{token}" - # Only applies to "in" header type. Must be empty for "in" query type. - # If not empty, the header value has to match (case sensitive) this prefix. - # If not matched, JWT will not be extracted. If matched, JWT will be - # extracted after the prefix is removed. - # - # For example, for "Authorization: Bearer \\{JWT}", - # value_prefix="Bearer " with a space at the end. - class JwtLocation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for an authentication provider, including support for - # [JSON Web Token - # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - # @!attribute [rw] id - # @return [::String] - # The unique identifier of the auth provider. It will be referred to by - # `AuthRequirement.provider_id`. - # - # Example: "bookstore_auth". - # @!attribute [rw] issuer - # @return [::String] - # Identifies the principal that issued the JWT. See - # https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 - # Usually a URL or an email address. - # - # Example: https://securetoken.google.com - # Example: 1234567-compute@developer.gserviceaccount.com - # @!attribute [rw] jwks_uri - # @return [::String] - # URL of the provider's public key set to validate signature of the JWT. See - # [OpenID - # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). - # Optional if the key set document: - # - can be retrieved from - # [OpenID - # Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - # of the issuer. - # - can be inferred from the email domain of the issuer (e.g. a Google - # service account). - # - # Example: https://www.googleapis.com/oauth2/v1/certs - # @!attribute [rw] audiences - # @return [::String] - # The list of JWT - # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - # that are allowed to access. A JWT containing any of these audiences will - # be accepted. When this setting is absent, JWTs with audiences: - # - "https://[service.name]/[google.protobuf.Api.name]" - # - "https://[service.name]/" - # will be accepted. - # For example, if no audiences are in the setting, LibraryService API will - # accept JWTs with the following audiences: - # - - # https://library-example.googleapis.com/google.example.library.v1.LibraryService - # - https://library-example.googleapis.com/ - # - # Example: - # - # audiences: bookstore_android.apps.googleusercontent.com, - # bookstore_web.apps.googleusercontent.com - # @!attribute [rw] authorization_url - # @return [::String] - # Redirect URL if JWT token is required but not present or is expired. - # Implement authorizationUrl of securityDefinitions in OpenAPI spec. - # @!attribute [rw] jwt_locations - # @return [::Array<::Google::Api::JwtLocation>] - # Defines the locations to extract the JWT. For now it is only used by the - # Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] - # (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) - # - # JWT locations can be one of HTTP headers, URL query parameters or - # cookies. The rule is that the first match wins. - # - # If not specified, default to use following 3 locations: - # 1) Authorization: Bearer - # 2) x-goog-iap-jwt-assertion - # 3) access_token query parameter - # - # Default locations can be specified as followings: - # jwt_locations: - # - header: Authorization - # value_prefix: "Bearer " - # - header: x-goog-iap-jwt-assertion - # - query: access_token - class AuthProvider - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # OAuth scopes are a way to define data and permissions on data. For example, - # there are scopes defined for "Read-only access to Google Calendar" and - # "Access to Cloud Platform". Users can consent to a scope for an application, - # giving it permission to access that data on their behalf. - # - # OAuth scope specifications should be fairly coarse grained; a user will need - # to see and understand the text description of what your scope means. - # - # In most cases: use one or at most two OAuth scopes for an entire family of - # products. If your product has multiple APIs, you should probably be sharing - # the OAuth scope across all of those APIs. - # - # When you need finer grained OAuth consent screens: talk with your product - # management about how developers will use them in practice. - # - # Please note that even though each of the canonical scopes is enough for a - # request to be accepted and passed to the backend, a request can still fail - # due to the backend requiring additional scopes or permissions. - # @!attribute [rw] canonical_scopes - # @return [::String] - # The list of publicly documented OAuth scopes that are allowed access. An - # OAuth token containing any of these scopes will be accepted. - # - # - # Example: - # - # canonical_scopes: https://www.googleapis.com/auth/calendar, - # https://www.googleapis.com/auth/calendar.read - class OAuthRequirements - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # User-defined authentication requirements, including support for - # [JSON Web Token - # (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - # @!attribute [rw] provider_id - # @return [::String] - # {::Google::Api::AuthProvider#id id} from authentication provider. - # - # Example: - # - # provider_id: bookstore_auth - # @!attribute [rw] audiences - # @return [::String] - # NOTE: This will be deprecated soon, once AuthProvider.audiences is - # implemented and accepted in all the runtime components. - # - # The list of JWT - # [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - # that are allowed to access. A JWT containing any of these audiences will - # be accepted. When this setting is absent, only JWTs with audience - # "https://[Service_name][google.api.Service.name]/{::Google::Protobuf::Api#name API_name}" - # will be accepted. For example, if no audiences are in the setting, - # LibraryService API will only accept JWTs with the following audience - # "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - # - # Example: - # - # audiences: bookstore_android.apps.googleusercontent.com, - # bookstore_web.apps.googleusercontent.com - class AuthRequirement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb deleted file mode 100644 index ccefcdf22809..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/documentation.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! - - -module Google - module Api - # `Documentation` provides the information for describing a service. - # - # Example: - #
documentation:
-    #   summary: >
-    #     The Google Calendar API gives access
-    #     to most calendar features.
-    #   pages:
-    #   - name: Overview
-    #     content: (== include google/foo/overview.md ==)
-    #   - name: Tutorial
-    #     content: (== include google/foo/tutorial.md ==)
-    #     subpages:
-    #     - name: Java
-    #       content: (== include google/foo/tutorial_java.md ==)
-    #   rules:
-    #   - selector: google.calendar.Calendar.Get
-    #     description: >
-    #       ...
-    #   - selector: google.calendar.Calendar.Put
-    #     description: >
-    #       ...
-    # 
- # Documentation is provided in markdown syntax. In addition to - # standard markdown features, definition lists, tables and fenced - # code blocks are supported. Section headers can be provided and are - # interpreted relative to the section nesting of the context where - # a documentation fragment is embedded. - # - # Documentation from the IDL is merged with documentation defined - # via the config at normalization time, where documentation provided - # by config rules overrides IDL provided. - # - # A number of constructs specific to the API platform are supported - # in documentation text. - # - # In order to reference a proto element, the following - # notation can be used: - #
[fully.qualified.proto.name][]
- # To override the display text used for the link, this can be used: - #
[display text][fully.qualified.proto.name]
- # Text can be excluded from doc using the following notation: - #
(-- internal comment --)
- # - # A few directives are available in documentation. Note that - # directives must appear on a single line to be properly - # identified. The `include` directive includes a markdown file from - # an external source: - #
(== include path/to/file ==)
- # The `resource_for` directive marks a message to be the resource of - # a collection in REST view. If it is not specified, tools attempt - # to infer the resource from the operations in a collection: - #
(== resource_for v1.shelves.books ==)
- # The directive `suppress_warning` does not directly affect documentation - # and is documented together with service config validation. - # @!attribute [rw] summary - # @return [::String] - # A short description of what the service does. The summary must be plain - # text. It becomes the overview of the service displayed in Google Cloud - # Console. - # NOTE: This field is equivalent to the standard field `description`. - # @!attribute [rw] pages - # @return [::Array<::Google::Api::Page>] - # The top level pages for the documentation set. - # @!attribute [rw] rules - # @return [::Array<::Google::Api::DocumentationRule>] - # A list of documentation rules that apply to individual API elements. - # - # **NOTE:** All service configuration rules follow "last one wins" order. - # @!attribute [rw] documentation_root_url - # @return [::String] - # The URL to the root of documentation. - # @!attribute [rw] service_root_url - # @return [::String] - # Specifies the service root url if the default one (the service name - # from the yaml file) is not suitable. This can be seen in any fully - # specified service urls as well as sections that show a base that other - # urls are relative to. - # @!attribute [rw] overview - # @return [::String] - # Declares a single overview page. For example: - #
documentation:
-    #       summary: ...
-    #       overview: (== include overview.md ==)
-    #     
- # This is a shortcut for the following declaration (using pages style): - #
documentation:
-    #       summary: ...
-    #       pages:
-    #       - name: Overview
-    #         content: (== include overview.md ==)
-    #     
- # Note: you cannot specify both `overview` field and `pages` field. - class Documentation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A documentation rule provides information about individual API elements. - # @!attribute [rw] selector - # @return [::String] - # The selector is a comma-separated list of patterns for any element such as - # a method, a field, an enum value. Each pattern is a qualified name of the - # element which may end in "*", indicating a wildcard. Wildcards are only - # allowed at the end and for a whole component of the qualified name, - # i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match - # one or more components. To specify a default for all applicable elements, - # the whole pattern "*" is used. - # @!attribute [rw] description - # @return [::String] - # Description of the selected proto element (e.g. a message, a method, a - # 'service' definition, or a field). Defaults to leading & trailing comments - # taken from the proto source definition of the proto element. - # @!attribute [rw] deprecation_description - # @return [::String] - # Deprecation description of the selected element(s). It can be provided if - # an element is marked as `deprecated`. - class DocumentationRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a documentation page. A page can contain subpages to represent - # nested documentation set structure. - # @!attribute [rw] name - # @return [::String] - # The name of the page. It will be used as an identity of the page to - # generate URI of the page, text of the link to this page in navigation, - # etc. The full page name (start from the root page name to this page - # concatenated with `.`) can be used as reference to the page in your - # documentation. For example: - #
pages:
-    #     - name: Tutorial
-    #       content: (== include tutorial.md ==)
-    #       subpages:
-    #       - name: Java
-    #         content: (== include tutorial_java.md ==)
-    #     
- # You can reference `Java` page using Markdown reference link syntax: - # `[Java][Tutorial.Java]`. - # @!attribute [rw] content - # @return [::String] - # The Markdown content of the page. You can use ```(== include {path} - # ==)``` to include content from a Markdown file. The content can be used - # to produce the documentation page such as HTML format page. - # @!attribute [rw] subpages - # @return [::Array<::Google::Api::Page>] - # Subpages of this page. The order of subpages specified here will be - # honored in the generated docset. - class Page - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb deleted file mode 100644 index 57d040a793ab..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.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 - # `Endpoint` describes a network address of a service that serves a set of - # APIs. It is commonly known as a service endpoint. A service may expose - # any number of service endpoints, and all service endpoints share the same - # service definition, such as quota limits and monitoring metrics. - # - # Example: - # - # type: google.api.Service - # name: library-example.googleapis.com - # endpoints: - # # Declares network address `https://library-example.googleapis.com` - # # for service `library-example.googleapis.com`. The `https` scheme - # # is implicit for all service endpoints. Other schemes may be - # # supported in the future. - # - name: library-example.googleapis.com - # allow_cors: false - # - name: content-staging-library-example.googleapis.com - # # Allows HTTP OPTIONS calls to be passed to the API frontend, for it - # # to decide whether the subsequent cross-origin request is allowed - # # to proceed. - # allow_cors: true - # @!attribute [rw] name - # @return [::String] - # The canonical name of this endpoint. - # @!attribute [rw] aliases - # @return [::Array<::String>] - # Aliases for this endpoint, these will be served by the same UrlMap as the - # parent endpoint, and will be provisioned in the GCP stack for the Regional - # Endpoints. - # @!attribute [rw] target - # @return [::String] - # The specification of an Internet routable address of API frontend that will - # handle requests to this [API - # Endpoint](https://cloud.google.com/apis/design/glossary). It should be - # either a valid IPv4 address or a fully-qualified domain name. For example, - # "8.8.8.8" or "myservice.appspot.com". - # @!attribute [rw] allow_cors - # @return [::Boolean] - # Allowing - # [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka - # cross-domain traffic, would allow the backends served from this endpoint to - # receive and respond to HTTP OPTIONS requests. The response will be used by - # the browser to determine whether the subsequent cross-origin request is - # allowed to proceed. - class Endpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/api/label.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/label.rb deleted file mode 100644 index 02d2f8d451f9..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/label.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 Api - # A description of a label. - # @!attribute [rw] key - # @return [::String] - # The label key. - # @!attribute [rw] value_type - # @return [::Google::Api::LabelDescriptor::ValueType] - # The type of data that can be assigned to the label. - # @!attribute [rw] description - # @return [::String] - # A human-readable description for the label. - class LabelDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Value types that can be used as label values. - module ValueType - # A variable-length string. This is the default. - STRING = 0 - - # Boolean; true or false. - BOOL = 1 - - # A 64-bit signed integer. - INT64 = 2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/api/monitored_resource.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb deleted file mode 100644 index 4d1ec410ddac..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb +++ /dev/null @@ -1,150 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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 object that describes the schema of a - # {::Google::Api::MonitoredResource MonitoredResource} object using a type name - # and a set of labels. For example, the monitored resource descriptor for - # Google Compute Engine VM instances has a type of - # `"gce_instance"` and specifies the use of the labels `"instance_id"` and - # `"zone"` to identify particular VM instances. - # - # Different APIs can support different monitored resource types. APIs generally - # provide a `list` method that returns the monitored resource descriptors used - # by the API. - # @!attribute [rw] name - # @return [::String] - # Optional. The resource name of the monitored resource descriptor: - # `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where - # \\{type} is the value of the `type` field in this object and - # \\{project_id} is a project ID that provides API-specific context for - # accessing the type. APIs that do not use project information can use the - # resource name format `"monitoredResourceDescriptors/{type}"`. - # @!attribute [rw] type - # @return [::String] - # Required. The monitored resource type. For example, the type - # `"cloudsql_database"` represents databases in Google Cloud SQL. - # For a list of types, see [Monitored resource - # types](https://cloud.google.com/monitoring/api/resources) - # and [Logging resource - # types](https://cloud.google.com/logging/docs/api/v2/resource-list). - # @!attribute [rw] display_name - # @return [::String] - # Optional. A concise name for the monitored resource type that might be - # displayed in user interfaces. It should be a Title Cased Noun Phrase, - # without any article or other determiners. For example, - # `"Google Cloud SQL Database"`. - # @!attribute [rw] description - # @return [::String] - # Optional. A detailed description of the monitored resource type that might - # be used in documentation. - # @!attribute [rw] labels - # @return [::Array<::Google::Api::LabelDescriptor>] - # Required. A set of labels used to describe instances of this monitored - # resource type. For example, an individual Google Cloud SQL database is - # identified by values for the labels `"database_id"` and `"zone"`. - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Optional. The launch stage of the monitored resource definition. - class MonitoredResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An object representing a resource that can be used for monitoring, logging, - # billing, or other purposes. Examples include virtual machine instances, - # databases, and storage devices such as disks. The `type` field identifies a - # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} object - # that describes the resource's schema. Information in the `labels` field - # identifies the actual resource and its attributes according to the schema. - # For example, a particular Compute Engine VM instance could be represented by - # the following object, because the - # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} for - # `"gce_instance"` has labels - # `"project_id"`, `"instance_id"` and `"zone"`: - # - # { "type": "gce_instance", - # "labels": { "project_id": "my-project", - # "instance_id": "12345678901234", - # "zone": "us-central1-a" }} - # @!attribute [rw] type - # @return [::String] - # Required. The monitored resource type. This field must match - # the `type` field of a - # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} - # object. For example, the type of a Compute Engine VM instance is - # `gce_instance`. Some descriptors include the service name in the type; for - # example, the type of a Datastream stream is - # `datastream.googleapis.com/Stream`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Required. Values for all of the labels listed in the associated monitored - # resource descriptor. For example, Compute Engine VM instances use the - # labels `"project_id"`, `"instance_id"`, and `"zone"`. - class MonitoredResource - 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 - - # Auxiliary metadata for a {::Google::Api::MonitoredResource MonitoredResource} - # object. {::Google::Api::MonitoredResource MonitoredResource} objects contain the - # minimum set of information to uniquely identify a monitored resource - # instance. There is some other useful auxiliary metadata. Monitoring and - # Logging use an ingestion pipeline to extract metadata for cloud resources of - # all types, and store the metadata in this message. - # @!attribute [rw] system_labels - # @return [::Google::Protobuf::Struct] - # Output only. Values for predefined system metadata labels. - # System labels are a kind of metadata extracted by Google, including - # "machine_image", "vpc", "subnet_id", - # "security_group", "name", etc. - # System label values can be only strings, Boolean values, or a list of - # strings. For example: - # - # { "name": "my-test-instance", - # "security_group": ["a", "b", "c"], - # "spot_instance": false } - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. A map of user-defined metadata labels. - class MonitoredResourceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitoring.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitoring.rb deleted file mode 100644 index 666ca63971d3..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/monitoring.rb +++ /dev/null @@ -1,112 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Monitoring configuration of the service. - # - # The example below shows how to configure monitored resources and metrics - # for monitoring. In the example, a monitored resource and two metrics are - # defined. The `library.googleapis.com/book/returned_count` metric is sent - # to both producer and consumer projects, whereas the - # `library.googleapis.com/book/num_overdue` metric is only sent to the - # consumer project. - # - # monitored_resources: - # - type: library.googleapis.com/Branch - # display_name: "Library Branch" - # description: "A branch of a library." - # launch_stage: GA - # labels: - # - key: resource_container - # description: "The Cloud container (ie. project id) for the Branch." - # - key: location - # description: "The location of the library branch." - # - key: branch_id - # description: "The id of the branch." - # metrics: - # - name: library.googleapis.com/book/returned_count - # display_name: "Books Returned" - # description: "The count of books that have been returned." - # launch_stage: GA - # metric_kind: DELTA - # value_type: INT64 - # unit: "1" - # labels: - # - key: customer_id - # description: "The id of the customer." - # - name: library.googleapis.com/book/num_overdue - # display_name: "Books Overdue" - # description: "The current number of overdue books." - # launch_stage: GA - # metric_kind: GAUGE - # value_type: INT64 - # unit: "1" - # labels: - # - key: customer_id - # description: "The id of the customer." - # monitoring: - # producer_destinations: - # - monitored_resource: library.googleapis.com/Branch - # metrics: - # - library.googleapis.com/book/returned_count - # consumer_destinations: - # - monitored_resource: library.googleapis.com/Branch - # metrics: - # - library.googleapis.com/book/returned_count - # - library.googleapis.com/book/num_overdue - # @!attribute [rw] producer_destinations - # @return [::Array<::Google::Api::Monitoring::MonitoringDestination>] - # Monitoring configurations for sending metrics to the producer project. - # There can be multiple producer destinations. A monitored resource type may - # appear in multiple monitoring destinations if different aggregations are - # needed for different sets of metrics associated with that monitored - # resource type. A monitored resource and metric pair may only be used once - # in the Monitoring configuration. - # @!attribute [rw] consumer_destinations - # @return [::Array<::Google::Api::Monitoring::MonitoringDestination>] - # Monitoring configurations for sending metrics to the consumer project. - # There can be multiple consumer destinations. A monitored resource type may - # appear in multiple monitoring destinations if different aggregations are - # needed for different sets of metrics associated with that monitored - # resource type. A monitored resource and metric pair may only be used once - # in the Monitoring configuration. - class Monitoring - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration of a specific monitoring destination (the producer project - # or the consumer project). - # @!attribute [rw] monitored_resource - # @return [::String] - # The monitored resource type. The type must be defined in - # [Service.monitored_resources][google.api.Service.monitored_resources] - # section. - # @!attribute [rw] metrics - # @return [::Array<::String>] - # Types of the metrics to report to this monitoring destination. - # Each type must be defined in - # [Service.metrics][google.api.Service.metrics] section. - class MonitoringDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb deleted file mode 100644 index 410251c03d80..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb +++ /dev/null @@ -1,208 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Quota configuration helps to achieve fairness and budgeting in service - # usage. - # - # The metric based quota configuration works this way: - # - The service configuration defines a set of metrics. - # - For API calls, the quota.metric_rules maps methods to metrics with - # corresponding costs. - # - The quota.limits defines limits on the metrics, which will be used for - # quota checks at runtime. - # - # An example quota configuration in yaml format: - # - # quota: - # limits: - # - # - name: apiWriteQpsPerProject - # metric: library.googleapis.com/write_calls - # unit: "1/min/\\{project}" # rate limit for consumer projects - # values: - # STANDARD: 10000 - # - # - # (The metric rules bind all methods to the read_calls metric, - # except for the UpdateBook and DeleteBook methods. These two methods - # are mapped to the write_calls metric, with the UpdateBook method - # consuming at twice rate as the DeleteBook method.) - # metric_rules: - # - selector: "*" - # metric_costs: - # library.googleapis.com/read_calls: 1 - # - selector: google.example.library.v1.LibraryService.UpdateBook - # metric_costs: - # library.googleapis.com/write_calls: 2 - # - selector: google.example.library.v1.LibraryService.DeleteBook - # metric_costs: - # library.googleapis.com/write_calls: 1 - # - # Corresponding Metric definition: - # - # metrics: - # - name: library.googleapis.com/read_calls - # display_name: Read requests - # metric_kind: DELTA - # value_type: INT64 - # - # - name: library.googleapis.com/write_calls - # display_name: Write requests - # metric_kind: DELTA - # value_type: INT64 - # @!attribute [rw] limits - # @return [::Array<::Google::Api::QuotaLimit>] - # List of QuotaLimit definitions for the service. - # @!attribute [rw] metric_rules - # @return [::Array<::Google::Api::MetricRule>] - # List of MetricRule definitions, each one mapping a selected method to one - # or more metrics. - class Quota - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Bind API methods to metrics. Binding a method to a metric causes that - # metric's configured quota behaviors to apply to the method call. - # @!attribute [rw] selector - # @return [::String] - # Selects the methods to which this rule applies. - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # @!attribute [rw] metric_costs - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # Metrics to update when the selected methods are called, and the associated - # cost applied to each metric. - # - # The key of the map is the metric name, and the values are the amount - # increased for the metric against which the quota limits are defined. - # The value must not be negative. - class MetricRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class MetricCostsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `QuotaLimit` defines a specific limit that applies over a specified duration - # for a limit type. There can be at most one limit for a duration and limit - # type combination defined within a `QuotaGroup`. - # @!attribute [rw] name - # @return [::String] - # Name of the quota limit. - # - # The name must be provided, and it must be unique within the service. The - # name can only include alphanumeric characters as well as '-'. - # - # The maximum length of the limit name is 64 characters. - # @!attribute [rw] description - # @return [::String] - # Optional. User-visible, extended description for this quota limit. - # Should be used only when more context is needed to understand this limit - # than provided by the limit's display name (see: `display_name`). - # @!attribute [rw] default_limit - # @return [::Integer] - # Default number of tokens that can be consumed during the specified - # duration. This is the number of tokens assigned when a client - # application developer activates the service for his/her project. - # - # Specifying a value of 0 will block all requests. This can be used if you - # are provisioning quota to selected consumers and blocking others. - # Similarly, a value of -1 will indicate an unlimited quota. No other - # negative values are allowed. - # - # Used by group-based quotas only. - # @!attribute [rw] max_limit - # @return [::Integer] - # Maximum number of tokens that can be consumed during the specified - # duration. Client application developers can override the default limit up - # to this maximum. If specified, this value cannot be set to a value less - # than the default limit. If not specified, it is set to the default limit. - # - # To allow clients to apply overrides with no upper bound, set this to -1, - # indicating unlimited maximum quota. - # - # Used by group-based quotas only. - # @!attribute [rw] free_tier - # @return [::Integer] - # Free tier value displayed in the Developers Console for this limit. - # The free tier is the number of tokens that will be subtracted from the - # billed amount when billing is enabled. - # This field can only be set on a limit with duration "1d", in a billable - # group; it is invalid on any other limit. If this field is not set, it - # defaults to 0, indicating that there is no free tier for this service. - # - # Used by group-based quotas only. - # @!attribute [rw] duration - # @return [::String] - # Duration of this limit in textual notation. Must be "100s" or "1d". - # - # Used by group-based quotas only. - # @!attribute [rw] metric - # @return [::String] - # The name of the metric this quota limit applies to. The quota limits with - # the same metric will be checked together during runtime. The metric must be - # defined within the service config. - # @!attribute [rw] unit - # @return [::String] - # Specify the unit of the quota limit. It uses the same syntax as - # [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported - # unit kinds are determined by the quota backend system. - # - # Here are some examples: - # * "1/min/\\{project}" for quota per minute per project. - # - # Note: the order of unit components is insignificant. - # The "1" at the beginning is required to follow the metric unit syntax. - # @!attribute [rw] values - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # Tiered limit values. You must specify this as a key:value pair, with an - # integer value that is the maximum number of requests allowed for the - # specified unit. Currently only STANDARD is supported. - # @!attribute [rw] display_name - # @return [::String] - # User-visible display name for this limit. - # Optional. If not set, the UI will provide a default display name based on - # the quota configuration. This field can be used to override the default - # display name generated from the configuration. - class QuotaLimit - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class ValuesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/api/serviceusage/v1/resources.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/resources.rb deleted file mode 100644 index 7895c440ea25..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/resources.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceUsage - module V1 - # A service that is available for use by the consumer. - # @!attribute [rw] name - # @return [::String] - # The resource name of the consumer and service. - # - # A valid name would be: - # - projects/123/services/serviceusage.googleapis.com - # @!attribute [rw] parent - # @return [::String] - # The resource name of the consumer. - # - # A valid name would be: - # - projects/123 - # @!attribute [rw] config - # @return [::Google::Cloud::ServiceUsage::V1::ServiceConfig] - # The service configuration of the available service. - # Some fields may be filtered out of the configuration in responses to - # the `ListServices` method. These fields are present only in responses to - # the `GetService` method. - # @!attribute [rw] state - # @return [::Google::Cloud::ServiceUsage::V1::State] - # Whether or not the service has been enabled for use by the consumer. - class Service - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The configuration of the service. - # @!attribute [rw] name - # @return [::String] - # The DNS address at which this service is available. - # - # An example DNS address would be: - # `calendar.googleapis.com`. - # @!attribute [rw] title - # @return [::String] - # The product title for this service. - # @!attribute [rw] apis - # @return [::Array<::Google::Protobuf::Api>] - # A list of API interfaces exported by this service. Contains only the names, - # versions, and method names of the interfaces. - # @!attribute [rw] documentation - # @return [::Google::Api::Documentation] - # Additional API documentation. Contains only the summary and the - # documentation URL. - # @!attribute [rw] quota - # @return [::Google::Api::Quota] - # Quota configuration. - # @!attribute [rw] authentication - # @return [::Google::Api::Authentication] - # Auth configuration. Contains only the OAuth rules. - # @!attribute [rw] usage - # @return [::Google::Api::Usage] - # Configuration controlling usage of this service. - # @!attribute [rw] endpoints - # @return [::Array<::Google::Api::Endpoint>] - # Configuration for network endpoints. Contains only the names and aliases - # of the endpoints. - # @!attribute [rw] monitored_resources - # @return [::Array<::Google::Api::MonitoredResourceDescriptor>] - # Defines the monitored resources used by this service. This is required - # by the [Service.monitoring][google.api.Service.monitoring] and - # [Service.logging][google.api.Service.logging] configurations. - # @!attribute [rw] monitoring - # @return [::Google::Api::Monitoring] - # Monitoring configuration. - # This should not include the 'producer_destinations' field. - class ServiceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The operation metadata returned for the batchend services operation. - # @!attribute [rw] resource_names - # @return [::Array<::String>] - # The full name of the resources that this operation is directly - # associated with. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Whether or not a service has been enabled for use by a consumer. - module State - # The default value, which indicates that the enabled state of the service - # is unspecified or not meaningful. Currently, all consumers other than - # projects (such as folders and organizations) are always in this state. - STATE_UNSPECIFIED = 0 - - # The service cannot be used by this consumer. It has either been explicitly - # disabled, or has never been enabled. - DISABLED = 1 - - # The service has been explicitly enabled for use by this consumer. - ENABLED = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/serviceusage.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/serviceusage.rb deleted file mode 100644 index ac900c98b599..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/serviceusage/v1/serviceusage.rb +++ /dev/null @@ -1,242 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module ServiceUsage - module V1 - # Request message for the `EnableService` method. - # @!attribute [rw] name - # @return [::String] - # Name of the consumer and service to enable the service on. - # - # The `EnableService` and `DisableService` methods currently only support - # projects. - # - # Enabling a service requires that the service is public or is shared with - # the user enabling the service. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - class EnableServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `EnableService` method. - # This response message is assigned to the `response` field of the returned - # Operation when that operation is done. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceUsage::V1::Service] - # The new state of the service after enabling. - class EnableServiceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `DisableService` method. - # @!attribute [rw] name - # @return [::String] - # Name of the consumer and service to disable the service on. - # - # The enable and disable methods currently only support projects. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # @!attribute [rw] disable_dependent_services - # @return [::Boolean] - # Indicates if services that are enabled and which depend on this service - # should also be disabled. If not set, an error will be generated if any - # enabled services depend on the service to be disabled. When set, the - # service, and any enabled services that depend on it, will be disabled - # together. - # @!attribute [rw] check_if_service_has_usage - # @return [::Google::Cloud::ServiceUsage::V1::DisableServiceRequest::CheckIfServiceHasUsage] - # Defines the behavior for checking service usage when disabling a service. - class DisableServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to determine if service usage should be checked when disabling a - # service. - module CheckIfServiceHasUsage - # When unset, the default behavior is used, which is SKIP. - CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED = 0 - - # If set, skip checking service usage when disabling a service. - SKIP = 1 - - # If set, service usage is checked when disabling the service. If a - # service, or its dependents, has usage in the last 30 days, the request - # returns a FAILED_PRECONDITION error. - CHECK = 2 - end - end - - # Response message for the `DisableService` method. - # This response message is assigned to the `response` field of the returned - # Operation when that operation is done. - # @!attribute [rw] service - # @return [::Google::Cloud::ServiceUsage::V1::Service] - # The new state of the service after disabling. - class DisableServiceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `GetService` method. - # @!attribute [rw] name - # @return [::String] - # Name of the consumer and service to get the `ConsumerState` for. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - class GetServiceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListServices` method. - # @!attribute [rw] parent - # @return [::String] - # Parent to search for services on. - # - # An example name would be: - # `projects/123` where `123` is the project number. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested size of the next page of data. - # Requested page size cannot exceed 200. - # If not set, the default page size is 50. - # @!attribute [rw] page_token - # @return [::String] - # Token identifying which result to start with, which is returned by a - # previous list call. - # @!attribute [rw] filter - # @return [::String] - # Only list services that conform to the given filter. - # The allowed filter strings are `state:ENABLED` and `state:DISABLED`. - class ListServicesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListServices` method. - # @!attribute [rw] services - # @return [::Array<::Google::Cloud::ServiceUsage::V1::Service>] - # The available services for the requested project. - # @!attribute [rw] next_page_token - # @return [::String] - # Token that can be passed to `ListServices` to resume a paginated - # query. - class ListServicesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `BatchEnableServices` method. - # @!attribute [rw] parent - # @return [::String] - # Parent to enable services on. - # - # An example name would be: - # `projects/123` where `123` is the project number. - # - # The `BatchEnableServices` method currently only supports projects. - # @!attribute [rw] service_ids - # @return [::Array<::String>] - # The identifiers of the services to enable on the project. - # - # A valid identifier would be: - # serviceusage.googleapis.com - # - # Enabling services requires that each service is public or is shared with - # the user enabling the service. - # - # A single request can enable a maximum of 20 services at a time. If more - # than 20 services are specified, the request will fail, and no state changes - # will occur. - class BatchEnableServicesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `BatchEnableServices` method. - # This response message is assigned to the `response` field of the returned - # Operation when that operation is done. - # @!attribute [rw] services - # @return [::Array<::Google::Cloud::ServiceUsage::V1::Service>] - # The new state of the services after enabling. - # @!attribute [rw] failures - # @return [::Array<::Google::Cloud::ServiceUsage::V1::BatchEnableServicesResponse::EnableFailure>] - # If allow_partial_success is true, and one or more services could not be - # enabled, this field contains the details about each failure. - class BatchEnableServicesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Provides error messages for the failing services. - # @!attribute [rw] service_id - # @return [::String] - # The service id of a service that could not be enabled. - # @!attribute [rw] error_message - # @return [::String] - # An error message describing why the service could not be enabled. - class EnableFailure - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for the `BatchGetServices` method. - # @!attribute [rw] parent - # @return [::String] - # Parent to retrieve services from. - # If this is set, the parent of all of the services specified in `names` must - # match this field. An example name would be: `projects/123` where `123` is - # the project number. The `BatchGetServices` method currently only supports - # projects. - # @!attribute [rw] names - # @return [::Array<::String>] - # Names of the services to retrieve. - # - # An example name would be: - # `projects/123/services/serviceusage.googleapis.com` where `123` is the - # project number. - # A single request can get a maximum of 30 services at a time. - class BatchGetServicesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `BatchGetServices` method. - # @!attribute [rw] services - # @return [::Array<::Google::Cloud::ServiceUsage::V1::Service>] - # The requested Service states. - class BatchGetServicesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb deleted file mode 100644 index 42ed23536d71..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/api/usage.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Configuration controlling usage of a service. - # @!attribute [rw] requirements - # @return [::Array<::String>] - # Requirements that must be satisfied before a consumer project can use the - # service. Each requirement is of the form /; - # for example 'serviceusage.googleapis.com/billing-enabled'. - # - # For Google APIs, a Terms of Service requirement must be included here. - # Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". - # Other Google APIs should include - # "serviceusage.googleapis.com/tos/universal". Additional ToS can be - # included based on the business needs. - # @!attribute [rw] rules - # @return [::Array<::Google::Api::UsageRule>] - # A list of usage rules that apply to individual API methods. - # - # **NOTE:** All service configuration rules follow "last one wins" order. - # @!attribute [rw] producer_notification_channel - # @return [::String] - # The full resource name of a channel used for sending notifications to the - # service producer. - # - # Google Service Management currently only supports - # [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification - # channel. To use Google Cloud Pub/Sub as the channel, this must be the name - # of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format - # documented in https://cloud.google.com/pubsub/docs/overview. - class Usage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Usage configuration rules for the service. - # @!attribute [rw] selector - # @return [::String] - # Selects the methods to which this rule applies. Use '*' to indicate all - # methods in all APIs. - # - # Refer to {::Google::Api::DocumentationRule#selector selector} for syntax - # details. - # @!attribute [rw] allow_unregistered_calls - # @return [::Boolean] - # Use this rule to configure unregistered calls for the service. Unregistered - # calls are calls that do not contain consumer project identity. - # (Example: calls that do not contain an API key). - # - # WARNING: By default, API methods do not allow unregistered calls, and each - # method call must be identified by a consumer project identity. - # @!attribute [rw] skip_service_control - # @return [::Boolean] - # If true, the selected method should skip service control and the control - # plane features, such as quota and billing, will not be available. - # This flag is used by Google Cloud Endpoints to bypass checks for internal - # methods, such as service health check methods. - class UsageRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/api.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/api.rb deleted file mode 100644 index 9817de10b446..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/api.rb +++ /dev/null @@ -1,194 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Api is a light-weight descriptor for an API Interface. - # - # Interfaces are also described as "protocol buffer services" in some contexts, - # such as by the "service" keyword in a .proto file, but they are different - # from API Services, which represent a concrete implementation of an interface - # as opposed to simply a description of methods and bindings. They are also - # sometimes simply referred to as "APIs" in other contexts, such as the name of - # this message itself. See https://cloud.google.com/apis/design/glossary for - # detailed terminology. - # @!attribute [rw] name - # @return [::String] - # The fully qualified name of this interface, including package name - # followed by the interface's simple name. - # @!attribute [rw] methods - # @return [::Array<::Google::Protobuf::Method>] - # The methods of this interface, in unspecified order. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # Any metadata attached to the interface. - # @!attribute [rw] version - # @return [::String] - # A version string for this interface. If specified, must have the form - # `major-version.minor-version`, as in `1.10`. If the minor version is - # omitted, it defaults to zero. If the entire version field is empty, the - # major version is derived from the package name, as outlined below. If the - # field is not empty, the version in the package name will be verified to be - # consistent with what is provided here. - # - # The versioning schema uses [semantic - # versioning](http://semver.org) where the major version number - # indicates a breaking change and the minor version an additive, - # non-breaking change. Both version numbers are signals to users - # what to expect from different versions, and should be carefully - # chosen based on the product plan. - # - # The major version is also reflected in the package name of the - # interface, which must end in `v`, as in - # `google.feature.v1`. For major versions 0 and 1, the suffix can - # be omitted. Zero major versions must only be used for - # experimental, non-GA interfaces. - # @!attribute [rw] source_context - # @return [::Google::Protobuf::SourceContext] - # Source context for the protocol buffer service represented by this - # message. - # @!attribute [rw] mixins - # @return [::Array<::Google::Protobuf::Mixin>] - # Included interfaces. See [Mixin][]. - # @!attribute [rw] syntax - # @return [::Google::Protobuf::Syntax] - # The source syntax of the service. - class Api - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Method represents a method of an API interface. - # @!attribute [rw] name - # @return [::String] - # The simple name of this method. - # @!attribute [rw] request_type_url - # @return [::String] - # A URL of the input message type. - # @!attribute [rw] request_streaming - # @return [::Boolean] - # If true, the request is streamed. - # @!attribute [rw] response_type_url - # @return [::String] - # The URL of the output message type. - # @!attribute [rw] response_streaming - # @return [::Boolean] - # If true, the response is streamed. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # Any metadata attached to the method. - # @!attribute [rw] syntax - # @return [::Google::Protobuf::Syntax] - # The source syntax of this method. - class Method - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Declares an API Interface to be included in this interface. The including - # interface must redeclare all the methods from the included interface, but - # documentation and options are inherited as follows: - # - # - If after comment and whitespace stripping, the documentation - # string of the redeclared method is empty, it will be inherited - # from the original method. - # - # - Each annotation belonging to the service config (http, - # visibility) which is not set in the redeclared method will be - # inherited. - # - # - If an http annotation is inherited, the path pattern will be - # modified as follows. Any version prefix will be replaced by the - # version of the including interface plus the [root][] path if - # specified. - # - # Example of a simple mixin: - # - # package google.acl.v1; - # service AccessControl { - # // Get the underlying ACL object. - # rpc GetAcl(GetAclRequest) returns (Acl) { - # option (google.api.http).get = "/v1/{resource=**}:getAcl"; - # } - # } - # - # package google.storage.v2; - # service Storage { - # rpc GetAcl(GetAclRequest) returns (Acl); - # - # // Get a data record. - # rpc GetData(GetDataRequest) returns (Data) { - # option (google.api.http).get = "/v2/{resource=**}"; - # } - # } - # - # Example of a mixin configuration: - # - # apis: - # - name: google.storage.v2.Storage - # mixins: - # - name: google.acl.v1.AccessControl - # - # The mixin construct implies that all methods in `AccessControl` are - # also declared with same name and request/response types in - # `Storage`. A documentation generator or annotation processor will - # see the effective `Storage.GetAcl` method after inheriting - # documentation and annotations as follows: - # - # service Storage { - # // Get the underlying ACL object. - # rpc GetAcl(GetAclRequest) returns (Acl) { - # option (google.api.http).get = "/v2/{resource=**}:getAcl"; - # } - # ... - # } - # - # Note how the version in the path pattern changed from `v1` to `v2`. - # - # If the `root` field in the mixin is specified, it should be a - # relative path under which inherited HTTP paths are placed. Example: - # - # apis: - # - name: google.storage.v2.Storage - # mixins: - # - name: google.acl.v1.AccessControl - # root: acls - # - # This implies the following inherited HTTP annotation: - # - # service Storage { - # // Get the underlying ACL object. - # rpc GetAcl(GetAclRequest) returns (Acl) { - # option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; - # } - # ... - # } - # @!attribute [rw] name - # @return [::String] - # The fully qualified name of the interface which is included. - # @!attribute [rw] root - # @return [::String] - # If non-empty specifies a path under which inherited HTTP paths - # are rooted. - class Mixin - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/source_context.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/source_context.rb deleted file mode 100644 index 1bc7c0900aec..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/source_context.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `SourceContext` represents information about the source of a - # protobuf element, like the file in which it is defined. - # @!attribute [rw] file_name - # @return [::String] - # The path-qualified name of the .proto file that contained the associated - # protobuf element. For example: `"google/protobuf/source_context.proto"`. - class SourceContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/proto_docs/google/protobuf/type.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/type.rb deleted file mode 100644 index f61674e32d16..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/protobuf/type.rb +++ /dev/null @@ -1,232 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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 protocol buffer message type. - # @!attribute [rw] name - # @return [::String] - # The fully qualified message name. - # @!attribute [rw] fields - # @return [::Array<::Google::Protobuf::Field>] - # The list of fields. - # @!attribute [rw] oneofs - # @return [::Array<::String>] - # The list of types appearing in `oneof` definitions in this type. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # The protocol buffer options. - # @!attribute [rw] source_context - # @return [::Google::Protobuf::SourceContext] - # The source context. - # @!attribute [rw] syntax - # @return [::Google::Protobuf::Syntax] - # The source syntax. - # @!attribute [rw] edition - # @return [::String] - # The source edition string, only valid when syntax is SYNTAX_EDITIONS. - class Type - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A single field of a message type. - # @!attribute [rw] kind - # @return [::Google::Protobuf::Field::Kind] - # The field type. - # @!attribute [rw] cardinality - # @return [::Google::Protobuf::Field::Cardinality] - # The field cardinality. - # @!attribute [rw] number - # @return [::Integer] - # The field number. - # @!attribute [rw] name - # @return [::String] - # The field name. - # @!attribute [rw] type_url - # @return [::String] - # The field type URL, without the scheme, for message or enumeration - # types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - # @!attribute [rw] oneof_index - # @return [::Integer] - # The index of the field type in `Type.oneofs`, for message or enumeration - # types. The first type has index 1; zero means the type is not in the list. - # @!attribute [rw] packed - # @return [::Boolean] - # Whether to use alternative packed wire representation. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # The protocol buffer options. - # @!attribute [rw] json_name - # @return [::String] - # The field JSON name. - # @!attribute [rw] default_value - # @return [::String] - # The string value of the default value of this field. Proto2 syntax only. - class Field - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Basic field types. - module Kind - # Field type unknown. - TYPE_UNKNOWN = 0 - - # Field type double. - TYPE_DOUBLE = 1 - - # Field type float. - TYPE_FLOAT = 2 - - # Field type int64. - TYPE_INT64 = 3 - - # Field type uint64. - TYPE_UINT64 = 4 - - # Field type int32. - TYPE_INT32 = 5 - - # Field type fixed64. - TYPE_FIXED64 = 6 - - # Field type fixed32. - TYPE_FIXED32 = 7 - - # Field type bool. - TYPE_BOOL = 8 - - # Field type string. - TYPE_STRING = 9 - - # Field type group. Proto2 syntax only, and deprecated. - TYPE_GROUP = 10 - - # Field type message. - TYPE_MESSAGE = 11 - - # Field type bytes. - TYPE_BYTES = 12 - - # Field type uint32. - TYPE_UINT32 = 13 - - # Field type enum. - TYPE_ENUM = 14 - - # Field type sfixed32. - TYPE_SFIXED32 = 15 - - # Field type sfixed64. - TYPE_SFIXED64 = 16 - - # Field type sint32. - TYPE_SINT32 = 17 - - # Field type sint64. - TYPE_SINT64 = 18 - end - - # Whether a field is optional, required, or repeated. - module Cardinality - # For fields with unknown cardinality. - CARDINALITY_UNKNOWN = 0 - - # For optional fields. - CARDINALITY_OPTIONAL = 1 - - # For required fields. Proto2 syntax only. - CARDINALITY_REQUIRED = 2 - - # For repeated fields. - CARDINALITY_REPEATED = 3 - end - end - - # Enum type definition. - # @!attribute [rw] name - # @return [::String] - # Enum type name. - # @!attribute [rw] enumvalue - # @return [::Array<::Google::Protobuf::EnumValue>] - # Enum value definitions. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # Protocol buffer options. - # @!attribute [rw] source_context - # @return [::Google::Protobuf::SourceContext] - # The source context. - # @!attribute [rw] syntax - # @return [::Google::Protobuf::Syntax] - # The source syntax. - # @!attribute [rw] edition - # @return [::String] - # The source edition string, only valid when syntax is SYNTAX_EDITIONS. - class Enum - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enum value definition. - # @!attribute [rw] name - # @return [::String] - # Enum value name. - # @!attribute [rw] number - # @return [::Integer] - # Enum value number. - # @!attribute [rw] options - # @return [::Array<::Google::Protobuf::Option>] - # Protocol buffer options. - class EnumValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A protocol buffer option, which can be attached to a message, field, - # enumeration, etc. - # @!attribute [rw] name - # @return [::String] - # The option's name. For protobuf built-in options (options defined in - # descriptor.proto), this is the short name. For example, `"map_entry"`. - # For custom options, it should be the fully-qualified name. For example, - # `"google.api.http"`. - # @!attribute [rw] value - # @return [::Google::Protobuf::Any] - # The option's value packed in an Any message. If the value is a primitive, - # the corresponding wrapper type defined in google/protobuf/wrappers.proto - # should be used. If the value is an enum, it should be stored as an int32 - # value using the google.protobuf.Int32Value type. - class Option - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The syntax in which a protocol buffer element is defined. - module Syntax - # Syntax `proto2`. - SYNTAX_PROTO2 = 0 - - # Syntax `proto3`. - SYNTAX_PROTO3 = 1 - - # Syntax `editions`. - SYNTAX_EDITIONS = 2 - end - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-service_usage-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-service_usage-v1/snippets/Gemfile deleted file mode 100644 index d5e54b2240b0..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-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-service_usage-v1", path: "../" -else - gem "google-cloud-service_usage-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-service_usage-v1/snippets/service_usage/batch_enable_services.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb deleted file mode 100644 index 3dca1ec69065..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START serviceusage_v1_generated_ServiceUsage_BatchEnableServices_sync] -require "google/cloud/service_usage/v1" - -## -# Snippet for the batch_enable_services call in the ServiceUsage service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_enable_services. -# -def batch_enable_services - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new - - # Call the batch_enable_services method. - result = client.batch_enable_services request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END serviceusage_v1_generated_ServiceUsage_BatchEnableServices_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb deleted file mode 100644 index 86456494e1ce..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START serviceusage_v1_generated_ServiceUsage_BatchGetServices_sync] -require "google/cloud/service_usage/v1" - -## -# Snippet for the batch_get_services call in the ServiceUsage service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_get_services. -# -def batch_get_services - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new - - # Call the batch_get_services method. - result = client.batch_get_services request - - # The returned object is of type Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse. - p result -end -# [END serviceusage_v1_generated_ServiceUsage_BatchGetServices_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb deleted file mode 100644 index 5bc9366a51e6..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START serviceusage_v1_generated_ServiceUsage_DisableService_sync] -require "google/cloud/service_usage/v1" - -## -# Snippet for the disable_service call in the ServiceUsage service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#disable_service. -# -def disable_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new - - # Call the disable_service method. - result = client.disable_service request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END serviceusage_v1_generated_ServiceUsage_DisableService_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb deleted file mode 100644 index 9d41562dd5d0..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START serviceusage_v1_generated_ServiceUsage_EnableService_sync] -require "google/cloud/service_usage/v1" - -## -# Snippet for the enable_service call in the ServiceUsage service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#enable_service. -# -def enable_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new - - # Call the enable_service method. - result = client.enable_service request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END serviceusage_v1_generated_ServiceUsage_EnableService_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb deleted file mode 100644 index 81f2e0dc7fb9..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START serviceusage_v1_generated_ServiceUsage_GetService_sync] -require "google/cloud/service_usage/v1" - -## -# Snippet for the get_service call in the ServiceUsage service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#get_service. -# -def get_service - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceUsage::V1::GetServiceRequest.new - - # Call the get_service method. - result = client.get_service request - - # The returned object is of type Google::Cloud::ServiceUsage::V1::Service. - p result -end -# [END serviceusage_v1_generated_ServiceUsage_GetService_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb b/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb deleted file mode 100644 index 13e90b729e12..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START serviceusage_v1_generated_ServiceUsage_ListServices_sync] -require "google/cloud/service_usage/v1" - -## -# Snippet for the list_services call in the ServiceUsage service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#list_services. -# -def list_services - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::ServiceUsage::V1::ListServicesRequest.new - - # Call the list_services method. - result = client.list_services request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::ServiceUsage::V1::Service. - p item - end -end -# [END serviceusage_v1_generated_ServiceUsage_ListServices_sync] diff --git a/owl-bot-staging/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json b/owl-bot-staging/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json deleted file mode 100644 index 633aac1aafdf..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-service_usage-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.api.serviceusage.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "serviceusage_v1_generated_ServiceUsage_EnableService_sync", - "title": "Snippet for the enable_service call in the ServiceUsage service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#enable_service.", - "file": "service_usage/enable_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_service", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#enable_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceUsage::V1::EnableServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ServiceUsage::Client", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" - }, - "method": { - "short_name": "EnableService", - "full_name": "google.api.serviceusage.v1.ServiceUsage.EnableService", - "service": { - "short_name": "ServiceUsage", - "full_name": "google.api.serviceusage.v1.ServiceUsage" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "serviceusage_v1_generated_ServiceUsage_DisableService_sync", - "title": "Snippet for the disable_service call in the ServiceUsage service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#disable_service.", - "file": "service_usage/disable_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_service", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#disable_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceUsage::V1::DisableServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ServiceUsage::Client", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" - }, - "method": { - "short_name": "DisableService", - "full_name": "google.api.serviceusage.v1.ServiceUsage.DisableService", - "service": { - "short_name": "ServiceUsage", - "full_name": "google.api.serviceusage.v1.ServiceUsage" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "serviceusage_v1_generated_ServiceUsage_GetService_sync", - "title": "Snippet for the get_service call in the ServiceUsage service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#get_service.", - "file": "service_usage/get_service.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_service", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#get_service", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceUsage::V1::GetServiceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceUsage::V1::Service", - "client": { - "short_name": "ServiceUsage::Client", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" - }, - "method": { - "short_name": "GetService", - "full_name": "google.api.serviceusage.v1.ServiceUsage.GetService", - "service": { - "short_name": "ServiceUsage", - "full_name": "google.api.serviceusage.v1.ServiceUsage" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "serviceusage_v1_generated_ServiceUsage_ListServices_sync", - "title": "Snippet for the list_services call in the ServiceUsage service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#list_services.", - "file": "service_usage/list_services.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_services", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#list_services", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceUsage::V1::ListServicesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceUsage::V1::ListServicesResponse", - "client": { - "short_name": "ServiceUsage::Client", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" - }, - "method": { - "short_name": "ListServices", - "full_name": "google.api.serviceusage.v1.ServiceUsage.ListServices", - "service": { - "short_name": "ServiceUsage", - "full_name": "google.api.serviceusage.v1.ServiceUsage" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "serviceusage_v1_generated_ServiceUsage_BatchEnableServices_sync", - "title": "Snippet for the batch_enable_services call in the ServiceUsage service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_enable_services.", - "file": "service_usage/batch_enable_services.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_enable_services", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_enable_services", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ServiceUsage::Client", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" - }, - "method": { - "short_name": "BatchEnableServices", - "full_name": "google.api.serviceusage.v1.ServiceUsage.BatchEnableServices", - "service": { - "short_name": "ServiceUsage", - "full_name": "google.api.serviceusage.v1.ServiceUsage" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "serviceusage_v1_generated_ServiceUsage_BatchGetServices_sync", - "title": "Snippet for the batch_get_services call in the ServiceUsage service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_get_services.", - "file": "service_usage/batch_get_services.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_get_services", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_get_services", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse", - "client": { - "short_name": "ServiceUsage::Client", - "full_name": "::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client" - }, - "method": { - "short_name": "BatchGetServices", - "full_name": "google.api.serviceusage.v1.ServiceUsage.BatchGetServices", - "service": { - "short_name": "ServiceUsage", - "full_name": "google.api.serviceusage.v1.ServiceUsage" - } - } - }, - "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-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb b/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb deleted file mode 100644 index efdf44506000..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_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/api/serviceusage/v1/serviceusage_pb" -require "google/api/serviceusage/v1/serviceusage_services_pb" -require "google/cloud/service_usage/v1/service_usage" - -class ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb b/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb deleted file mode 100644 index 038fd69ceef7..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb +++ /dev/null @@ -1,430 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/api/serviceusage/v1/serviceusage_pb" -require "google/cloud/service_usage/v1/service_usage/rest" - - -class ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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_enable_service - # Create test objects. - 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" - - enable_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_enable_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.enable_service({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.enable_service name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.enable_service ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.enable_service({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.enable_service(::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_service_client_stub.call_count - end - end - end - - def test_disable_service - # Create test objects. - 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" - disable_dependent_services = true - check_if_service_has_usage = :CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED - - disable_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_disable_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, disable_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.disable_service({ name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.disable_service name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.disable_service ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new(name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.disable_service({ name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.disable_service(::Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new(name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, disable_service_client_stub.call_count - end - end - end - - def test_get_service - # Create test objects. - client_result = ::Google::Cloud::ServiceUsage::V1::Service.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_service_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_get_service_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_service({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_service name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_service ::Google::Cloud::ServiceUsage::V1::GetServiceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_service({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_service(::Google::Cloud::ServiceUsage::V1::GetServiceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_service_client_stub.call_count - end - end - end - - def test_list_services - # Create test objects. - client_result = ::Google::Cloud::ServiceUsage::V1::ListServicesResponse.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_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_list_services_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_services({ 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_services 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_services ::Google::Cloud::ServiceUsage::V1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceUsage::V1::ListServicesRequest.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_services_client_stub.call_count - end - end - end - - def test_batch_enable_services - # Create test objects. - 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" - service_ids = ["hello world"] - - batch_enable_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_batch_enable_services_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_enable_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_enable_services({ parent: parent, service_ids: service_ids }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_enable_services parent: parent, service_ids: service_ids do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_enable_services ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new(parent: parent, service_ids: service_ids) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_enable_services({ parent: parent, service_ids: service_ids }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_enable_services(::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new(parent: parent, service_ids: service_ids), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_enable_services_client_stub.call_count - end - end - end - - def test_batch_get_services - # Create test objects. - client_result = ::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - names = ["hello world"] - - batch_get_services_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::ServiceStub.stub :transcode_batch_get_services_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_get_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_get_services({ parent: parent, names: names }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_get_services parent: parent, names: names do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_get_services ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new(parent: parent, names: names) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_get_services({ parent: parent, names: names }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_get_services(::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new(parent: parent, names: names), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_get_services_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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb b/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb deleted file mode 100644 index aa0dff757696..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb +++ /dev/null @@ -1,500 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/api/serviceusage/v1/serviceusage_pb" -require "google/cloud/service_usage/v1/service_usage" - -class ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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_enable_service - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - enable_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_service, name - assert_kind_of ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.enable_service({ name: 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.enable_service name: 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.enable_service ::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.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.enable_service({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.enable_service(::Google::Cloud::ServiceUsage::V1::EnableServiceRequest.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, enable_service_client_stub.call_rpc_count - end - end - - def test_disable_service - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - disable_dependent_services = true - check_if_service_has_usage = :CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED - - disable_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_service, name - assert_kind_of ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["disable_dependent_services"] - assert_equal :CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED, request["check_if_service_has_usage"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_service({ name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_service name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_service ::Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new(name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_service({ name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.disable_service(::Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new(name: name, disable_dependent_services: disable_dependent_services, check_if_service_has_usage: check_if_service_has_usage), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, disable_service_client_stub.call_rpc_count - end - end - - def test_get_service - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceUsage::V1::Service.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_service_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_service, name - assert_kind_of ::Google::Cloud::ServiceUsage::V1::GetServiceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_service_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_service({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_service name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_service ::Google::Cloud::ServiceUsage::V1::GetServiceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_service({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_service(::Google::Cloud::ServiceUsage::V1::GetServiceRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_service_client_stub.call_rpc_count - end - end - - def test_list_services - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceUsage::V1::ListServicesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_services, name - assert_kind_of ::Google::Cloud::ServiceUsage::V1::ListServicesRequest, 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_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_services({ 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_services 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_services ::Google::Cloud::ServiceUsage::V1::ListServicesRequest.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_services({ 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_services(::Google::Cloud::ServiceUsage::V1::ListServicesRequest.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_services_client_stub.call_rpc_count - end - end - - def test_batch_enable_services - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - service_ids = ["hello world"] - - batch_enable_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_enable_services, name - assert_kind_of ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["service_ids"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_enable_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_enable_services({ parent: parent, service_ids: service_ids }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_enable_services parent: parent, service_ids: service_ids do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_enable_services ::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new(parent: parent, service_ids: service_ids) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_enable_services({ parent: parent, service_ids: service_ids }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_enable_services(::Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new(parent: parent, service_ids: service_ids), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_enable_services_client_stub.call_rpc_count - end - end - - def test_batch_get_services - # Create GRPC objects. - grpc_response = ::Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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"] - - batch_get_services_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_get_services, name - assert_kind_of ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["names"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_get_services_client_stub do - # Create client - client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_get_services({ parent: parent, names: names }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_get_services parent: parent, names: names do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_get_services ::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.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.batch_get_services({ 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.batch_get_services(::Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.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, batch_get_services_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::ServiceUsage::V1::ServiceUsage::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::ServiceUsage::V1::ServiceUsage::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-service_usage-v1/test/helper.rb b/owl-bot-staging/google-cloud-service_usage-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-service_usage-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-shell-v1/.gitignore b/owl-bot-staging/google-cloud-shell-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-shell-v1/.repo-metadata.json deleted file mode 100644 index 928c50bb2ebd..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudshell.googleapis.com", - "api_shortname": "cloudshell", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-shell-v1/latest", - "distribution_name": "google-cloud-shell-v1", - "is_cloud": true, - "language": "ruby", - "name": "cloudshell", - "name_pretty": "Cloud Shell V1 API", - "product_documentation": "https://cloud.google.com/shell/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Shell is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser. Note that google-cloud-shell-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-shell instead. See the readme for more details.", - "ruby-cloud-env-prefix": "CLOUD_SHELL", - "ruby-cloud-product-url": "https://cloud.google.com/shell/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-shell-v1/.rubocop.yml b/owl-bot-staging/google-cloud-shell-v1/.rubocop.yml deleted file mode 100644 index 63ca4175e823..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-shell-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-shell-v1.rb" diff --git a/owl-bot-staging/google-cloud-shell-v1/.toys.rb b/owl-bot-staging/google-cloud-shell-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/.yardopts b/owl-bot-staging/google-cloud-shell-v1/.yardopts deleted file mode 100644 index eac9d9000676..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Shell 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-shell-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-shell-v1/AUTHENTICATION.md deleted file mode 100644 index 4d8d9081cbb9..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-shell-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-shell-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/shell/v1" - -client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/shell/v1" - -::Google::Cloud::Shell::V1::CloudShellService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Shell::V1::CloudShellService::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-shell-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/shell/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Shell::V1::CloudShellService::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-shell-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-shell-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-shell-v1/Gemfile b/owl-bot-staging/google-cloud-shell-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-shell-v1/LICENSE.md b/owl-bot-staging/google-cloud-shell-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/README.md b/owl-bot-staging/google-cloud-shell-v1/README.md deleted file mode 100644 index 35be9a650ba7..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Shell V1 API - -Allows users to start, configure, and connect to interactive shell sessions running in the cloud. - -Cloud Shell is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser. - -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 Shell V1 API. Most users should consider using -the main client gem, -[google-cloud-shell](https://rubygems.org/gems/google-cloud-shell). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-shell-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/cloudshell.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/shell/v1" - -client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new -request = ::Google::Cloud::Shell::V1::GetEnvironmentRequest.new # (request fields as keyword arguments...) -response = client.get_environment request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-shell-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/shell/) -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/shell/v1" -require "logger" - -client = ::Google::Cloud::Shell::V1::CloudShellService::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-shell`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-shell-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-shell`. -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-shell-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-shell-v1/Rakefile b/owl-bot-staging/google-cloud-shell-v1/Rakefile deleted file mode 100644 index fec628dc4e26..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["CLOUD_SHELL_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["CLOUD_SHELL_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["CLOUD_SHELL_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 CLOUD_SHELL_TEST_PROJECT=test123 CLOUD_SHELL_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/shell/v1/cloud_shell_service/credentials" - ::Google::Cloud::Shell::V1::CloudShellService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["CLOUD_SHELL_PROJECT"] = project - ENV["CLOUD_SHELL_TEST_PROJECT"] = project - ENV["CLOUD_SHELL_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-shell-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-shell-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-shell-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-shell-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-shell-v1" - header "google-cloud-shell-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-shell-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-shell-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-shell-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-shell-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-shell-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-shell-v1/gapic_metadata.json deleted file mode 100644 index 23f6c55881ac..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/gapic_metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.shell.v1", - "libraryPackage": "::Google::Cloud::Shell::V1", - "services": { - "CloudShellService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Shell::V1::CloudShellService::Client", - "rpcs": { - "GetEnvironment": { - "methods": [ - "get_environment" - ] - }, - "StartEnvironment": { - "methods": [ - "start_environment" - ] - }, - "AuthorizeEnvironment": { - "methods": [ - "authorize_environment" - ] - }, - "AddPublicKey": { - "methods": [ - "add_public_key" - ] - }, - "RemovePublicKey": { - "methods": [ - "remove_public_key" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-shell-v1/google-cloud-shell-v1.gemspec b/owl-bot-staging/google-cloud-shell-v1/google-cloud-shell-v1.gemspec deleted file mode 100644 index 7a2b913037be..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/google-cloud-shell-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/shell/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-shell-v1" - gem.version = Google::Cloud::Shell::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Shell is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser. Note that google-cloud-shell-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-shell instead. See the readme for more details." - gem.summary = "Allows users to start, configure, and connect to interactive shell sessions running in the cloud." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google-cloud-shell-v1.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google-cloud-shell-v1.rb deleted file mode 100644 index 4f94ddb87d3e..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google-cloud-shell-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/shell/v1" diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1.rb deleted file mode 100644 index c94c21ed2929..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/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/shell/v1/cloud_shell_service" -require "google/cloud/shell/v1/version" - -module Google - module Cloud - module Shell - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/shell/v1" - # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/shell/v1" - # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/shell/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service.rb deleted file mode 100644 index 7e5d994d8637..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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/shell/v1/version" - -require "google/cloud/shell/v1/cloud_shell_service/credentials" -require "google/cloud/shell/v1/cloud_shell_service/paths" -require "google/cloud/shell/v1/cloud_shell_service/operations" -require "google/cloud/shell/v1/cloud_shell_service/client" -require "google/cloud/shell/v1/cloud_shell_service/rest" - -module Google - module Cloud - module Shell - module V1 - ## - # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at - # least one environment, which has the ID "default". Environment consists of a - # Docker image defining what is installed on the environment and a home - # directory containing the user's data that will remain across sessions. - # Clients use this API to start and fetch information about their environment, - # which can then be used to connect to that environment via a separate SSH - # client. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/shell/v1/cloud_shell_service" - # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/shell/v1/cloud_shell_service/rest" - # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - module CloudShellService - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_shell_service", "helpers.rb" -require "google/cloud/shell/v1/cloud_shell_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/client.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/client.rb deleted file mode 100644 index c1a4f329a844..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/client.rb +++ /dev/null @@ -1,954 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/shell/v1/cloudshell_pb" - -module Google - module Cloud - module Shell - module V1 - module CloudShellService - ## - # Client for the CloudShellService service. - # - # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at - # least one environment, which has the ID "default". Environment consists of a - # Docker image defining what is installed on the environment and a home - # directory containing the user's data that will remain across sessions. - # Clients use this API to start and fetch information about their environment, - # which can then be used to connect to that environment via a separate SSH - # client. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudshell.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_shell_service_stub - - ## - # Configure the CloudShellService Client class. - # - # See {::Google::Cloud::Shell::V1::CloudShellService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudShellService clients - # ::Google::Cloud::Shell::V1::CloudShellService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Shell", "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.get_environment.timeout = 60.0 - default_config.rpcs.get_environment.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config.rpcs.start_environment.timeout = 60.0 - - default_config.rpcs.authorize_environment.timeout = 60.0 - - default_config.rpcs.add_public_key.timeout = 60.0 - - default_config.rpcs.remove_public_key.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudShellService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Shell::V1::CloudShellService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam 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_shell_service_stub.universe_domain - end - - ## - # Create a new CloudShellService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudShellService 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/shell/v1/cloudshell_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_shell_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Shell::V1::CloudShellService::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_shell_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::Shell::V1::CloudShellService::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_shell_service_stub.logger - end - - # Service calls - - ## - # Gets an environment. Returns NOT_FOUND if the environment does not exist. - # - # @overload get_environment(request, options = nil) - # Pass arguments to `get_environment` via a request object, either of type - # {::Google::Cloud::Shell::V1::GetEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::GetEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_environment(name: nil) - # Pass arguments to `get_environment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the requested resource, for example `users/me/environments/default` - # or `users/someone@example.com/environments/default`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Shell::V1::Environment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Shell::V1::Environment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::GetEnvironmentRequest.new - # - # # Call the get_environment method. - # result = client.get_environment request - # - # # The returned object is of type Google::Cloud::Shell::V1::Environment. - # p result - # - def get_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::GetEnvironmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Shell::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_environment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.call_rpc :get_environment, request, 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 an existing environment, allowing clients to connect to it. The - # returned operation will contain an instance of StartEnvironmentMetadata in - # its metadata field. Users can wait for the environment to start by polling - # this operation via GetOperation. Once the environment has finished starting - # and is ready to accept connections, the operation will contain a - # StartEnvironmentResponse in its response field. - # - # @overload start_environment(request, options = nil) - # Pass arguments to `start_environment` via a request object, either of type - # {::Google::Cloud::Shell::V1::StartEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::StartEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload start_environment(name: nil, access_token: nil, public_keys: nil) - # Pass arguments to `start_environment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the resource that should be started, for example - # `users/me/environments/default` or - # `users/someone@example.com/environments/default`. - # @param access_token [::String] - # The initial access token passed to the environment. If this is present and - # valid, the environment will be pre-authenticated with gcloud so that the - # user can run gcloud commands in Cloud Shell without having to log in. This - # code can be updated later by calling AuthorizeEnvironment. - # @param public_keys [::Array<::String>] - # Public keys that should be added to the environment before it is started. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::StartEnvironmentRequest.new - # - # # Call the start_environment method. - # result = client.start_environment request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def start_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::StartEnvironmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.start_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Shell::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.start_environment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.call_rpc :start_environment, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sends OAuth credentials to a running environment on behalf of a user. When - # this completes, the environment will be authorized to run various Google - # Cloud command line tools without requiring the user to manually - # authenticate. - # - # @overload authorize_environment(request, options = nil) - # Pass arguments to `authorize_environment` via a request object, either of type - # {::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload authorize_environment(name: nil, access_token: nil, id_token: nil, expire_time: nil) - # Pass arguments to `authorize_environment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the resource that should receive the credentials, for example - # `users/me/environments/default` or - # `users/someone@example.com/environments/default`. - # @param access_token [::String] - # The OAuth access token that should be sent to the environment. - # @param id_token [::String] - # The OAuth ID token that should be sent to the environment. - # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the credentials expire. If not set, defaults to one hour from - # when the server received the request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new - # - # # Call the authorize_environment method. - # result = client.authorize_environment request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def authorize_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.authorize_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Shell::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.authorize_environment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.authorize_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.call_rpc :authorize_environment, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Adds a public SSH key to an environment, allowing clients with the - # corresponding private key to connect to that environment via SSH. If a key - # with the same content already exists, this will error with ALREADY_EXISTS. - # - # @overload add_public_key(request, options = nil) - # Pass arguments to `add_public_key` via a request object, either of type - # {::Google::Cloud::Shell::V1::AddPublicKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::AddPublicKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_key(environment: nil, key: nil) - # Pass arguments to `add_public_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 environment [::String] - # Environment this key should be added to, e.g. - # `users/me/environments/default`. - # @param key [::String] - # Key that should be added to the environment. Supported formats are - # `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` - # (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and - # `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as - # <format> <content>, where <content> part is encoded with - # Base64. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::AddPublicKeyRequest.new - # - # # Call the add_public_key method. - # result = client.add_public_key request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def add_public_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::AddPublicKeyRequest - - # Converts hash and nil to 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_public_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::Shell::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.environment - header_params["environment"] = request.environment - end - - request_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_public_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_public_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.call_rpc :add_public_key, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Removes a public SSH key from an environment. Clients will no longer be - # able to connect to the environment using the corresponding private key. - # If a key with the same content is not present, this will error with - # NOT_FOUND. - # - # @overload remove_public_key(request, options = nil) - # Pass arguments to `remove_public_key` via a request object, either of type - # {::Google::Cloud::Shell::V1::RemovePublicKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::RemovePublicKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_key(environment: nil, key: nil) - # Pass arguments to `remove_public_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 environment [::String] - # Environment this key should be removed from, e.g. - # `users/me/environments/default`. - # @param key [::String] - # Key that should be removed from the environment. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::RemovePublicKeyRequest.new - # - # # Call the remove_public_key method. - # result = client.remove_public_key request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def remove_public_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::RemovePublicKeyRequest - - # Converts hash and nil to 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_public_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::Shell::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.environment - header_params["environment"] = request.environment - end - - request_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_public_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_public_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.call_rpc :remove_public_key, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudShellService API. - # - # This class represents the configuration for CloudShellService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Shell::V1::CloudShellService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_environment to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Shell::V1::CloudShellService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_environment.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_environment.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Shell::V1::CloudShellService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudshell.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CloudShellService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_environment - ## - # RPC-specific configuration for `start_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :start_environment - ## - # RPC-specific configuration for `authorize_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :authorize_environment - ## - # RPC-specific configuration for `add_public_key` - # @return [::Gapic::Config::Method] - # - attr_reader :add_public_key - ## - # RPC-specific configuration for `remove_public_key` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_public_key - - # @private - def initialize parent_rpcs = nil - get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment - @get_environment = ::Gapic::Config::Method.new get_environment_config - start_environment_config = parent_rpcs.start_environment if parent_rpcs.respond_to? :start_environment - @start_environment = ::Gapic::Config::Method.new start_environment_config - authorize_environment_config = parent_rpcs.authorize_environment if parent_rpcs.respond_to? :authorize_environment - @authorize_environment = ::Gapic::Config::Method.new authorize_environment_config - add_public_key_config = parent_rpcs.add_public_key if parent_rpcs.respond_to? :add_public_key - @add_public_key = ::Gapic::Config::Method.new add_public_key_config - remove_public_key_config = parent_rpcs.remove_public_key if parent_rpcs.respond_to? :remove_public_key - @remove_public_key = ::Gapic::Config::Method.new remove_public_key_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/credentials.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/credentials.rb deleted file mode 100644 index c19294dbdf8e..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_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 Shell - module V1 - module CloudShellService - # Credentials for the CloudShellService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "CLOUD_SHELL_CREDENTIALS", - "CLOUD_SHELL_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "CLOUD_SHELL_CREDENTIALS_JSON", - "CLOUD_SHELL_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-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/operations.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/operations.rb deleted file mode 100644 index 1e26fee8ef5a..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_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 Shell - module V1 - module CloudShellService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudshell.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudShellService 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 CloudShellService 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::Shell::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Shell::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Shell::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Shell::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::Shell::V1::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 = "cloudshell.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/paths.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/paths.rb deleted file mode 100644 index f03f93ba390f..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/paths.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Shell - module V1 - module CloudShellService - # Path helper methods for the CloudShellService API. - module Paths - ## - # Create a fully-qualified Environment resource string. - # - # The resource will be in the following format: - # - # `users/{user}/environments/{environment}` - # - # @param user [String] - # @param environment [String] - # - # @return [::String] - def environment_path user:, environment: - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - - "users/#{user}/environments/#{environment}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest.rb deleted file mode 100644 index 478c24d2218a..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/shell/v1/version" - -require "google/cloud/shell/v1/cloud_shell_service/credentials" -require "google/cloud/shell/v1/cloud_shell_service/paths" -require "google/cloud/shell/v1/cloud_shell_service/rest/operations" -require "google/cloud/shell/v1/cloud_shell_service/rest/client" - -module Google - module Cloud - module Shell - module V1 - ## - # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at - # least one environment, which has the ID "default". Environment consists of a - # Docker image defining what is installed on the environment and a home - # directory containing the user's data that will remain across sessions. - # Clients use this API to start and fetch information about their environment, - # which can then be used to connect to that environment via a separate SSH - # client. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/shell/v1/cloud_shell_service/rest" - # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - module CloudShellService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/shell/v1/cloud_shell_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/client.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/client.rb deleted file mode 100644 index 5973f25dd87c..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/client.rb +++ /dev/null @@ -1,876 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/shell/v1/cloudshell_pb" -require "google/cloud/shell/v1/cloud_shell_service/rest/service_stub" - -module Google - module Cloud - module Shell - module V1 - module CloudShellService - module Rest - ## - # REST client for the CloudShellService service. - # - # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at - # least one environment, which has the ID "default". Environment consists of a - # Docker image defining what is installed on the environment and a home - # directory containing the user's data that will remain across sessions. - # Clients use this API to start and fetch information about their environment, - # which can then be used to connect to that environment via a separate SSH - # client. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudshell.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_shell_service_stub - - ## - # Configure the CloudShellService Client class. - # - # See {::Google::Cloud::Shell::V1::CloudShellService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudShellService clients - # ::Google::Cloud::Shell::V1::CloudShellService::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", "Shell", "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.get_environment.timeout = 60.0 - default_config.rpcs.get_environment.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config.rpcs.start_environment.timeout = 60.0 - - default_config.rpcs.authorize_environment.timeout = 60.0 - - default_config.rpcs.add_public_key.timeout = 60.0 - - default_config.rpcs.remove_public_key.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudShellService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Shell::V1::CloudShellService::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_shell_service_stub.universe_domain - end - - ## - # Create a new CloudShellService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudShellService 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::Shell::V1::CloudShellService::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_shell_service_stub = ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_shell_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::Shell::V1::CloudShellService::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_shell_service_stub.logger - end - - # Service calls - - ## - # Gets an environment. Returns NOT_FOUND if the environment does not exist. - # - # @overload get_environment(request, options = nil) - # Pass arguments to `get_environment` via a request object, either of type - # {::Google::Cloud::Shell::V1::GetEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::GetEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_environment(name: nil) - # Pass arguments to `get_environment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the requested resource, for example `users/me/environments/default` - # or `users/someone@example.com/environments/default`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Shell::V1::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Shell::V1::Environment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::GetEnvironmentRequest.new - # - # # Call the get_environment method. - # result = client.get_environment request - # - # # The returned object is of type Google::Cloud::Shell::V1::Environment. - # p result - # - def get_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::GetEnvironmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Shell::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_environment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.get_environment request, 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 an existing environment, allowing clients to connect to it. The - # returned operation will contain an instance of StartEnvironmentMetadata in - # its metadata field. Users can wait for the environment to start by polling - # this operation via GetOperation. Once the environment has finished starting - # and is ready to accept connections, the operation will contain a - # StartEnvironmentResponse in its response field. - # - # @overload start_environment(request, options = nil) - # Pass arguments to `start_environment` via a request object, either of type - # {::Google::Cloud::Shell::V1::StartEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::StartEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload start_environment(name: nil, access_token: nil, public_keys: nil) - # Pass arguments to `start_environment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the resource that should be started, for example - # `users/me/environments/default` or - # `users/someone@example.com/environments/default`. - # @param access_token [::String] - # The initial access token passed to the environment. If this is present and - # valid, the environment will be pre-authenticated with gcloud so that the - # user can run gcloud commands in Cloud Shell without having to log in. This - # code can be updated later by calling AuthorizeEnvironment. - # @param public_keys [::Array<::String>] - # Public keys that should be added to the environment before it is started. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::StartEnvironmentRequest.new - # - # # Call the start_environment method. - # result = client.start_environment request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def start_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::StartEnvironmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.start_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Shell::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.start_environment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.start_environment request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sends OAuth credentials to a running environment on behalf of a user. When - # this completes, the environment will be authorized to run various Google - # Cloud command line tools without requiring the user to manually - # authenticate. - # - # @overload authorize_environment(request, options = nil) - # Pass arguments to `authorize_environment` via a request object, either of type - # {::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload authorize_environment(name: nil, access_token: nil, id_token: nil, expire_time: nil) - # Pass arguments to `authorize_environment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Name of the resource that should receive the credentials, for example - # `users/me/environments/default` or - # `users/someone@example.com/environments/default`. - # @param access_token [::String] - # The OAuth access token that should be sent to the environment. - # @param id_token [::String] - # The OAuth ID token that should be sent to the environment. - # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] - # The time when the credentials expire. If not set, defaults to one hour from - # when the server received the request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new - # - # # Call the authorize_environment method. - # result = client.authorize_environment request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def authorize_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.authorize_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Shell::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.authorize_environment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.authorize_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.authorize_environment request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Adds a public SSH key to an environment, allowing clients with the - # corresponding private key to connect to that environment via SSH. If a key - # with the same content already exists, this will error with ALREADY_EXISTS. - # - # @overload add_public_key(request, options = nil) - # Pass arguments to `add_public_key` via a request object, either of type - # {::Google::Cloud::Shell::V1::AddPublicKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::AddPublicKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_key(environment: nil, key: nil) - # Pass arguments to `add_public_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 environment [::String] - # Environment this key should be added to, e.g. - # `users/me/environments/default`. - # @param key [::String] - # Key that should be added to the environment. Supported formats are - # `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` - # (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and - # `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as - # <format> <content>, where <content> part is encoded with - # Base64. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::AddPublicKeyRequest.new - # - # # Call the add_public_key method. - # result = client.add_public_key request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def add_public_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::AddPublicKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.add_public_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Shell::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_public_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_public_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.add_public_key request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Removes a public SSH key from an environment. Clients will no longer be - # able to connect to the environment using the corresponding private key. - # If a key with the same content is not present, this will error with - # NOT_FOUND. - # - # @overload remove_public_key(request, options = nil) - # Pass arguments to `remove_public_key` via a request object, either of type - # {::Google::Cloud::Shell::V1::RemovePublicKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Shell::V1::RemovePublicKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_key(environment: nil, key: nil) - # Pass arguments to `remove_public_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 environment [::String] - # Environment this key should be removed from, e.g. - # `users/me/environments/default`. - # @param key [::String] - # Key that should be removed from the environment. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/shell/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Shell::V1::RemovePublicKeyRequest.new - # - # # Call the remove_public_key method. - # result = client.remove_public_key request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def remove_public_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Shell::V1::RemovePublicKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.remove_public_key.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Shell::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.remove_public_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_public_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_shell_service_stub.remove_public_key request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudShellService REST API. - # - # This class represents the configuration for CloudShellService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Shell::V1::CloudShellService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_environment to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_environment.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_environment.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudshell.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CloudShellService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_environment - ## - # RPC-specific configuration for `start_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :start_environment - ## - # RPC-specific configuration for `authorize_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :authorize_environment - ## - # RPC-specific configuration for `add_public_key` - # @return [::Gapic::Config::Method] - # - attr_reader :add_public_key - ## - # RPC-specific configuration for `remove_public_key` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_public_key - - # @private - def initialize parent_rpcs = nil - get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment - @get_environment = ::Gapic::Config::Method.new get_environment_config - start_environment_config = parent_rpcs.start_environment if parent_rpcs.respond_to? :start_environment - @start_environment = ::Gapic::Config::Method.new start_environment_config - authorize_environment_config = parent_rpcs.authorize_environment if parent_rpcs.respond_to? :authorize_environment - @authorize_environment = ::Gapic::Config::Method.new authorize_environment_config - add_public_key_config = parent_rpcs.add_public_key if parent_rpcs.respond_to? :add_public_key - @add_public_key = ::Gapic::Config::Method.new add_public_key_config - remove_public_key_config = parent_rpcs.remove_public_key if parent_rpcs.respond_to? :remove_public_key - @remove_public_key = ::Gapic::Config::Method.new remove_public_key_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/operations.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/operations.rb deleted file mode 100644 index 43a883613944..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/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 Shell - module V1 - module CloudShellService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudshell.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudShellService 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 CloudShellService 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::Shell::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Shell::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Shell::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Shell::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "cloudshell.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb deleted file mode 100644 index 6b15a0548b64..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.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! - -require "google/cloud/shell/v1/cloudshell_pb" - -module Google - module Cloud - module Shell - module V1 - module CloudShellService - module Rest - ## - # REST service stub for the CloudShellService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_environment REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::GetEnvironmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Shell::V1::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Shell::V1::Environment] - # A result object deserialized from the server's reply - def get_environment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_environment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_environment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Shell::V1::Environment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the start_environment REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::StartEnvironmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def start_environment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_environment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "start_environment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the authorize_environment REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def authorize_environment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_authorize_environment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "authorize_environment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_public_key REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::AddPublicKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def add_public_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_public_key_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "add_public_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the remove_public_key REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::RemovePublicKeyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def remove_public_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_public_key_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "remove_public_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_environment REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::GetEnvironmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_environment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^users/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_environment REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::StartEnvironmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_start_environment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:start", - body: "*", - matches: [ - ["name", %r{^users/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the authorize_environment REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_authorize_environment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:authorize", - body: "*", - matches: [ - ["name", %r{^users/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_public_key REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::AddPublicKeyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_public_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{environment}:addPublicKey", - body: "*", - matches: [ - ["environment", %r{^users/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_public_key REST call - # - # @param request_pb [::Google::Cloud::Shell::V1::RemovePublicKeyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_public_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{environment}:removePublicKey", - body: "*", - matches: [ - ["environment", %r{^users/[^/]+/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb deleted file mode 100644 index 553b989af184..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/shell/v1/cloudshell.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/timestamp_pb' - - -descriptor_data = "\n&google/cloud/shell/v1/cloudshell.proto\x12\x15google.cloud.shell.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\x1fgoogle/protobuf/timestamp.proto\"\xb3\x03\n\x0b\x45nvironment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x0c\x64ocker_image\x18\x03 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12<\n\x05state\x18\x04 \x01(\x0e\x32(.google.cloud.shell.v1.Environment.StateB\x03\xe0\x41\x03\x12\x15\n\x08web_host\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cssh_username\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08ssh_host\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08ssh_port\x18\x07 \x01(\x05\x42\x03\xe0\x41\x03\x12\x18\n\x0bpublic_keys\x18\x08 \x03(\tB\x03\xe0\x41\x03\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tSUSPENDED\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:S\xea\x41P\n%cloudshell.googleapis.com/Environment\x12\'users/{user}/environments/{environment}\"T\n\x15GetEnvironmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudshell.googleapis.com/Environment\"\x1b\n\x19\x43reateEnvironmentMetadata\"\x1b\n\x19\x44\x65leteEnvironmentMetadata\"R\n\x17StartEnvironmentRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x02 \x01(\t\x12\x13\n\x0bpublic_keys\x18\x03 \x03(\t\"\x84\x01\n\x1b\x41uthorizeEnvironmentRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x02 \x01(\t\x12\x10\n\x08id_token\x18\x04 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x1e\n\x1c\x41uthorizeEnvironmentResponse\"\x1e\n\x1c\x41uthorizeEnvironmentMetadata\"\xd2\x01\n\x18StartEnvironmentMetadata\x12\x44\n\x05state\x18\x01 \x01(\x0e\x32\x35.google.cloud.shell.v1.StartEnvironmentMetadata.State\"p\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STARTING\x10\x01\x12\x14\n\x10UNARCHIVING_DISK\x10\x02\x12\x1e\n\x1a\x41WAITING_COMPUTE_RESOURCES\x10\x04\x12\x0c\n\x08\x46INISHED\x10\x03\"S\n\x18StartEnvironmentResponse\x12\x37\n\x0b\x65nvironment\x18\x01 \x01(\x0b\x32\".google.cloud.shell.v1.Environment\"7\n\x13\x41\x64\x64PublicKeyRequest\x12\x13\n\x0b\x65nvironment\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\"#\n\x14\x41\x64\x64PublicKeyResponse\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x16\n\x14\x41\x64\x64PublicKeyMetadata\":\n\x16RemovePublicKeyRequest\x12\x13\n\x0b\x65nvironment\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\"\x19\n\x17RemovePublicKeyResponse\"\x19\n\x17RemovePublicKeyMetadata\"\x9e\x02\n\x16\x43loudShellErrorDetails\x12O\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x41.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode\"\xb2\x01\n\x13\x43loudShellErrorCode\x12&\n\"CLOUD_SHELL_ERROR_CODE_UNSPECIFIED\x10\x00\x12\x15\n\x11IMAGE_UNAVAILABLE\x10\x01\x12\x18\n\x14\x43LOUD_SHELL_DISABLED\x10\x02\x12\x11\n\rTOS_VIOLATION\x10\x04\x12\x12\n\x0eQUOTA_EXCEEDED\x10\x05\x12\x1b\n\x17\x45NVIRONMENT_UNAVAILABLE\x10\x06\x32\xd4\x08\n\x11\x43loudShellService\x12\x94\x01\n\x0eGetEnvironment\x12,.google.cloud.shell.v1.GetEnvironmentRequest\x1a\".google.cloud.shell.v1.Environment\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=users/*/environments/*}\x12\xcc\x01\n\x10StartEnvironment\x12..google.cloud.shell.v1.StartEnvironmentRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41\x34\n\x18StartEnvironmentResponse\x12\x18StartEnvironmentMetadata\x82\xd3\xe4\x93\x02,\"\'/v1/{name=users/*/environments/*}:start:\x01*\x12\xe0\x01\n\x14\x41uthorizeEnvironment\x12\x32.google.cloud.shell.v1.AuthorizeEnvironmentRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41<\n\x1c\x41uthorizeEnvironmentResponse\x12\x1c\x41uthorizeEnvironmentMetadata\x82\xd3\xe4\x93\x02\x30\"+/v1/{name=users/*/environments/*}:authorize:\x01*\x12\xca\x01\n\x0c\x41\x64\x64PublicKey\x12*.google.cloud.shell.v1.AddPublicKeyRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41,\n\x14\x41\x64\x64PublicKeyResponse\x12\x14\x41\x64\x64PublicKeyMetadata\x82\xd3\xe4\x93\x02:\"5/v1/{environment=users/*/environments/*}:addPublicKey:\x01*\x12\xd9\x01\n\x0fRemovePublicKey\x12-.google.cloud.shell.v1.RemovePublicKeyRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x32\n\x17RemovePublicKeyResponse\x12\x17RemovePublicKeyMetadata\x82\xd3\xe4\x93\x02=\"8/v1/{environment=users/*/environments/*}:removePublicKey:\x01*\x1aM\xca\x41\x19\x63loudshell.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB_\n\x19\x63om.google.cloud.shell.v1B\x0f\x43loudShellProtoP\x01Z/cloud.google.com/go/shell/apiv1/shellpb;shellpbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Shell - module V1 - Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.Environment").msgclass - Environment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.Environment.State").enummodule - GetEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.GetEnvironmentRequest").msgclass - CreateEnvironmentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.CreateEnvironmentMetadata").msgclass - DeleteEnvironmentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.DeleteEnvironmentMetadata").msgclass - StartEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.StartEnvironmentRequest").msgclass - AuthorizeEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AuthorizeEnvironmentRequest").msgclass - AuthorizeEnvironmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AuthorizeEnvironmentResponse").msgclass - AuthorizeEnvironmentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AuthorizeEnvironmentMetadata").msgclass - StartEnvironmentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.StartEnvironmentMetadata").msgclass - StartEnvironmentMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.StartEnvironmentMetadata.State").enummodule - StartEnvironmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.StartEnvironmentResponse").msgclass - AddPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AddPublicKeyRequest").msgclass - AddPublicKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AddPublicKeyResponse").msgclass - AddPublicKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.AddPublicKeyMetadata").msgclass - RemovePublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.RemovePublicKeyRequest").msgclass - RemovePublicKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.RemovePublicKeyResponse").msgclass - RemovePublicKeyMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.RemovePublicKeyMetadata").msgclass - CloudShellErrorDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.CloudShellErrorDetails").msgclass - CloudShellErrorDetails::CloudShellErrorCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_services_pb.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_services_pb.rb deleted file mode 100644 index a9cf73ced654..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_services_pb.rb +++ /dev/null @@ -1,72 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/shell/v1/cloudshell.proto for package 'google.cloud.shell.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/shell/v1/cloudshell_pb' - -module Google - module Cloud - module Shell - module V1 - module CloudShellService - # API for interacting with Google Cloud Shell. Each user of Cloud Shell has at - # least one environment, which has the ID "default". Environment consists of a - # Docker image defining what is installed on the environment and a home - # directory containing the user's data that will remain across sessions. - # Clients use this API to start and fetch information about their environment, - # which can then be used to connect to that environment via a separate SSH - # client. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.shell.v1.CloudShellService' - - # Gets an environment. Returns NOT_FOUND if the environment does not exist. - rpc :GetEnvironment, ::Google::Cloud::Shell::V1::GetEnvironmentRequest, ::Google::Cloud::Shell::V1::Environment - # Starts an existing environment, allowing clients to connect to it. The - # returned operation will contain an instance of StartEnvironmentMetadata in - # its metadata field. Users can wait for the environment to start by polling - # this operation via GetOperation. Once the environment has finished starting - # and is ready to accept connections, the operation will contain a - # StartEnvironmentResponse in its response field. - rpc :StartEnvironment, ::Google::Cloud::Shell::V1::StartEnvironmentRequest, ::Google::Longrunning::Operation - # Sends OAuth credentials to a running environment on behalf of a user. When - # this completes, the environment will be authorized to run various Google - # Cloud command line tools without requiring the user to manually - # authenticate. - rpc :AuthorizeEnvironment, ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest, ::Google::Longrunning::Operation - # Adds a public SSH key to an environment, allowing clients with the - # corresponding private key to connect to that environment via SSH. If a key - # with the same content already exists, this will error with ALREADY_EXISTS. - rpc :AddPublicKey, ::Google::Cloud::Shell::V1::AddPublicKeyRequest, ::Google::Longrunning::Operation - # Removes a public SSH key from an environment. Clients will no longer be - # able to connect to the environment using the corresponding private key. - # If a key with the same content is not present, this will error with - # NOT_FOUND. - rpc :RemovePublicKey, ::Google::Cloud::Shell::V1::RemovePublicKeyRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/rest.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/rest.rb deleted file mode 100644 index a29fd5893233..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/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/shell/v1/cloud_shell_service/rest" -require "google/cloud/shell/v1/version" - -module Google - module Cloud - module Shell - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/shell/v1/rest" - # client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb b/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb deleted file mode 100644 index b3e028a7b6d5..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/lib/google/cloud/shell/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 Shell - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-shell-v1/proto_docs/README.md deleted file mode 100644 index b2196eb48b44..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Shell 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-shell-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb deleted file mode 100644 index 56848a1f0233..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb +++ /dev/null @@ -1,331 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Shell - module V1 - # A Cloud Shell environment, which is defined as the combination of a Docker - # image specifying what is installed on the environment and a home directory - # containing the user's data that will remain across sessions. Each user has - # at least an environment with the ID "default". - # @!attribute [rw] name - # @return [::String] - # Immutable. Full name of this resource, in the format - # `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the - # email address of the user to whom this environment belongs, and - # `{environment_id}` is the identifier of this environment. For example, - # `users/someone@example.com/environments/default`. - # @!attribute [r] id - # @return [::String] - # Output only. The environment's identifier, unique among the user's - # environments. - # @!attribute [rw] docker_image - # @return [::String] - # Required. Immutable. Full path to the Docker image used to run this environment, e.g. - # "gcr.io/dev-con/cloud-devshell:latest". - # @!attribute [r] state - # @return [::Google::Cloud::Shell::V1::Environment::State] - # Output only. Current execution state of this environment. - # @!attribute [r] web_host - # @return [::String] - # Output only. Host to which clients can connect to initiate HTTPS or WSS - # connections with the environment. - # @!attribute [r] ssh_username - # @return [::String] - # Output only. Username that clients should use when initiating SSH sessions - # with the environment. - # @!attribute [r] ssh_host - # @return [::String] - # Output only. Host to which clients can connect to initiate SSH sessions - # with the environment. - # @!attribute [r] ssh_port - # @return [::Integer] - # Output only. Port to which clients can connect to initiate SSH sessions - # with the environment. - # @!attribute [r] public_keys - # @return [::Array<::String>] - # Output only. Public keys associated with the environment. Clients can - # connect to this environment via SSH only if they possess a private key - # corresponding to at least one of these public keys. Keys can be added to or - # removed from the environment using the AddPublicKey and RemovePublicKey - # methods. - class Environment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible execution states for an environment. - module State - # The environment's states is unknown. - STATE_UNSPECIFIED = 0 - - # The environment is not running and can't be connected to. Starting the - # environment will transition it to the PENDING state. - SUSPENDED = 1 - - # The environment is being started but is not yet ready to accept - # connections. - PENDING = 2 - - # The environment is running and ready to accept connections. It will - # automatically transition back to DISABLED after a period of inactivity or - # if another environment is started. - RUNNING = 3 - - # The environment is being deleted and can't be connected to. - DELETING = 4 - end - end - - # Request message for - # {::Google::Cloud::Shell::V1::CloudShellService::Client#get_environment GetEnvironment}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the requested resource, for example `users/me/environments/default` - # or `users/someone@example.com/environments/default`. - class GetEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message included in the metadata field of operations returned from - # [CreateEnvironment][google.cloud.shell.v1.CloudShellService.CreateEnvironment]. - class CreateEnvironmentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message included in the metadata field of operations returned from - # [DeleteEnvironment][google.cloud.shell.v1.CloudShellService.DeleteEnvironment]. - class DeleteEnvironmentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment StartEnvironment}. - # @!attribute [rw] name - # @return [::String] - # Name of the resource that should be started, for example - # `users/me/environments/default` or - # `users/someone@example.com/environments/default`. - # @!attribute [rw] access_token - # @return [::String] - # The initial access token passed to the environment. If this is present and - # valid, the environment will be pre-authenticated with gcloud so that the - # user can run gcloud commands in Cloud Shell without having to log in. This - # code can be updated later by calling AuthorizeEnvironment. - # @!attribute [rw] public_keys - # @return [::Array<::String>] - # Public keys that should be added to the environment before it is started. - class StartEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment AuthorizeEnvironment}. - # @!attribute [rw] name - # @return [::String] - # Name of the resource that should receive the credentials, for example - # `users/me/environments/default` or - # `users/someone@example.com/environments/default`. - # @!attribute [rw] access_token - # @return [::String] - # The OAuth access token that should be sent to the environment. - # @!attribute [rw] id_token - # @return [::String] - # The OAuth ID token that should be sent to the environment. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # The time when the credentials expire. If not set, defaults to one hour from - # when the server received the request. - class AuthorizeEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment AuthorizeEnvironment}. - class AuthorizeEnvironmentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message included in the metadata field of operations returned from - # {::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment AuthorizeEnvironment}. - class AuthorizeEnvironmentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message included in the metadata field of operations returned from - # {::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment StartEnvironment}. - # @!attribute [rw] state - # @return [::Google::Cloud::Shell::V1::StartEnvironmentMetadata::State] - # Current state of the environment being started. - class StartEnvironmentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states an environment might transition between during startup. - # These states are not normally actionable by clients, but may be used to - # show a progress message to the user. An environment won't necessarily go - # through all of these states when starting. More states are likely to be - # added in the future. - module State - # The environment's start state is unknown. - STATE_UNSPECIFIED = 0 - - # The environment is in the process of being started, but no additional - # details are available. - STARTING = 1 - - # Startup is waiting for the user's disk to be unarchived. This can happen - # when the user returns to Cloud Shell after not having used it for a - # while, and suggests that startup will take longer than normal. - UNARCHIVING_DISK = 2 - - # Startup is waiting for compute resources to be assigned to the - # environment. This should normally happen very quickly, but an environment - # might stay in this state for an extended period of time if the system is - # experiencing heavy load. - AWAITING_COMPUTE_RESOURCES = 4 - - # Startup has completed. If the start operation was successful, the user - # should be able to establish an SSH connection to their environment. - # Otherwise, the operation will contain details of the failure. - FINISHED = 3 - end - end - - # Message included in the response field of operations returned from - # {::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment StartEnvironment} - # once the operation is complete. - # @!attribute [rw] environment - # @return [::Google::Cloud::Shell::V1::Environment] - # Environment that was started. - class StartEnvironmentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key AddPublicKey}. - # @!attribute [rw] environment - # @return [::String] - # Environment this key should be added to, e.g. - # `users/me/environments/default`. - # @!attribute [rw] key - # @return [::String] - # Key that should be added to the environment. Supported formats are - # `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` - # (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and - # `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as - # <format> <content>, where <content> part is encoded with - # Base64. - class AddPublicKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key AddPublicKey}. - # @!attribute [rw] key - # @return [::String] - # Key that was added to the environment. - class AddPublicKeyResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message included in the metadata field of operations returned from - # {::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key AddPublicKey}. - class AddPublicKeyMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key RemovePublicKey}. - # @!attribute [rw] environment - # @return [::String] - # Environment this key should be removed from, e.g. - # `users/me/environments/default`. - # @!attribute [rw] key - # @return [::String] - # Key that should be removed from the environment. - class RemovePublicKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key RemovePublicKey}. - class RemovePublicKeyResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message included in the metadata field of operations returned from - # {::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key RemovePublicKey}. - class RemovePublicKeyMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cloud-shell specific information that will be included as details in failure - # responses. - # @!attribute [rw] code - # @return [::Google::Cloud::Shell::V1::CloudShellErrorDetails::CloudShellErrorCode] - # Code indicating the specific error the occurred. - class CloudShellErrorDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Set of possible errors returned from API calls. - module CloudShellErrorCode - # An unknown error occurred. - CLOUD_SHELL_ERROR_CODE_UNSPECIFIED = 0 - - # The image used by the Cloud Shell environment either does not exist or - # the user does not have access to it. - IMAGE_UNAVAILABLE = 1 - - # Cloud Shell has been disabled by an administrator for the user making the - # request. - CLOUD_SHELL_DISABLED = 2 - - # Cloud Shell has been permanently disabled due to a Terms of Service - # violation by the user. - TOS_VIOLATION = 4 - - # The user has exhausted their weekly Cloud Shell quota, and Cloud Shell - # will be disabled until the quota resets. - QUOTA_EXCEEDED = 5 - - # The Cloud Shell environment is unavailable and cannot be connected to at - # the moment. - ENVIRONMENT_UNAVAILABLE = 6 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-shell-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-shell-v1/snippets/Gemfile deleted file mode 100644 index bf1674af9c6d..000000000000 --- a/owl-bot-staging/google-cloud-shell-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-shell-v1", path: "../" -else - gem "google-cloud-shell-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-shell-v1/snippets/cloud_shell_service/add_public_key.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb deleted file mode 100644 index da6e75c81361..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudshell_v1_generated_CloudShellService_AddPublicKey_sync] -require "google/cloud/shell/v1" - -## -# Snippet for the add_public_key call in the CloudShellService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key. -# -def add_public_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Shell::V1::CloudShellService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Shell::V1::AddPublicKeyRequest.new - - # Call the add_public_key method. - result = client.add_public_key request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudshell_v1_generated_CloudShellService_AddPublicKey_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb deleted file mode 100644 index b16bf5d9babc..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudshell_v1_generated_CloudShellService_AuthorizeEnvironment_sync] -require "google/cloud/shell/v1" - -## -# Snippet for the authorize_environment call in the CloudShellService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment. -# -def authorize_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Shell::V1::CloudShellService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new - - # Call the authorize_environment method. - result = client.authorize_environment request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudshell_v1_generated_CloudShellService_AuthorizeEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb deleted file mode 100644 index c36b2f501286..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudshell_v1_generated_CloudShellService_GetEnvironment_sync] -require "google/cloud/shell/v1" - -## -# Snippet for the get_environment call in the CloudShellService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Shell::V1::CloudShellService::Client#get_environment. -# -def get_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Shell::V1::CloudShellService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Shell::V1::GetEnvironmentRequest.new - - # Call the get_environment method. - result = client.get_environment request - - # The returned object is of type Google::Cloud::Shell::V1::Environment. - p result -end -# [END cloudshell_v1_generated_CloudShellService_GetEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb deleted file mode 100644 index aefbd90a0735..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudshell_v1_generated_CloudShellService_RemovePublicKey_sync] -require "google/cloud/shell/v1" - -## -# Snippet for the remove_public_key call in the CloudShellService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key. -# -def remove_public_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Shell::V1::CloudShellService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Shell::V1::RemovePublicKeyRequest.new - - # Call the remove_public_key method. - result = client.remove_public_key request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudshell_v1_generated_CloudShellService_RemovePublicKey_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb b/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb deleted file mode 100644 index 4f91952a7a8c..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudshell_v1_generated_CloudShellService_StartEnvironment_sync] -require "google/cloud/shell/v1" - -## -# Snippet for the start_environment call in the CloudShellService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Shell::V1::CloudShellService::Client#start_environment. -# -def start_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Shell::V1::CloudShellService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Shell::V1::StartEnvironmentRequest.new - - # Call the start_environment method. - result = client.start_environment request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END cloudshell_v1_generated_CloudShellService_StartEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json b/owl-bot-staging/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json deleted file mode 100644 index 5f8796a64fec..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-shell-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.shell.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudshell_v1_generated_CloudShellService_GetEnvironment_sync", - "title": "Snippet for the get_environment call in the CloudShellService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#get_environment.", - "file": "cloud_shell_service/get_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_environment", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#get_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Shell::V1::GetEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Shell::V1::Environment", - "client": { - "short_name": "CloudShellService::Client", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" - }, - "method": { - "short_name": "GetEnvironment", - "full_name": "google.cloud.shell.v1.CloudShellService.GetEnvironment", - "service": { - "short_name": "CloudShellService", - "full_name": "google.cloud.shell.v1.CloudShellService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudshell_v1_generated_CloudShellService_StartEnvironment_sync", - "title": "Snippet for the start_environment call in the CloudShellService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#start_environment.", - "file": "cloud_shell_service/start_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_environment", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Shell::V1::StartEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudShellService::Client", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" - }, - "method": { - "short_name": "StartEnvironment", - "full_name": "google.cloud.shell.v1.CloudShellService.StartEnvironment", - "service": { - "short_name": "CloudShellService", - "full_name": "google.cloud.shell.v1.CloudShellService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudshell_v1_generated_CloudShellService_AuthorizeEnvironment_sync", - "title": "Snippet for the authorize_environment call in the CloudShellService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment.", - "file": "cloud_shell_service/authorize_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "authorize_environment", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudShellService::Client", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" - }, - "method": { - "short_name": "AuthorizeEnvironment", - "full_name": "google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment", - "service": { - "short_name": "CloudShellService", - "full_name": "google.cloud.shell.v1.CloudShellService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudshell_v1_generated_CloudShellService_AddPublicKey_sync", - "title": "Snippet for the add_public_key call in the CloudShellService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key.", - "file": "cloud_shell_service/add_public_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_public_key", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Shell::V1::AddPublicKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudShellService::Client", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" - }, - "method": { - "short_name": "AddPublicKey", - "full_name": "google.cloud.shell.v1.CloudShellService.AddPublicKey", - "service": { - "short_name": "CloudShellService", - "full_name": "google.cloud.shell.v1.CloudShellService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudshell_v1_generated_CloudShellService_RemovePublicKey_sync", - "title": "Snippet for the remove_public_key call in the CloudShellService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key.", - "file": "cloud_shell_service/remove_public_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_public_key", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Shell::V1::RemovePublicKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudShellService::Client", - "full_name": "::Google::Cloud::Shell::V1::CloudShellService::Client" - }, - "method": { - "short_name": "RemovePublicKey", - "full_name": "google.cloud.shell.v1.CloudShellService.RemovePublicKey", - "service": { - "short_name": "CloudShellService", - "full_name": "google.cloud.shell.v1.CloudShellService" - } - } - }, - "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-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb deleted file mode 100644 index 35d81fe7c8d8..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_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/shell/v1/cloudshell_pb" -require "google/cloud/shell/v1/cloudshell_services_pb" -require "google/cloud/shell/v1/cloud_shell_service" - -class ::Google::Cloud::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb deleted file mode 100644 index 04962e8b8cea..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_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/shell/v1/cloud_shell_service" - -class ::Google::Cloud::Shell::V1::CloudShellService::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_environment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.environment_path user: "value0", environment: "value1" - assert_equal "users/value0/environments/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb deleted file mode 100644 index bd16feaeb6cd..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb +++ /dev/null @@ -1,376 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/shell/v1/cloudshell_pb" -require "google/cloud/shell/v1/cloud_shell_service/rest" - - -class ::Google::Cloud::Shell::V1::CloudShellService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_environment - # Create test objects. - client_result = ::Google::Cloud::Shell::V1::Environment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_environment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_get_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_environment_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_environment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_environment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_environment ::Google::Cloud::Shell::V1::GetEnvironmentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_environment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_environment(::Google::Cloud::Shell::V1::GetEnvironmentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_environment_client_stub.call_count - end - end - end - - def test_start_environment - # Create test objects. - 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" - access_token = "hello world" - public_keys = ["hello world"] - - start_environment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_start_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_environment_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_environment({ name: name, access_token: access_token, public_keys: public_keys }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_environment name: name, access_token: access_token, public_keys: public_keys do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_environment ::Google::Cloud::Shell::V1::StartEnvironmentRequest.new(name: name, access_token: access_token, public_keys: public_keys) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_environment({ name: name, access_token: access_token, public_keys: public_keys }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.start_environment(::Google::Cloud::Shell::V1::StartEnvironmentRequest.new(name: name, access_token: access_token, public_keys: public_keys), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, start_environment_client_stub.call_count - end - end - end - - def test_authorize_environment - # Create test objects. - 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" - access_token = "hello world" - id_token = "hello world" - expire_time = {} - - authorize_environment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_authorize_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, authorize_environment_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.authorize_environment({ name: name, access_token: access_token, id_token: id_token, expire_time: expire_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.authorize_environment name: name, access_token: access_token, id_token: id_token, expire_time: expire_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.authorize_environment ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new(name: name, access_token: access_token, id_token: id_token, expire_time: expire_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.authorize_environment({ name: name, access_token: access_token, id_token: id_token, expire_time: expire_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.authorize_environment(::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new(name: name, access_token: access_token, id_token: id_token, expire_time: expire_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, authorize_environment_client_stub.call_count - end - end - end - - def test_add_public_key - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - environment = "hello world" - key = "hello world" - - add_public_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_add_public_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_public_key_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_public_key({ environment: environment, key: key }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_public_key environment: environment, key: key do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_public_key ::Google::Cloud::Shell::V1::AddPublicKeyRequest.new(environment: environment, key: key) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_public_key({ environment: environment, key: key }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_public_key(::Google::Cloud::Shell::V1::AddPublicKeyRequest.new(environment: environment, key: key), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_public_key_client_stub.call_count - end - end - end - - def test_remove_public_key - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - environment = "hello world" - key = "hello world" - - remove_public_key_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Shell::V1::CloudShellService::Rest::ServiceStub.stub :transcode_remove_public_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_public_key_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_public_key({ environment: environment, key: key }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_public_key environment: environment, key: key do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_public_key ::Google::Cloud::Shell::V1::RemovePublicKeyRequest.new(environment: environment, key: key) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_public_key({ environment: environment, key: key }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_public_key(::Google::Cloud::Shell::V1::RemovePublicKeyRequest.new(environment: environment, key: key), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_public_key_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb b/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb deleted file mode 100644 index c419fa31b991..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb +++ /dev/null @@ -1,442 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/shell/v1/cloudshell_pb" -require "google/cloud/shell/v1/cloud_shell_service" - -class ::Google::Cloud::Shell::V1::CloudShellService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_environment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Shell::V1::Environment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_environment, name - assert_kind_of ::Google::Cloud::Shell::V1::GetEnvironmentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_environment_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_environment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_environment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_environment ::Google::Cloud::Shell::V1::GetEnvironmentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_environment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_environment(::Google::Cloud::Shell::V1::GetEnvironmentRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_environment_client_stub.call_rpc_count - end - end - - def test_start_environment - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - access_token = "hello world" - public_keys = ["hello world"] - - start_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_environment, name - assert_kind_of ::Google::Cloud::Shell::V1::StartEnvironmentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["access_token"] - assert_equal ["hello world"], request["public_keys"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_environment_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_environment({ name: name, access_token: access_token, public_keys: public_keys }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.start_environment name: name, access_token: access_token, public_keys: public_keys do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.start_environment ::Google::Cloud::Shell::V1::StartEnvironmentRequest.new(name: name, access_token: access_token, public_keys: public_keys) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.start_environment({ name: name, access_token: access_token, public_keys: public_keys }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.start_environment(::Google::Cloud::Shell::V1::StartEnvironmentRequest.new(name: name, access_token: access_token, public_keys: public_keys), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, start_environment_client_stub.call_rpc_count - end - end - - def test_authorize_environment - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - access_token = "hello world" - id_token = "hello world" - expire_time = {} - - authorize_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :authorize_environment, name - assert_kind_of ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["access_token"] - assert_equal "hello world", request["id_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["expire_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, authorize_environment_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.authorize_environment({ name: name, access_token: access_token, id_token: id_token, expire_time: expire_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.authorize_environment name: name, access_token: access_token, id_token: id_token, expire_time: expire_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.authorize_environment ::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new(name: name, access_token: access_token, id_token: id_token, expire_time: expire_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.authorize_environment({ name: name, access_token: access_token, id_token: id_token, expire_time: expire_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.authorize_environment(::Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new(name: name, access_token: access_token, id_token: id_token, expire_time: expire_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, authorize_environment_client_stub.call_rpc_count - end - end - - def test_add_public_key - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - environment = "hello world" - key = "hello world" - - add_public_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_public_key, name - assert_kind_of ::Google::Cloud::Shell::V1::AddPublicKeyRequest, request - assert_equal "hello world", request["environment"] - assert_equal "hello world", request["key"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_public_key_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_public_key({ environment: environment, key: key }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_public_key environment: environment, key: key do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_public_key ::Google::Cloud::Shell::V1::AddPublicKeyRequest.new(environment: environment, key: key) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_public_key({ environment: environment, key: key }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_public_key(::Google::Cloud::Shell::V1::AddPublicKeyRequest.new(environment: environment, key: key), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_public_key_client_stub.call_rpc_count - end - end - - def test_remove_public_key - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - environment = "hello world" - key = "hello world" - - remove_public_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_public_key, name - assert_kind_of ::Google::Cloud::Shell::V1::RemovePublicKeyRequest, request - assert_equal "hello world", request["environment"] - assert_equal "hello world", request["key"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_public_key_client_stub do - # Create client - client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_public_key({ environment: environment, key: key }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.remove_public_key environment: environment, key: key do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.remove_public_key ::Google::Cloud::Shell::V1::RemovePublicKeyRequest.new(environment: environment, key: key) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.remove_public_key({ environment: environment, key: key }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.remove_public_key(::Google::Cloud::Shell::V1::RemovePublicKeyRequest.new(environment: environment, key: key), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, remove_public_key_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Shell::V1::CloudShellService::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::Shell::V1::CloudShellService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Shell::V1::CloudShellService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-shell-v1/test/helper.rb b/owl-bot-staging/google-cloud-shell-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-shell-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.repo-metadata.json deleted file mode 100644 index e3f41ff59e96..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "spanner.googleapis.com", - "api_shortname": "spanner", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-database-v1/latest", - "distribution_name": "google-cloud-spanner-admin-database-v1", - "is_cloud": true, - "language": "ruby", - "name": "spanner", - "name_pretty": "Cloud Spanner Database Admin V1 API", - "product_documentation": "https://cloud.google.com/spanner", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-admin-database-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SPANNER", - "ruby-cloud-product-url": "https://cloud.google.com/spanner", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.rubocop.yml deleted file mode 100644 index 7278d0340d48..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-spanner-admin-database-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-spanner-admin-database-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-admin-database-v1/.yardopts deleted file mode 100644 index 11ef47976a02..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Spanner Database Admin 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-spanner-admin-database-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/AUTHENTICATION.md deleted file mode 100644 index dff234acc315..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-spanner-admin-database-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-spanner-admin-database-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/spanner/admin/database/v1" - -client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/spanner/admin/database/v1" - -::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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-spanner-admin-database-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/spanner/admin/database/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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-spanner-admin-database-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-database-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/README.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/README.md deleted file mode 100644 index ccb56c65fc6d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Spanner Database Admin V1 API - -Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. - - -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 Spanner Database Admin V1 API. Most users should consider using -the main client gem, -[google-cloud-spanner](https://rubygems.org/gems/google-cloud-spanner). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-spanner-admin-database-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/spanner.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/spanner/admin/database/v1" - -client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -request = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new # (request fields as keyword arguments...) -response = client.list_databases request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-database-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/spanner) -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/spanner/admin/database/v1" -require "logger" - -client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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-spanner`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-spanner-admin-database-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-spanner`. -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-spanner-admin-database-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-spanner-admin-database-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-admin-database-v1/Rakefile deleted file mode 100644 index 49214abd44ec..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SPANNER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SPANNER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SPANNER_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 SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/spanner/admin/database/v1/database_admin/credentials" - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SPANNER_PROJECT"] = project - ENV["SPANNER_TEST_PROJECT"] = project - ENV["SPANNER_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-spanner-admin-database-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-spanner-admin-database-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-spanner-admin-database-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-spanner-admin-database-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-spanner-admin-database-v1" - header "google-cloud-spanner-admin-database-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-spanner-admin-database-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-spanner-admin-database-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-spanner-admin-database-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-spanner-admin-database-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-spanner-admin-database-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-admin-database-v1/gapic_metadata.json deleted file mode 100644 index d7aa9420ad18..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/gapic_metadata.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.spanner.admin.database.v1", - "libraryPackage": "::Google::Cloud::Spanner::Admin::Database::V1", - "services": { - "DatabaseAdmin": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client", - "rpcs": { - "ListDatabases": { - "methods": [ - "list_databases" - ] - }, - "CreateDatabase": { - "methods": [ - "create_database" - ] - }, - "GetDatabase": { - "methods": [ - "get_database" - ] - }, - "UpdateDatabase": { - "methods": [ - "update_database" - ] - }, - "UpdateDatabaseDdl": { - "methods": [ - "update_database_ddl" - ] - }, - "DropDatabase": { - "methods": [ - "drop_database" - ] - }, - "GetDatabaseDdl": { - "methods": [ - "get_database_ddl" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "CreateBackup": { - "methods": [ - "create_backup" - ] - }, - "CopyBackup": { - "methods": [ - "copy_backup" - ] - }, - "GetBackup": { - "methods": [ - "get_backup" - ] - }, - "UpdateBackup": { - "methods": [ - "update_backup" - ] - }, - "DeleteBackup": { - "methods": [ - "delete_backup" - ] - }, - "ListBackups": { - "methods": [ - "list_backups" - ] - }, - "RestoreDatabase": { - "methods": [ - "restore_database" - ] - }, - "ListDatabaseOperations": { - "methods": [ - "list_database_operations" - ] - }, - "ListBackupOperations": { - "methods": [ - "list_backup_operations" - ] - }, - "ListDatabaseRoles": { - "methods": [ - "list_database_roles" - ] - }, - "AddSplitPoints": { - "methods": [ - "add_split_points" - ] - }, - "CreateBackupSchedule": { - "methods": [ - "create_backup_schedule" - ] - }, - "GetBackupSchedule": { - "methods": [ - "get_backup_schedule" - ] - }, - "UpdateBackupSchedule": { - "methods": [ - "update_backup_schedule" - ] - }, - "DeleteBackupSchedule": { - "methods": [ - "delete_backup_schedule" - ] - }, - "ListBackupSchedules": { - "methods": [ - "list_backup_schedules" - ] - }, - "InternalUpdateGraphOperation": { - "methods": [ - "internal_update_graph_operation" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/google-cloud-spanner-admin-database-v1.gemspec b/owl-bot-staging/google-cloud-spanner-admin-database-v1/google-cloud-spanner-admin-database-v1.gemspec deleted file mode 100644 index 731bba82b5c4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/google-cloud-spanner-admin-database-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/spanner/admin/database/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-spanner-admin-database-v1" - gem.version = Google::Cloud::Spanner::Admin::Database::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-admin-database-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details." - gem.summary = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google-cloud-spanner-admin-database-v1.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google-cloud-spanner-admin-database-v1.rb deleted file mode 100644 index 4a1420305d7f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google-cloud-spanner-admin-database-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/spanner/admin/database/v1" diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1.rb deleted file mode 100644 index ab4f375dca61..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1.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 "google/cloud/spanner/admin/database/v1/database_admin" -require "google/cloud/spanner/admin/database/v1/version" - -module Google - module Cloud - module Spanner - module Admin - module Database - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/spanner/admin/database/v1" - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/spanner/admin/database/v1" - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - module V1 - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/spanner/admin/database/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin.rb deleted file mode 100644 index 31d5189b1b85..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/spanner/admin/database/v1/version" - -require "google/cloud/spanner/admin/database/v1/database_admin/credentials" -require "google/cloud/spanner/admin/database/v1/database_admin/paths" -require "google/cloud/spanner/admin/database/v1/database_admin/operations" -require "google/cloud/spanner/admin/database/v1/database_admin/client" -require "google/cloud/spanner/admin/database/v1/database_admin/rest" - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - ## - # Cloud Spanner Database Admin API - # - # The Cloud Spanner Database Admin API can be used to: - # * create, drop, and list databases - # * update the schema of pre-existing databases - # * create, delete, copy and list backups for a database - # * restore a database from an existing backup - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/spanner/admin/database/v1/database_admin" - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/spanner/admin/database/v1/database_admin/rest" - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - module DatabaseAdmin - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "database_admin", "helpers.rb" -require "google/cloud/spanner/admin/database/v1/database_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb deleted file mode 100644 index 3b17fcbd5a6b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb +++ /dev/null @@ -1,3658 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/spanner/admin/database/v1/spanner_database_admin_pb" - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - module DatabaseAdmin - ## - # Client for the DatabaseAdmin service. - # - # Cloud Spanner Database Admin API - # - # The Cloud Spanner Database Admin API can be used to: - # * create, drop, and list databases - # * update the schema of pre-existing databases - # * create, delete, copy and list backups for a database - # * restore a database from an existing backup - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :database_admin_stub - - ## - # Configure the DatabaseAdmin Client class. - # - # See {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DatabaseAdmin clients - # ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Spanner", "Admin", "Database", "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_databases.timeout = 3600.0 - default_config.rpcs.list_databases.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_database.timeout = 3600.0 - - default_config.rpcs.get_database.timeout = 3600.0 - default_config.rpcs.get_database.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_database.timeout = 3600.0 - default_config.rpcs.update_database.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_database_ddl.timeout = 3600.0 - default_config.rpcs.update_database_ddl.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.drop_database.timeout = 3600.0 - default_config.rpcs.drop_database.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_database_ddl.timeout = 3600.0 - default_config.rpcs.get_database_ddl.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.set_iam_policy.timeout = 30.0 - - default_config.rpcs.get_iam_policy.timeout = 30.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.test_iam_permissions.timeout = 30.0 - - default_config.rpcs.create_backup.timeout = 3600.0 - - default_config.rpcs.copy_backup.timeout = 3600.0 - - default_config.rpcs.get_backup.timeout = 3600.0 - default_config.rpcs.get_backup.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_backup.timeout = 3600.0 - default_config.rpcs.update_backup.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_backup.timeout = 3600.0 - default_config.rpcs.delete_backup.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_backups.timeout = 3600.0 - default_config.rpcs.list_backups.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.restore_database.timeout = 3600.0 - - default_config.rpcs.list_database_operations.timeout = 3600.0 - default_config.rpcs.list_database_operations.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_backup_operations.timeout = 3600.0 - default_config.rpcs.list_backup_operations.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_database_roles.timeout = 3600.0 - default_config.rpcs.list_database_roles.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.add_split_points.timeout = 3600.0 - default_config.rpcs.add_split_points.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_backup_schedule.timeout = 3600.0 - default_config.rpcs.create_backup_schedule.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_backup_schedule.timeout = 3600.0 - default_config.rpcs.get_backup_schedule.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_backup_schedule.timeout = 3600.0 - default_config.rpcs.update_backup_schedule.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_backup_schedule.timeout = 3600.0 - default_config.rpcs.delete_backup_schedule.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_backup_schedules.timeout = 3600.0 - default_config.rpcs.list_backup_schedules.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DatabaseAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @database_admin_stub.universe_domain - end - - ## - # Create a new DatabaseAdmin client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DatabaseAdmin 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/spanner/admin/database/v1/spanner_database_admin_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 - - @database_admin_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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 - ) - - @database_admin_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::Spanner::Admin::Database::V1::DatabaseAdmin::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @database_admin_stub.logger - end - - # Service calls - - ## - # Lists Cloud Spanner databases. - # - # @overload list_databases(request, options = nil) - # Pass arguments to `list_databases` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_databases(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_databases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The instance whose databases should be listed. - # Values are of the form `projects//instances/`. - # @param page_size [::Integer] - # Number of databases to be returned in the response. If 0 or less, - # defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new - # - # # Call the list_databases method. - # result = client.list_databases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Database. - # p item - # end - # - def list_databases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_databases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_databases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_databases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :list_databases, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_databases, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new Cloud Spanner database and starts to prepare it for serving. - # The returned {::Google::Longrunning::Operation long-running operation} will - # have a name of the format `/operations/` and - # can be used to track preparation of the database. The - # {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata CreateDatabaseMetadata}. - # The {::Google::Longrunning::Operation#response response} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful. - # - # @overload create_database(request, options = nil) - # Pass arguments to `create_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_database(parent: nil, create_statement: nil, extra_statements: nil, encryption_config: nil, database_dialect: nil, proto_descriptors: nil) - # Pass arguments to `create_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance that will serve the new database. - # Values are of the form `projects//instances/`. - # @param create_statement [::String] - # Required. A `CREATE DATABASE` statement, which specifies the ID of the - # new database. The database ID must conform to the regular expression - # `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. - # If the database ID is a reserved word or if it contains a hyphen, the - # database ID must be enclosed in backticks (`` ` ``). - # @param extra_statements [::Array<::String>] - # Optional. A list of DDL statements to run inside the newly created - # database. Statements can create tables, indexes, etc. These - # statements execute atomically with the creation of the database: - # if there is an error in any statement, the database is not created. - # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig, ::Hash] - # Optional. The encryption configuration for the database. If this field is - # not specified, Cloud Spanner will encrypt/decrypt all data at rest using - # Google default encryption. - # @param database_dialect [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] - # Optional. The dialect of the Cloud Spanner Database. - # @param proto_descriptors [::String] - # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in - # 'extra_statements' above. - # Contains a protobuf-serialized - # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - # To generate it, [install](https://grpc.io/docs/protoc-installation/) and - # run `protoc` with --include_imports and --descriptor_set_out. For example, - # to generate for moon/shot/app.proto, run - # ``` - # $protoc --proto_path=/app_path --proto_path=/lib_path \ - # --include_imports \ - # --descriptor_set_out=descriptors.data \ - # moon/shot/app.proto - # ``` - # For more details, see protobuffer [self - # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new - # - # # Call the create_database method. - # result = client.create_database request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest - - # Converts hash and nil to 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_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :create_database, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 state of a Cloud Spanner database. - # - # @overload get_database(request, options = nil) - # Pass arguments to `get_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_database(name: nil) - # Pass arguments to `get_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 database. Values are of the form - # `projects//instances//databases/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::Database] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new - # - # # Call the get_database method. - # result = client.get_database request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Database. - # p result - # - def get_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :get_database, request, 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 Cloud Spanner database. The returned - # {::Google::Longrunning::Operation long-running operation} can be used to track - # the progress of updating the database. If the named database does not - # exist, returns `NOT_FOUND`. - # - # While the operation is pending: - # - # * The database's - # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling} - # field is set to true. - # * Cancelling the operation is best-effort. If the cancellation succeeds, - # the operation metadata's - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata#cancel_time cancel_time} - # is set, the updates are reverted, and the operation terminates with a - # `CANCELLED` status. - # * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error - # until the pending operation is done (returns successfully or with - # error). - # * Reading the database via the API continues to give the pre-request - # values. - # - # Upon completion of the returned operation: - # - # * The new values are in effect and readable via the API. - # * The database's - # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling} - # field becomes false. - # - # The returned {::Google::Longrunning::Operation long-running operation} will - # have a name of the format - # `projects//instances//databases//operations/` - # and can be used to track the database modification. The - # {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata UpdateDatabaseMetadata}. - # The {::Google::Longrunning::Operation#response response} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful. - # - # @overload update_database(request, options = nil) - # Pass arguments to `update_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_database(database: nil, update_mask: nil) - # Pass arguments to `update_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::Google::Cloud::Spanner::Admin::Database::V1::Database, ::Hash] - # Required. The database to update. - # The `name` field of the database is of the form - # `projects//instances//databases/`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The list of fields to update. Currently, only - # `enable_drop_protection` field can be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new - # - # # Call the update_database method. - # result = client.update_database request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest - - # Converts hash and nil to 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_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database&.name - header_params["database.name"] = request.database.name - end - - request_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_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :update_database, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 schema of a Cloud Spanner database by - # creating/altering/dropping tables, columns, indexes, etc. The returned - # {::Google::Longrunning::Operation long-running operation} will have a name of - # the format `/operations/` and can be used to - # track execution of the schema change(s). The - # {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlMetadata UpdateDatabaseDdlMetadata}. - # The operation has no response. - # - # @overload update_database_ddl(request, options = nil) - # Pass arguments to `update_database_ddl` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_database_ddl(database: nil, statements: nil, operation_id: nil, proto_descriptors: nil, throughput_mode: nil) - # Pass arguments to `update_database_ddl` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database to update. - # @param statements [::Array<::String>] - # Required. DDL statements to be applied to the database. - # @param operation_id [::String] - # If empty, the new update request is assigned an - # automatically-generated operation ID. Otherwise, `operation_id` - # is used to construct the name of the resulting - # {::Google::Longrunning::Operation Operation}. - # - # Specifying an explicit operation ID simplifies determining - # whether the statements were executed in the event that the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} - # call is replayed, or the return value is otherwise lost: the - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database} - # and `operation_id` fields can be combined to form the - # {::Google::Longrunning::Operation#name name} of the resulting - # {::Google::Longrunning::Operation longrunning.Operation}: - # `/operations/`. - # - # `operation_id` should be unique within the database, and must be - # a valid identifier: `[a-z][a-z0-9_]*`. Note that - # automatically-generated operation IDs always begin with an - # underscore. If the named operation already exists, - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} - # returns `ALREADY_EXISTS`. - # @param proto_descriptors [::String] - # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. - # Contains a protobuf-serialized - # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - # To generate it, [install](https://grpc.io/docs/protoc-installation/) and - # run `protoc` with --include_imports and --descriptor_set_out. For example, - # to generate for moon/shot/app.proto, run - # ``` - # $protoc --proto_path=/app_path --proto_path=/lib_path \ - # --include_imports \ - # --descriptor_set_out=descriptors.data \ - # moon/shot/app.proto - # ``` - # For more details, see protobuffer [self - # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - # @param throughput_mode [::Boolean] - # Optional. This field is exposed to be used by the Spanner Migration Tool. - # For more details, see - # [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new - # - # # Call the update_database_ddl method. - # result = client.update_database_ddl request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_database_ddl request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest - - # Converts hash and nil to 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_database_ddl.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_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_database_ddl.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_database_ddl.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :update_database_ddl, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Drops (aka deletes) a Cloud Spanner database. - # Completed backups for the database will be retained according to their - # `expire_time`. - # Note: Cloud Spanner might continue to accept requests for a few seconds - # after the database has been deleted. - # - # @overload drop_database(request, options = nil) - # Pass arguments to `drop_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload drop_database(database: nil) - # Pass arguments to `drop_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database to be dropped. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new - # - # # Call the drop_database method. - # result = client.drop_database request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def drop_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.drop_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.drop_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.drop_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :drop_database, request, 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 schema of a Cloud Spanner database as a list of formatted - # DDL statements. This method does not show pending schema updates, those may - # be queried using the Operations API. - # - # @overload get_database_ddl(request, options = nil) - # Pass arguments to `get_database_ddl` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_database_ddl(database: nil) - # Pass arguments to `get_database_ddl` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database whose schema we wish to get. - # Values are of the form - # `projects//instances//databases/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new - # - # # Call the get_database_ddl method. - # result = client.get_database_ddl request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse. - # p result - # - def get_database_ddl request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_database_ddl.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_database_ddl.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_database_ddl.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :get_database_ddl, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on a database or backup resource. - # Replaces any existing policy. - # - # Authorization requires `spanner.databases.setIamPolicy` - # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - # For backups, authorization requires `spanner.backups.setIamPolicy` - # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a database or backup resource. - # Returns an empty policy if a database or backup exists but does not have a - # policy set. - # - # Authorization requires `spanner.databases.getIamPolicy` permission on - # [resource][google.iam.v1.GetIamPolicyRequest.resource]. - # For backups, authorization requires `spanner.backups.getIamPolicy` - # permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that the caller has on the specified database or backup - # resource. - # - # Attempting this RPC on a non-existent Cloud Spanner database will - # result in a NOT_FOUND error if the user has - # `spanner.databases.list` permission on the containing Cloud - # Spanner instance. Otherwise returns an empty set of permissions. - # Calling this method on a backup that does not exist will - # result in a NOT_FOUND error if the user has - # `spanner.backups.list` permission on the containing instance. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts creating a new Cloud Spanner Backup. - # The returned backup {::Google::Longrunning::Operation long-running operation} - # will have a name of the format - # `projects//instances//backups//operations/` - # and can be used to track creation of the backup. The - # {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. - # The {::Google::Longrunning::Operation#response response} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. - # Cancelling the returned operation will stop the creation and delete the - # backup. There can be only one pending backup creation per database. Backup - # creation of different databases can run concurrently. - # - # @overload create_backup(request, options = nil) - # Pass arguments to `create_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_backup(parent: nil, backup_id: nil, backup: nil, encryption_config: nil) - # Pass arguments to `create_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 parent [::String] - # Required. The name of the instance in which the backup will be - # created. This must be the same instance that contains the database the - # backup will be created from. The backup will be stored in the - # location(s) specified in the instance configuration of this - # instance. Values are of the form - # `projects//instances/`. - # @param backup_id [::String] - # Required. The id of the backup to be created. The `backup_id` appended to - # `parent` forms the full backup name of the form - # `projects//instances//backups/`. - # @param backup [::Google::Cloud::Spanner::Admin::Database::V1::Backup, ::Hash] - # Required. The backup to create. - # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig, ::Hash] - # Optional. The encryption configuration used to encrypt the backup. If this - # field is not specified, the backup will use the same encryption - # configuration as the database by default, namely - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} - # = `USE_DATABASE_ENCRYPTION`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new - # - # # Call the create_backup method. - # result = client.create_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 create_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest - - # Converts hash and nil to 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_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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :create_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 - - ## - # Starts copying a Cloud Spanner Backup. - # The returned backup {::Google::Longrunning::Operation long-running operation} - # will have a name of the format - # `projects//instances//backups//operations/` - # and can be used to track copying of the backup. The operation is associated - # with the destination backup. - # The {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. - # The {::Google::Longrunning::Operation#response response} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. - # Cancelling the returned operation will stop the copying and delete the - # destination backup. Concurrent CopyBackup requests can run on the same - # source backup. - # - # @overload copy_backup(request, options = nil) - # Pass arguments to `copy_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload copy_backup(parent: nil, backup_id: nil, source_backup: nil, expire_time: nil, encryption_config: nil) - # Pass arguments to `copy_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 parent [::String] - # Required. The name of the destination instance that will contain the backup - # copy. Values are of the form: `projects//instances/`. - # @param backup_id [::String] - # Required. The id of the backup copy. - # The `backup_id` appended to `parent` forms the full backup_uri of the form - # `projects//instances//backups/`. - # @param source_backup [::String] - # Required. The source backup to be copied. - # The source backup needs to be in READY state for it to be copied. - # Once CopyBackup is in progress, the source backup cannot be deleted or - # cleaned up on expiration until CopyBackup is finished. - # Values are of the form: - # `projects//instances//backups/`. - # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The expiration time of the backup in microsecond granularity. - # The expiration time must be at least 6 hours and at most 366 days - # from the `create_time` of the source backup. Once the `expire_time` has - # passed, the backup is eligible to be automatically deleted by Cloud Spanner - # to free the resources used by the backup. - # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig, ::Hash] - # Optional. The encryption configuration used to encrypt the backup. If this - # field is not specified, the backup will use the same encryption - # configuration as the source backup by default, namely - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} - # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new - # - # # Call the copy_backup method. - # result = client.copy_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 copy_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.copy_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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.copy_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.copy_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :copy_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 - - ## - # Gets metadata on a pending or completed - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::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. Name of the backup. - # Values are of the form - # `projects//instances//backups/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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 - - @database_admin_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 - - ## - # Updates a pending or completed - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. - # - # @overload update_backup(request, options = nil) - # Pass arguments to `update_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_backup(backup: nil, update_mask: nil) - # Pass arguments to `update_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 backup [::Google::Cloud::Spanner::Admin::Database::V1::Backup, ::Hash] - # Required. The backup to update. `backup.name`, and the fields to be updated - # as specified by `update_mask` are required. Other fields are ignored. - # Update is only supported for the following fields: - # * `backup.expire_time`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields (e.g. `expire_time`) in the - # Backup resource should be updated. This mask is relative to the Backup - # resource, not to the request message. The field mask must always be - # specified; this prevents any future fields from being erased accidentally - # by clients that do not know about them. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new - # - # # Call the update_backup method. - # result = client.update_backup request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. - # p result - # - def update_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest - - # Converts hash and nil to 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_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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.backup&.name - header_params["backup.name"] = request.backup.name - end - - request_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_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :update_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 pending or completed - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::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) - # 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. Name of the backup to delete. - # Values are of the form - # `projects//instances//backups/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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 - - @database_admin_stub.call_rpc :delete_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 - - ## - # Lists completed and pending backups. - # Backups returned are ordered by `create_time` in descending order, - # starting from the most recent `create_time`. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::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, filter: 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 instance to list backups from. Values are of the - # form `projects//instances/`. - # @param filter [::String] - # An expression that filters the list of returned backups. - # - # A filter expression consists of a field name, a comparison operator, and a - # value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup} are eligible for - # filtering: - # - # * `name` - # * `database` - # * `state` - # * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `size_bytes` - # * `backup_schedules` - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic, but - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `name:Howl` - The backup's name contains the string "howl". - # * `database:prod` - # - The database's name contains the string "prod". - # * `state:CREATING` - The backup is pending creation. - # * `state:READY` - The backup is fully created and ready for use. - # * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` - # - The backup name contains the string "howl" and `create_time` - # of the backup is before 2018-03-28T14:50:00Z. - # * `expire_time < \"2018-03-28T14:50:00Z\"` - # - The backup `expire_time` is before 2018-03-28T14:50:00Z. - # * `size_bytes > 10000000000` - The backup's size is greater than 10GB - # * `backup_schedules:daily` - # - The backup is created from a schedule with "daily" in its name. - # @param page_size [::Integer] - # Number of backups to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse ListBackupsResponse} - # to the same `parent` and with the same `filter`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_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 - - @database_admin_stub.call_rpc :list_backups, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @database_admin_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 - - ## - # Create a new database by restoring from a completed backup. The new - # database must be in the same project and in an instance with the same - # instance configuration as the instance containing - # the backup. The returned database [long-running - # operation][google.longrunning.Operation] has a name of the format - # `projects//instances//databases//operations/`, - # and can be used to track the progress of the operation, and to cancel it. - # The {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. - # The {::Google::Longrunning::Operation#response response} type - # is {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if - # successful. Cancelling the returned operation will stop the restore and - # delete the database. - # There can be only one database being restored into an instance at a time. - # Once the restore operation completes, a new restore operation can be - # initiated, without waiting for the optimize operation associated with the - # first restore to complete. - # - # @overload restore_database(request, options = nil) - # Pass arguments to `restore_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload restore_database(parent: nil, database_id: nil, backup: nil, encryption_config: nil) - # Pass arguments to `restore_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance in which to create the - # restored database. This instance must be in the same project and - # have the same instance configuration as the instance containing - # the source backup. Values are of the form - # `projects//instances/`. - # @param database_id [::String] - # Required. The id of the database to create and restore to. This - # database must not already exist. The `database_id` appended to - # `parent` forms the full database name of the form - # `projects//instances//databases/`. - # @param backup [::String] - # Name of the backup from which to restore. Values are of the form - # `projects//instances//backups/`. - # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig, ::Hash] - # Optional. An encryption configuration describing the encryption type and - # key resources in Cloud KMS used to encrypt/decrypt the database to restore - # to. If this field is not specified, the restored database will use the same - # encryption configuration as the backup by default, namely - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} - # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new - # - # # Call the restore_database method. - # result = client.restore_database request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def restore_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.restore_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.restore_database.timeout, - metadata: metadata, - retry_policy: @config.rpcs.restore_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :restore_database, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 database {::Google::Longrunning::Operation longrunning-operations}. - # A database operation has a name of the form - # `projects//instances//databases//operations/`. - # The long-running operation - # {::Google::Longrunning::Operation#metadata metadata} field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. - # - # @overload list_database_operations(request, options = nil) - # Pass arguments to `list_database_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_database_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_database_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The instance of the database operations. - # Values are of the form `projects//instances/`. - # @param filter [::String] - # An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the {::Google::Longrunning::Operation Operation} - # are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} - # is - # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ - # `(metadata.source_type:BACKUP) AND` \ - # `(metadata.backup_info.backup:backup_howl) AND` \ - # `(metadata.name:restored_howl) AND` \ - # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. - # * The database is restored from a backup. - # * The backup name contains "backup_howl". - # * The restored database's name contains "restored_howl". - # * The operation started before 2018-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse ListDatabaseOperationsResponse} - # to the same `parent` and with the same `filter`. - # - # @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/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new - # - # # Call the list_database_operations method. - # result = client.list_database_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_database_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_database_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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_database_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_database_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :list_database_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_database_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 - - ## - # Lists the backup {::Google::Longrunning::Operation long-running operations} in - # the given instance. A backup operation has a name of the form - # `projects//instances//backups//operations/`. - # The long-running operation - # {::Google::Longrunning::Operation#metadata metadata} field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.progress.start_time` in descending order starting - # from the most recently started operation. - # - # @overload list_backup_operations(request, options = nil) - # Pass arguments to `list_backup_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The instance of the backup operations. Values are of - # the form `projects//instances/`. - # @param filter [::String] - # An expression that filters the list of returned backup operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the {::Google::Longrunning::Operation operation} - # are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} - # is - # `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic, but - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - # `metadata.database:prod` - Returns operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. - # * The source database name of backup contains the string "prod". - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - # `(metadata.name:howl) AND` \ - # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Returns operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. - # * The backup name contains the string "howl". - # * The operation started before 2018-03-28T14:50:00Z. - # * The operation resulted in an error. - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ - # `(metadata.source_backup:test) AND` \ - # `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ - # `(error:*)` - Returns operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. - # * The source backup name contains the string "test". - # * The operation started before 2022-01-18T14:50:00Z. - # * The operation resulted in an error. - # * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - # `(metadata.database:test_db)) OR` \ - # `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) - # AND` \ - # `(metadata.source_backup:test_bkp)) AND` \ - # `(error:*)` - Returns operations where: - # * The operation's metadata matches either of criteria: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} - # AND the source database name of the backup contains the string - # "test_db" - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata} - # AND the source backup name contains the string "test_bkp" - # * The operation resulted in an error. - # @param page_size [::Integer] - # Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse ListBackupOperationsResponse} - # to the same `parent` and with the same `filter`. - # - # @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/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new - # - # # Call the list_backup_operations method. - # result = client.list_backup_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_backup_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest - - # Converts hash and nil to an 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_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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_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_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backup_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :list_backup_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_backup_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 - - ## - # Lists Cloud Spanner database roles. - # - # @overload list_database_roles(request, options = nil) - # Pass arguments to `list_database_roles` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_database_roles(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_database_roles` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The database whose roles should be listed. - # Values are of the form - # `projects//instances//databases/`. - # @param page_size [::Integer] - # Number of database roles to be returned in the response. If 0 or less, - # defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse ListDatabaseRolesResponse}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new - # - # # Call the list_database_roles method. - # result = client.list_database_roles request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole. - # p item - # end - # - def list_database_roles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_database_roles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_database_roles.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_database_roles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :list_database_roles, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_database_roles, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Adds split points to specified tables, indexes of a database. - # - # @overload add_split_points(request, options = nil) - # Pass arguments to `add_split_points` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_split_points(database: nil, split_points: nil, initiator: nil) - # Pass arguments to `add_split_points` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database on whose tables/indexes split points are to be - # added. Values are of the form - # `projects//instances//databases/`. - # @param split_points [::Array<::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints, ::Hash>] - # Required. The split points to add. - # @param initiator [::String] - # Optional. A user-supplied tag associated with the split points. - # For example, "intital_data_load", "special_event_1". - # Defaults to "CloudAddSplitPointsAPI" if not specified. - # The length of the tag must not exceed 50 characters,else will be trimmed. - # Only valid UTF8 characters are allowed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new - # - # # Call the add_split_points method. - # result = client.add_split_points request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse. - # p result - # - def add_split_points request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest - - # Converts hash and nil to 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_split_points.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_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_split_points.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_split_points.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :add_split_points, request, 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 backup schedule. - # - # @overload create_backup_schedule(request, options = nil) - # Pass arguments to `create_backup_schedule` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_backup_schedule(parent: nil, backup_schedule_id: nil, backup_schedule: nil) - # Pass arguments to `create_backup_schedule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 database that this backup schedule applies to. - # @param backup_schedule_id [::String] - # Required. The Id to use for the backup schedule. The `backup_schedule_id` - # appended to `parent` forms the full backup schedule name of the form - # `projects//instances//databases//backupSchedules/`. - # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash] - # Required. The backup schedule to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new - # - # # Call the create_backup_schedule method. - # result = client.create_backup_schedule request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - # p result - # - def create_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest - - # Converts hash and nil to 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_backup_schedule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :create_backup_schedule, request, 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 backup schedule for the input schedule name. - # - # @overload get_backup_schedule(request, options = nil) - # Pass arguments to `get_backup_schedule` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_schedule(name: nil) - # Pass arguments to `get_backup_schedule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 schedule to retrieve. - # Values are of the form - # `projects//instances//databases//backupSchedules/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new - # - # # Call the get_backup_schedule method. - # result = client.get_backup_schedule request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - # p result - # - def get_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest - - # Converts hash and nil to an 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_schedule.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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_schedule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :get_backup_schedule, request, 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 backup schedule. - # - # @overload update_backup_schedule(request, options = nil) - # Pass arguments to `update_backup_schedule` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_backup_schedule(backup_schedule: nil, update_mask: nil) - # Pass arguments to `update_backup_schedule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash] - # Required. The backup schedule to update. `backup_schedule.name`, and the - # fields to be updated as specified by `update_mask` are required. Other - # fields are ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in the BackupSchedule resource - # should be updated. This mask is relative to the BackupSchedule resource, - # not to the request message. The field mask must always be - # specified; this prevents any future fields from being erased - # accidentally. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new - # - # # Call the update_backup_schedule method. - # result = client.update_backup_schedule request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - # p result - # - def update_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest - - # Converts hash and nil to 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.backup_schedule&.name - header_params["backup_schedule.name"] = request.backup_schedule.name - end - - request_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_backup_schedule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :update_backup_schedule, request, 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 backup schedule. - # - # @overload delete_backup_schedule(request, options = nil) - # Pass arguments to `delete_backup_schedule` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_schedule(name: nil) - # Pass arguments to `delete_backup_schedule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 schedule to delete. - # Values are of the form - # `projects//instances//databases//backupSchedules/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new - # - # # Call the delete_backup_schedule method. - # result = client.delete_backup_schedule request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest - - # Converts hash and nil to an 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_schedule.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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_schedule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :delete_backup_schedule, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the backup schedules for the database. - # - # @overload list_backup_schedules(request, options = nil) - # Pass arguments to `list_backup_schedules` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_schedules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_schedules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Database is the parent resource whose backup schedules should be - # listed. Values are of the form - # projects//instances//databases/ - # @param page_size [::Integer] - # Optional. Number of backup schedules to be returned in the response. If 0 - # or less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # Optional. If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse ListBackupSchedulesResponse} - # to the same `parent`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.new - # - # # Call the list_backup_schedules method. - # result = client.list_backup_schedules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - # p item - # end - # - def list_backup_schedules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest - - # Converts hash and nil to an 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_schedules.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_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_schedules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backup_schedules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :list_backup_schedules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_backup_schedules, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # This is an internal API called by Spanner Graph jobs. You should never need - # to call this API directly. - # - # @overload internal_update_graph_operation(request, options = nil) - # Pass arguments to `internal_update_graph_operation` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload internal_update_graph_operation(database: nil, operation_id: nil, vm_identity_token: nil, progress: nil, status: nil) - # Pass arguments to `internal_update_graph_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Internal field, do not use directly. - # @param operation_id [::String] - # Internal field, do not use directly. - # @param vm_identity_token [::String] - # Internal field, do not use directly. - # @param progress [::Float] - # Internal field, do not use directly. - # @param status [::Google::Rpc::Status, ::Hash] - # Internal field, do not use directly. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest.new - # - # # Call the internal_update_graph_operation method. - # result = client.internal_update_graph_operation request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse. - # p result - # - def internal_update_graph_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.internal_update_graph_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::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.internal_update_graph_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.internal_update_graph_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.call_rpc :internal_update_graph_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 - - ## - # Configuration class for the DatabaseAdmin API. - # - # This class represents the configuration for DatabaseAdmin, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_databases to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_databases.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_databases.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the DatabaseAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_databases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_databases - ## - # RPC-specific configuration for `create_database` - # @return [::Gapic::Config::Method] - # - attr_reader :create_database - ## - # RPC-specific configuration for `get_database` - # @return [::Gapic::Config::Method] - # - attr_reader :get_database - ## - # RPC-specific configuration for `update_database` - # @return [::Gapic::Config::Method] - # - attr_reader :update_database - ## - # RPC-specific configuration for `update_database_ddl` - # @return [::Gapic::Config::Method] - # - attr_reader :update_database_ddl - ## - # RPC-specific configuration for `drop_database` - # @return [::Gapic::Config::Method] - # - attr_reader :drop_database - ## - # RPC-specific configuration for `get_database_ddl` - # @return [::Gapic::Config::Method] - # - attr_reader :get_database_ddl - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `create_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :create_backup - ## - # RPC-specific configuration for `copy_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :copy_backup - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `update_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :update_backup - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `restore_database` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_database - ## - # RPC-specific configuration for `list_database_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_database_operations - ## - # RPC-specific configuration for `list_backup_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_operations - ## - # RPC-specific configuration for `list_database_roles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_database_roles - ## - # RPC-specific configuration for `add_split_points` - # @return [::Gapic::Config::Method] - # - attr_reader :add_split_points - ## - # RPC-specific configuration for `create_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :create_backup_schedule - ## - # RPC-specific configuration for `get_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_schedule - ## - # RPC-specific configuration for `update_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :update_backup_schedule - ## - # RPC-specific configuration for `delete_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup_schedule - ## - # RPC-specific configuration for `list_backup_schedules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_schedules - ## - # RPC-specific configuration for `internal_update_graph_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :internal_update_graph_operation - - # @private - def initialize parent_rpcs = nil - list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases - @list_databases = ::Gapic::Config::Method.new list_databases_config - create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database - @create_database = ::Gapic::Config::Method.new create_database_config - get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database - @get_database = ::Gapic::Config::Method.new get_database_config - update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database - @update_database = ::Gapic::Config::Method.new update_database_config - update_database_ddl_config = parent_rpcs.update_database_ddl if parent_rpcs.respond_to? :update_database_ddl - @update_database_ddl = ::Gapic::Config::Method.new update_database_ddl_config - drop_database_config = parent_rpcs.drop_database if parent_rpcs.respond_to? :drop_database - @drop_database = ::Gapic::Config::Method.new drop_database_config - get_database_ddl_config = parent_rpcs.get_database_ddl if parent_rpcs.respond_to? :get_database_ddl - @get_database_ddl = ::Gapic::Config::Method.new get_database_ddl_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup - @create_backup = ::Gapic::Config::Method.new create_backup_config - copy_backup_config = parent_rpcs.copy_backup if parent_rpcs.respond_to? :copy_backup - @copy_backup = ::Gapic::Config::Method.new copy_backup_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup - @update_backup = ::Gapic::Config::Method.new update_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 - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database - @restore_database = ::Gapic::Config::Method.new restore_database_config - list_database_operations_config = parent_rpcs.list_database_operations if parent_rpcs.respond_to? :list_database_operations - @list_database_operations = ::Gapic::Config::Method.new list_database_operations_config - list_backup_operations_config = parent_rpcs.list_backup_operations if parent_rpcs.respond_to? :list_backup_operations - @list_backup_operations = ::Gapic::Config::Method.new list_backup_operations_config - list_database_roles_config = parent_rpcs.list_database_roles if parent_rpcs.respond_to? :list_database_roles - @list_database_roles = ::Gapic::Config::Method.new list_database_roles_config - add_split_points_config = parent_rpcs.add_split_points if parent_rpcs.respond_to? :add_split_points - @add_split_points = ::Gapic::Config::Method.new add_split_points_config - create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule - @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config - get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule - @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config - update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule - @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config - delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule - @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config - list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules - @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config - internal_update_graph_operation_config = parent_rpcs.internal_update_graph_operation if parent_rpcs.respond_to? :internal_update_graph_operation - @internal_update_graph_operation = ::Gapic::Config::Method.new internal_update_graph_operation_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-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/credentials.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/credentials.rb deleted file mode 100644 index b3c941a3dbff..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/credentials.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 "googleauth" - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - module DatabaseAdmin - # Credentials for the DatabaseAdmin API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/spanner.admin" - ] - self.env_vars = [ - "SPANNER_CREDENTIALS", - "SPANNER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPANNER_CREDENTIALS_JSON", - "SPANNER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb deleted file mode 100644 index f89774ba724e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb +++ /dev/null @@ -1,845 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 Spanner - module Admin - module Database - module V1 - module DatabaseAdmin - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the DatabaseAdmin 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 DatabaseAdmin 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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Spanner::Admin::Database::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::Spanner::Admin::Database::V1::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 = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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 -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb deleted file mode 100644 index ca3d3e310737..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.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! - - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - module DatabaseAdmin - # Path helper methods for the DatabaseAdmin API. - module Paths - ## - # Create a fully-qualified Backup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/backups/{backup}` - # - # @param project [String] - # @param instance [String] - # @param backup [String] - # - # @return [::String] - def backup_path project:, instance:, backup: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/backups/#{backup}" - end - - ## - # Create a fully-qualified BackupSchedule resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}` - # - # @param project [String] - # @param instance [String] - # @param database [String] - # @param schedule [String] - # - # @return [::String] - def backup_schedule_path project:, instance:, database:, schedule: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/databases/#{database}/backupSchedules/#{schedule}" - 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 Database resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/databases/{database}` - # - # @param project [String] - # @param instance [String] - # @param database [String] - # - # @return [::String] - def database_path project:, instance:, database: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/databases/#{database}" - end - - ## - # Create a fully-qualified Instance resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}` - # - # @param project [String] - # @param instance [String] - # - # @return [::String] - def instance_path project:, instance: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/instances/#{instance}" - end - - ## - # Create a fully-qualified InstancePartition resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - # - # @param project [String] - # @param instance [String] - # @param instance_partition [String] - # - # @return [::String] - def instance_partition_path project:, instance:, instance_partition: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/instancePartitions/#{instance_partition}" - end - - extend self - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest.rb deleted file mode 100644 index 1d9a8d24707b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/spanner/admin/database/v1/version" - -require "google/cloud/spanner/admin/database/v1/database_admin/credentials" -require "google/cloud/spanner/admin/database/v1/database_admin/paths" -require "google/cloud/spanner/admin/database/v1/database_admin/rest/operations" -require "google/cloud/spanner/admin/database/v1/database_admin/rest/client" - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - ## - # Cloud Spanner Database Admin API - # - # The Cloud Spanner Database Admin API can be used to: - # * create, drop, and list databases - # * update the schema of pre-existing databases - # * create, delete, copy and list backups for a database - # * restore a database from an existing backup - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/spanner/admin/database/v1/database_admin/rest" - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - module DatabaseAdmin - # Client for the REST transport - module Rest - end - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/spanner/admin/database/v1/database_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb deleted file mode 100644 index 666baf6f1c37..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb +++ /dev/null @@ -1,3338 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/spanner/admin/database/v1/spanner_database_admin_pb" -require "google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub" - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - module DatabaseAdmin - module Rest - ## - # REST client for the DatabaseAdmin service. - # - # Cloud Spanner Database Admin API - # - # The Cloud Spanner Database Admin API can be used to: - # * create, drop, and list databases - # * update the schema of pre-existing databases - # * create, delete, copy and list backups for a database - # * restore a database from an existing backup - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :database_admin_stub - - ## - # Configure the DatabaseAdmin Client class. - # - # See {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DatabaseAdmin clients - # ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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", "Spanner", "Admin", "Database", "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_databases.timeout = 3600.0 - default_config.rpcs.list_databases.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_database.timeout = 3600.0 - - default_config.rpcs.get_database.timeout = 3600.0 - default_config.rpcs.get_database.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_database.timeout = 3600.0 - default_config.rpcs.update_database.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_database_ddl.timeout = 3600.0 - default_config.rpcs.update_database_ddl.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.drop_database.timeout = 3600.0 - default_config.rpcs.drop_database.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_database_ddl.timeout = 3600.0 - default_config.rpcs.get_database_ddl.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.set_iam_policy.timeout = 30.0 - - default_config.rpcs.get_iam_policy.timeout = 30.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.test_iam_permissions.timeout = 30.0 - - default_config.rpcs.create_backup.timeout = 3600.0 - - default_config.rpcs.copy_backup.timeout = 3600.0 - - default_config.rpcs.get_backup.timeout = 3600.0 - default_config.rpcs.get_backup.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_backup.timeout = 3600.0 - default_config.rpcs.update_backup.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_backup.timeout = 3600.0 - default_config.rpcs.delete_backup.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_backups.timeout = 3600.0 - default_config.rpcs.list_backups.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.restore_database.timeout = 3600.0 - - default_config.rpcs.list_database_operations.timeout = 3600.0 - default_config.rpcs.list_database_operations.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_backup_operations.timeout = 3600.0 - default_config.rpcs.list_backup_operations.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_database_roles.timeout = 3600.0 - default_config.rpcs.list_database_roles.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.add_split_points.timeout = 3600.0 - default_config.rpcs.add_split_points.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_backup_schedule.timeout = 3600.0 - default_config.rpcs.create_backup_schedule.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_backup_schedule.timeout = 3600.0 - default_config.rpcs.get_backup_schedule.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_backup_schedule.timeout = 3600.0 - default_config.rpcs.update_backup_schedule.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_backup_schedule.timeout = 3600.0 - default_config.rpcs.delete_backup_schedule.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_backup_schedules.timeout = 3600.0 - default_config.rpcs.list_backup_schedules.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DatabaseAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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 - @database_admin_stub.universe_domain - end - - ## - # Create a new DatabaseAdmin REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DatabaseAdmin 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::Spanner::Admin::Database::V1::DatabaseAdmin::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 - - @database_admin_stub = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @database_admin_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @database_admin_stub.logger - end - - # Service calls - - ## - # Lists Cloud Spanner databases. - # - # @overload list_databases(request, options = nil) - # Pass arguments to `list_databases` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_databases(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_databases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The instance whose databases should be listed. - # Values are of the form `projects//instances/`. - # @param page_size [::Integer] - # Number of databases to be returned in the response. If 0 or less, - # defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new - # - # # Call the list_databases method. - # result = client.list_databases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Database. - # p item - # end - # - def list_databases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_databases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_databases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_databases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.list_databases request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_databases, "databases", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new Cloud Spanner database and starts to prepare it for serving. - # The returned {::Google::Longrunning::Operation long-running operation} will - # have a name of the format `/operations/` and - # can be used to track preparation of the database. The - # {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata CreateDatabaseMetadata}. - # The {::Google::Longrunning::Operation#response response} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful. - # - # @overload create_database(request, options = nil) - # Pass arguments to `create_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_database(parent: nil, create_statement: nil, extra_statements: nil, encryption_config: nil, database_dialect: nil, proto_descriptors: nil) - # Pass arguments to `create_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance that will serve the new database. - # Values are of the form `projects//instances/`. - # @param create_statement [::String] - # Required. A `CREATE DATABASE` statement, which specifies the ID of the - # new database. The database ID must conform to the regular expression - # `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. - # If the database ID is a reserved word or if it contains a hyphen, the - # database ID must be enclosed in backticks (`` ` ``). - # @param extra_statements [::Array<::String>] - # Optional. A list of DDL statements to run inside the newly created - # database. Statements can create tables, indexes, etc. These - # statements execute atomically with the creation of the database: - # if there is an error in any statement, the database is not created. - # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig, ::Hash] - # Optional. The encryption configuration for the database. If this field is - # not specified, Cloud Spanner will encrypt/decrypt all data at rest using - # Google default encryption. - # @param database_dialect [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] - # Optional. The dialect of the Cloud Spanner Database. - # @param proto_descriptors [::String] - # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in - # 'extra_statements' above. - # Contains a protobuf-serialized - # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - # To generate it, [install](https://grpc.io/docs/protoc-installation/) and - # run `protoc` with --include_imports and --descriptor_set_out. For example, - # to generate for moon/shot/app.proto, run - # ``` - # $protoc --proto_path=/app_path --proto_path=/lib_path \ - # --include_imports \ - # --descriptor_set_out=descriptors.data \ - # moon/shot/app.proto - # ``` - # For more details, see protobuffer [self - # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new - # - # # Call the create_database method. - # result = client.create_database request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest - - # Converts hash and nil to an 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_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.create_database request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 state of a Cloud Spanner database. - # - # @overload get_database(request, options = nil) - # Pass arguments to `get_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_database(name: nil) - # Pass arguments to `get_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 database. Values are of the form - # `projects//instances//databases/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Database] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new - # - # # Call the get_database method. - # result = client.get_database request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Database. - # p result - # - def get_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.get_database request, 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 Cloud Spanner database. The returned - # {::Google::Longrunning::Operation long-running operation} can be used to track - # the progress of updating the database. If the named database does not - # exist, returns `NOT_FOUND`. - # - # While the operation is pending: - # - # * The database's - # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling} - # field is set to true. - # * Cancelling the operation is best-effort. If the cancellation succeeds, - # the operation metadata's - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata#cancel_time cancel_time} - # is set, the updates are reverted, and the operation terminates with a - # `CANCELLED` status. - # * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error - # until the pending operation is done (returns successfully or with - # error). - # * Reading the database via the API continues to give the pre-request - # values. - # - # Upon completion of the returned operation: - # - # * The new values are in effect and readable via the API. - # * The database's - # {::Google::Cloud::Spanner::Admin::Database::V1::Database#reconciling reconciling} - # field becomes false. - # - # The returned {::Google::Longrunning::Operation long-running operation} will - # have a name of the format - # `projects//instances//databases//operations/` - # and can be used to track the database modification. The - # {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseMetadata UpdateDatabaseMetadata}. - # The {::Google::Longrunning::Operation#response response} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful. - # - # @overload update_database(request, options = nil) - # Pass arguments to `update_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_database(database: nil, update_mask: nil) - # Pass arguments to `update_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::Google::Cloud::Spanner::Admin::Database::V1::Database, ::Hash] - # Required. The database to update. - # The `name` field of the database is of the form - # `projects//instances//databases/`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The list of fields to update. Currently, only - # `enable_drop_protection` field can be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new - # - # # Call the update_database method. - # result = client.update_database request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest - - # Converts hash and nil to an 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_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.update_database request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 schema of a Cloud Spanner database by - # creating/altering/dropping tables, columns, indexes, etc. The returned - # {::Google::Longrunning::Operation long-running operation} will have a name of - # the format `/operations/` and can be used to - # track execution of the schema change(s). The - # {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlMetadata UpdateDatabaseDdlMetadata}. - # The operation has no response. - # - # @overload update_database_ddl(request, options = nil) - # Pass arguments to `update_database_ddl` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_database_ddl(database: nil, statements: nil, operation_id: nil, proto_descriptors: nil, throughput_mode: nil) - # Pass arguments to `update_database_ddl` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database to update. - # @param statements [::Array<::String>] - # Required. DDL statements to be applied to the database. - # @param operation_id [::String] - # If empty, the new update request is assigned an - # automatically-generated operation ID. Otherwise, `operation_id` - # is used to construct the name of the resulting - # {::Google::Longrunning::Operation Operation}. - # - # Specifying an explicit operation ID simplifies determining - # whether the statements were executed in the event that the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client#update_database_ddl UpdateDatabaseDdl} - # call is replayed, or the return value is otherwise lost: the - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database} - # and `operation_id` fields can be combined to form the - # {::Google::Longrunning::Operation#name name} of the resulting - # {::Google::Longrunning::Operation longrunning.Operation}: - # `/operations/`. - # - # `operation_id` should be unique within the database, and must be - # a valid identifier: `[a-z][a-z0-9_]*`. Note that - # automatically-generated operation IDs always begin with an - # underscore. If the named operation already exists, - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client#update_database_ddl UpdateDatabaseDdl} - # returns `ALREADY_EXISTS`. - # @param proto_descriptors [::String] - # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. - # Contains a protobuf-serialized - # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - # To generate it, [install](https://grpc.io/docs/protoc-installation/) and - # run `protoc` with --include_imports and --descriptor_set_out. For example, - # to generate for moon/shot/app.proto, run - # ``` - # $protoc --proto_path=/app_path --proto_path=/lib_path \ - # --include_imports \ - # --descriptor_set_out=descriptors.data \ - # moon/shot/app.proto - # ``` - # For more details, see protobuffer [self - # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - # @param throughput_mode [::Boolean] - # Optional. This field is exposed to be used by the Spanner Migration Tool. - # For more details, see - # [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new - # - # # Call the update_database_ddl method. - # result = client.update_database_ddl request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_database_ddl request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest - - # Converts hash and nil to an 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_database_ddl.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_database_ddl.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_database_ddl.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.update_database_ddl request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Drops (aka deletes) a Cloud Spanner database. - # Completed backups for the database will be retained according to their - # `expire_time`. - # Note: Cloud Spanner might continue to accept requests for a few seconds - # after the database has been deleted. - # - # @overload drop_database(request, options = nil) - # Pass arguments to `drop_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload drop_database(database: nil) - # Pass arguments to `drop_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database to be dropped. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new - # - # # Call the drop_database method. - # result = client.drop_database request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def drop_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.drop_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.drop_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.drop_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.drop_database request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the schema of a Cloud Spanner database as a list of formatted - # DDL statements. This method does not show pending schema updates, those may - # be queried using the Operations API. - # - # @overload get_database_ddl(request, options = nil) - # Pass arguments to `get_database_ddl` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_database_ddl(database: nil) - # Pass arguments to `get_database_ddl` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database whose schema we wish to get. - # Values are of the form - # `projects//instances//databases/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new - # - # # Call the get_database_ddl method. - # result = client.get_database_ddl request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse. - # p result - # - def get_database_ddl request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_database_ddl.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_database_ddl.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_database_ddl.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.get_database_ddl request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on a database or backup resource. - # Replaces any existing policy. - # - # Authorization requires `spanner.databases.setIamPolicy` - # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - # For backups, authorization requires `spanner.backups.setIamPolicy` - # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a database or backup resource. - # Returns an empty policy if a database or backup exists but does not have a - # policy set. - # - # Authorization requires `spanner.databases.getIamPolicy` permission on - # [resource][google.iam.v1.GetIamPolicyRequest.resource]. - # For backups, authorization requires `spanner.backups.getIamPolicy` - # permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that the caller has on the specified database or backup - # resource. - # - # Attempting this RPC on a non-existent Cloud Spanner database will - # result in a NOT_FOUND error if the user has - # `spanner.databases.list` permission on the containing Cloud - # Spanner instance. Otherwise returns an empty set of permissions. - # Calling this method on a backup that does not exist will - # result in a NOT_FOUND error if the user has - # `spanner.backups.list` permission on the containing instance. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts creating a new Cloud Spanner Backup. - # The returned backup {::Google::Longrunning::Operation long-running operation} - # will have a name of the format - # `projects//instances//backups//operations/` - # and can be used to track creation of the backup. The - # {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. - # The {::Google::Longrunning::Operation#response response} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. - # Cancelling the returned operation will stop the creation and delete the - # backup. There can be only one pending backup creation per database. Backup - # creation of different databases can run concurrently. - # - # @overload create_backup(request, options = nil) - # Pass arguments to `create_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_backup(parent: nil, backup_id: nil, backup: nil, encryption_config: nil) - # Pass arguments to `create_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 parent [::String] - # Required. The name of the instance in which the backup will be - # created. This must be the same instance that contains the database the - # backup will be created from. The backup will be stored in the - # location(s) specified in the instance configuration of this - # instance. Values are of the form - # `projects//instances/`. - # @param backup_id [::String] - # Required. The id of the backup to be created. The `backup_id` appended to - # `parent` forms the full backup name of the form - # `projects//instances//backups/`. - # @param backup [::Google::Cloud::Spanner::Admin::Database::V1::Backup, ::Hash] - # Required. The backup to create. - # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig, ::Hash] - # Optional. The encryption configuration used to encrypt the backup. If this - # field is not specified, the backup will use the same encryption - # configuration as the database by default, namely - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} - # = `USE_DATABASE_ENCRYPTION`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new - # - # # Call the create_backup method. - # result = client.create_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 create_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest - - # Converts hash and nil to an 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_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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.create_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 - - ## - # Starts copying a Cloud Spanner Backup. - # The returned backup {::Google::Longrunning::Operation long-running operation} - # will have a name of the format - # `projects//instances//backups//operations/` - # and can be used to track copying of the backup. The operation is associated - # with the destination backup. - # The {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. - # The {::Google::Longrunning::Operation#response response} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. - # Cancelling the returned operation will stop the copying and delete the - # destination backup. Concurrent CopyBackup requests can run on the same - # source backup. - # - # @overload copy_backup(request, options = nil) - # Pass arguments to `copy_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload copy_backup(parent: nil, backup_id: nil, source_backup: nil, expire_time: nil, encryption_config: nil) - # Pass arguments to `copy_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 parent [::String] - # Required. The name of the destination instance that will contain the backup - # copy. Values are of the form: `projects//instances/`. - # @param backup_id [::String] - # Required. The id of the backup copy. - # The `backup_id` appended to `parent` forms the full backup_uri of the form - # `projects//instances//backups/`. - # @param source_backup [::String] - # Required. The source backup to be copied. - # The source backup needs to be in READY state for it to be copied. - # Once CopyBackup is in progress, the source backup cannot be deleted or - # cleaned up on expiration until CopyBackup is finished. - # Values are of the form: - # `projects//instances//backups/`. - # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The expiration time of the backup in microsecond granularity. - # The expiration time must be at least 6 hours and at most 366 days - # from the `create_time` of the source backup. Once the `expire_time` has - # passed, the backup is eligible to be automatically deleted by Cloud Spanner - # to free the resources used by the backup. - # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig, ::Hash] - # Optional. The encryption configuration used to encrypt the backup. If this - # field is not specified, the backup will use the same encryption - # configuration as the source backup by default, namely - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} - # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new - # - # # Call the copy_backup method. - # result = client.copy_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 copy_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.copy_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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.copy_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.copy_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.copy_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 - - ## - # Gets metadata on a pending or completed - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::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. Name of the backup. - # Values are of the form - # `projects//instances//backups/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @database_admin_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 - - ## - # Updates a pending or completed - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. - # - # @overload update_backup(request, options = nil) - # Pass arguments to `update_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_backup(backup: nil, update_mask: nil) - # Pass arguments to `update_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 backup [::Google::Cloud::Spanner::Admin::Database::V1::Backup, ::Hash] - # Required. The backup to update. `backup.name`, and the fields to be updated - # as specified by `update_mask` are required. Other fields are ignored. - # Update is only supported for the following fields: - # * `backup.expire_time`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields (e.g. `expire_time`) in the - # Backup resource should be updated. This mask is relative to the Backup - # resource, not to the request message. The field mask must always be - # specified; this prevents any future fields from being erased accidentally - # by clients that do not know about them. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new - # - # # Call the update_backup method. - # result = client.update_backup request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. - # p result - # - def update_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest - - # Converts hash and nil to an 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_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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.update_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 pending or completed - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::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) - # 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. Name of the backup to delete. - # Values are of the form - # `projects//instances//backups/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @database_admin_stub.delete_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 - - ## - # Lists completed and pending backups. - # Backups returned are ordered by `create_time` in descending order, - # starting from the most recent `create_time`. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::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, filter: 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 instance to list backups from. Values are of the - # form `projects//instances/`. - # @param filter [::String] - # An expression that filters the list of returned backups. - # - # A filter expression consists of a field name, a comparison operator, and a - # value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup} are eligible for - # filtering: - # - # * `name` - # * `database` - # * `state` - # * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `size_bytes` - # * `backup_schedules` - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic, but - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `name:Howl` - The backup's name contains the string "howl". - # * `database:prod` - # - The database's name contains the string "prod". - # * `state:CREATING` - The backup is pending creation. - # * `state:READY` - The backup is fully created and ready for use. - # * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` - # - The backup name contains the string "howl" and `create_time` - # of the backup is before 2018-03-28T14:50:00Z. - # * `expire_time < \"2018-03-28T14:50:00Z\"` - # - The backup `expire_time` is before 2018-03-28T14:50:00Z. - # * `size_bytes > 10000000000` - The backup's size is greater than 10GB - # * `backup_schedules:daily` - # - The backup is created from a schedule with "daily" in its name. - # @param page_size [::Integer] - # Number of backups to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse ListBackupsResponse} - # to the same `parent` and with the same `filter`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @database_admin_stub.list_backups request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @database_admin_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 - - ## - # Create a new database by restoring from a completed backup. The new - # database must be in the same project and in an instance with the same - # instance configuration as the instance containing - # the backup. The returned database [long-running - # operation][google.longrunning.Operation] has a name of the format - # `projects//instances//databases//operations/`, - # and can be used to track the progress of the operation, and to cancel it. - # The {::Google::Longrunning::Operation#metadata metadata} field type is - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. - # The {::Google::Longrunning::Operation#response response} type - # is {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if - # successful. Cancelling the returned operation will stop the restore and - # delete the database. - # There can be only one database being restored into an instance at a time. - # Once the restore operation completes, a new restore operation can be - # initiated, without waiting for the optimize operation associated with the - # first restore to complete. - # - # @overload restore_database(request, options = nil) - # Pass arguments to `restore_database` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload restore_database(parent: nil, database_id: nil, backup: nil, encryption_config: nil) - # Pass arguments to `restore_database` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance in which to create the - # restored database. This instance must be in the same project and - # have the same instance configuration as the instance containing - # the source backup. Values are of the form - # `projects//instances/`. - # @param database_id [::String] - # Required. The id of the database to create and restore to. This - # database must not already exist. The `database_id` appended to - # `parent` forms the full database name of the form - # `projects//instances//databases/`. - # @param backup [::String] - # Name of the backup from which to restore. Values are of the form - # `projects//instances//backups/`. - # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig, ::Hash] - # Optional. An encryption configuration describing the encryption type and - # key resources in Cloud KMS used to encrypt/decrypt the database to restore - # to. If this field is not specified, the restored database will use the same - # encryption configuration as the backup by default, namely - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} - # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new - # - # # Call the restore_database method. - # result = client.restore_database request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def restore_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.restore_database.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.restore_database.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.restore_database.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.restore_database request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 database {::Google::Longrunning::Operation longrunning-operations}. - # A database operation has a name of the form - # `projects//instances//databases//operations/`. - # The long-running operation - # {::Google::Longrunning::Operation#metadata metadata} field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. - # - # @overload list_database_operations(request, options = nil) - # Pass arguments to `list_database_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_database_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_database_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The instance of the database operations. - # Values are of the form `projects//instances/`. - # @param filter [::String] - # An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the {::Google::Longrunning::Operation Operation} - # are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} - # is - # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ - # `(metadata.source_type:BACKUP) AND` \ - # `(metadata.backup_info.backup:backup_howl) AND` \ - # `(metadata.name:restored_howl) AND` \ - # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. - # * The database is restored from a backup. - # * The backup name contains "backup_howl". - # * The restored database's name contains "restored_howl". - # * The operation started before 2018-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse ListDatabaseOperationsResponse} - # to the same `parent` and with the same `filter`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new - # - # # Call the list_database_operations method. - # result = client.list_database_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_database_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_database_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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_database_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_database_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.list_database_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_database_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 - - ## - # Lists the backup {::Google::Longrunning::Operation long-running operations} in - # the given instance. A backup operation has a name of the form - # `projects//instances//backups//operations/`. - # The long-running operation - # {::Google::Longrunning::Operation#metadata metadata} field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.progress.start_time` in descending order starting - # from the most recently started operation. - # - # @overload list_backup_operations(request, options = nil) - # Pass arguments to `list_backup_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The instance of the backup operations. Values are of - # the form `projects//instances/`. - # @param filter [::String] - # An expression that filters the list of returned backup operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the {::Google::Longrunning::Operation operation} - # are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} - # is - # `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic, but - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - # `metadata.database:prod` - Returns operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. - # * The source database name of backup contains the string "prod". - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - # `(metadata.name:howl) AND` \ - # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Returns operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. - # * The backup name contains the string "howl". - # * The operation started before 2018-03-28T14:50:00Z. - # * The operation resulted in an error. - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ - # `(metadata.source_backup:test) AND` \ - # `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ - # `(error:*)` - Returns operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. - # * The source backup name contains the string "test". - # * The operation started before 2022-01-18T14:50:00Z. - # * The operation resulted in an error. - # * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - # `(metadata.database:test_db)) OR` \ - # `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) - # AND` \ - # `(metadata.source_backup:test_bkp)) AND` \ - # `(error:*)` - Returns operations where: - # * The operation's metadata matches either of criteria: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} - # AND the source database name of the backup contains the string - # "test_db" - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata} - # AND the source backup name contains the string "test_bkp" - # * The operation resulted in an error. - # @param page_size [::Integer] - # Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse ListBackupOperationsResponse} - # to the same `parent` and with the same `filter`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new - # - # # Call the list_backup_operations method. - # result = client.list_backup_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_backup_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest - - # Converts hash and nil to an options 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_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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backup_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.list_backup_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_backup_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 - - ## - # Lists Cloud Spanner database roles. - # - # @overload list_database_roles(request, options = nil) - # Pass arguments to `list_database_roles` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_database_roles(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_database_roles` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The database whose roles should be listed. - # Values are of the form - # `projects//instances//databases/`. - # @param page_size [::Integer] - # Number of database roles to be returned in the response. If 0 or less, - # defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse ListDatabaseRolesResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new - # - # # Call the list_database_roles method. - # result = client.list_database_roles request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole. - # p item - # end - # - def list_database_roles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_database_roles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_database_roles.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_database_roles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.list_database_roles request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_database_roles, "database_roles", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Adds split points to specified tables, indexes of a database. - # - # @overload add_split_points(request, options = nil) - # Pass arguments to `add_split_points` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_split_points(database: nil, split_points: nil, initiator: nil) - # Pass arguments to `add_split_points` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database on whose tables/indexes split points are to be - # added. Values are of the form - # `projects//instances//databases/`. - # @param split_points [::Array<::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints, ::Hash>] - # Required. The split points to add. - # @param initiator [::String] - # Optional. A user-supplied tag associated with the split points. - # For example, "intital_data_load", "special_event_1". - # Defaults to "CloudAddSplitPointsAPI" if not specified. - # The length of the tag must not exceed 50 characters,else will be trimmed. - # Only valid UTF8 characters are allowed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new - # - # # Call the add_split_points method. - # result = client.add_split_points request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse. - # p result - # - def add_split_points request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.add_split_points.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_split_points.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_split_points.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.add_split_points request, 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 backup schedule. - # - # @overload create_backup_schedule(request, options = nil) - # Pass arguments to `create_backup_schedule` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_backup_schedule(parent: nil, backup_schedule_id: nil, backup_schedule: nil) - # Pass arguments to `create_backup_schedule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 database that this backup schedule applies to. - # @param backup_schedule_id [::String] - # Required. The Id to use for the backup schedule. The `backup_schedule_id` - # appended to `parent` forms the full backup schedule name of the form - # `projects//instances//databases//backupSchedules/`. - # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash] - # Required. The backup schedule to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new - # - # # Call the create_backup_schedule method. - # result = client.create_backup_schedule request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - # p result - # - def create_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest - - # Converts hash and nil to an 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_backup_schedule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.create_backup_schedule request, 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 backup schedule for the input schedule name. - # - # @overload get_backup_schedule(request, options = nil) - # Pass arguments to `get_backup_schedule` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_schedule(name: nil) - # Pass arguments to `get_backup_schedule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 schedule to retrieve. - # Values are of the form - # `projects//instances//databases//backupSchedules/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new - # - # # Call the get_backup_schedule method. - # result = client.get_backup_schedule request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - # p result - # - def get_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest - - # Converts hash and nil to an options 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_schedule.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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_schedule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.get_backup_schedule request, 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 backup schedule. - # - # @overload update_backup_schedule(request, options = nil) - # Pass arguments to `update_backup_schedule` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_backup_schedule(backup_schedule: nil, update_mask: nil) - # Pass arguments to `update_backup_schedule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash] - # Required. The backup schedule to update. `backup_schedule.name`, and the - # fields to be updated as specified by `update_mask` are required. Other - # fields are ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in the BackupSchedule resource - # should be updated. This mask is relative to the BackupSchedule resource, - # not to the request message. The field mask must always be - # specified; this prevents any future fields from being erased - # accidentally. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new - # - # # Call the update_backup_schedule method. - # result = client.update_backup_schedule request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - # p result - # - def update_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest - - # Converts hash and nil to an 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_backup_schedule.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_backup_schedule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.update_backup_schedule request, 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 backup schedule. - # - # @overload delete_backup_schedule(request, options = nil) - # Pass arguments to `delete_backup_schedule` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_schedule(name: nil) - # Pass arguments to `delete_backup_schedule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 schedule to delete. - # Values are of the form - # `projects//instances//databases//backupSchedules/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new - # - # # Call the delete_backup_schedule method. - # result = client.delete_backup_schedule request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_backup_schedule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest - - # Converts hash and nil to an options 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_schedule.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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_schedule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_backup_schedule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.delete_backup_schedule request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the backup schedules for the database. - # - # @overload list_backup_schedules(request, options = nil) - # Pass arguments to `list_backup_schedules` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_schedules(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_schedules` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Database is the parent resource whose backup schedules should be - # listed. Values are of the form - # projects//instances//databases/ - # @param page_size [::Integer] - # Optional. Number of backup schedules to be returned in the response. If 0 - # or less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # Optional. If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse ListBackupSchedulesResponse} - # to the same `parent`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/database/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.new - # - # # Call the list_backup_schedules method. - # result = client.list_backup_schedules request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - # p item - # end - # - def list_backup_schedules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest - - # Converts hash and nil to an options 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_schedules.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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_schedules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backup_schedules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @database_admin_stub.list_backup_schedules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_backup_schedules, "backup_schedules", request, result, 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 DatabaseAdmin REST API. - # - # This class represents the configuration for DatabaseAdmin REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_databases to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_databases.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_databases.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the DatabaseAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_databases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_databases - ## - # RPC-specific configuration for `create_database` - # @return [::Gapic::Config::Method] - # - attr_reader :create_database - ## - # RPC-specific configuration for `get_database` - # @return [::Gapic::Config::Method] - # - attr_reader :get_database - ## - # RPC-specific configuration for `update_database` - # @return [::Gapic::Config::Method] - # - attr_reader :update_database - ## - # RPC-specific configuration for `update_database_ddl` - # @return [::Gapic::Config::Method] - # - attr_reader :update_database_ddl - ## - # RPC-specific configuration for `drop_database` - # @return [::Gapic::Config::Method] - # - attr_reader :drop_database - ## - # RPC-specific configuration for `get_database_ddl` - # @return [::Gapic::Config::Method] - # - attr_reader :get_database_ddl - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `create_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :create_backup - ## - # RPC-specific configuration for `copy_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :copy_backup - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `update_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :update_backup - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `restore_database` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_database - ## - # RPC-specific configuration for `list_database_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_database_operations - ## - # RPC-specific configuration for `list_backup_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_operations - ## - # RPC-specific configuration for `list_database_roles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_database_roles - ## - # RPC-specific configuration for `add_split_points` - # @return [::Gapic::Config::Method] - # - attr_reader :add_split_points - ## - # RPC-specific configuration for `create_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :create_backup_schedule - ## - # RPC-specific configuration for `get_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_schedule - ## - # RPC-specific configuration for `update_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :update_backup_schedule - ## - # RPC-specific configuration for `delete_backup_schedule` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup_schedule - ## - # RPC-specific configuration for `list_backup_schedules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_schedules - - # @private - def initialize parent_rpcs = nil - list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases - @list_databases = ::Gapic::Config::Method.new list_databases_config - create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database - @create_database = ::Gapic::Config::Method.new create_database_config - get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database - @get_database = ::Gapic::Config::Method.new get_database_config - update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database - @update_database = ::Gapic::Config::Method.new update_database_config - update_database_ddl_config = parent_rpcs.update_database_ddl if parent_rpcs.respond_to? :update_database_ddl - @update_database_ddl = ::Gapic::Config::Method.new update_database_ddl_config - drop_database_config = parent_rpcs.drop_database if parent_rpcs.respond_to? :drop_database - @drop_database = ::Gapic::Config::Method.new drop_database_config - get_database_ddl_config = parent_rpcs.get_database_ddl if parent_rpcs.respond_to? :get_database_ddl - @get_database_ddl = ::Gapic::Config::Method.new get_database_ddl_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup - @create_backup = ::Gapic::Config::Method.new create_backup_config - copy_backup_config = parent_rpcs.copy_backup if parent_rpcs.respond_to? :copy_backup - @copy_backup = ::Gapic::Config::Method.new copy_backup_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup - @update_backup = ::Gapic::Config::Method.new update_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 - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - restore_database_config = parent_rpcs.restore_database if parent_rpcs.respond_to? :restore_database - @restore_database = ::Gapic::Config::Method.new restore_database_config - list_database_operations_config = parent_rpcs.list_database_operations if parent_rpcs.respond_to? :list_database_operations - @list_database_operations = ::Gapic::Config::Method.new list_database_operations_config - list_backup_operations_config = parent_rpcs.list_backup_operations if parent_rpcs.respond_to? :list_backup_operations - @list_backup_operations = ::Gapic::Config::Method.new list_backup_operations_config - list_database_roles_config = parent_rpcs.list_database_roles if parent_rpcs.respond_to? :list_database_roles - @list_database_roles = ::Gapic::Config::Method.new list_database_roles_config - add_split_points_config = parent_rpcs.add_split_points if parent_rpcs.respond_to? :add_split_points - @add_split_points = ::Gapic::Config::Method.new add_split_points_config - create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule - @create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config - get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule - @get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config - update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule - @update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config - delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule - @delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config - list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules - @list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/operations.rb deleted file mode 100644 index 6b9abe99cdd6..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/operations.rb +++ /dev/null @@ -1,1012 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 Spanner - module Admin - module Database - module V1 - module DatabaseAdmin - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the DatabaseAdmin 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 DatabaseAdmin 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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Database::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/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/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/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/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb deleted file mode 100644 index 1322d594b811..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb +++ /dev/null @@ -1,1740 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/spanner/admin/database/v1/spanner_database_admin_pb" - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - module DatabaseAdmin - module Rest - ## - # REST service stub for the DatabaseAdmin 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_databases REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse] - # A result object deserialized from the server's reply - def list_databases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_databases_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_databases", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.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_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_database_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_database", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Database] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database] - # A result object deserialized from the server's reply - def get_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_database_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_database", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::Database.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_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_database_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_database", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_database_ddl REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_database_ddl request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_database_ddl_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_database_ddl", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the drop_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def drop_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_drop_database_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "drop_database", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_database_ddl REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse] - # A result object deserialized from the server's reply - def get_database_ddl request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_database_ddl_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_database_ddl", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_backup REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_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: "create_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 copy_backup REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def copy_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_copy_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: "copy_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 get_backup REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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 update_backup REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # A result object deserialized from the server's reply - def update_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_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: "update_backup", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # 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::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_backups REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::ListBackupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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 restore_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def restore_database request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_restore_database_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "restore_database", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_database_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse] - # A result object deserialized from the server's reply - def list_database_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_database_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_database_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.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_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse] - # A result object deserialized from the server's reply - def list_backup_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_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_backup_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.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_database_roles REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse] - # A result object deserialized from the server's reply - def list_database_roles request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_database_roles_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_database_roles", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_split_points REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse] - # A result object deserialized from the server's reply - def add_split_points request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_split_points_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "add_split_points", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse.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_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # A result object deserialized from the server's reply - def create_backup_schedule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_backup_schedule_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_backup_schedule", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.decode_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_schedule REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # A result object deserialized from the server's reply - def get_backup_schedule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_schedule_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |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_schedule", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.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_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # A result object deserialized from the server's reply - def update_backup_schedule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_backup_schedule_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_backup_schedule", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.decode_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_schedule REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_backup_schedule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_schedule_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |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_schedule", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_backup_schedules REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse] - # A result object deserialized from the server's reply - def list_backup_schedules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_schedules_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |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_schedules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse.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_databases REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_databases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/databases", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest] - # 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_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/databases", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest] - # 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_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{database.name}", - body: "database", - matches: [ - ["database.name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_database_ddl REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest] - # 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_database_ddl_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{database}/ddl", - body: "*", - matches: [ - ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the drop_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_drop_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{database}", - matches: [ - ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_database_ddl REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_database_ddl_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{database}/ddl", - matches: [ - ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/databaseRoles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_backup REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest] - # 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_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/backups", - body: "backup", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the copy_backup REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_copy_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/backups:copy", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_backup REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest] - # 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_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{backup.name}", - body: "backup", - matches: [ - ["backup.name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_backup REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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/[^/]+/instances/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backups REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::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/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the restore_database REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_restore_database_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/databases:restore", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_database_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_database_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/databaseOperations", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backup_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest] - # A 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_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/backupOperations", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_database_roles REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_database_roles_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/databaseRoles", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_split_points REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_split_points_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{database}:addSplitPoints", - body: "*", - matches: [ - ["database", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest] - # 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_backup_schedule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/backupSchedules", - body: "backup_schedule", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest] - # A 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_schedule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest] - # 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_backup_schedule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{backup_schedule.name}", - body: "backup_schedule", - matches: [ - ["backup_schedule.name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_backup_schedule REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest] - # A 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_schedule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/backupSchedules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backup_schedules REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest] - # A 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_schedules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/backupSchedules", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/rest.rb deleted file mode 100644 index d33ad82d059e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/rest.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/spanner/admin/database/v1/database_admin/rest" -require "google/cloud/spanner/admin/database/v1/version" - -module Google - module Cloud - module Spanner - module Admin - module Database - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/spanner/admin/database/v1/rest" - # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new - # - module V1 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/version.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/version.rb deleted file mode 100644 index 112d0b089460..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/version.rb +++ /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! - - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - VERSION = "0.0.1" - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_pb.rb deleted file mode 100644 index 6435707649ba..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/admin/database/v1/backup.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/spanner/admin/database/v1/common_pb' - - -descriptor_data = "\n-google/spanner/admin/database/v1/backup.proto\x12 google.spanner.admin.database.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a-google/spanner/admin/database/v1/common.proto\"\xed\t\n\x06\x42\x61\x63kup\x12\x36\n\x08\x64\x61tabase\x18\x02 \x01(\tB$\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x30\n\x0cversion_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12 \n\x13\x66reeable_size_bytes\x18\x0f \x01(\x03\x42\x03\xe0\x41\x03\x12!\n\x14\x65xclusive_size_bytes\x18\x10 \x01(\x03\x42\x03\xe0\x41\x03\x12\x42\n\x05state\x18\x06 \x01(\x0e\x32..google.spanner.admin.database.v1.Backup.StateB\x03\xe0\x41\x03\x12\x46\n\x15referencing_databases\x18\x07 \x03(\tB\'\xe0\x41\x03\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12N\n\x0f\x65ncryption_info\x18\x08 \x01(\x0b\x32\x30.google.spanner.admin.database.v1.EncryptionInfoB\x03\xe0\x41\x03\x12U\n\x16\x65ncryption_information\x18\r \x03(\x0b\x32\x30.google.spanner.admin.database.v1.EncryptionInfoB\x03\xe0\x41\x03\x12P\n\x10\x64\x61tabase_dialect\x18\n \x01(\x0e\x32\x31.google.spanner.admin.database.v1.DatabaseDialectB\x03\xe0\x41\x03\x12\x42\n\x13referencing_backups\x18\x0b \x03(\tB%\xe0\x41\x03\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x38\n\x0fmax_expire_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x10\x62\x61\x63kup_schedules\x18\x0e \x03(\tB-\xe0\x41\x03\xfa\x41\'\n%spanner.googleapis.com/BackupSchedule\x12(\n\x1bincremental_backup_chain_id\x18\x11 \x01(\tB\x03\xe0\x41\x03\x12<\n\x13oldest_version_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12[\n\x13instance_partitions\x18\x13 \x03(\x0b\x32\x39.google.spanner.admin.database.v1.BackupInstancePartitionB\x03\xe0\x41\x03\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02:\\\xea\x41Y\n\x1dspanner.googleapis.com/Backup\x12\x38projects/{project}/instances/{instance}/backups/{backup}\"\x85\x02\n\x13\x43reateBackupRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x16\n\tbackup_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x62\x61\x63kup\x18\x03 \x01(\x0b\x32(.google.spanner.admin.database.v1.BackupB\x03\xe0\x41\x02\x12^\n\x11\x65ncryption_config\x18\x04 \x01(\x0b\x32>.google.spanner.admin.database.v1.CreateBackupEncryptionConfigB\x03\xe0\x41\x01\"\xf8\x01\n\x14\x43reateBackupMetadata\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x36\n\x08\x64\x61tabase\x18\x02 \x01(\tB$\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x45\n\x08progress\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.database.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb6\x02\n\x11\x43opyBackupRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x16\n\tbackup_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\rsource_backup\x18\x03 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x34\n\x0b\x65xpire_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\\\n\x11\x65ncryption_config\x18\x05 \x01(\x0b\x32<.google.spanner.admin.database.v1.CopyBackupEncryptionConfigB\x03\xe0\x41\x01\"\xf9\x01\n\x12\x43opyBackupMetadata\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x39\n\rsource_backup\x18\x02 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x45\n\x08progress\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.database.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8a\x01\n\x13UpdateBackupRequest\x12=\n\x06\x62\x61\x63kup\x18\x01 \x01(\x0b\x32(.google.spanner.admin.database.v1.BackupB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"G\n\x10GetBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\"J\n\x13\x44\x65leteBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\"\x84\x01\n\x12ListBackupsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"i\n\x13ListBackupsResponse\x12\x39\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32(.google.spanner.admin.database.v1.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8d\x01\n\x1bListBackupOperationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"j\n\x1cListBackupOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe2\x01\n\nBackupInfo\x12\x32\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dspanner.googleapis.com/Backup\x12\x30\n\x0cversion_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12=\n\x0fsource_database\x18\x03 \x01(\tB$\xfa\x41!\n\x1fspanner.googleapis.com/Database\"\x9f\x03\n\x1c\x43reateBackupEncryptionConfig\x12k\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32M.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionTypeB\x03\xe0\x41\x02\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12@\n\rkms_key_names\x18\x03 \x03(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x8e\x01\n\x0e\x45ncryptionType\x12\x1f\n\x1b\x45NCRYPTION_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17USE_DATABASE_ENCRYPTION\x10\x01\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x02\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x03\"\xab\x03\n\x1a\x43opyBackupEncryptionConfig\x12i\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32K.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionTypeB\x03\xe0\x41\x02\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12@\n\rkms_key_names\x18\x03 \x03(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x9e\x01\n\x0e\x45ncryptionType\x12\x1f\n\x1b\x45NCRYPTION_TYPE_UNSPECIFIED\x10\x00\x12+\n\'USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION\x10\x01\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x02\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x03\"\x10\n\x0e\x46ullBackupSpec\"\x17\n\x15IncrementalBackupSpec\"d\n\x17\x42\x61\x63kupInstancePartition\x12I\n\x12instance_partition\x18\x01 \x01(\tB-\xfa\x41*\n(spanner.googleapis.com/InstancePartitionB\xfd\x01\n$com.google.spanner.admin.database.v1B\x0b\x42\x61\x63kupProtoP\x01ZFcloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb\xaa\x02&Google.Cloud.Spanner.Admin.Database.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Database\\V1\xea\x02+Google::Cloud::Spanner::Admin::Database::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Backup").msgclass - Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Backup.State").enummodule - CreateBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupRequest").msgclass - CreateBackupMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupMetadata").msgclass - CopyBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupRequest").msgclass - CopyBackupMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupMetadata").msgclass - UpdateBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateBackupRequest").msgclass - GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetBackupRequest").msgclass - DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DeleteBackupRequest").msgclass - ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupsRequest").msgclass - ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupsResponse").msgclass - ListBackupOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsRequest").msgclass - ListBackupOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsResponse").msgclass - BackupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupInfo").msgclass - CreateBackupEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig").msgclass - CreateBackupEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType").enummodule - CopyBackupEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupEncryptionConfig").msgclass - CopyBackupEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType").enummodule - FullBackupSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.FullBackupSpec").msgclass - IncrementalBackupSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.IncrementalBackupSpec").msgclass - BackupInstancePartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupInstancePartition").msgclass - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb deleted file mode 100644 index 1a24f3b3670a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/admin/database/v1/backup_schedule.proto - -require 'google/protobuf' - -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' -require 'google/spanner/admin/database/v1/backup_pb' - - -descriptor_data = "\n6google/spanner/admin/database/v1/backup_schedule.proto\x12 google.spanner.admin.database.v1\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\x1a-google/spanner/admin/database/v1/backup.proto\"i\n\x12\x42\x61\x63kupScheduleSpec\x12\x42\n\tcron_spec\x18\x01 \x01(\x0b\x32-.google.spanner.admin.database.v1.CrontabSpecH\x00\x42\x0f\n\rschedule_spec\"\xa4\x05\n\x0e\x42\x61\x63kupSchedule\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12G\n\x04spec\x18\x06 \x01(\x0b\x32\x34.google.spanner.admin.database.v1.BackupScheduleSpecB\x03\xe0\x41\x01\x12:\n\x12retention_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12^\n\x11\x65ncryption_config\x18\x04 \x01(\x0b\x32>.google.spanner.admin.database.v1.CreateBackupEncryptionConfigB\x03\xe0\x41\x01\x12L\n\x10\x66ull_backup_spec\x18\x07 \x01(\x0b\x32\x30.google.spanner.admin.database.v1.FullBackupSpecH\x00\x12Z\n\x17incremental_backup_spec\x18\x08 \x01(\x0b\x32\x37.google.spanner.admin.database.v1.IncrementalBackupSpecH\x00\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\xa5\x01\xea\x41\xa1\x01\n%spanner.googleapis.com/BackupSchedule\x12Wprojects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}*\x0f\x62\x61\x63kupSchedules2\x0e\x62\x61\x63kupScheduleB\x12\n\x10\x62\x61\x63kup_type_spec\"q\n\x0b\x43rontabSpec\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\ttime_zone\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x37\n\x0f\x63reation_window\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\"\xc7\x01\n\x1b\x43reateBackupScheduleRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x1f\n\x12\x62\x61\x63kup_schedule_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0f\x62\x61\x63kup_schedule\x18\x03 \x01(\x0b\x32\x30.google.spanner.admin.database.v1.BackupScheduleB\x03\xe0\x41\x02\"W\n\x18GetBackupScheduleRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/BackupSchedule\"Z\n\x1b\x44\x65leteBackupScheduleRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/BackupSchedule\"\x86\x01\n\x1aListBackupSchedulesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x82\x01\n\x1bListBackupSchedulesResponse\x12J\n\x10\x62\x61\x63kup_schedules\x18\x01 \x03(\x0b\x32\x30.google.spanner.admin.database.v1.BackupSchedule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa3\x01\n\x1bUpdateBackupScheduleRequest\x12N\n\x0f\x62\x61\x63kup_schedule\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.database.v1.BackupScheduleB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x42\x85\x02\n$com.google.spanner.admin.database.v1B\x13\x42\x61\x63kupScheduleProtoP\x01ZFcloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb\xaa\x02&Google.Cloud.Spanner.Admin.Database.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Database\\V1\xea\x02+Google::Cloud::Spanner::Admin::Database::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - BackupScheduleSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupScheduleSpec").msgclass - BackupSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupSchedule").msgclass - CrontabSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CrontabSpec").msgclass - CreateBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupScheduleRequest").msgclass - GetBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetBackupScheduleRequest").msgclass - DeleteBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DeleteBackupScheduleRequest").msgclass - ListBackupSchedulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupSchedulesRequest").msgclass - ListBackupSchedulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupSchedulesResponse").msgclass - UpdateBackupScheduleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateBackupScheduleRequest").msgclass - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/common_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/common_pb.rb deleted file mode 100644 index 407157236bdf..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/common_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/admin/database/v1/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n-google/spanner/admin/database/v1/common.proto\x12 google.spanner.admin.database.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x8b\x01\n\x11OperationProgress\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x01\n\x10\x45ncryptionConfig\x12<\n\x0ckms_key_name\x18\x02 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12=\n\rkms_key_names\x18\x03 \x03(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\xc2\x02\n\x0e\x45ncryptionInfo\x12S\n\x0f\x65ncryption_type\x18\x03 \x01(\x0e\x32\x35.google.spanner.admin.database.v1.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12\x32\n\x11\x65ncryption_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12I\n\x0fkms_key_version\x18\x02 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\\\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*\\\n\x0f\x44\x61tabaseDialect\x12 \n\x1c\x44\x41TABASE_DIALECT_UNSPECIFIED\x10\x00\x12\x17\n\x13GOOGLE_STANDARD_SQL\x10\x01\x12\x0e\n\nPOSTGRESQL\x10\x02\x42\xa2\x04\n$com.google.spanner.admin.database.v1B\x0b\x43ommonProtoP\x01ZFcloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb\xaa\x02&Google.Cloud.Spanner.Admin.Database.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Database\\V1\xea\x02+Google::Cloud::Spanner::Admin::Database::V1\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - OperationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OperationProgress").msgclass - EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionConfig").msgclass - EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo").msgclass - EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo.Type").enummodule - DatabaseDialect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DatabaseDialect").enummodule - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb deleted file mode 100644 index 5cccf7377b63..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/admin/database/v1/spanner_database_admin.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/spanner/admin/database/v1/backup_pb' -require 'google/spanner/admin/database/v1/backup_schedule_pb' -require 'google/spanner/admin/database/v1/common_pb' - - -descriptor_data = "\n=google/spanner/admin/database/v1/spanner_database_admin.proto\x12 google.spanner.admin.database.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a-google/spanner/admin/database/v1/backup.proto\x1a\x36google/spanner/admin/database/v1/backup_schedule.proto\x1a-google/spanner/admin/database/v1/common.proto\"\xab\x01\n\x0bRestoreInfo\x12H\n\x0bsource_type\x18\x01 \x01(\x0e\x32\x33.google.spanner.admin.database.v1.RestoreSourceType\x12\x43\n\x0b\x62\x61\x63kup_info\x18\x02 \x01(\x0b\x32,.google.spanner.admin.database.v1.BackupInfoH\x00\x42\r\n\x0bsource_info\"\xca\x06\n\x08\x44\x61tabase\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x05state\x18\x02 \x01(\x0e\x32\x30.google.spanner.admin.database.v1.Database.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12H\n\x0crestore_info\x18\x04 \x01(\x0b\x32-.google.spanner.admin.database.v1.RestoreInfoB\x03\xe0\x41\x03\x12R\n\x11\x65ncryption_config\x18\x05 \x01(\x0b\x32\x32.google.spanner.admin.database.v1.EncryptionConfigB\x03\xe0\x41\x03\x12N\n\x0f\x65ncryption_info\x18\x08 \x03(\x0b\x32\x30.google.spanner.admin.database.v1.EncryptionInfoB\x03\xe0\x41\x03\x12%\n\x18version_retention_period\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12>\n\x15\x65\x61rliest_version_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x64\x65\x66\x61ult_leader\x18\t \x01(\tB\x03\xe0\x41\x03\x12P\n\x10\x64\x61tabase_dialect\x18\n \x01(\x0e\x32\x31.google.spanner.admin.database.v1.DatabaseDialectB\x03\xe0\x41\x03\x12\x1e\n\x16\x65nable_drop_protection\x18\x0b \x01(\x08\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\"M\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x14\n\x10READY_OPTIMIZING\x10\x03:b\xea\x41_\n\x1fspanner.googleapis.com/Database\x12\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/instances/*}/databases\x12\xa4\x02\n\x0e\x43reateDatabase\x12\x37.google.spanner.admin.database.v1.CreateDatabaseRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41\x64\n)google.spanner.admin.database.v1.Database\x12\x37google.spanner.admin.database.v1.CreateDatabaseMetadata\xda\x41\x17parent,create_statement\x82\xd3\xe4\x93\x02\x32\"-/v1/{parent=projects/*/instances/*}/databases:\x01*\x12\xad\x01\n\x0bGetDatabase\x12\x34.google.spanner.admin.database.v1.GetDatabaseRequest\x1a*.google.spanner.admin.database.v1.Database\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/instances/*/databases/*}\x12\xef\x01\n\x0eUpdateDatabase\x12\x37.google.spanner.admin.database.v1.UpdateDatabaseRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41\"\n\x08\x44\x61tabase\x12\x16UpdateDatabaseMetadata\xda\x41\x14\x64\x61tabase,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{database.name=projects/*/instances/*/databases/*}:\x08\x64\x61tabase\x12\x9d\x02\n\x11UpdateDatabaseDdl\x12:.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest\x1a\x1d.google.longrunning.Operation\"\xac\x01\xca\x41S\n\x15google.protobuf.Empty\x12:google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata\xda\x41\x13\x64\x61tabase,statements\x82\xd3\xe4\x93\x02:25/v1/{database=projects/*/instances/*/databases/*}/ddl:\x01*\x12\xa3\x01\n\x0c\x44ropDatabase\x12\x35.google.spanner.admin.database.v1.DropDatabaseRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02\x33*1/v1/{database=projects/*/instances/*/databases/*}\x12\xcd\x01\n\x0eGetDatabaseDdl\x12\x37.google.spanner.admin.database.v1.GetDatabaseDdlRequest\x1a\x38.google.spanner.admin.database.v1.GetDatabaseDdlResponse\"H\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{database=projects/*/instances/*/databases/*}/ddl\x12\xc2\x02\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xf6\x01\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\xdd\x01\">/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy:\x01*ZA\"/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy:\x01*ZA\".google.spanner.admin.database.v1.ListBackupOperationsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/instances/*}/backupOperations\x12\xdc\x01\n\x11ListDatabaseRoles\x12:.google.spanner.admin.database.v1.ListDatabaseRolesRequest\x1a;.google.spanner.admin.database.v1.ListDatabaseRolesResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles\x12\xe8\x01\n\x0e\x41\x64\x64SplitPoints\x12\x37.google.spanner.admin.database.v1.AddSplitPointsRequest\x1a\x38.google.spanner.admin.database.v1.AddSplitPointsResponse\"c\xda\x41\x15\x64\x61tabase,split_points\x82\xd3\xe4\x93\x02\x45\"@/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints:\x01*\x12\x8e\x02\n\x14\x43reateBackupSchedule\x12=.google.spanner.admin.database.v1.CreateBackupScheduleRequest\x1a\x30.google.spanner.admin.database.v1.BackupSchedule\"\x84\x01\xda\x41)parent,backup_schedule,backup_schedule_id\x82\xd3\xe4\x93\x02R\"?/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules:\x0f\x62\x61\x63kup_schedule\x12\xd1\x01\n\x11GetBackupSchedule\x12:.google.spanner.admin.database.v1.GetBackupScheduleRequest\x1a\x30.google.spanner.admin.database.v1.BackupSchedule\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}\x12\x90\x02\n\x14UpdateBackupSchedule\x12=.google.spanner.admin.database.v1.UpdateBackupScheduleRequest\x1a\x30.google.spanner.admin.database.v1.BackupSchedule\"\x86\x01\xda\x41\x1b\x62\x61\x63kup_schedule,update_mask\x82\xd3\xe4\x93\x02\x62\x32O/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}:\x0f\x62\x61\x63kup_schedule\x12\xbd\x01\n\x14\x44\x65leteBackupSchedule\x12=.google.spanner.admin.database.v1.DeleteBackupScheduleRequest\x1a\x16.google.protobuf.Empty\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41*?/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}\x12\xe4\x01\n\x13ListBackupSchedules\x12<.google.spanner.admin.database.v1.ListBackupSchedulesRequest\x1a=.google.spanner.admin.database.v1.ListBackupSchedulesResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules\x12\xc7\x01\n\x1cInternalUpdateGraphOperation\x12\x45.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest\x1a\x46.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse\"\x18\xda\x41\x15\x64\x61tabase,operation_id\x1ax\xca\x41\x16spanner.googleapis.com\xd2\x41\\https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.adminB\xd6\x03\n$com.google.spanner.admin.database.v1B\x19SpannerDatabaseAdminProtoP\x01ZFcloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb\xaa\x02&Google.Cloud.Spanner.Admin.Database.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Database\\V1\xea\x02+Google::Cloud::Spanner::Admin::Database::V1\xea\x41J\n\x1fspanner.googleapis.com/Instance\x12\'projects/{project}/instances/{instance}\xea\x41{\n(spanner.googleapis.com/InstancePartition\x12Oprojects/{project}/instances/{instance}/instancePartitions/{instance_partition}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - RestoreInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreInfo").msgclass - Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Database").msgclass - Database::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Database.State").enummodule - ListDatabasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabasesRequest").msgclass - ListDatabasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabasesResponse").msgclass - CreateDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateDatabaseRequest").msgclass - CreateDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateDatabaseMetadata").msgclass - GetDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseRequest").msgclass - UpdateDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseRequest").msgclass - UpdateDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseMetadata").msgclass - UpdateDatabaseDdlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseDdlRequest").msgclass - DdlStatementActionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DdlStatementActionInfo").msgclass - UpdateDatabaseDdlMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata").msgclass - DropDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DropDatabaseRequest").msgclass - GetDatabaseDdlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseDdlRequest").msgclass - GetDatabaseDdlResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseDdlResponse").msgclass - ListDatabaseOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsRequest").msgclass - ListDatabaseOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsResponse").msgclass - RestoreDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseRequest").msgclass - RestoreDatabaseEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig").msgclass - RestoreDatabaseEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType").enummodule - RestoreDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseMetadata").msgclass - OptimizeRestoredDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata").msgclass - DatabaseRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DatabaseRole").msgclass - ListDatabaseRolesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseRolesRequest").msgclass - ListDatabaseRolesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseRolesResponse").msgclass - AddSplitPointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.AddSplitPointsRequest").msgclass - AddSplitPointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.AddSplitPointsResponse").msgclass - SplitPoints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.SplitPoints").msgclass - SplitPoints::Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.SplitPoints.Key").msgclass - InternalUpdateGraphOperationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest").msgclass - InternalUpdateGraphOperationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse").msgclass - RestoreSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreSourceType").enummodule - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb deleted file mode 100644 index 84dcc83177fd..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +++ /dev/null @@ -1,245 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/spanner/admin/database/v1/spanner_database_admin.proto for package 'Google.Cloud.Spanner.Admin.Database.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/spanner/admin/database/v1/spanner_database_admin_pb' - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - module DatabaseAdmin - # Cloud Spanner Database Admin API - # - # The Cloud Spanner Database Admin API can be used to: - # * create, drop, and list databases - # * update the schema of pre-existing databases - # * create, delete, copy and list backups for a database - # * restore a database from an existing backup - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.spanner.admin.database.v1.DatabaseAdmin' - - # Lists Cloud Spanner databases. - rpc :ListDatabases, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse - # Creates a new Cloud Spanner database and starts to prepare it for serving. - # The returned [long-running operation][google.longrunning.Operation] will - # have a name of the format `/operations/` and - # can be used to track preparation of the database. The - # [metadata][google.longrunning.Operation.metadata] field type is - # [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. - # The [response][google.longrunning.Operation.response] field type is - # [Database][google.spanner.admin.database.v1.Database], if successful. - rpc :CreateDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, ::Google::Longrunning::Operation - # Gets the state of a Cloud Spanner database. - rpc :GetDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Database - # Updates a Cloud Spanner database. The returned - # [long-running operation][google.longrunning.Operation] can be used to track - # the progress of updating the database. If the named database does not - # exist, returns `NOT_FOUND`. - # - # While the operation is pending: - # - # * The database's - # [reconciling][google.spanner.admin.database.v1.Database.reconciling] - # field is set to true. - # * Cancelling the operation is best-effort. If the cancellation succeeds, - # the operation metadata's - # [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] - # is set, the updates are reverted, and the operation terminates with a - # `CANCELLED` status. - # * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error - # until the pending operation is done (returns successfully or with - # error). - # * Reading the database via the API continues to give the pre-request - # values. - # - # Upon completion of the returned operation: - # - # * The new values are in effect and readable via the API. - # * The database's - # [reconciling][google.spanner.admin.database.v1.Database.reconciling] - # field becomes false. - # - # The returned [long-running operation][google.longrunning.Operation] will - # have a name of the format - # `projects//instances//databases//operations/` - # and can be used to track the database modification. The - # [metadata][google.longrunning.Operation.metadata] field type is - # [UpdateDatabaseMetadata][google.spanner.admin.database.v1.UpdateDatabaseMetadata]. - # The [response][google.longrunning.Operation.response] field type is - # [Database][google.spanner.admin.database.v1.Database], if successful. - rpc :UpdateDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, ::Google::Longrunning::Operation - # Updates the schema of a Cloud Spanner database by - # creating/altering/dropping tables, columns, indexes, etc. The returned - # [long-running operation][google.longrunning.Operation] will have a name of - # the format `/operations/` and can be used to - # track execution of the schema change(s). The - # [metadata][google.longrunning.Operation.metadata] field type is - # [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. - # The operation has no response. - rpc :UpdateDatabaseDdl, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, ::Google::Longrunning::Operation - # Drops (aka deletes) a Cloud Spanner database. - # Completed backups for the database will be retained according to their - # `expire_time`. - # Note: Cloud Spanner might continue to accept requests for a few seconds - # after the database has been deleted. - rpc :DropDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, ::Google::Protobuf::Empty - # Returns the schema of a Cloud Spanner database as a list of formatted - # DDL statements. This method does not show pending schema updates, those may - # be queried using the [Operations][google.longrunning.Operations] API. - rpc :GetDatabaseDdl, ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse - # Sets the access control policy on a database or backup resource. - # Replaces any existing policy. - # - # Authorization requires `spanner.databases.setIamPolicy` - # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - # For backups, authorization requires `spanner.backups.setIamPolicy` - # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets the access control policy for a database or backup resource. - # Returns an empty policy if a database or backup exists but does not have a - # policy set. - # - # Authorization requires `spanner.databases.getIamPolicy` permission on - # [resource][google.iam.v1.GetIamPolicyRequest.resource]. - # For backups, authorization requires `spanner.backups.getIamPolicy` - # permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that the caller has on the specified database or backup - # resource. - # - # Attempting this RPC on a non-existent Cloud Spanner database will - # result in a NOT_FOUND error if the user has - # `spanner.databases.list` permission on the containing Cloud - # Spanner instance. Otherwise returns an empty set of permissions. - # Calling this method on a backup that does not exist will - # result in a NOT_FOUND error if the user has - # `spanner.backups.list` permission on the containing instance. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Starts creating a new Cloud Spanner Backup. - # The returned backup [long-running operation][google.longrunning.Operation] - # will have a name of the format - # `projects//instances//backups//operations/` - # and can be used to track creation of the backup. The - # [metadata][google.longrunning.Operation.metadata] field type is - # [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - # The [response][google.longrunning.Operation.response] field type is - # [Backup][google.spanner.admin.database.v1.Backup], if successful. - # Cancelling the returned operation will stop the creation and delete the - # backup. There can be only one pending backup creation per database. Backup - # creation of different databases can run concurrently. - rpc :CreateBackup, ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, ::Google::Longrunning::Operation - # Starts copying a Cloud Spanner Backup. - # The returned backup [long-running operation][google.longrunning.Operation] - # will have a name of the format - # `projects//instances//backups//operations/` - # and can be used to track copying of the backup. The operation is associated - # with the destination backup. - # The [metadata][google.longrunning.Operation.metadata] field type is - # [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - # The [response][google.longrunning.Operation.response] field type is - # [Backup][google.spanner.admin.database.v1.Backup], if successful. - # Cancelling the returned operation will stop the copying and delete the - # destination backup. Concurrent CopyBackup requests can run on the same - # source backup. - rpc :CopyBackup, ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, ::Google::Longrunning::Operation - # Gets metadata on a pending or completed - # [Backup][google.spanner.admin.database.v1.Backup]. - rpc :GetBackup, ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Backup - # Updates a pending or completed - # [Backup][google.spanner.admin.database.v1.Backup]. - rpc :UpdateBackup, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Backup - # Deletes a pending or completed - # [Backup][google.spanner.admin.database.v1.Backup]. - rpc :DeleteBackup, ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest, ::Google::Protobuf::Empty - # Lists completed and pending backups. - # Backups returned are ordered by `create_time` in descending order, - # starting from the most recent `create_time`. - rpc :ListBackups, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse - # Create a new database by restoring from a completed backup. The new - # database must be in the same project and in an instance with the same - # instance configuration as the instance containing - # the backup. The returned database [long-running - # operation][google.longrunning.Operation] has a name of the format - # `projects//instances//databases//operations/`, - # and can be used to track the progress of the operation, and to cancel it. - # The [metadata][google.longrunning.Operation.metadata] field type is - # [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. - # The [response][google.longrunning.Operation.response] type - # is [Database][google.spanner.admin.database.v1.Database], if - # successful. Cancelling the returned operation will stop the restore and - # delete the database. - # There can be only one database being restored into an instance at a time. - # Once the restore operation completes, a new restore operation can be - # initiated, without waiting for the optimize operation associated with the - # first restore to complete. - rpc :RestoreDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, ::Google::Longrunning::Operation - # Lists database [longrunning-operations][google.longrunning.Operation]. - # A database operation has a name of the form - # `projects//instances//databases//operations/`. - # The long-running operation - # [metadata][google.longrunning.Operation.metadata] field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. - rpc :ListDatabaseOperations, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse - # Lists the backup [long-running operations][google.longrunning.Operation] in - # the given instance. A backup operation has a name of the form - # `projects//instances//backups//operations/`. - # The long-running operation - # [metadata][google.longrunning.Operation.metadata] field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.progress.start_time` in descending order starting - # from the most recently started operation. - rpc :ListBackupOperations, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse - # Lists Cloud Spanner database roles. - rpc :ListDatabaseRoles, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse - # Adds split points to specified tables, indexes of a database. - rpc :AddSplitPoints, ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse - # Creates a new backup schedule. - rpc :CreateBackupSchedule, ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule - # Gets backup schedule for the input schedule name. - rpc :GetBackupSchedule, ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule - # Updates a backup schedule. - rpc :UpdateBackupSchedule, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule - # Deletes a backup schedule. - rpc :DeleteBackupSchedule, ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, ::Google::Protobuf::Empty - # Lists all the backup schedules for the database. - rpc :ListBackupSchedules, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse - # This is an internal API called by Spanner Graph jobs. You should never need - # to call this API directly. - rpc :InternalUpdateGraphOperation, ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest, ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/README.md deleted file mode 100644 index c27a38fa2526..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Spanner Database Admin 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-spanner-admin-database-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup.rb deleted file mode 100644 index e94d6cbaa8e3..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup.rb +++ /dev/null @@ -1,730 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - # A backup of a Cloud Spanner database. - # @!attribute [rw] database - # @return [::String] - # Required for the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} - # operation. Name of the database from which this backup was created. This - # needs to be in the same instance as the backup. Values are of the form - # `projects//instances//databases/`. - # @!attribute [rw] version_time - # @return [::Google::Protobuf::Timestamp] - # The backup will contain an externally consistent copy of the database at - # the timestamp specified by `version_time`. If `version_time` is not - # specified, the system will set `version_time` to the `create_time` of the - # backup. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Required for the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} - # operation. The expiration time of the backup, with microseconds - # granularity that must be at least 6 hours and at most 366 days - # from the time the CreateBackup request is processed. Once the `expire_time` - # has passed, the backup is eligible to be automatically deleted by Cloud - # Spanner to free the resources used by the backup. - # @!attribute [rw] name - # @return [::String] - # Output only for the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} - # operation. Required for the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup UpdateBackup} - # operation. - # - # A globally unique identifier for the backup which cannot be - # changed. Values are of the form - # `projects//instances//backups/[a-z][a-z0-9_\-]*[a-z0-9]` - # The final segment of the name must be between 2 and 60 characters - # in length. - # - # The backup is stored in the location(s) specified in the instance - # configuration of the instance containing the backup, identified - # by the prefix of the backup name of the form - # `projects//instances/`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} - # request is received. If the request does not specify `version_time`, the - # `version_time` of the backup will be equivalent to the `create_time`. - # @!attribute [r] size_bytes - # @return [::Integer] - # Output only. Size of the backup in bytes. - # @!attribute [r] freeable_size_bytes - # @return [::Integer] - # Output only. The number of bytes that will be freed by deleting this - # backup. This value will be zero if, for example, this backup is part of an - # incremental backup chain and younger backups in the chain require that we - # keep its data. For backups not in an incremental backup chain, this is - # always the size of the backup. This value may change if backups on the same - # chain get created, deleted or expired. - # @!attribute [r] exclusive_size_bytes - # @return [::Integer] - # Output only. For a backup in an incremental backup chain, this is the - # storage space needed to keep the data that has changed since the previous - # backup. For all other backups, this is always the size of the backup. This - # value may change if backups on the same chain get deleted or expired. - # - # This field can be used to calculate the total storage space used by a set - # of backups. For example, the total space used by all backups of a database - # can be computed by summing up this field. - # @!attribute [r] state - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup::State] - # Output only. The current state of the backup. - # @!attribute [r] referencing_databases - # @return [::Array<::String>] - # Output only. The names of the restored databases that reference the backup. - # The database names are of - # the form `projects//instances//databases/`. - # Referencing databases may exist in different instances. The existence of - # any referencing database prevents the backup from being deleted. When a - # restored database from the backup enters the `READY` state, the reference - # to the backup is removed. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo] - # Output only. The encryption information for the backup. - # @!attribute [r] encryption_information - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo>] - # Output only. The encryption information for the backup, whether it is - # protected by one or more KMS keys. The information includes all Cloud - # KMS key versions used to encrypt the backup. The `encryption_status' field - # inside of each `EncryptionInfo` is not populated. At least one of the key - # versions must be available for the backup to be restored. If a key version - # is revoked in the middle of a restore, the restore behavior is undefined. - # @!attribute [r] database_dialect - # @return [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] - # Output only. The database dialect information for the backup. - # @!attribute [r] referencing_backups - # @return [::Array<::String>] - # Output only. The names of the destination backups being created by copying - # this source backup. The backup names are of the form - # `projects//instances//backups/`. - # Referencing backups may exist in different instances. The existence of - # any referencing backup prevents the backup from being deleted. When the - # copy operation is done (either successfully completed or cancelled or the - # destination backup is deleted), the reference to the backup is removed. - # @!attribute [r] max_expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The max allowed expiration time of the backup, with - # microseconds granularity. A backup's expiration time can be configured in - # multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or - # copying an existing backup, the expiration time specified must be - # less than `Backup.max_expire_time`. - # @!attribute [r] backup_schedules - # @return [::Array<::String>] - # Output only. List of backup schedule URIs that are associated with - # creating this backup. This is only applicable for scheduled backups, and - # is empty for on-demand backups. - # - # To optimize for storage, whenever possible, multiple schedules are - # collapsed together to create one backup. In such cases, this field captures - # the list of all backup schedule URIs that are associated with creating - # this backup. If collapsing is not done, then this field captures the - # single backup schedule URI associated with creating this backup. - # @!attribute [r] incremental_backup_chain_id - # @return [::String] - # Output only. Populated only for backups in an incremental backup chain. - # Backups share the same chain id if and only if they belong to the same - # incremental backup chain. Use this field to determine which backups are - # part of the same incremental backup chain. The ordering of backups in the - # chain can be determined by ordering the backup `version_time`. - # @!attribute [r] oldest_version_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Data deleted at a time older than this is guaranteed not to be - # retained in order to support this backup. For a backup in an incremental - # backup chain, this is the version time of the oldest backup that exists or - # ever existed in the chain. For all other backups, this is the version time - # of the backup. This field can be used to understand what data is being - # retained by the backup system. - # @!attribute [r] instance_partitions - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::BackupInstancePartition>] - # Output only. The instance partition(s) storing the backup. - # - # This is the same as the list of the instance partition(s) that the database - # had footprint in at the backup's `version_time`. - class Backup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the current state of the backup. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The pending backup is still being created. Operations on the - # backup may fail with `FAILED_PRECONDITION` in this state. - CREATING = 1 - - # The backup is complete and ready for use. - READY = 2 - end - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the instance in which the backup will be - # created. This must be the same instance that contains the database the - # backup will be created from. The backup will be stored in the - # location(s) specified in the instance configuration of this - # instance. Values are of the form - # `projects//instances/`. - # @!attribute [rw] backup_id - # @return [::String] - # Required. The id of the backup to be created. The `backup_id` appended to - # `parent` forms the full backup name of the form - # `projects//instances//backups/`. - # @!attribute [rw] backup - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # Required. The backup to create. - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig] - # Optional. The encryption configuration used to encrypt the backup. If this - # field is not specified, the backup will use the same encryption - # configuration as the database by default, namely - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} - # = `USE_DATABASE_ENCRYPTION`. - class CreateBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup}. - # @!attribute [rw] name - # @return [::String] - # The name of the backup being created. - # @!attribute [rw] database - # @return [::String] - # The name of the database the backup is created from. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} - # operation. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which cancellation of this operation was received. - # Operations.CancelOperation - # starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not guaranteed. - # 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`. - class CreateBackupMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the destination instance that will contain the backup - # copy. Values are of the form: `projects//instances/`. - # @!attribute [rw] backup_id - # @return [::String] - # Required. The id of the backup copy. - # The `backup_id` appended to `parent` forms the full backup_uri of the form - # `projects//instances//backups/`. - # @!attribute [rw] source_backup - # @return [::String] - # Required. The source backup to be copied. - # The source backup needs to be in READY state for it to be copied. - # Once CopyBackup is in progress, the source backup cannot be deleted or - # cleaned up on expiration until CopyBackup is finished. - # Values are of the form: - # `projects//instances//backups/`. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Required. The expiration time of the backup in microsecond granularity. - # The expiration time must be at least 6 hours and at most 366 days - # from the `create_time` of the source backup. Once the `expire_time` has - # passed, the backup is eligible to be automatically deleted by Cloud Spanner - # to free the resources used by the backup. - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig] - # Optional. The encryption configuration used to encrypt the backup. If this - # field is not specified, the backup will use the same encryption - # configuration as the source backup by default, namely - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} - # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - class CopyBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup}. - # @!attribute [rw] name - # @return [::String] - # The name of the backup being created through the copy operation. - # Values are of the form - # `projects//instances//backups/`. - # @!attribute [rw] source_backup - # @return [::String] - # The name of the source backup that is being copied. - # Values are of the form - # `projects//instances//backups/`. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup} - # operation. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which cancellation of CopyBackup operation was received. - # Operations.CancelOperation - # starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not guaranteed. - # 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`. - class CopyBackupMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup UpdateBackup}. - # @!attribute [rw] backup - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup] - # Required. The backup to update. `backup.name`, and the fields to be updated - # as specified by `update_mask` are required. Other fields are ignored. - # Update is only supported for the following fields: - # * `backup.expire_time`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A mask specifying which fields (e.g. `expire_time`) in the - # Backup resource should be updated. This mask is relative to the Backup - # resource, not to the request message. The field mask must always be - # specified; this prevents any future fields from being erased accidentally - # by clients that do not know about them. - class UpdateBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup GetBackup}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the backup. - # Values are of the form - # `projects//instances//backups/`. - class GetBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup DeleteBackup}. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the backup to delete. - # Values are of the form - # `projects//instances//backups/`. - class DeleteBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups ListBackups}. - # @!attribute [rw] parent - # @return [::String] - # Required. The instance to list backups from. Values are of the - # form `projects//instances/`. - # @!attribute [rw] filter - # @return [::String] - # An expression that filters the list of returned backups. - # - # A filter expression consists of a field name, a comparison operator, and a - # value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the - # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup} are eligible for - # filtering: - # - # * `name` - # * `database` - # * `state` - # * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `size_bytes` - # * `backup_schedules` - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic, but - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `name:Howl` - The backup's name contains the string "howl". - # * `database:prod` - # - The database's name contains the string "prod". - # * `state:CREATING` - The backup is pending creation. - # * `state:READY` - The backup is fully created and ready for use. - # * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` - # - The backup name contains the string "howl" and `create_time` - # of the backup is before 2018-03-28T14:50:00Z. - # * `expire_time < \"2018-03-28T14:50:00Z\"` - # - The backup `expire_time` is before 2018-03-28T14:50:00Z. - # * `size_bytes > 10000000000` - The backup's size is greater than 10GB - # * `backup_schedules:daily` - # - The backup is created from a schedule with "daily" in its name. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of backups to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse ListBackupsResponse} - # to the same `parent` and with the same `filter`. - class ListBackupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups ListBackups}. - # @!attribute [rw] backups - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::Backup>] - # The list of matching backups. Backups returned are ordered by `create_time` - # in descending order, starting from the most recent `create_time`. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups ListBackups} - # call to fetch more of the matching backups. - class ListBackupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations ListBackupOperations}. - # @!attribute [rw] parent - # @return [::String] - # Required. The instance of the backup operations. Values are of - # the form `projects//instances/`. - # @!attribute [rw] filter - # @return [::String] - # An expression that filters the list of returned backup operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the {::Google::Longrunning::Operation operation} - # are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} - # is - # `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic, but - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - # `metadata.database:prod` - Returns operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. - # * The source database name of backup contains the string "prod". - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - # `(metadata.name:howl) AND` \ - # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Returns operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. - # * The backup name contains the string "howl". - # * The operation started before 2018-03-28T14:50:00Z. - # * The operation resulted in an error. - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ - # `(metadata.source_backup:test) AND` \ - # `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \ - # `(error:*)` - Returns operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}. - # * The source backup name contains the string "test". - # * The operation started before 2022-01-18T14:50:00Z. - # * The operation resulted in an error. - # * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \ - # `(metadata.database:test_db)) OR` \ - # `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) - # AND` \ - # `(metadata.source_backup:test_bkp)) AND` \ - # `(error:*)` - Returns operations where: - # * The operation's metadata matches either of criteria: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} - # AND the source database name of the backup contains the string - # "test_db" - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata} - # AND the source backup name contains the string "test_bkp" - # * The operation resulted in an error. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse ListBackupOperationsResponse} - # to the same `parent` and with the same `filter`. - class ListBackupOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations ListBackupOperations}. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # The list of matching backup [long-running - # operations][google.longrunning.Operation]. Each operation's name will be - # prefixed by the backup's name. The operation's - # {::Google::Longrunning::Operation#metadata metadata} field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that are pending or have completed/failed/canceled within the - # last 7 days. Operations returned are ordered by - # `operation.metadata.value.progress.start_time` in descending order starting - # from the most recently started operation. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations ListBackupOperations} - # call to fetch more of the matching metadata. - class ListBackupOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about a backup. - # @!attribute [rw] backup - # @return [::String] - # Name of the backup. - # @!attribute [rw] version_time - # @return [::Google::Protobuf::Timestamp] - # The backup contains an externally consistent copy of `source_database` at - # the timestamp specified by `version_time`. If the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} - # request did not specify `version_time`, the `version_time` of the backup is - # equivalent to the `create_time`. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup CreateBackup} - # request was received. - # @!attribute [rw] source_database - # @return [::String] - # Name of the database the backup was created from. - class BackupInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Encryption configuration for the backup to create. - # @!attribute [rw] encryption_type - # @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig::EncryptionType] - # Required. The encryption type of the backup. - # @!attribute [rw] kms_key_name - # @return [::String] - # Optional. The Cloud KMS key that will be used to protect the backup. - # This field should be set only when - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} - # is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form - # `projects//locations//keyRings//cryptoKeys/`. - # @!attribute [rw] kms_key_names - # @return [::Array<::String>] - # Optional. Specifies the KMS configuration for the one or more keys used to - # protect the backup. Values are of the form - # `projects//locations//keyRings//cryptoKeys/`. - # - # The keys referenced by kms_key_names must fully cover all - # regions of the backup's instance configuration. Some examples: - # * For single region instance configs, specify a single regional - # location KMS key. - # * For multi-regional instance configs of type GOOGLE_MANAGED, - # either specify a multi-regional location KMS key or multiple regional - # location KMS keys that cover all regions in the instance config. - # * For an instance config of type USER_MANAGED, please specify only - # regional location KMS keys to cover each region in the instance config. - # Multi-regional location KMS keys are not supported for USER_MANAGED - # instance configs. - class CreateBackupEncryptionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Encryption types for the backup. - module EncryptionType - # Unspecified. Do not use. - ENCRYPTION_TYPE_UNSPECIFIED = 0 - - # Use the same encryption configuration as the database. This is the - # default option when - # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig encryption_config} - # is empty. For example, if the database is using - # `Customer_Managed_Encryption`, the backup will be using the same Cloud - # KMS key as the database. - USE_DATABASE_ENCRYPTION = 1 - - # Use Google default encryption. - GOOGLE_DEFAULT_ENCRYPTION = 2 - - # Use customer managed encryption. If specified, `kms_key_name` - # must contain a valid Cloud KMS key. - CUSTOMER_MANAGED_ENCRYPTION = 3 - end - end - - # Encryption configuration for the copied backup. - # @!attribute [rw] encryption_type - # @return [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig::EncryptionType] - # Required. The encryption type of the backup. - # @!attribute [rw] kms_key_name - # @return [::String] - # Optional. The Cloud KMS key that will be used to protect the backup. - # This field should be set only when - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} - # is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form - # `projects//locations//keyRings//cryptoKeys/`. - # @!attribute [rw] kms_key_names - # @return [::Array<::String>] - # Optional. Specifies the KMS configuration for the one or more keys used to - # protect the backup. Values are of the form - # `projects//locations//keyRings//cryptoKeys/`. - # Kms keys specified can be in any order. - # - # The keys referenced by kms_key_names must fully cover all - # regions of the backup's instance configuration. Some examples: - # * For single region instance configs, specify a single regional - # location KMS key. - # * For multi-regional instance configs of type GOOGLE_MANAGED, - # either specify a multi-regional location KMS key or multiple regional - # location KMS keys that cover all regions in the instance config. - # * For an instance config of type USER_MANAGED, please specify only - # regional location KMS keys to cover each region in the instance config. - # Multi-regional location KMS keys are not supported for USER_MANAGED - # instance configs. - class CopyBackupEncryptionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Encryption types for the backup. - module EncryptionType - # Unspecified. Do not use. - ENCRYPTION_TYPE_UNSPECIFIED = 0 - - # This is the default option for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup} - # when - # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig encryption_config} - # is not specified. For example, if the source backup is using - # `Customer_Managed_Encryption`, the backup will be using the same Cloud - # KMS key as the source backup. - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1 - - # Use Google default encryption. - GOOGLE_DEFAULT_ENCRYPTION = 2 - - # Use customer managed encryption. If specified, either `kms_key_name` or - # `kms_key_names` must contain valid Cloud KMS key(s). - CUSTOMER_MANAGED_ENCRYPTION = 3 - end - end - - # The specification for full backups. - # A full backup stores the entire contents of the database at a given - # version time. - class FullBackupSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The specification for incremental backup chains. - # An incremental backup stores the delta of changes between a previous - # backup and the database contents at a given version time. An - # incremental backup chain consists of a full backup and zero or more - # successive incremental backups. The first backup created for an - # incremental backup chain is always a full backup. - class IncrementalBackupSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Instance partition information for the backup. - # @!attribute [rw] instance_partition - # @return [::String] - # A unique identifier for the instance partition. Values are of the form - # `projects//instances//instancePartitions/` - class BackupInstancePartition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb deleted file mode 100644 index 99370211c6c5..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb +++ /dev/null @@ -1,220 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - # Defines specifications of the backup schedule. - # @!attribute [rw] cron_spec - # @return [::Google::Cloud::Spanner::Admin::Database::V1::CrontabSpec] - # Cron style schedule specification. - class BackupScheduleSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # BackupSchedule expresses the automated backup creation specification for a - # Spanner database. - # Next ID: 10 - # @!attribute [rw] name - # @return [::String] - # Identifier. Output only for the - # [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation. - # Required for the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule UpdateBackupSchedule} - # operation. A globally unique identifier for the backup schedule which - # cannot be changed. Values are of the form - # `projects//instances//databases//backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]` - # The final segment of the name must be between 2 and 60 characters in - # length. - # @!attribute [rw] spec - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupScheduleSpec] - # Optional. The schedule specification based on which the backup creations - # are triggered. - # @!attribute [rw] retention_duration - # @return [::Google::Protobuf::Duration] - # Optional. The retention duration of a backup that must be at least 6 hours - # and at most 366 days. The backup is eligible to be automatically deleted - # once the retention period has elapsed. - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig] - # Optional. The encryption configuration that will be used to encrypt the - # backup. If this field is not specified, the backup will use the same - # encryption configuration as the database. - # @!attribute [rw] full_backup_spec - # @return [::Google::Cloud::Spanner::Admin::Database::V1::FullBackupSpec] - # The schedule creates only full backups. - # - # Note: The following fields are mutually exclusive: `full_backup_spec`, `incremental_backup_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] incremental_backup_spec - # @return [::Google::Cloud::Spanner::Admin::Database::V1::IncrementalBackupSpec] - # The schedule creates incremental backup chains. - # - # Note: The following fields are mutually exclusive: `incremental_backup_spec`, `full_backup_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp at which the schedule was last updated. - # If the schedule has never been updated, this field contains the timestamp - # when the schedule was first created. - class BackupSchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CrontabSpec can be used to specify the version time and frequency at - # which the backup should be created. - # @!attribute [rw] text - # @return [::String] - # Required. Textual representation of the crontab. User can customize the - # backup frequency and the backup version time using the cron - # expression. The version time must be in UTC timezone. - # - # The backup will contain an externally consistent copy of the - # database at the version time. Allowed frequencies are 12 hour, 1 day, - # 1 week and 1 month. Examples of valid cron specifications: - # * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC. - # * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC. - # * `0 2 * * * ` : once a day at 2 past midnight in UTC. - # * `0 2 * * 0 ` : once a week every Sunday at 2 past midnight in UTC. - # * `0 2 8 * * ` : once a month on 8th day at 2 past midnight in UTC. - # @!attribute [r] time_zone - # @return [::String] - # Output only. The time zone of the times in `CrontabSpec.text`. Currently - # only UTC is supported. - # @!attribute [r] creation_window - # @return [::Google::Protobuf::Duration] - # Output only. Schedule backups will contain an externally consistent copy - # of the database at the version time specified in - # `schedule_spec.cron_spec`. However, Spanner may not initiate the creation - # of the scheduled backups at that version time. Spanner will initiate - # the creation of scheduled backups within the time window bounded by the - # version_time specified in `schedule_spec.cron_spec` and version_time + - # `creation_window`. - class CrontabSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup_schedule CreateBackupSchedule}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the database that this backup schedule applies to. - # @!attribute [rw] backup_schedule_id - # @return [::String] - # Required. The Id to use for the backup schedule. The `backup_schedule_id` - # appended to `parent` forms the full backup schedule name of the form - # `projects//instances//databases//backupSchedules/`. - # @!attribute [rw] backup_schedule - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # Required. The backup schedule to create. - class CreateBackupScheduleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup_schedule GetBackupSchedule}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the schedule to retrieve. - # Values are of the form - # `projects//instances//databases//backupSchedules/`. - class GetBackupScheduleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup_schedule DeleteBackupSchedule}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the schedule to delete. - # Values are of the form - # `projects//instances//databases//backupSchedules/`. - class DeleteBackupScheduleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules ListBackupSchedules}. - # @!attribute [rw] parent - # @return [::String] - # Required. Database is the parent resource whose backup schedules should be - # listed. Values are of the form - # projects//instances//databases/ - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Number of backup schedules to be returned in the response. If 0 - # or less, defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # Optional. If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse ListBackupSchedulesResponse} - # to the same `parent`. - class ListBackupSchedulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules ListBackupSchedules}. - # @!attribute [rw] backup_schedules - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>] - # The list of backup schedules for a database. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules ListBackupSchedules} - # call to fetch more of the schedules. - class ListBackupSchedulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule UpdateBackupScheduleRequest}. - # @!attribute [rw] backup_schedule - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule] - # Required. The backup schedule to update. `backup_schedule.name`, and the - # fields to be updated as specified by `update_mask` are required. Other - # fields are ignored. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A mask specifying which fields in the BackupSchedule resource - # should be updated. This mask is relative to the BackupSchedule resource, - # not to the request message. The field mask must always be - # specified; this prevents any future fields from being erased - # accidentally. - class UpdateBackupScheduleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/common.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/common.rb deleted file mode 100644 index 7deaa30f1933..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/common.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - # Encapsulates progress related information for a Cloud Spanner long - # running operation. - # @!attribute [rw] progress_percent - # @return [::Integer] - # Percent completion of the operation. - # Values are between 0 and 100 inclusive. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Time the request was received. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # If set, the time at which this operation failed or was completed - # successfully. - class OperationProgress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Encryption configuration for a Cloud Spanner database. - # @!attribute [rw] kms_key_name - # @return [::String] - # The Cloud KMS key to be used for encrypting and decrypting - # the database. Values are of the form - # `projects//locations//keyRings//cryptoKeys/`. - # @!attribute [rw] kms_key_names - # @return [::Array<::String>] - # Specifies the KMS configuration for the one or more keys used to encrypt - # the database. Values are of the form - # `projects//locations//keyRings//cryptoKeys/`. - # - # The keys referenced by kms_key_names must fully cover all - # regions of the database instance configuration. Some examples: - # * For single region database instance configs, specify a single regional - # location KMS key. - # * For multi-regional database instance configs of type GOOGLE_MANAGED, - # either specify a multi-regional location KMS key or multiple regional - # location KMS keys that cover all regions in the instance config. - # * For a database instance config of type USER_MANAGED, please specify only - # regional location KMS keys to cover each region in the instance config. - # Multi-regional location KMS keys are not supported for USER_MANAGED - # instance configs. - class EncryptionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Encryption information for a Cloud Spanner database or backup. - # @!attribute [r] encryption_type - # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo::Type] - # Output only. The type of encryption. - # @!attribute [r] encryption_status - # @return [::Google::Rpc::Status] - # Output only. If present, the status of a recent encrypt/decrypt call on - # underlying data for this database or backup. Regardless of status, data is - # always encrypted at rest. - # @!attribute [r] kms_key_version - # @return [::String] - # Output only. A Cloud KMS key version that is being used to protect the - # database or backup. - class EncryptionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible encryption types. - module Type - # Encryption type was not specified, though data at rest remains encrypted. - TYPE_UNSPECIFIED = 0 - - # The data is encrypted at rest with a key that is - # fully managed by Google. No key version or status 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. The active version of the key. `kms_key_version` - # will be populated, and `encryption_status` may be populated. - CUSTOMER_MANAGED_ENCRYPTION = 2 - end - end - - # Indicates the dialect type of a database. - module DatabaseDialect - # Default value. This value will create a database with the - # GOOGLE_STANDARD_SQL dialect. - DATABASE_DIALECT_UNSPECIFIED = 0 - - # GoogleSQL supported SQL. - GOOGLE_STANDARD_SQL = 1 - - # PostgreSQL supported SQL. - POSTGRESQL = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb deleted file mode 100644 index 4c996f50b61f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb +++ /dev/null @@ -1,834 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module Admin - module Database - module V1 - # Information about the database restore. - # @!attribute [rw] source_type - # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreSourceType] - # The type of the restore source. - # @!attribute [rw] backup_info - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupInfo] - # Information about the backup used to restore the database. The backup - # may no longer exist. - class RestoreInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Cloud Spanner database. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the database. Values are of the form - # `projects//instances//databases/`, - # where `` is as specified in the `CREATE DATABASE` - # statement. This name can be passed to other API methods to - # identify the database. - # @!attribute [r] state - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database::State] - # Output only. The current database state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. If exists, the time at which the database creation started. - # @!attribute [r] restore_info - # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreInfo] - # Output only. Applicable only for restored databases. Contains information - # about the restore source. - # @!attribute [r] encryption_config - # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig] - # Output only. For databases that are using customer managed encryption, this - # field contains the encryption configuration for the database. - # For databases that are using Google default or other types of encryption, - # this field is empty. - # @!attribute [r] encryption_info - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo>] - # Output only. For databases that are using customer managed encryption, this - # field contains the encryption information for the database, such as - # all Cloud KMS key versions that are in use. The `encryption_status' field - # inside of each `EncryptionInfo` is not populated. - # - # For databases that are using Google default or other types of encryption, - # this field is empty. - # - # This field is propagated lazily from the backend. There might be a delay - # from when a key version is being used and when it appears in this field. - # @!attribute [r] version_retention_period - # @return [::String] - # Output only. The period in which Cloud Spanner retains all versions of data - # for the database. This is the same as the value of version_retention_period - # database option set using - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}. - # Defaults to 1 hour, if not set. - # @!attribute [r] earliest_version_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Earliest timestamp at which older versions of the data can be - # read. This value is continuously updated by Cloud Spanner and becomes stale - # the moment it is queried. If you are using this value to recover data, make - # sure to account for the time from the moment when the value is queried to - # the moment when you initiate the recovery. - # @!attribute [r] default_leader - # @return [::String] - # Output only. The read-write region which contains the database's leader - # replicas. - # - # This is the same as the value of default_leader - # database option set using DatabaseAdmin.CreateDatabase or - # DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty. - # @!attribute [r] database_dialect - # @return [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] - # Output only. The dialect of the Cloud Spanner Database. - # @!attribute [rw] enable_drop_protection - # @return [::Boolean] - # Whether drop protection is enabled for this database. Defaults to false, - # if not set. For more details, please see how to [prevent accidental - # database - # deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion). - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. If true, the database is being updated. If false, there are no - # ongoing update operations for the database. - class Database - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the current state of the database. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The database is still being created. Operations on the database may fail - # with `FAILED_PRECONDITION` in this state. - CREATING = 1 - - # The database is fully created and ready for use. - READY = 2 - - # The database is fully created and ready for use, but is still - # being optimized for performance and cannot handle full load. - # - # In this state, the database still references the backup - # it was restore from, preventing the backup - # from being deleted. When optimizations are complete, the full performance - # of the database will be restored, and the database will transition to - # `READY` state. - READY_OPTIMIZING = 3 - end - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases}. - # @!attribute [rw] parent - # @return [::String] - # Required. The instance whose databases should be listed. - # Values are of the form `projects//instances/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of databases to be returned in the response. If 0 or less, - # defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}. - class ListDatabasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases}. - # @!attribute [rw] databases - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::Database>] - # Databases that matched the request. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases} - # call to fetch more of the matching databases. - class ListDatabasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database CreateDatabase}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the instance that will serve the new database. - # Values are of the form `projects//instances/`. - # @!attribute [rw] create_statement - # @return [::String] - # Required. A `CREATE DATABASE` statement, which specifies the ID of the - # new database. The database ID must conform to the regular expression - # `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length. - # If the database ID is a reserved word or if it contains a hyphen, the - # database ID must be enclosed in backticks (`` ` ``). - # @!attribute [rw] extra_statements - # @return [::Array<::String>] - # Optional. A list of DDL statements to run inside the newly created - # database. Statements can create tables, indexes, etc. These - # statements execute atomically with the creation of the database: - # if there is an error in any statement, the database is not created. - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig] - # Optional. The encryption configuration for the database. If this field is - # not specified, Cloud Spanner will encrypt/decrypt all data at rest using - # Google default encryption. - # @!attribute [rw] database_dialect - # @return [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect] - # Optional. The dialect of the Cloud Spanner Database. - # @!attribute [rw] proto_descriptors - # @return [::String] - # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in - # 'extra_statements' above. - # Contains a protobuf-serialized - # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - # To generate it, [install](https://grpc.io/docs/protoc-installation/) and - # run `protoc` with --include_imports and --descriptor_set_out. For example, - # to generate for moon/shot/app.proto, run - # ``` - # $protoc --proto_path=/app_path --proto_path=/lib_path \ - # --include_imports \ - # --descriptor_set_out=descriptors.data \ - # moon/shot/app.proto - # ``` - # For more details, see protobuffer [self - # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - class CreateDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database CreateDatabase}. - # @!attribute [rw] database - # @return [::String] - # The database being created. - class CreateDatabaseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database GetDatabase}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested database. Values are of the form - # `projects//instances//databases/`. - class GetDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database UpdateDatabase}. - # @!attribute [rw] database - # @return [::Google::Cloud::Spanner::Admin::Database::V1::Database] - # Required. The database to update. - # The `name` field of the database is of the form - # `projects//instances//databases/`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The list of fields to update. Currently, only - # `enable_drop_protection` field can be updated. - class UpdateDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database UpdateDatabase}. - # @!attribute [rw] request - # @return [::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest] - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database UpdateDatabase}. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database UpdateDatabase} - # operation. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. If set, this operation is - # in the process of undoing itself (which is best-effort). - class UpdateDatabaseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enqueues the given DDL statements to be applied, in order but not - # necessarily all at once, to the database schema at some point (or - # points) in the future. The server checks that the statements - # are executable (syntactically valid, name tables that exist, etc.) - # before enqueueing them, but they may still fail upon - # later execution (e.g., if a statement from another batch of - # statements is applied first and it conflicts in some way, or if - # there is some data-related problem like a `NULL` value in a column to - # which `NOT NULL` would be added). If a statement fails, all - # subsequent statements in the batch are automatically cancelled. - # - # Each batch of statements is assigned a name which can be used with - # the Operations API to monitor - # progress. See the - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#operation_id operation_id} - # field for more details. - # @!attribute [rw] database - # @return [::String] - # Required. The database to update. - # @!attribute [rw] statements - # @return [::Array<::String>] - # Required. DDL statements to be applied to the database. - # @!attribute [rw] operation_id - # @return [::String] - # If empty, the new update request is assigned an - # automatically-generated operation ID. Otherwise, `operation_id` - # is used to construct the name of the resulting - # {::Google::Longrunning::Operation Operation}. - # - # Specifying an explicit operation ID simplifies determining - # whether the statements were executed in the event that the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} - # call is replayed, or the return value is otherwise lost: the - # {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database} - # and `operation_id` fields can be combined to form the - # {::Google::Longrunning::Operation#name name} of the resulting - # {::Google::Longrunning::Operation longrunning.Operation}: - # `/operations/`. - # - # `operation_id` should be unique within the database, and must be - # a valid identifier: `[a-z][a-z0-9_]*`. Note that - # automatically-generated operation IDs always begin with an - # underscore. If the named operation already exists, - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} - # returns `ALREADY_EXISTS`. - # @!attribute [rw] proto_descriptors - # @return [::String] - # Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. - # Contains a protobuf-serialized - # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - # To generate it, [install](https://grpc.io/docs/protoc-installation/) and - # run `protoc` with --include_imports and --descriptor_set_out. For example, - # to generate for moon/shot/app.proto, run - # ``` - # $protoc --proto_path=/app_path --proto_path=/lib_path \ - # --include_imports \ - # --descriptor_set_out=descriptors.data \ - # moon/shot/app.proto - # ``` - # For more details, see protobuffer [self - # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - # @!attribute [rw] throughput_mode - # @return [::Boolean] - # Optional. This field is exposed to be used by the Spanner Migration Tool. - # For more details, see - # [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool). - class UpdateDatabaseDdlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Action information extracted from a DDL statement. This proto is used to - # display the brief info of the DDL statement for the operation - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}. - # @!attribute [rw] action - # @return [::String] - # The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc. - # This field is a non-empty string. - # @!attribute [rw] entity_type - # @return [::String] - # The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc. - # This field can be empty string for some DDL statement, - # e.g. for statement "ANALYZE", `entity_type` = "". - # @!attribute [rw] entity_names - # @return [::Array<::String>] - # The entity name(s) being operated on the DDL statement. - # E.g. - # 1. For statement "CREATE TABLE t1(...)", `entity_names` = ["t1"]. - # 2. For statement "GRANT ROLE r1, r2 ...", `entity_names` = ["r1", "r2"]. - # 3. For statement "ANALYZE", `entity_names` = []. - class DdlStatementActionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}. - # @!attribute [rw] database - # @return [::String] - # The database being modified. - # @!attribute [rw] statements - # @return [::Array<::String>] - # For an update this list contains all the statements. For an - # individual statement, this list contains only that statement. - # @!attribute [rw] commit_timestamps - # @return [::Array<::Google::Protobuf::Timestamp>] - # Reports the commit timestamps of all statements that have - # succeeded so far, where `commit_timestamps[i]` is the commit - # timestamp for the statement `statements[i]`. - # @!attribute [r] throttled - # @return [::Boolean] - # Output only. When true, indicates that the operation is throttled e.g. - # due to resource constraints. When resources become available the operation - # will resume and this field will be false again. - # @!attribute [rw] progress - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress>] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} - # operations. All DDL statements will have continuously updating progress, - # and `progress[i]` is the operation progress for `statements[i]`. Also, - # `progress[i]` will have start time and end time populated with commit - # timestamp of operation, as well as a progress of 100% once the operation - # has completed. - # @!attribute [rw] actions - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::DdlStatementActionInfo>] - # The brief action info for the DDL statements. - # `actions[i]` is the brief info for `statements[i]`. - class UpdateDatabaseDdlMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database DropDatabase}. - # @!attribute [rw] database - # @return [::String] - # Required. The database to be dropped. - class DropDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl GetDatabaseDdl}. - # @!attribute [rw] database - # @return [::String] - # Required. The database whose schema we wish to get. - # Values are of the form - # `projects//instances//databases/` - class GetDatabaseDdlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl GetDatabaseDdl}. - # @!attribute [rw] statements - # @return [::Array<::String>] - # A list of formatted DDL statements defining the schema of the database - # specified in the request. - # @!attribute [rw] proto_descriptors - # @return [::String] - # Proto descriptors stored in the database. - # Contains a protobuf-serialized - # [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). - # For more details, see protobuffer [self - # description](https://developers.google.com/protocol-buffers/docs/techniques#self-description). - class GetDatabaseDdlResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations ListDatabaseOperations}. - # @!attribute [rw] parent - # @return [::String] - # Required. The instance of the database operations. - # Values are of the form `projects//instances/`. - # @!attribute [rw] filter - # @return [::String] - # An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the {::Google::Longrunning::Operation Operation} - # are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} - # is - # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \ - # `(metadata.source_type:BACKUP) AND` \ - # `(metadata.backup_info.backup:backup_howl) AND` \ - # `(metadata.name:restored_howl) AND` \ - # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}. - # * The database is restored from a backup. - # * The backup name contains "backup_howl". - # * The restored database's name contains "restored_howl". - # * The operation started before 2018-03-28T14:50:00Z. - # * The operation resulted in an error. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse ListDatabaseOperationsResponse} - # to the same `parent` and with the same `filter`. - class ListDatabaseOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations ListDatabaseOperations}. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # The list of matching database [long-running - # operations][google.longrunning.Operation]. Each operation's name will be - # prefixed by the database's name. The operation's - # {::Google::Longrunning::Operation#metadata metadata} field type - # `metadata.type_url` describes the type of the metadata. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations ListDatabaseOperations} - # call to fetch more of the matching metadata. - class ListDatabaseOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database RestoreDatabase}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the instance in which to create the - # restored database. This instance must be in the same project and - # have the same instance configuration as the instance containing - # the source backup. Values are of the form - # `projects//instances/`. - # @!attribute [rw] database_id - # @return [::String] - # Required. The id of the database to create and restore to. This - # database must not already exist. The `database_id` appended to - # `parent` forms the full database name of the form - # `projects//instances//databases/`. - # @!attribute [rw] backup - # @return [::String] - # Name of the backup from which to restore. Values are of the form - # `projects//instances//backups/`. - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig] - # Optional. An encryption configuration describing the encryption type and - # key resources in Cloud KMS used to encrypt/decrypt the database to restore - # to. If this field is not specified, the restored database will use the same - # encryption configuration as the backup by default, namely - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} - # = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`. - class RestoreDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Encryption configuration for the restored database. - # @!attribute [rw] encryption_type - # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig::EncryptionType] - # Required. The encryption type of the restored database. - # @!attribute [rw] kms_key_name - # @return [::String] - # Optional. The Cloud KMS key that will be used to encrypt/decrypt the - # restored database. This field should be set only when - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} - # is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form - # `projects//locations//keyRings//cryptoKeys/`. - # @!attribute [rw] kms_key_names - # @return [::Array<::String>] - # Optional. Specifies the KMS configuration for the one or more keys used to - # encrypt the database. Values are of the form - # `projects//locations//keyRings//cryptoKeys/`. - # - # The keys referenced by kms_key_names must fully cover all - # regions of the database instance configuration. Some examples: - # * For single region database instance configs, specify a single regional - # location KMS key. - # * For multi-regional database instance configs of type GOOGLE_MANAGED, - # either specify a multi-regional location KMS key or multiple regional - # location KMS keys that cover all regions in the instance config. - # * For a database instance config of type USER_MANAGED, please specify only - # regional location KMS keys to cover each region in the instance config. - # Multi-regional location KMS keys are not supported for USER_MANAGED - # instance configs. - class RestoreDatabaseEncryptionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Encryption types for the database to be restored. - module EncryptionType - # Unspecified. Do not use. - ENCRYPTION_TYPE_UNSPECIFIED = 0 - - # This is the default option when - # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig encryption_config} - # is not specified. - USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1 - - # Use Google default encryption. - GOOGLE_DEFAULT_ENCRYPTION = 2 - - # Use customer managed encryption. If specified, `kms_key_name` must - # must contain a valid Cloud KMS key. - CUSTOMER_MANAGED_ENCRYPTION = 3 - end - end - - # Metadata type for the long-running operation returned by - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database RestoreDatabase}. - # @!attribute [rw] name - # @return [::String] - # Name of the database being created and restored to. - # @!attribute [rw] source_type - # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreSourceType] - # The type of the restore source. - # @!attribute [rw] backup_info - # @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupInfo] - # Information about the backup used to restore the database. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database RestoreDatabase} - # operation. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which cancellation of this operation was received. - # Operations.CancelOperation - # starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not guaranteed. - # 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`. - # @!attribute [rw] optimize_database_operation_name - # @return [::String] - # If exists, the name of the long-running operation that will be used to - # track the post-restore optimization process to optimize the performance of - # the restored database, and remove the dependency on the restore source. - # The name is of the form - # `projects//instances//databases//operations/` - # where the is the name of database being created and restored to. - # The metadata type of the long-running operation is - # {::Google::Cloud::Spanner::Admin::Database::V1::OptimizeRestoredDatabaseMetadata OptimizeRestoredDatabaseMetadata}. - # This long-running operation will be automatically created by the system - # after the RestoreDatabase long-running operation completes successfully. - # This operation will not be created if the restore was not successful. - class RestoreDatabaseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the long-running operation used to track the progress - # of optimizations performed on a newly restored database. This long-running - # operation is automatically created by the system after the successful - # completion of a database restore, and cannot be cancelled. - # @!attribute [rw] name - # @return [::String] - # Name of the restored database being optimized. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress] - # The progress of the post-restore optimizations. - class OptimizeRestoredDatabaseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Cloud Spanner database role. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the database role. Values are of the form - # `projects//instances//databases//databaseRoles/` - # where `` is as specified in the `CREATE ROLE` DDL statement. - class DatabaseRole - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles ListDatabaseRoles}. - # @!attribute [rw] parent - # @return [::String] - # Required. The database whose roles should be listed. - # Values are of the form - # `projects//instances//databases/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of database roles to be returned in the response. If 0 or less, - # defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse ListDatabaseRolesResponse}. - class ListDatabaseRolesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles ListDatabaseRoles}. - # @!attribute [rw] database_roles - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>] - # Database roles that matched the request. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles ListDatabaseRoles} - # call to fetch more of the matching roles. - class ListDatabaseRolesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points AddSplitPoints}. - # @!attribute [rw] database - # @return [::String] - # Required. The database on whose tables/indexes split points are to be - # added. Values are of the form - # `projects//instances//databases/`. - # @!attribute [rw] split_points - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints>] - # Required. The split points to add. - # @!attribute [rw] initiator - # @return [::String] - # Optional. A user-supplied tag associated with the split points. - # For example, "intital_data_load", "special_event_1". - # Defaults to "CloudAddSplitPointsAPI" if not specified. - # The length of the tag must not exceed 50 characters,else will be trimmed. - # Only valid UTF8 characters are allowed. - class AddSplitPointsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points AddSplitPoints}. - class AddSplitPointsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The split points of a table/index. - # @!attribute [rw] table - # @return [::String] - # The table to split. - # @!attribute [rw] index - # @return [::String] - # The index to split. - # If specified, the `table` field must refer to the index's base table. - # @!attribute [rw] keys - # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints::Key>] - # Required. The list of split keys, i.e., the split boundaries. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The expiration timestamp of the split points. - # A timestamp in the past means immediate expiration. - # The maximum value can be 30 days in the future. - # Defaults to 10 days in the future if not specified. - class SplitPoints - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A split key. - # @!attribute [rw] key_parts - # @return [::Google::Protobuf::ListValue] - # Required. The column values making up the split key. - class Key - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Internal request proto, do not use directly. - # @!attribute [rw] database - # @return [::String] - # Internal field, do not use directly. - # @!attribute [rw] operation_id - # @return [::String] - # Internal field, do not use directly. - # @!attribute [rw] vm_identity_token - # @return [::String] - # Internal field, do not use directly. - # @!attribute [rw] progress - # @return [::Float] - # Internal field, do not use directly. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Internal field, do not use directly. - class InternalUpdateGraphOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Internal response proto, do not use directly. - class InternalUpdateGraphOperationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicates the type of the restore source. - module RestoreSourceType - # No restore associated. - TYPE_UNSPECIFIED = 0 - - # A backup was used as the source of the restore. - BACKUP = 1 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/Gemfile deleted file mode 100644 index 9f880b7cd501..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-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-spanner-admin-database-v1", path: "../" -else - gem "google-cloud-spanner-admin-database-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-spanner-admin-database-v1/snippets/database_admin/add_split_points.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/add_split_points.rb deleted file mode 100644 index b40f9ed68996..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/add_split_points.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the add_split_points call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points. -# -def add_split_points - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new - - # Call the add_split_points method. - result = client.add_split_points request - - # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb deleted file mode 100644 index 4f5d4e196698..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_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 spanner_v1_generated_DatabaseAdmin_CopyBackup_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the copy_backup call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup. -# -def copy_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new - - # Call the copy_backup method. - result = client.copy_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 spanner_v1_generated_DatabaseAdmin_CopyBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb deleted file mode 100644 index 7bdb66daafbb..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_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 spanner_v1_generated_DatabaseAdmin_CreateBackup_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the create_backup call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup. -# -def create_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new - - # Call the create_backup method. - result = client.create_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 spanner_v1_generated_DatabaseAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup_schedule.rb deleted file mode 100644 index 0e52ad4acecc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup_schedule.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_CreateBackupSchedule_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the create_backup_schedule call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup_schedule. -# -def create_backup_schedule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new - - # Call the create_backup_schedule method. - result = client.create_backup_schedule request - - # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_CreateBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb deleted file mode 100644 index 7071ecb8f557..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_CreateDatabase_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the create_database call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database. -# -def create_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new - - # Call the create_database method. - result = client.create_database request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_DatabaseAdmin_CreateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb deleted file mode 100644 index 4193a0014644..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_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 spanner_v1_generated_DatabaseAdmin_DeleteBackup_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the delete_backup call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup. -# -def delete_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new - - # Call the delete_backup method. - result = client.delete_backup request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup_schedule.rb deleted file mode 100644 index 60427f4241f3..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup_schedule.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_DeleteBackupSchedule_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the delete_backup_schedule call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup_schedule. -# -def delete_backup_schedule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new - - # Call the delete_backup_schedule method. - result = client.delete_backup_schedule request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_DeleteBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb deleted file mode 100644 index 7d960d68517c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_DropDatabase_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the drop_database call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database. -# -def drop_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new - - # Call the drop_database method. - result = client.drop_database request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_DropDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb deleted file mode 100644 index 45401693ebdb..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/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 spanner_v1_generated_DatabaseAdmin_GetBackup_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the get_backup call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup. -# -def get_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest.new - - # Call the get_backup method. - result = client.get_backup request - - # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup_schedule.rb deleted file mode 100644 index 29edea9a86fa..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup_schedule.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_GetBackupSchedule_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the get_backup_schedule call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup_schedule. -# -def get_backup_schedule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new - - # Call the get_backup_schedule method. - result = client.get_backup_schedule request - - # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_GetBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb deleted file mode 100644 index cee9d27e148b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_GetDatabase_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the get_database call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database. -# -def get_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new - - # Call the get_database method. - result = client.get_database request - - # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Database. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_GetDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb deleted file mode 100644 index 0bcdf7f40932..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the get_database_ddl call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl. -# -def get_database_ddl - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new - - # Call the get_database_ddl method. - result = client.get_database_ddl request - - # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb deleted file mode 100644 index ec196400f896..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_GetIamPolicy_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the get_iam_policy call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/internal_update_graph_operation.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/internal_update_graph_operation.rb deleted file mode 100644 index d28d071db2e0..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/internal_update_graph_operation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_InternalUpdateGraphOperation_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the internal_update_graph_operation call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#internal_update_graph_operation. -# -def internal_update_graph_operation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest.new - - # Call the internal_update_graph_operation method. - result = client.internal_update_graph_operation request - - # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_InternalUpdateGraphOperation_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb deleted file mode 100644 index aa01ffea3aca..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_ListBackupOperations_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the list_backup_operations call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations. -# -def list_backup_operations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new - - # Call the list_backup_operations method. - result = client.list_backup_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 -end -# [END spanner_v1_generated_DatabaseAdmin_ListBackupOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_schedules.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_schedules.rb deleted file mode 100644 index bbb680f5318f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_schedules.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 spanner_v1_generated_DatabaseAdmin_ListBackupSchedules_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the list_backup_schedules call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules. -# -def list_backup_schedules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.new - - # Call the list_backup_schedules method. - result = client.list_backup_schedules request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - p item - end -end -# [END spanner_v1_generated_DatabaseAdmin_ListBackupSchedules_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb deleted file mode 100644 index db27cb097f7c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/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 spanner_v1_generated_DatabaseAdmin_ListBackups_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the list_backups call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups. -# -def list_backups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::Backup. - p item - end -end -# [END spanner_v1_generated_DatabaseAdmin_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb deleted file mode 100644 index 2bc09405f027..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the list_database_operations call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations. -# -def list_database_operations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new - - # Call the list_database_operations method. - result = client.list_database_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 -end -# [END spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb deleted file mode 100644 index 0c3f79067aae..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.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 spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the list_database_roles call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles. -# -def list_database_roles - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new - - # Call the list_database_roles method. - result = client.list_database_roles request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole. - p item - end -end -# [END spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb deleted file mode 100644 index 6fc0fc085df9..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.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 spanner_v1_generated_DatabaseAdmin_ListDatabases_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the list_databases call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases. -# -def list_databases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new - - # Call the list_databases method. - result = client.list_databases request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Database. - p item - end -end -# [END spanner_v1_generated_DatabaseAdmin_ListDatabases_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb deleted file mode 100644 index 29fba6511896..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_RestoreDatabase_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the restore_database call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database. -# -def restore_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new - - # Call the restore_database method. - result = client.restore_database request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_DatabaseAdmin_RestoreDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb deleted file mode 100644 index c009dea6b085..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_SetIamPolicy_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the set_iam_policy call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb deleted file mode 100644 index 0758fe97ccf3..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_TestIamPermissions_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the test_iam_permissions call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb deleted file mode 100644 index 0d378479ff72..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_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 spanner_v1_generated_DatabaseAdmin_UpdateBackup_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the update_backup call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup. -# -def update_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new - - # Call the update_backup method. - result = client.update_backup request - - # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup_schedule.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup_schedule.rb deleted file mode 100644 index 25c121a40b2e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup_schedule.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_UpdateBackupSchedule_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the update_backup_schedule call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule. -# -def update_backup_schedule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new - - # Call the update_backup_schedule method. - result = client.update_backup_schedule request - - # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule. - p result -end -# [END spanner_v1_generated_DatabaseAdmin_UpdateBackupSchedule_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database.rb deleted file mode 100644 index 7e8b003939c4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_UpdateDatabase_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the update_database call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database. -# -def update_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new - - # Call the update_database method. - result = client.update_database request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_DatabaseAdmin_UpdateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb deleted file mode 100644 index 16bc289eab58..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_sync] -require "google/cloud/spanner/admin/database/v1" - -## -# Snippet for the update_database_ddl call in the DatabaseAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl. -# -def update_database_ddl - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new - - # Call the update_database_ddl method. - result = client.update_database_ddl request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json b/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json deleted file mode 100644 index 804d69497d76..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json +++ /dev/null @@ -1,1095 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-spanner-admin-database-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.spanner.admin.database.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_ListDatabases_sync", - "title": "Snippet for the list_databases call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases.", - "file": "database_admin/list_databases.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_databases", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "ListDatabases", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_CreateDatabase_sync", - "title": "Snippet for the create_database call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database.", - "file": "database_admin/create_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_database", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "CreateDatabase", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_GetDatabase_sync", - "title": "Snippet for the get_database call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database.", - "file": "database_admin/get_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_database", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::Database", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "GetDatabase", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_UpdateDatabase_sync", - "title": "Snippet for the update_database call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database.", - "file": "database_admin/update_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_database", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "UpdateDatabase", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_sync", - "title": "Snippet for the update_database_ddl call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl.", - "file": "database_admin/update_database_ddl.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_database_ddl", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "UpdateDatabaseDdl", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_DropDatabase_sync", - "title": "Snippet for the drop_database call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database.", - "file": "database_admin/drop_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "drop_database", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "DropDatabase", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_sync", - "title": "Snippet for the get_database_ddl call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl.", - "file": "database_admin/get_database_ddl.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_database_ddl", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "GetDatabaseDdl", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#set_iam_policy.", - "file": "database_admin/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.SetIamPolicy", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_iam_policy.", - "file": "database_admin/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetIamPolicy", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#test_iam_permissions.", - "file": "database_admin/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.TestIamPermissions", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_CreateBackup_sync", - "title": "Snippet for the create_backup call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup.", - "file": "database_admin/create_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_backup", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "CreateBackup", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_CopyBackup_sync", - "title": "Snippet for the copy_backup call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup.", - "file": "database_admin/copy_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "copy_backup", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "CopyBackup", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_GetBackup_sync", - "title": "Snippet for the get_backup call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup.", - "file": "database_admin/get_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::Backup", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "GetBackup", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetBackup", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_UpdateBackup_sync", - "title": "Snippet for the update_backup call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup.", - "file": "database_admin/update_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_backup", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::Backup", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "UpdateBackup", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_DeleteBackup_sync", - "title": "Snippet for the delete_backup call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup.", - "file": "database_admin/delete_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_backup", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "DeleteBackup", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_ListBackups_sync", - "title": "Snippet for the list_backups call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups.", - "file": "database_admin/list_backups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backups", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "ListBackups", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListBackups", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_RestoreDatabase_sync", - "title": "Snippet for the restore_database call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database.", - "file": "database_admin/restore_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_database", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "RestoreDatabase", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_sync", - "title": "Snippet for the list_database_operations call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations.", - "file": "database_admin/list_database_operations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_database_operations", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "ListDatabaseOperations", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_ListBackupOperations_sync", - "title": "Snippet for the list_backup_operations call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations.", - "file": "database_admin/list_backup_operations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backup_operations", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "ListBackupOperations", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_sync", - "title": "Snippet for the list_database_roles call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles.", - "file": "database_admin/list_database_roles.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_database_roles", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "ListDatabaseRoles", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync", - "title": "Snippet for the add_split_points call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points.", - "file": "database_admin/add_split_points.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_split_points", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#add_split_points", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "AddSplitPoints", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_CreateBackupSchedule_sync", - "title": "Snippet for the create_backup_schedule call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup_schedule.", - "file": "database_admin/create_backup_schedule.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_backup_schedule", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup_schedule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "CreateBackupSchedule", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_GetBackupSchedule_sync", - "title": "Snippet for the get_backup_schedule call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup_schedule.", - "file": "database_admin/get_backup_schedule.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup_schedule", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup_schedule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "GetBackupSchedule", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_UpdateBackupSchedule_sync", - "title": "Snippet for the update_backup_schedule call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule.", - "file": "database_admin/update_backup_schedule.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_backup_schedule", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup_schedule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "UpdateBackupSchedule", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_DeleteBackupSchedule_sync", - "title": "Snippet for the delete_backup_schedule call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup_schedule.", - "file": "database_admin/delete_backup_schedule.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_backup_schedule", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup_schedule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "DeleteBackupSchedule", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_ListBackupSchedules_sync", - "title": "Snippet for the list_backup_schedules call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules.", - "file": "database_admin/list_backup_schedules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backup_schedules", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_schedules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "ListBackupSchedules", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_DatabaseAdmin_InternalUpdateGraphOperation_sync", - "title": "Snippet for the internal_update_graph_operation call in the DatabaseAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#internal_update_graph_operation.", - "file": "database_admin/internal_update_graph_operation.rb", - "language": "RUBY", - "client_method": { - "short_name": "internal_update_graph_operation", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#internal_update_graph_operation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse", - "client": { - "short_name": "DatabaseAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client" - }, - "method": { - "short_name": "InternalUpdateGraphOperation", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin.InternalUpdateGraphOperation", - "service": { - "short_name": "DatabaseAdmin", - "full_name": "google.spanner.admin.database.v1.DatabaseAdmin" - } - } - }, - "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-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb deleted file mode 100644 index 835166633ef1..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_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/spanner/admin/database/v1/spanner_database_admin_pb" -require "google/spanner/admin/database/v1/spanner_database_admin_services_pb" -require "google/cloud/spanner/admin/database/v1/database_admin" - -class ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb deleted file mode 100644 index 5c96b14460f0..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_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 "gapic/grpc/service_stub" - -require "google/cloud/spanner/admin/database/v1/database_admin" - -class ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_path project: "value0", instance: "value1", backup: "value2" - assert_equal "projects/value0/instances/value1/backups/value2", path - end - end - - def test_backup_schedule_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_schedule_path project: "value0", instance: "value1", database: "value2", schedule: "value3" - assert_equal "projects/value0/instances/value1/databases/value2/backupSchedules/value3", 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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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_database_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.database_path project: "value0", instance: "value1", database: "value2" - assert_equal "projects/value0/instances/value1/databases/value2", path - end - end - - def test_instance_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_path project: "value0", instance: "value1" - assert_equal "projects/value0/instances/value1", path - end - end - - def test_instance_partition_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_partition_path project: "value0", instance: "value1", instance_partition: "value2" - assert_equal "projects/value0/instances/value1/instancePartitions/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb deleted file mode 100644 index 6e5024ac4a63..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb +++ /dev/null @@ -1,1548 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/spanner/admin/database/v1/spanner_database_admin_pb" -require "google/cloud/spanner/admin/database/v1/database_admin/rest" - - -class ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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_databases - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.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_databases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_databases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_databases_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_databases({ 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_databases 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_databases ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.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_databases({ 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_databases(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.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_databases_client_stub.call_count - end - end - end - - def test_create_database - # Create test objects. - 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" - create_statement = "hello world" - extra_statements = ["hello world"] - encryption_config = {} - database_dialect = :DATABASE_DIALECT_UNSPECIFIED - proto_descriptors = "hello world" - - create_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_create_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_database({ parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_database parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_database ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new(parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_database({ parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_database(::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new(parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_database_client_stub.call_count - end - end - end - - def test_get_database - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::Database.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_database({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_database name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_database ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_database({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_database(::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_database_client_stub.call_count - end - end - end - - def test_update_database - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - database = {} - update_mask = {} - - update_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_update_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_database({ database: database, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_database database: database, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_database ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_database({ database: database, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_database(::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new(database: database, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_database_client_stub.call_count - end - end - end - - def test_update_database_ddl - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - database = "hello world" - statements = ["hello world"] - operation_id = "hello world" - proto_descriptors = "hello world" - throughput_mode = true - - update_database_ddl_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_update_database_ddl_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_database_ddl_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_database_ddl({ database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_database_ddl database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_database_ddl ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new(database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_database_ddl({ database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_database_ddl(::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new(database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_database_ddl_client_stub.call_count - end - end - end - - def test_drop_database - # 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. - database = "hello world" - - drop_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_drop_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, drop_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.drop_database({ database: database }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.drop_database database: database do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.drop_database ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new(database: database) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.drop_database({ database: database }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.drop_database(::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new(database: database), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, drop_database_client_stub.call_count - end - end - end - - def test_get_database_ddl - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - database = "hello world" - - get_database_ddl_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_database_ddl_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_database_ddl_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_database_ddl({ database: database }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_database_ddl database: database do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_database_ddl ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new(database: database) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_database_ddl({ database: database }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_database_ddl(::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new(database: database), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_database_ddl_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_create_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. - parent = "hello world" - backup_id = "hello world" - backup = {} - encryption_config = {} - - create_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_create_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_backup_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_backup parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_backup ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_backup(::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_backup_client_stub.call_count - end - end - end - - def test_copy_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. - parent = "hello world" - backup_id = "hello world" - source_backup = "hello world" - expire_time = {} - encryption_config = {} - - copy_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_copy_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, copy_backup_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.copy_backup({ parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.copy_backup parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.copy_backup ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new(parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.copy_backup({ parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.copy_backup(::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new(parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, copy_backup_client_stub.call_count - end - end - end - - def test_get_backup - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::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::Spanner::Admin::Database::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_update_backup - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::Backup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - backup = {} - update_mask = {} - - update_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_update_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_backup_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_backup({ backup: backup, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_backup backup: backup, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_backup ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new(backup: backup, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_backup({ backup: backup, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_backup(::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new(backup: backup, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_backup_client_stub.call_count - end - end - end - - def test_delete_backup - # 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_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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_backup({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_backup name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_backup({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new(name: name), 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_list_backups - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - 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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backups({ parent: parent, 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.list_backups parent: parent, 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.list_backups ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new(parent: parent, 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.list_backups({ parent: parent, 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.list_backups(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new(parent: parent, 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, list_backups_client_stub.call_count - end - end - end - - def test_restore_database - # Create test objects. - 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" - database_id = "hello world" - backup = "hello world" - encryption_config = {} - - restore_database_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_restore_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, restore_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.restore_database({ parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.restore_database parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.restore_database ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.restore_database({ parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.restore_database(::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, restore_database_client_stub.call_count - end - end - end - - def test_list_database_operations - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_database_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_database_operations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_database_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_database_operations({ parent: parent, 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.list_database_operations parent: parent, 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.list_database_operations ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new(parent: parent, 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.list_database_operations({ parent: parent, 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.list_database_operations(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new(parent: parent, 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, list_database_operations_client_stub.call_count - end - end - end - - def test_list_backup_operations - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_backup_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_backup_operations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backup_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backup_operations({ parent: parent, 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.list_backup_operations parent: parent, 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.list_backup_operations ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new(parent: parent, 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.list_backup_operations({ parent: parent, 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.list_backup_operations(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new(parent: parent, 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, list_backup_operations_client_stub.call_count - end - end - end - - def test_list_database_roles - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse.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_database_roles_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_database_roles_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_database_roles_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_database_roles({ 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_database_roles 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_database_roles ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.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_database_roles({ 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_database_roles(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.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_database_roles_client_stub.call_count - end - end - end - - def test_add_split_points - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - database = "hello world" - split_points = [{}] - initiator = "hello world" - - add_split_points_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_add_split_points_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_split_points_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_split_points({ database: database, split_points: split_points, initiator: initiator }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_split_points database: database, split_points: split_points, initiator: initiator do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_split_points ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new(database: database, split_points: split_points, initiator: initiator) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_split_points({ database: database, split_points: split_points, initiator: initiator }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_split_points(::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new(database: database, split_points: split_points, initiator: initiator), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_split_points_client_stub.call_count - end - end - end - - def test_create_backup_schedule - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - backup_schedule_id = "hello world" - backup_schedule = {} - - create_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_create_backup_schedule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_backup_schedule({ parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_backup_schedule parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_backup_schedule({ parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_backup_schedule_client_stub.call_count - end - end - end - - def test_get_backup_schedule - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_get_backup_schedule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_backup_schedule({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_backup_schedule name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_backup_schedule({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_backup_schedule_client_stub.call_count - end - end - end - - def test_update_backup_schedule - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - backup_schedule = {} - update_mask = {} - - update_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_update_backup_schedule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_backup_schedule backup_schedule: backup_schedule, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_backup_schedule_client_stub.call_count - end - end - end - - def test_delete_backup_schedule - # 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_backup_schedule_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_delete_backup_schedule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_backup_schedule({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_backup_schedule name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_backup_schedule({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_backup_schedule_client_stub.call_count - end - end - end - - def test_list_backup_schedules - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse.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_schedules_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::ServiceStub.stub :transcode_list_backup_schedules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backup_schedules_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backup_schedules({ 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_schedules 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_schedules ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.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_schedules({ 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_schedules(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.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_schedules_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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb deleted file mode 100644 index 6e2f29620c73..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb +++ /dev/null @@ -1,1843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/spanner/admin/database/v1/spanner_database_admin_pb" -require "google/cloud/spanner/admin/database/v1/database_admin" - -class ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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_databases - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_databases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_databases, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, 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_databases_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_databases({ parent: parent, page_size: page_size, page_token: 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_databases parent: parent, page_size: page_size, page_token: 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_databases ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.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_databases({ parent: parent, page_size: page_size, page_token: page_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_databases(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.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_databases_client_stub.call_rpc_count - end - end - - def test_create_database - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - create_statement = "hello world" - extra_statements = ["hello world"] - encryption_config = {} - database_dialect = :DATABASE_DIALECT_UNSPECIFIED - proto_descriptors = "hello world" - - create_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_database, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["create_statement"] - assert_equal ["hello world"], request["extra_statements"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig), request["encryption_config"] - assert_equal :DATABASE_DIALECT_UNSPECIFIED, request["database_dialect"] - assert_equal "hello world", request["proto_descriptors"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_database({ parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors }) do |response, 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_database parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors do |response, 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_database ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new(parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors) do |response, operation| - assert_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_database({ parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors }, grpc_options) do |response, operation| - assert_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_database(::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new(parent: parent, create_statement: create_statement, extra_statements: extra_statements, encryption_config: encryption_config, database_dialect: database_dialect, proto_descriptors: proto_descriptors), grpc_options) do |response, operation| - assert_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_database_client_stub.call_rpc_count - end - end - - def test_get_database - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::Database.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_database, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_database({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_database name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_database ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_database({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_database(::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_database_client_stub.call_rpc_count - end - end - - def test_update_database - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = {} - update_mask = {} - - update_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_database, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::Database), request["database"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_database({ database: database, 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_database database: database, 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_database ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new(database: database, 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_database({ database: database, 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_database(::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest.new(database: database, 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_database_client_stub.call_rpc_count - end - end - - def test_update_database_ddl - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - statements = ["hello world"] - operation_id = "hello world" - proto_descriptors = "hello world" - throughput_mode = true - - update_database_ddl_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_database_ddl, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, request - assert_equal "hello world", request["database"] - assert_equal ["hello world"], request["statements"] - assert_equal "hello world", request["operation_id"] - assert_equal "hello world", request["proto_descriptors"] - assert_equal true, request["throughput_mode"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_database_ddl_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_database_ddl({ database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_database_ddl database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_database_ddl ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new(database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_database_ddl({ database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_database_ddl(::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new(database: database, statements: statements, operation_id: operation_id, proto_descriptors: proto_descriptors, throughput_mode: throughput_mode), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_database_ddl_client_stub.call_rpc_count - end - end - - def test_drop_database - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - - drop_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :drop_database, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, request - assert_equal "hello world", request["database"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, drop_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.drop_database({ database: database }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.drop_database database: database do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.drop_database ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new(database: database) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.drop_database({ database: database }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.drop_database(::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new(database: database), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, drop_database_client_stub.call_rpc_count - end - end - - def test_get_database_ddl - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - - get_database_ddl_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_database_ddl, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, request - assert_equal "hello world", request["database"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_database_ddl_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_database_ddl({ database: database }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_database_ddl database: database do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_database_ddl ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new(database: database) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_database_ddl({ database: database }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_database_ddl(::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new(database: database), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_database_ddl_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_create_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. - parent = "hello world" - backup_id = "hello world" - backup = {} - encryption_config = {} - - create_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_backup, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["backup_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::Backup), request["backup"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig), request["encryption_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_backup_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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.create_backup parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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.create_backup ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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.create_backup({ parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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.create_backup(::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, encryption_config: encryption_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, create_backup_client_stub.call_rpc_count - end - end - - def test_copy_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. - parent = "hello world" - backup_id = "hello world" - source_backup = "hello world" - expire_time = {} - encryption_config = {} - - copy_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :copy_backup, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["backup_id"] - assert_equal "hello world", request["source_backup"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["expire_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig), request["encryption_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, copy_backup_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.copy_backup({ parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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.copy_backup parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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.copy_backup ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new(parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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.copy_backup({ parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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.copy_backup(::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new(parent: parent, backup_id: backup_id, source_backup: source_backup, expire_time: expire_time, encryption_config: encryption_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, copy_backup_client_stub.call_rpc_count - end - end - - def test_get_backup - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::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::Spanner::Admin::Database::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::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::Spanner::Admin::Database::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_update_backup - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::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. - backup = {} - update_mask = {} - - update_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_backup, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::Backup), request["backup"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_backup_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_backup({ backup: backup, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_backup backup: backup, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_backup ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new(backup: backup, 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_backup({ backup: backup, 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_backup(::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new(backup: backup, 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_backup_client_stub.call_rpc_count - end - end - - def test_delete_backup - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_backup, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_backup({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_backup name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_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.delete_backup(::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new(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_backup_client_stub.call_rpc_count - end - end - - def test_list_backups - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::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" - filter = "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::Spanner::Admin::Database::V1::ListBackupsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backups({ parent: parent, 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.list_backups parent: parent, 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.list_backups ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new(parent: parent, 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.list_backups({ parent: parent, 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.list_backups(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new(parent: parent, 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, list_backups_client_stub.call_rpc_count - end - end - - def test_restore_database - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - database_id = "hello world" - backup = "hello world" - encryption_config = {} - - restore_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :restore_database, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["database_id"] - assert_equal "hello world", request["backup"] - assert_equal :backup, request.source - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig), request["encryption_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, restore_database_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.restore_database({ parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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.restore_database parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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.restore_database ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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.restore_database({ parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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.restore_database(::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new(parent: parent, database_id: database_id, backup: backup, encryption_config: encryption_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, restore_database_client_stub.call_rpc_count - end - end - - def test_list_database_operations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_database_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_database_operations, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_database_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_database_operations({ parent: parent, 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.list_database_operations parent: parent, 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.list_database_operations ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new(parent: parent, 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.list_database_operations({ parent: parent, 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.list_database_operations(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new(parent: parent, 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, list_database_operations_client_stub.call_rpc_count - end - end - - def test_list_backup_operations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_backup_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backup_operations, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_backup_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backup_operations({ parent: parent, 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.list_backup_operations parent: parent, 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.list_backup_operations ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new(parent: parent, 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.list_backup_operations({ parent: parent, 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.list_backup_operations(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new(parent: parent, 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, list_backup_operations_client_stub.call_rpc_count - end - end - - def test_list_database_roles - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_database_roles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_database_roles, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, 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_database_roles_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_database_roles({ parent: parent, page_size: page_size, page_token: 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_database_roles parent: parent, page_size: page_size, page_token: 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_database_roles ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.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_database_roles({ parent: parent, page_size: page_size, page_token: page_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_database_roles(::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.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_database_roles_client_stub.call_rpc_count - end - end - - def test_add_split_points - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - split_points = [{}] - initiator = "hello world" - - add_split_points_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_split_points, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest, request - assert_equal "hello world", request["database"] - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::SplitPoints, request["split_points"].first - assert_equal "hello world", request["initiator"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_split_points_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_split_points({ database: database, split_points: split_points, initiator: initiator }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_split_points database: database, split_points: split_points, initiator: initiator do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_split_points ::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new(database: database, split_points: split_points, initiator: initiator) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_split_points({ database: database, split_points: split_points, initiator: initiator }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_split_points(::Google::Cloud::Spanner::Admin::Database::V1::AddSplitPointsRequest.new(database: database, split_points: split_points, initiator: initiator), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_split_points_client_stub.call_rpc_count - end - end - - def test_create_backup_schedule - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - backup_schedule_id = "hello world" - backup_schedule = {} - - create_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_backup_schedule, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["backup_schedule_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule), request["backup_schedule"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_backup_schedule({ parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_backup_schedule parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_backup_schedule({ parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new(parent: parent, backup_schedule_id: backup_schedule_id, backup_schedule: backup_schedule), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_backup_schedule_client_stub.call_rpc_count - end - end - - def test_get_backup_schedule - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = 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_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_backup_schedule, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_backup_schedule({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_backup_schedule name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.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_schedule({ name: 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_schedule(::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new(name: 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_schedule_client_stub.call_rpc_count - end - end - - def test_update_backup_schedule - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - backup_schedule = {} - update_mask = {} - - update_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_backup_schedule, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule), request["backup_schedule"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_backup_schedule({ backup_schedule: backup_schedule, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_backup_schedule backup_schedule: backup_schedule, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, 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_backup_schedule({ backup_schedule: backup_schedule, 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_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new(backup_schedule: backup_schedule, 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_backup_schedule_client_stub.call_rpc_count - end - end - - def test_delete_backup_schedule - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_backup_schedule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_backup_schedule, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_backup_schedule_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_backup_schedule({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_backup_schedule name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_backup_schedule ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_backup_schedule({ 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_backup_schedule(::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new(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_backup_schedule_client_stub.call_rpc_count - end - end - - def test_list_backup_schedules - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_schedules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backup_schedules, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, 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_schedules_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backup_schedules({ parent: parent, page_size: page_size, page_token: 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_schedules parent: parent, page_size: page_size, page_token: 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_schedules ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.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_schedules({ parent: parent, page_size: page_size, page_token: page_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_schedules(::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.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_schedules_client_stub.call_rpc_count - end - end - - def test_internal_update_graph_operation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - operation_id = "hello world" - vm_identity_token = "hello world" - progress = 3.5 - status = {} - - internal_update_graph_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :internal_update_graph_operation, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest, request - assert_equal "hello world", request["database"] - assert_equal "hello world", request["operation_id"] - assert_equal "hello world", request["vm_identity_token"] - assert_equal 3.5, request["progress"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Rpc::Status), request["status"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, internal_update_graph_operation_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.internal_update_graph_operation({ database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.internal_update_graph_operation database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.internal_update_graph_operation ::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest.new(database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.internal_update_graph_operation({ database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.internal_update_graph_operation(::Google::Cloud::Spanner::Admin::Database::V1::InternalUpdateGraphOperationRequest.new(database: database, operation_id: operation_id, vm_identity_token: vm_identity_token, progress: progress, status: status), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, internal_update_graph_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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::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::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-database-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json deleted file mode 100644 index f5020bbedc04..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "spanner.googleapis.com", - "api_shortname": "spanner", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-instance-v1/latest", - "distribution_name": "google-cloud-spanner-admin-instance-v1", - "is_cloud": true, - "language": "ruby", - "name": "spanner", - "name_pretty": "Cloud Spanner Instance Admin V1 API", - "product_documentation": "https://cloud.google.com/spanner", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-admin-instance-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SPANNER", - "ruby-cloud-product-url": "https://cloud.google.com/spanner", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml deleted file mode 100644 index d1a683d9ac76..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts deleted file mode 100644 index 5a169a006a69..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Spanner Instance Admin 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-spanner-admin-instance-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md deleted file mode 100644 index cfb0ca7fb54f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-spanner-admin-instance-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-spanner-admin-instance-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/spanner/admin/instance/v1" - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/spanner/admin/instance/v1" - -::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-spanner-admin-instance-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/spanner/admin/instance/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-spanner-admin-instance-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/README.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md deleted file mode 100644 index b579b9d0f741..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Spanner Instance Admin V1 API - -Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. - - -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 Spanner Instance Admin V1 API. Most users should consider using -the main client gem, -[google-cloud-spanner](https://rubygems.org/gems/google-cloud-spanner). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-spanner-admin-instance-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/spanner.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/spanner/admin/instance/v1" - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -request = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new # (request fields as keyword arguments...) -response = client.list_instance_configs request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-instance-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/spanner) -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/spanner/admin/instance/v1" -require "logger" - -client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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-spanner`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-spanner-admin-instance-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-spanner`. -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-spanner-admin-instance-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-spanner-admin-instance-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/Rakefile deleted file mode 100644 index ec4f0e71b11c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SPANNER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SPANNER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SPANNER_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 SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SPANNER_PROJECT"] = project - ENV["SPANNER_TEST_PROJECT"] = project - ENV["SPANNER_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-spanner-admin-instance-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-spanner-admin-instance-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-spanner-admin-instance-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-spanner-admin-instance-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-spanner-admin-instance-v1" - header "google-cloud-spanner-admin-instance-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-spanner-admin-instance-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-spanner-admin-instance-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-spanner-admin-instance-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-spanner-admin-instance-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-spanner-admin-instance-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json deleted file mode 100644 index 2e44d0f21e72..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/gapic_metadata.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.spanner.admin.instance.v1", - "libraryPackage": "::Google::Cloud::Spanner::Admin::Instance::V1", - "services": { - "InstanceAdmin": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client", - "rpcs": { - "ListInstanceConfigs": { - "methods": [ - "list_instance_configs" - ] - }, - "GetInstanceConfig": { - "methods": [ - "get_instance_config" - ] - }, - "CreateInstanceConfig": { - "methods": [ - "create_instance_config" - ] - }, - "UpdateInstanceConfig": { - "methods": [ - "update_instance_config" - ] - }, - "DeleteInstanceConfig": { - "methods": [ - "delete_instance_config" - ] - }, - "ListInstanceConfigOperations": { - "methods": [ - "list_instance_config_operations" - ] - }, - "ListInstances": { - "methods": [ - "list_instances" - ] - }, - "ListInstancePartitions": { - "methods": [ - "list_instance_partitions" - ] - }, - "GetInstance": { - "methods": [ - "get_instance" - ] - }, - "CreateInstance": { - "methods": [ - "create_instance" - ] - }, - "UpdateInstance": { - "methods": [ - "update_instance" - ] - }, - "DeleteInstance": { - "methods": [ - "delete_instance" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "GetInstancePartition": { - "methods": [ - "get_instance_partition" - ] - }, - "CreateInstancePartition": { - "methods": [ - "create_instance_partition" - ] - }, - "DeleteInstancePartition": { - "methods": [ - "delete_instance_partition" - ] - }, - "UpdateInstancePartition": { - "methods": [ - "update_instance_partition" - ] - }, - "ListInstancePartitionOperations": { - "methods": [ - "list_instance_partition_operations" - ] - }, - "MoveInstance": { - "methods": [ - "move_instance" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec deleted file mode 100644 index fdf1af7548a0..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/google-cloud-spanner-admin-instance-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/spanner/admin/instance/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-spanner-admin-instance-v1" - gem.version = Google::Cloud::Spanner::Admin::Instance::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-admin-instance-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details." - gem.summary = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-v1.rb deleted file mode 100644 index 31e76b3589b3..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google-cloud-spanner-admin-instance-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/spanner/admin/instance/v1" diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.rb deleted file mode 100644 index 36a77f21a4d3..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1.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 "google/cloud/spanner/admin/instance/v1/instance_admin" -require "google/cloud/spanner/admin/instance/v1/version" - -module Google - module Cloud - module Spanner - module Admin - module Instance - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/spanner/admin/instance/v1" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/spanner/admin/instance/v1" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - module V1 - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/spanner/admin/instance/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.rb deleted file mode 100644 index 80c300501ca9..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin.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! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/spanner/admin/instance/v1/version" - -require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" -require "google/cloud/spanner/admin/instance/v1/instance_admin/paths" -require "google/cloud/spanner/admin/instance/v1/instance_admin/operations" -require "google/cloud/spanner/admin/instance/v1/instance_admin/client" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - ## - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/spanner/admin/instance/v1/instance_admin" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - module InstanceAdmin - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "instance_admin", "helpers.rb" -require "google/cloud/spanner/admin/instance/v1/instance_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb deleted file mode 100644 index abf931465381..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb +++ /dev/null @@ -1,3140 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/spanner/admin/instance/v1/spanner_instance_admin_pb" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - ## - # Client for the InstanceAdmin service. - # - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :instance_admin_stub - - ## - # Configure the InstanceAdmin Client class. - # - # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all InstanceAdmin clients - # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Spanner", "Admin", "Instance", "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_instance_configs.timeout = 3600.0 - default_config.rpcs.list_instance_configs.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_instance_config.timeout = 3600.0 - default_config.rpcs.get_instance_config.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_instances.timeout = 3600.0 - default_config.rpcs.list_instances.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_instance.timeout = 3600.0 - default_config.rpcs.get_instance.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_instance.timeout = 3600.0 - - default_config.rpcs.update_instance.timeout = 3600.0 - - default_config.rpcs.delete_instance.timeout = 3600.0 - default_config.rpcs.delete_instance.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.set_iam_policy.timeout = 30.0 - - default_config.rpcs.get_iam_policy.timeout = 30.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.test_iam_permissions.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the InstanceAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @instance_admin_stub.universe_domain - end - - ## - # Create a new InstanceAdmin client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the InstanceAdmin 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/spanner/admin/instance/v1/spanner_instance_admin_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 - - @instance_admin_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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 - ) - - @instance_admin_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::Spanner::Admin::Instance::V1::InstanceAdmin::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @instance_admin_stub.logger - end - - # Service calls - - ## - # Lists the supported instance configurations for a given project. - # - # Returns both Google-managed configurations and user-managed - # configurations. - # - # @overload list_instance_configs(request, options = nil) - # Pass arguments to `list_instance_configs` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_instance_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instance_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project for which a list of supported instance - # configurations is requested. Values are of the form - # `projects/`. - # @param page_size [::Integer] - # Number of instance configurations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new - # - # # Call the list_instance_configs method. - # result = client.list_instance_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - # p item - # end - # - def list_instance_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_instance_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_instance_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instance_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instance_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a particular instance configuration. - # - # @overload get_instance_config(request, options = nil) - # Pass arguments to `get_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_instance_config(name: nil) - # Pass arguments to `get_instance_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the requested instance configuration. Values are of - # the form `projects//instanceConfigs/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new - # - # # Call the get_instance_config method. - # result = client.get_instance_config request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - # p result - # - def get_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_instance_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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_instance_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :get_instance_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an instance configuration and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance configuration. The instance configuration name is assigned by the - # caller. If the named instance configuration already exists, - # `CreateInstanceConfig` returns `ALREADY_EXISTS`. - # - # Immediately after the request returns: - # - # * The instance configuration is readable via the API, with all requested - # attributes. The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field is set to true. Its state is `CREATING`. - # - # While the operation is pending: - # - # * Cancelling the operation renders the instance configuration immediately - # unreadable via the API. - # * Except for deleting the creating resource, all other attempts to modify - # the instance configuration are rejected. - # - # Upon completion of the returned operation: - # - # * Instances can be created using the instance configuration. - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field becomes false. Its state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # creation of the instance configuration. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if - # successful. - # - # Authorization requires `spanner.instanceConfigs.create` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest#parent parent}. - # - # @overload create_instance_config(request, options = nil) - # Pass arguments to `create_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil) - # Pass arguments to `create_instance_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project in which to create the instance - # configuration. Values are of the form `projects/`. - # @param instance_config_id [::String] - # Required. The ID of the instance configuration to create. Valid identifiers - # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. The `custom-` prefix is required to avoid name - # conflicts with Google-managed configurations. - # @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] - # Required. The `InstanceConfig` proto of the configuration to create. - # `instance_config.name` must be - # `/instanceConfigs/`. - # `instance_config.base_config` must be a Google-managed configuration name, - # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new - # - # # Call the create_instance_config method. - # result = client.create_instance_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_instance_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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_instance_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :create_instance_config, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 an instance configuration. The returned - # long-running operation can be used to track - # the progress of updating the instance. If the named instance configuration - # does not exist, returns `NOT_FOUND`. - # - # Only user-managed configurations can be updated. - # - # Immediately after the request returns: - # - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field is set to true. - # - # While the operation is pending: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}. - # The operation is guaranteed to succeed at undoing all changes, after - # which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance configuration are rejected. - # * Reading the instance configuration via the API continues to give the - # pre-request values. - # - # Upon completion of the returned operation: - # - # * Creating instances using the instance configuration uses the new - # values. - # * The new values of the instance configuration are readable via the API. - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field becomes false. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # the instance configuration modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if - # successful. - # - # Authorization requires `spanner.instanceConfigs.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. - # - # @overload update_instance_config(request, options = nil) - # Pass arguments to `update_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_instance_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 instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] - # Required. The user instance configuration to update, which must always - # include the instance configuration name. Otherwise, only fields mentioned - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} - # need be included. To prevent conflicts of concurrent updates, - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can - # be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be - # updated. The field mask must always be specified; this prevents any future - # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} - # from being erased accidentally by clients that do not know about them. Only - # display_name and labels can be updated. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new - # - # # Call the update_instance_config method. - # result = client.update_instance_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_instance_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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.instance_config&.name - header_params["instance_config.name"] = request.instance_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_instance_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :update_instance_config, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 the instance configuration. Deletion is only allowed when no - # instances are using the configuration. If any instances are using - # the configuration, returns `FAILED_PRECONDITION`. - # - # Only user-managed configurations can be deleted. - # - # Authorization requires `spanner.instanceConfigs.delete` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. - # - # @overload delete_instance_config(request, options = nil) - # Pass arguments to `delete_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_instance_config(name: nil, etag: nil, validate_only: nil) - # Pass arguments to `delete_instance_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the instance configuration to be deleted. - # Values are of the form - # `projects//instanceConfigs/` - # @param etag [::String] - # Used for optimistic concurrency control as a way to help prevent - # simultaneous deletes of an instance configuration from overwriting each - # other. If not empty, the API - # only deletes the instance configuration when the etag provided matches the - # current status of the requested instance configuration. Otherwise, deletes - # the instance configuration without checking the current status of the - # requested instance configuration. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new - # - # # Call the delete_instance_config method. - # result = client.delete_instance_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_instance_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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_instance_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :delete_instance_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the user-managed instance configuration long-running - # operations in the given project. An instance - # configuration operation has a name of the form - # `projects//instanceConfigs//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting - # from the most recently started operation. - # - # @overload list_instance_config_operations(request, options = nil) - # Pass arguments to `list_instance_config_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instance_config_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project of the instance configuration operations. - # Values are of the form `projects/`. - # @param filter [::String] - # An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - # AND` \ - # `(metadata.instance_config.name:custom-config) AND` \ - # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # * The instance configuration name contains "custom-config". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} - # to the same `parent` and with the same `filter`. - # - # @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/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new - # - # # Call the list_instance_config_operations method. - # result = client.list_instance_config_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_instance_config_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_instance_config_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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_instance_config_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instance_config_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instance_config_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_config_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 - - ## - # Lists all instances in the given project. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, instance_deadline: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project for which a list of instances is - # requested. Values are of the form `projects/`. - # @param page_size [::Integer] - # Number of instances to be returned in the response. If 0 or less, defaults - # to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # @param filter [::String] - # An expression for filtering the results of the request. Filter rules are - # case insensitive. The fields eligible for filtering are: - # - # * `name` - # * `display_name` - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `name:*` --> The instance has a name. - # * `name:Howl` --> The instance's name contains the string "howl". - # * `name:HOWL` --> Equivalent to above. - # * `NAME:howl` --> Equivalent to above. - # * `labels.env:*` --> The instance has the label "env". - # * `labels.env:dev` --> The instance has the label "env" and the value of - # the label contains the string "dev". - # * `name:howl labels.env:dev` --> The instance's name contains "howl" and - # it has the label "env" with its value - # containing "dev". - # @param instance_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Deadline used while retrieving metadata for instances. - # Instances whose metadata cannot be retrieved within this deadline will be - # added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_instances.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instances, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instances, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all instance partitions for the given instance. - # - # @overload list_instance_partitions(request, options = nil) - # Pass arguments to `list_instance_partitions` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_instance_partitions(parent: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) - # Pass arguments to `list_instance_partitions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The instance whose instance partitions should be listed. Values - # are of the form `projects//instances/`. Use `{instance} - # = '-'` to list instance partitions for all Instances in a project, e.g., - # `projects/myproject/instances/-`. - # @param page_size [::Integer] - # Number of instance partitions to be returned in the response. If 0 or less, - # defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Deadline used while retrieving metadata for instance partitions. - # Instance partitions whose metadata cannot be retrieved within this deadline - # will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new - # - # # Call the list_instance_partitions method. - # result = client.list_instance_partitions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. - # p item - # end - # - def list_instance_partitions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_instance_partitions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_instance_partitions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instance_partitions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instance_partitions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, request, response, 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 information about a particular instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_instance(name: nil, field_mask: nil) - # Pass arguments to `get_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the requested instance. Values are of the form - # `projects//instances/`. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # If field_mask is present, specifies the subset of - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be - # returned. If absent, all - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :get_instance, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an instance and begins preparing it to begin serving. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance. The instance name is assigned by the caller. If the - # named instance already exists, `CreateInstance` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance is readable via the API, with all requested attributes - # but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance immediately unreadable - # via the API. - # * The instance can be deleted. - # * All other attempts to modify the instance are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can be created in the instance. - # * The instance's allocated resource levels are readable via the API. - # * The instance's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track creation of the instance. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata CreateInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_instance(parent: nil, instance_id: nil, instance: nil) - # Pass arguments to `create_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project in which to create the instance. Values - # are of the form `projects/`. - # @param instance_id [::String] - # Required. The ID of the instance to create. Valid identifiers are of the - # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in - # length. - # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] - # Required. The instance to create. The name may be omitted, but if - # specified must be `/instances/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :create_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an instance, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance. If the named instance does not - # exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance's allocation - # has been requested, billing is based on the newly-requested level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time}, - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance are rejected. - # * Reading the instance via the API continues to give the pre-request - # resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance's - # tables. - # * The instance's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track the instance modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata UpdateInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. - # - # Authorization requires `spanner.instances.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance#name name}. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_instance(instance: nil, field_mask: nil) - # Pass arguments to `update_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] - # Required. The instance to update, which must always include the instance - # name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} - # need be included. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. - # The field mask must always be specified; this prevents any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased - # accidentally by clients that do not know about them. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new - # - # # Call the update_instance method. - # result = client.update_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.instance&.name - header_params["instance.name"] = request.instance.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :update_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an instance. - # - # Immediately upon completion of the request: - # - # * Billing ceases for all of the instance's reserved resources. - # - # Soon afterward: - # - # * The instance and *all of its databases* immediately and - # irrevocably disappear from the API. All data in the databases - # is permanently deleted. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_instance(name: nil) - # Pass arguments to `delete_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the instance to be deleted. Values are of the form - # `projects//instances/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :delete_instance, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on an instance resource. Replaces any - # existing policy. - # - # Authorization requires `spanner.instances.setIamPolicy` on - # [resource][google.iam.v1.SetIamPolicyRequest.resource]. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for an instance resource. Returns an empty - # policy if an instance exists but does not have a policy set. - # - # Authorization requires `spanner.instances.getIamPolicy` on - # [resource][google.iam.v1.GetIamPolicyRequest.resource]. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that the caller has on the specified instance resource. - # - # Attempting this RPC on a non-existent Cloud Spanner instance resource will - # result in a NOT_FOUND error if the user has `spanner.instances.list` - # permission on the containing Google Cloud Project. Otherwise returns an - # empty set of permissions. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a particular instance partition. - # - # @overload get_instance_partition(request, options = nil) - # Pass arguments to `get_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_instance_partition(name: nil) - # Pass arguments to `get_instance_partition` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance partition. Values are of - # the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new - # - # # Call the get_instance_partition method. - # result = client.get_instance_partition request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. - # p result - # - def get_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_instance_partition.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :get_instance_partition, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an instance partition and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new instance partition. - # The instance partition name is assigned by the caller. If the named - # instance partition already exists, `CreateInstancePartition` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance partition is readable via the API, with all requested - # attributes but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance partition immediately - # unreadable via the API. - # * The instance partition can be deleted. - # * All other attempts to modify the instance partition are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can start using this instance partition. - # * The instance partition's allocated resource levels are readable via the - # API. - # * The instance partition's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track creation of the instance partition. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if - # successful. - # - # @overload create_instance_partition(request, options = nil) - # Pass arguments to `create_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_instance_partition(parent: nil, instance_partition_id: nil, instance_partition: nil) - # Pass arguments to `create_instance_partition` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance in which to create the instance - # partition. Values are of the form - # `projects//instances/`. - # @param instance_partition_id [::String] - # Required. The ID of the instance partition to create. Valid identifiers are - # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. - # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] - # Required. The instance partition to create. The instance_partition.name may - # be omitted, but if specified must be - # `/instancePartitions/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new - # - # # Call the create_instance_partition method. - # result = client.create_instance_partition request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_instance_partition.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :create_instance_partition, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing instance partition. Requires that the - # instance partition is not used by any database or backup and is not the - # default instance partition of an instance. - # - # Authorization requires `spanner.instancePartitions.delete` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. - # - # @overload delete_instance_partition(request, options = nil) - # Pass arguments to `delete_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_instance_partition(name: nil, etag: nil) - # Pass arguments to `delete_instance_partition` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance partition to be deleted. - # Values are of the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - # @param etag [::String] - # Optional. If not empty, the API only deletes the instance partition when - # the etag provided matches the current status of the requested instance - # partition. Otherwise, deletes the instance partition without checking the - # current status of the requested instance partition. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new - # - # # Call the delete_instance_partition method. - # result = client.delete_instance_partition request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_instance_partition.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :delete_instance_partition, request, 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 instance partition, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance partition. If the named instance - # partition does not exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance partition's - # allocation has been requested, billing is based on the newly-requested - # level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata#cancel_time cancel_time}, - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance partition are rejected. - # * Reading the instance partition via the API continues to give the - # pre-request resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance - # partition's tables. - # * The instance partition's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track the instance partition modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata UpdateInstancePartitionMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if - # successful. - # - # Authorization requires `spanner.instancePartitions.update` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. - # - # @overload update_instance_partition(request, options = nil) - # Pass arguments to `update_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_instance_partition(instance_partition: nil, field_mask: nil) - # Pass arguments to `update_instance_partition` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] - # Required. The instance partition to update, which must always include the - # instance partition name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} - # need be included. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # should be updated. The field mask must always be specified; this prevents - # any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # from being erased accidentally by clients that do not know about them. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new - # - # # Call the update_instance_partition method. - # result = client.update_instance_partition request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.instance_partition&.name - header_params["instance_partition.name"] = request.instance_partition.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_instance_partition.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :update_instance_partition, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 instance partition long-running operations in the given instance. - # An instance partition operation has a name of the form - # `projects//instances//instancePartitions//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting from the - # most recently started operation. - # - # Authorization requires `spanner.instancePartitionOperations.list` - # permission on the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#parent parent}. - # - # @overload list_instance_partition_operations(request, options = nil) - # Pass arguments to `list_instance_partition_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_instance_partition_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) - # Pass arguments to `list_instance_partition_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent instance of the instance partition operations. - # Values are of the form `projects//instances/`. - # @param filter [::String] - # Optional. An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - # AND` \ - # `(metadata.instance_partition.name:custom-instance-partition) AND` \ - # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # * The instance partition name contains "custom-instance-partition". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Optional. Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # Optional. If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} - # to the same `parent` and with the same `filter`. - # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Deadline used while retrieving metadata for instance partition - # operations. Instance partitions whose operation metadata cannot be - # retrieved within this deadline will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. - # - # @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/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new - # - # # Call the list_instance_partition_operations method. - # result = client.list_instance_partition_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_instance_partition_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_instance_partition_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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_instance_partition_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instance_partition_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :list_instance_partition_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_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 - - ## - # Moves an instance to the target instance configuration. You can use the - # returned long-running operation to track - # the progress of moving the instance. - # - # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of - # the following criteria: - # - # * Is undergoing a move to a different instance configuration - # * Has backups - # * Has an ongoing update - # * Contains any CMEK-enabled databases - # * Is a free trial instance - # - # While the operation is pending: - # - # * All other attempts to modify the instance, including changes to its - # compute capacity, are rejected. - # * The following database and backup admin operations are rejected: - # - # * `DatabaseAdmin.CreateDatabase` - # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is - # specified in the request.) - # * `DatabaseAdmin.RestoreDatabase` - # * `DatabaseAdmin.CreateBackup` - # * `DatabaseAdmin.CopyBackup` - # - # * Both the source and target instance configurations are subject to - # hourly compute and storage charges. - # * The instance might experience higher read-write latencies and a higher - # transaction abort rate. However, moving an instance doesn't cause any - # downtime. - # - # The returned long-running operation has - # a name of the format - # `/operations/` and can be used to track - # the move instance operation. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata MoveInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, - # if successful. - # Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata#cancel_time cancel_time}. - # Cancellation is not immediate because it involves moving any data - # previously moved to the target instance configuration back to the original - # instance configuration. You can use this operation to track the progress of - # the cancellation. Upon successful completion of the cancellation, the - # operation terminates with `CANCELLED` status. - # - # If not cancelled, upon completion of the returned operation: - # - # * The instance successfully moves to the target instance - # configuration. - # * You are billed for compute and storage in target instance - # configuration. - # - # Authorization requires the `spanner.instances.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance instance}. - # - # For more details, see - # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). - # - # @overload move_instance(request, options = nil) - # Pass arguments to `move_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload move_instance(name: nil, target_config: nil) - # Pass arguments to `move_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The instance to move. - # Values are of the form `projects//instances/`. - # @param target_config [::String] - # Required. The target instance configuration where to move the instance. - # Values are of the form `projects//instanceConfigs/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new - # - # # Call the move_instance method. - # result = client.move_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def move_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.move_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.move_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.move_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.call_rpc :move_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the InstanceAdmin API. - # - # This class represents the configuration for InstanceAdmin, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_instance_configs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instance_configs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instance_configs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the InstanceAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_instance_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_configs - ## - # RPC-specific configuration for `get_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_config - ## - # RPC-specific configuration for `create_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance_config - ## - # RPC-specific configuration for `update_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance_config - ## - # RPC-specific configuration for `delete_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance_config - ## - # RPC-specific configuration for `list_instance_config_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_config_operations - ## - # RPC-specific configuration for `list_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `list_instance_partitions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_partitions - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `update_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `get_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_partition - ## - # RPC-specific configuration for `create_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance_partition - ## - # RPC-specific configuration for `delete_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance_partition - ## - # RPC-specific configuration for `update_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance_partition - ## - # RPC-specific configuration for `list_instance_partition_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_partition_operations - ## - # RPC-specific configuration for `move_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :move_instance - - # @private - def initialize parent_rpcs = nil - list_instance_configs_config = parent_rpcs.list_instance_configs if parent_rpcs.respond_to? :list_instance_configs - @list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config - get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config - @get_instance_config = ::Gapic::Config::Method.new get_instance_config_config - create_instance_config_config = parent_rpcs.create_instance_config if parent_rpcs.respond_to? :create_instance_config - @create_instance_config = ::Gapic::Config::Method.new create_instance_config_config - update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config - @update_instance_config = ::Gapic::Config::Method.new update_instance_config_config - delete_instance_config_config = parent_rpcs.delete_instance_config if parent_rpcs.respond_to? :delete_instance_config - @delete_instance_config = ::Gapic::Config::Method.new delete_instance_config_config - list_instance_config_operations_config = parent_rpcs.list_instance_config_operations if parent_rpcs.respond_to? :list_instance_config_operations - @list_instance_config_operations = ::Gapic::Config::Method.new list_instance_config_operations_config - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - list_instance_partitions_config = parent_rpcs.list_instance_partitions if parent_rpcs.respond_to? :list_instance_partitions - @list_instance_partitions = ::Gapic::Config::Method.new list_instance_partitions_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance - @update_instance = ::Gapic::Config::Method.new update_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - get_instance_partition_config = parent_rpcs.get_instance_partition if parent_rpcs.respond_to? :get_instance_partition - @get_instance_partition = ::Gapic::Config::Method.new get_instance_partition_config - create_instance_partition_config = parent_rpcs.create_instance_partition if parent_rpcs.respond_to? :create_instance_partition - @create_instance_partition = ::Gapic::Config::Method.new create_instance_partition_config - delete_instance_partition_config = parent_rpcs.delete_instance_partition if parent_rpcs.respond_to? :delete_instance_partition - @delete_instance_partition = ::Gapic::Config::Method.new delete_instance_partition_config - update_instance_partition_config = parent_rpcs.update_instance_partition if parent_rpcs.respond_to? :update_instance_partition - @update_instance_partition = ::Gapic::Config::Method.new update_instance_partition_config - list_instance_partition_operations_config = parent_rpcs.list_instance_partition_operations if parent_rpcs.respond_to? :list_instance_partition_operations - @list_instance_partition_operations = ::Gapic::Config::Method.new list_instance_partition_operations_config - move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance - @move_instance = ::Gapic::Config::Method.new move_instance_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-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.rb deleted file mode 100644 index f1cfbb949203..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/credentials.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 "googleauth" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - # Credentials for the InstanceAdmin API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/spanner.admin" - ] - self.env_vars = [ - "SPANNER_CREDENTIALS", - "SPANNER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPANNER_CREDENTIALS_JSON", - "SPANNER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb deleted file mode 100644 index 1c2e3065f0d4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/operations.rb +++ /dev/null @@ -1,845 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the InstanceAdmin 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 InstanceAdmin 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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Spanner::Admin::Instance::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::Spanner::Admin::Instance::V1::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 = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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 -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb deleted file mode 100644 index 58eb65bcfcfe..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - # Path helper methods for the InstanceAdmin API. - module Paths - ## - # Create a fully-qualified Instance resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}` - # - # @param project [String] - # @param instance [String] - # - # @return [::String] - def instance_path project:, instance: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/instances/#{instance}" - end - - ## - # Create a fully-qualified InstanceConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instanceConfigs/{instance_config}` - # - # @param project [String] - # @param instance_config [String] - # - # @return [::String] - def instance_config_path project:, instance_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/instanceConfigs/#{instance_config}" - end - - ## - # Create a fully-qualified InstancePartition resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - # - # @param project [String] - # @param instance [String] - # @param instance_partition [String] - # - # @return [::String] - def instance_partition_path project:, instance:, instance_partition: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/instancePartitions/#{instance_partition}" - 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 - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.rb deleted file mode 100644 index 17c9131daf5d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest.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" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/spanner/admin/instance/v1/version" - -require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" -require "google/cloud/spanner/admin/instance/v1/instance_admin/paths" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/client" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - ## - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - module InstanceAdmin - # Client for the REST transport - module Rest - end - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb deleted file mode 100644 index 660ec9bb8d2c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb +++ /dev/null @@ -1,2948 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/spanner/admin/instance/v1/spanner_instance_admin_pb" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - module Rest - ## - # REST client for the InstanceAdmin service. - # - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :instance_admin_stub - - ## - # Configure the InstanceAdmin Client class. - # - # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all InstanceAdmin clients - # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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", "Spanner", "Admin", "Instance", "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_instance_configs.timeout = 3600.0 - default_config.rpcs.list_instance_configs.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_instance_config.timeout = 3600.0 - default_config.rpcs.get_instance_config.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_instances.timeout = 3600.0 - default_config.rpcs.list_instances.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_instance.timeout = 3600.0 - default_config.rpcs.get_instance.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_instance.timeout = 3600.0 - - default_config.rpcs.update_instance.timeout = 3600.0 - - default_config.rpcs.delete_instance.timeout = 3600.0 - default_config.rpcs.delete_instance.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.set_iam_policy.timeout = 30.0 - - default_config.rpcs.get_iam_policy.timeout = 30.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.test_iam_permissions.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the InstanceAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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 - @instance_admin_stub.universe_domain - end - - ## - # Create a new InstanceAdmin REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the InstanceAdmin 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::Spanner::Admin::Instance::V1::InstanceAdmin::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 - - @instance_admin_stub = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @instance_admin_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @instance_admin_stub.logger - end - - # Service calls - - ## - # Lists the supported instance configurations for a given project. - # - # Returns both Google-managed configurations and user-managed - # configurations. - # - # @overload list_instance_configs(request, options = nil) - # Pass arguments to `list_instance_configs` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_instance_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instance_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project for which a list of supported instance - # configurations is requested. Values are of the form - # `projects/`. - # @param page_size [::Integer] - # Number of instance configurations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new - # - # # Call the list_instance_configs method. - # result = client.list_instance_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - # p item - # end - # - def list_instance_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_instance_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instance_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instance_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instance_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, "instance_configs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a particular instance configuration. - # - # @overload get_instance_config(request, options = nil) - # Pass arguments to `get_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_instance_config(name: nil) - # Pass arguments to `get_instance_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the requested instance configuration. Values are of - # the form `projects//instanceConfigs/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new - # - # # Call the get_instance_config method. - # result = client.get_instance_config request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - # p result - # - def get_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_instance_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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_instance_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.get_instance_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an instance configuration and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance configuration. The instance configuration name is assigned by the - # caller. If the named instance configuration already exists, - # `CreateInstanceConfig` returns `ALREADY_EXISTS`. - # - # Immediately after the request returns: - # - # * The instance configuration is readable via the API, with all requested - # attributes. The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field is set to true. Its state is `CREATING`. - # - # While the operation is pending: - # - # * Cancelling the operation renders the instance configuration immediately - # unreadable via the API. - # * Except for deleting the creating resource, all other attempts to modify - # the instance configuration are rejected. - # - # Upon completion of the returned operation: - # - # * Instances can be created using the instance configuration. - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field becomes false. Its state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # creation of the instance configuration. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if - # successful. - # - # Authorization requires `spanner.instanceConfigs.create` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest#parent parent}. - # - # @overload create_instance_config(request, options = nil) - # Pass arguments to `create_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil) - # Pass arguments to `create_instance_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project in which to create the instance - # configuration. Values are of the form `projects/`. - # @param instance_config_id [::String] - # Required. The ID of the instance configuration to create. Valid identifiers - # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. The `custom-` prefix is required to avoid name - # conflicts with Google-managed configurations. - # @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] - # Required. The `InstanceConfig` proto of the configuration to create. - # `instance_config.name` must be - # `/instanceConfigs/`. - # `instance_config.base_config` must be a Google-managed configuration name, - # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new - # - # # Call the create_instance_config method. - # result = client.create_instance_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_instance_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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_instance_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.create_instance_config request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an instance configuration. The returned - # long-running operation can be used to track - # the progress of updating the instance. If the named instance configuration - # does not exist, returns `NOT_FOUND`. - # - # Only user-managed configurations can be updated. - # - # Immediately after the request returns: - # - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field is set to true. - # - # While the operation is pending: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}. - # The operation is guaranteed to succeed at undoing all changes, after - # which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance configuration are rejected. - # * Reading the instance configuration via the API continues to give the - # pre-request values. - # - # Upon completion of the returned operation: - # - # * Creating instances using the instance configuration uses the new - # values. - # * The new values of the instance configuration are readable via the API. - # * The instance configuration's - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling} - # field becomes false. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # the instance configuration modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if - # successful. - # - # Authorization requires `spanner.instanceConfigs.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. - # - # @overload update_instance_config(request, options = nil) - # Pass arguments to `update_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_instance_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 instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash] - # Required. The user instance configuration to update, which must always - # include the instance configuration name. Otherwise, only fields mentioned - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} - # need be included. To prevent conflicts of concurrent updates, - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can - # be used. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be - # updated. The field mask must always be specified; this prevents any future - # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} - # from being erased accidentally by clients that do not know about them. Only - # display_name and labels can be updated. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new - # - # # Call the update_instance_config method. - # result = client.update_instance_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_instance_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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_instance_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.update_instance_config request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 the instance configuration. Deletion is only allowed when no - # instances are using the configuration. If any instances are using - # the configuration, returns `FAILED_PRECONDITION`. - # - # Only user-managed configurations can be deleted. - # - # Authorization requires `spanner.instanceConfigs.delete` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}. - # - # @overload delete_instance_config(request, options = nil) - # Pass arguments to `delete_instance_config` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_instance_config(name: nil, etag: nil, validate_only: nil) - # Pass arguments to `delete_instance_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the instance configuration to be deleted. - # Values are of the form - # `projects//instanceConfigs/` - # @param etag [::String] - # Used for optimistic concurrency control as a way to help prevent - # simultaneous deletes of an instance configuration from overwriting each - # other. If not empty, the API - # only deletes the instance configuration when the etag provided matches the - # current status of the requested instance configuration. Otherwise, deletes - # the instance configuration without checking the current status of the - # requested instance configuration. - # @param validate_only [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new - # - # # Call the delete_instance_config method. - # result = client.delete_instance_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_instance_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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_instance_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_instance_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.delete_instance_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the user-managed instance configuration long-running - # operations in the given project. An instance - # configuration operation has a name of the form - # `projects//instanceConfigs//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting - # from the most recently started operation. - # - # @overload list_instance_config_operations(request, options = nil) - # Pass arguments to `list_instance_config_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_instance_config_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project of the instance configuration operations. - # Values are of the form `projects/`. - # @param filter [::String] - # An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - # AND` \ - # `(metadata.instance_config.name:custom-config) AND` \ - # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # * The instance configuration name contains "custom-config". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} - # to the same `parent` and with the same `filter`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new - # - # # Call the list_instance_config_operations method. - # result = client.list_instance_config_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_instance_config_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_instance_config_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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instance_config_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instance_config_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instance_config_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_config_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 - - ## - # Lists all instances in the given project. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, instance_deadline: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project for which a list of instances is - # requested. Values are of the form `projects/`. - # @param page_size [::Integer] - # Number of instances to be returned in the response. If 0 or less, defaults - # to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # @param filter [::String] - # An expression for filtering the results of the request. Filter rules are - # case insensitive. The fields eligible for filtering are: - # - # * `name` - # * `display_name` - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `name:*` --> The instance has a name. - # * `name:Howl` --> The instance's name contains the string "howl". - # * `name:HOWL` --> Equivalent to above. - # * `NAME:howl` --> Equivalent to above. - # * `labels.env:*` --> The instance has the label "env". - # * `labels.env:dev` --> The instance has the label "env" and the value of - # the label contains the string "dev". - # * `name:howl labels.env:dev` --> The instance's name contains "howl" and - # it has the label "env" with its value - # containing "dev". - # @param instance_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Deadline used while retrieving metadata for instances. - # Instances whose metadata cannot be retrieved within this deadline will be - # added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_instances request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_instances.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instances request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instances, "instances", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all instance partitions for the given instance. - # - # @overload list_instance_partitions(request, options = nil) - # Pass arguments to `list_instance_partitions` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_instance_partitions(parent: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) - # Pass arguments to `list_instance_partitions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The instance whose instance partitions should be listed. Values - # are of the form `projects//instances/`. Use `{instance} - # = '-'` to list instance partitions for all Instances in a project, e.g., - # `projects/myproject/instances/-`. - # @param page_size [::Integer] - # Number of instance partitions to be returned in the response. If 0 or less, - # defaults to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Deadline used while retrieving metadata for instance partitions. - # Instance partitions whose metadata cannot be retrieved within this deadline - # will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new - # - # # Call the list_instance_partitions method. - # result = client.list_instance_partitions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. - # p item - # end - # - def list_instance_partitions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_instance_partitions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instance_partitions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instance_partitions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instance_partitions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, "instance_partitions", request, result, 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 information about a particular instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_instance(name: nil, field_mask: nil) - # Pass arguments to `get_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the requested instance. Values are of the form - # `projects//instances/`. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # If field_mask is present, specifies the subset of - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be - # returned. If absent, all - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.get_instance request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an instance and begins preparing it to begin serving. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance. The instance name is assigned by the caller. If the - # named instance already exists, `CreateInstance` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance is readable via the API, with all requested attributes - # but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance immediately unreadable - # via the API. - # * The instance can be deleted. - # * All other attempts to modify the instance are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can be created in the instance. - # * The instance's allocated resource levels are readable via the API. - # * The instance's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track creation of the instance. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata CreateInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_instance(parent: nil, instance_id: nil, instance: nil) - # Pass arguments to `create_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project in which to create the instance. Values - # are of the form `projects/`. - # @param instance_id [::String] - # Required. The ID of the instance to create. Valid identifiers are of the - # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in - # length. - # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] - # Required. The instance to create. The name may be omitted, but if - # specified must be `/instances/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new - # - # # Call the create_instance method. - # result = client.create_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.create_instance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an instance, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance. If the named instance does not - # exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance's allocation - # has been requested, billing is based on the newly-requested level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time}, - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance are rejected. - # * Reading the instance via the API continues to give the pre-request - # resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance's - # tables. - # * The instance's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track the instance modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata UpdateInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, if successful. - # - # Authorization requires `spanner.instances.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance#name name}. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_instance(instance: nil, field_mask: nil) - # Pass arguments to `update_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash] - # Required. The instance to update, which must always include the instance - # name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} - # need be included. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. - # The field mask must always be specified; this prevents any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased - # accidentally by clients that do not know about them. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new - # - # # Call the update_instance method. - # result = client.update_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.update_instance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an instance. - # - # Immediately upon completion of the request: - # - # * Billing ceases for all of the instance's reserved resources. - # - # Soon afterward: - # - # * The instance and *all of its databases* immediately and - # irrevocably disappear from the API. All data in the databases - # is permanently deleted. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_instance(name: nil) - # Pass arguments to `delete_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the instance to be deleted. Values are of the form - # `projects//instances/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.delete_instance request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on an instance resource. Replaces any - # existing policy. - # - # Authorization requires `spanner.instances.setIamPolicy` on - # [resource][google.iam.v1.SetIamPolicyRequest.resource]. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for an instance resource. Returns an empty - # policy if an instance exists but does not have a policy set. - # - # Authorization requires `spanner.instances.getIamPolicy` on - # [resource][google.iam.v1.GetIamPolicyRequest.resource]. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that the caller has on the specified instance resource. - # - # Attempting this RPC on a non-existent Cloud Spanner instance resource will - # result in a NOT_FOUND error if the user has `spanner.instances.list` - # permission on the containing Google Cloud Project. Otherwise returns an - # empty set of permissions. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets information about a particular instance partition. - # - # @overload get_instance_partition(request, options = nil) - # Pass arguments to `get_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_instance_partition(name: nil) - # Pass arguments to `get_instance_partition` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance partition. Values are of - # the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new - # - # # Call the get_instance_partition method. - # result = client.get_instance_partition request - # - # # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. - # p result - # - def get_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_instance_partition.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.get_instance_partition request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an instance partition and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new instance partition. - # The instance partition name is assigned by the caller. If the named - # instance partition already exists, `CreateInstancePartition` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance partition is readable via the API, with all requested - # attributes but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance partition immediately - # unreadable via the API. - # * The instance partition can be deleted. - # * All other attempts to modify the instance partition are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can start using this instance partition. - # * The instance partition's allocated resource levels are readable via the - # API. - # * The instance partition's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track creation of the instance partition. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if - # successful. - # - # @overload create_instance_partition(request, options = nil) - # Pass arguments to `create_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_instance_partition(parent: nil, instance_partition_id: nil, instance_partition: nil) - # Pass arguments to `create_instance_partition` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance in which to create the instance - # partition. Values are of the form - # `projects//instances/`. - # @param instance_partition_id [::String] - # Required. The ID of the instance partition to create. Valid identifiers are - # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. - # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] - # Required. The instance partition to create. The instance_partition.name may - # be omitted, but if specified must be - # `/instancePartitions/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new - # - # # Call the create_instance_partition method. - # result = client.create_instance_partition request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_instance_partition.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.create_instance_partition request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing instance partition. Requires that the - # instance partition is not used by any database or backup and is not the - # default instance partition of an instance. - # - # Authorization requires `spanner.instancePartitions.delete` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. - # - # @overload delete_instance_partition(request, options = nil) - # Pass arguments to `delete_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_instance_partition(name: nil, etag: nil) - # Pass arguments to `delete_instance_partition` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 instance partition to be deleted. - # Values are of the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - # @param etag [::String] - # Optional. If not empty, the API only deletes the instance partition when - # the etag provided matches the current status of the requested instance - # partition. Otherwise, deletes the instance partition without checking the - # current status of the requested instance partition. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new - # - # # Call the delete_instance_partition method. - # result = client.delete_instance_partition request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_instance_partition.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.delete_instance_partition request, 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 instance partition, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance partition. If the named instance - # partition does not exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance partition's - # allocation has been requested, billing is based on the newly-requested - # level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata#cancel_time cancel_time}, - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance partition are rejected. - # * Reading the instance partition via the API continues to give the - # pre-request resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance - # partition's tables. - # * The instance partition's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track the instance partition modification. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionMetadata UpdateInstancePartitionMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition}, if - # successful. - # - # Authorization requires `spanner.instancePartitions.update` permission on - # the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition#name name}. - # - # @overload update_instance_partition(request, options = nil) - # Pass arguments to `update_instance_partition` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_instance_partition(instance_partition: nil, field_mask: nil) - # Pass arguments to `update_instance_partition` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param instance_partition [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition, ::Hash] - # Required. The instance partition to update, which must always include the - # instance partition name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} - # need be included. - # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # should be updated. The field mask must always be specified; this prevents - # any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # from being erased accidentally by clients that do not know about them. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new - # - # # Call the update_instance_partition method. - # result = client.update_instance_partition request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_instance_partition request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_instance_partition.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_instance_partition.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_instance_partition.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.update_instance_partition request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 instance partition long-running operations in the given instance. - # An instance partition operation has a name of the form - # `projects//instances//instancePartitions//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting from the - # most recently started operation. - # - # Authorization requires `spanner.instancePartitionOperations.list` - # permission on the resource - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#parent parent}. - # - # @overload list_instance_partition_operations(request, options = nil) - # Pass arguments to `list_instance_partition_operations` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_instance_partition_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) - # Pass arguments to `list_instance_partition_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent instance of the instance partition operations. - # Values are of the form `projects//instances/`. - # @param filter [::String] - # Optional. An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - # AND` \ - # `(metadata.instance_partition.name:custom-instance-partition) AND` \ - # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # * The instance partition name contains "custom-instance-partition". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @param page_size [::Integer] - # Optional. Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @param page_token [::String] - # Optional. If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} - # to the same `parent` and with the same `filter`. - # @param instance_partition_deadline [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Deadline used while retrieving metadata for instance partition - # operations. Instance partitions whose operation metadata cannot be - # retrieved within this deadline will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new - # - # # Call the list_instance_partition_operations method. - # result = client.list_instance_partition_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_instance_partition_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_instance_partition_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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_instance_partition_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instance_partition_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.list_instance_partition_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_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 - - ## - # Moves an instance to the target instance configuration. You can use the - # returned long-running operation to track - # the progress of moving the instance. - # - # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of - # the following criteria: - # - # * Is undergoing a move to a different instance configuration - # * Has backups - # * Has an ongoing update - # * Contains any CMEK-enabled databases - # * Is a free trial instance - # - # While the operation is pending: - # - # * All other attempts to modify the instance, including changes to its - # compute capacity, are rejected. - # * The following database and backup admin operations are rejected: - # - # * `DatabaseAdmin.CreateDatabase` - # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is - # specified in the request.) - # * `DatabaseAdmin.RestoreDatabase` - # * `DatabaseAdmin.CreateBackup` - # * `DatabaseAdmin.CopyBackup` - # - # * Both the source and target instance configurations are subject to - # hourly compute and storage charges. - # * The instance might experience higher read-write latencies and a higher - # transaction abort rate. However, moving an instance doesn't cause any - # downtime. - # - # The returned long-running operation has - # a name of the format - # `/operations/` and can be used to track - # the move instance operation. The - # metadata field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata MoveInstanceMetadata}. - # The response field type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance}, - # if successful. - # Cancelling the operation sets its metadata's - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata#cancel_time cancel_time}. - # Cancellation is not immediate because it involves moving any data - # previously moved to the target instance configuration back to the original - # instance configuration. You can use this operation to track the progress of - # the cancellation. Upon successful completion of the cancellation, the - # operation terminates with `CANCELLED` status. - # - # If not cancelled, upon completion of the returned operation: - # - # * The instance successfully moves to the target instance - # configuration. - # * You are billed for compute and storage in target instance - # configuration. - # - # Authorization requires the `spanner.instances.update` permission on - # the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance instance}. - # - # For more details, see - # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). - # - # @overload move_instance(request, options = nil) - # Pass arguments to `move_instance` via a request object, either of type - # {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload move_instance(name: nil, target_config: nil) - # Pass arguments to `move_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The instance to move. - # Values are of the form `projects//instances/`. - # @param target_config [::String] - # Required. The target instance configuration where to move the instance. - # Values are of the form `projects//instanceConfigs/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/spanner/admin/instance/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new - # - # # Call the move_instance method. - # result = client.move_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def move_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.move_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.move_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.move_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @instance_admin_stub.move_instance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the InstanceAdmin REST API. - # - # This class represents the configuration for InstanceAdmin REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_instance_configs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_instance_configs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_instance_configs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the InstanceAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_instance_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_configs - ## - # RPC-specific configuration for `get_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_config - ## - # RPC-specific configuration for `create_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance_config - ## - # RPC-specific configuration for `update_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance_config - ## - # RPC-specific configuration for `delete_instance_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance_config - ## - # RPC-specific configuration for `list_instance_config_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_config_operations - ## - # RPC-specific configuration for `list_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `list_instance_partitions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_partitions - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `update_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance - ## - # RPC-specific configuration for `delete_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `get_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance_partition - ## - # RPC-specific configuration for `create_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance_partition - ## - # RPC-specific configuration for `delete_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_instance_partition - ## - # RPC-specific configuration for `update_instance_partition` - # @return [::Gapic::Config::Method] - # - attr_reader :update_instance_partition - ## - # RPC-specific configuration for `list_instance_partition_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instance_partition_operations - ## - # RPC-specific configuration for `move_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :move_instance - - # @private - def initialize parent_rpcs = nil - list_instance_configs_config = parent_rpcs.list_instance_configs if parent_rpcs.respond_to? :list_instance_configs - @list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config - get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config - @get_instance_config = ::Gapic::Config::Method.new get_instance_config_config - create_instance_config_config = parent_rpcs.create_instance_config if parent_rpcs.respond_to? :create_instance_config - @create_instance_config = ::Gapic::Config::Method.new create_instance_config_config - update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config - @update_instance_config = ::Gapic::Config::Method.new update_instance_config_config - delete_instance_config_config = parent_rpcs.delete_instance_config if parent_rpcs.respond_to? :delete_instance_config - @delete_instance_config = ::Gapic::Config::Method.new delete_instance_config_config - list_instance_config_operations_config = parent_rpcs.list_instance_config_operations if parent_rpcs.respond_to? :list_instance_config_operations - @list_instance_config_operations = ::Gapic::Config::Method.new list_instance_config_operations_config - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - list_instance_partitions_config = parent_rpcs.list_instance_partitions if parent_rpcs.respond_to? :list_instance_partitions - @list_instance_partitions = ::Gapic::Config::Method.new list_instance_partitions_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance - @update_instance = ::Gapic::Config::Method.new update_instance_config - delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance - @delete_instance = ::Gapic::Config::Method.new delete_instance_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - get_instance_partition_config = parent_rpcs.get_instance_partition if parent_rpcs.respond_to? :get_instance_partition - @get_instance_partition = ::Gapic::Config::Method.new get_instance_partition_config - create_instance_partition_config = parent_rpcs.create_instance_partition if parent_rpcs.respond_to? :create_instance_partition - @create_instance_partition = ::Gapic::Config::Method.new create_instance_partition_config - delete_instance_partition_config = parent_rpcs.delete_instance_partition if parent_rpcs.respond_to? :delete_instance_partition - @delete_instance_partition = ::Gapic::Config::Method.new delete_instance_partition_config - update_instance_partition_config = parent_rpcs.update_instance_partition if parent_rpcs.respond_to? :update_instance_partition - @update_instance_partition = ::Gapic::Config::Method.new update_instance_partition_config - list_instance_partition_operations_config = parent_rpcs.list_instance_partition_operations if parent_rpcs.respond_to? :list_instance_partition_operations - @list_instance_partition_operations = ::Gapic::Config::Method.new list_instance_partition_operations_config - move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance - @move_instance = ::Gapic::Config::Method.new move_instance_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb deleted file mode 100644 index ca2f206d9d5f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/operations.rb +++ /dev/null @@ -1,1068 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the InstanceAdmin 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 InstanceAdmin 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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Spanner::Admin::Instance::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/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/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/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/[^/]+/instances/[^/]+/databases/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/backups/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/ssdCaches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb deleted file mode 100644 index 7f927a943f3e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb +++ /dev/null @@ -1,1376 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/spanner/admin/instance/v1/spanner_instance_admin_pb" - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - module Rest - ## - # REST service stub for the InstanceAdmin 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_instance_configs REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse] - # A result object deserialized from the server's reply - def list_instance_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_configs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_instance_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # A result object deserialized from the server's reply - def get_instance_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_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_instance_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_instance_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_instance_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_instance_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_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_instance_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_instance_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_instance_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_instance_config_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse] - # A result object deserialized from the server's reply - def list_instance_config_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_config_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_instance_config_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.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_instances REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse] - # A result object deserialized from the server's reply - def list_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instances_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_instances", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_instance_partitions REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse] - # A result object deserialized from the server's reply - def list_instance_partitions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_partitions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_instance_partitions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # A result object deserialized from the server's reply - def get_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::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 set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # A result object deserialized from the server's reply - def get_instance_partition request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_instance_partition_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_instance_partition", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_instance_partition request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_partition_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_instance_partition", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_instance_partition request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_partition_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_instance_partition", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_instance_partition request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_instance_partition_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_instance_partition", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_instance_partition_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse] - # A result object deserialized from the server's reply - def list_instance_partition_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_instance_partition_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_instance_partition_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the move_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def move_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_move_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "move_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instance_configs REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instance_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instanceConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_instance_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_instance_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/instanceConfigs", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_instance_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{instance_config.name}", - body: "*", - matches: [ - ["instance_config.name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance_config REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_instance_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instanceConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instance_config_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instance_config_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instanceConfigOperations", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instances REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instances", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instance_partitions REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instance_partitions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instancePartitions", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/instances", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{instance.name}", - body: "*", - matches: [ - ["instance.name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_instance_partition_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_instance_partition_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/instancePartitions", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_instance_partition_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_instance_partition REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_instance_partition_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{instance_partition.name}", - body: "*", - matches: [ - ["instance_partition.name", %r{^projects/[^/]+/instances/[^/]+/instancePartitions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instance_partition_operations REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_instance_partition_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instancePartitionOperations", - matches: [ - ["parent", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the move_instance REST call - # - # @param request_pb [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_move_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:move", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb deleted file mode 100644 index bc6ad4b7dcf4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/rest.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" -require "google/cloud/spanner/admin/instance/v1/version" - -module Google - module Cloud - module Spanner - module Admin - module Instance - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/spanner/admin/instance/v1/rest" - # client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new - # - module V1 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb deleted file mode 100644 index a9cfa90b04fb..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/version.rb +++ /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! - - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - VERSION = "0.0.1" - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb deleted file mode 100644 index f6f080766f8d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/common_pb.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/admin/instance/v1/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/spanner/admin/instance/v1/common.proto\x12 google.spanner.admin.instance.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8b\x01\n\x11OperationProgress\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\")\n\x10ReplicaSelection\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x02*w\n\x11\x46ulfillmentPeriod\x12\"\n\x1e\x46ULFILLMENT_PERIOD_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x46ULFILLMENT_PERIOD_NORMAL\x10\x01\x12\x1f\n\x1b\x46ULFILLMENT_PERIOD_EXTENDED\x10\x02\x42\xfd\x01\n$com.google.spanner.admin.instance.v1B\x0b\x43ommonProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - OperationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.OperationProgress").msgclass - ReplicaSelection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaSelection").msgclass - FulfillmentPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FulfillmentPeriod").enummodule - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb deleted file mode 100644 index 49f467979b51..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +++ /dev/null @@ -1,89 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/admin/instance/v1/spanner_instance_admin.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/spanner/admin/instance/v1/common_pb' - - -descriptor_data = "\n=google/spanner/admin/instance/v1/spanner_instance_admin.proto\x12 google.spanner.admin.instance.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a-google/spanner/admin/instance/v1/common.proto\"\xda\x01\n\x0bReplicaInfo\x12\x10\n\x08location\x18\x01 \x01(\t\x12G\n\x04type\x18\x02 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType\x12\x1f\n\x17\x64\x65\x66\x61ult_leader_location\x18\x03 \x01(\x08\"O\n\x0bReplicaType\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x12\x0b\n\x07WITNESS\x10\x03\"\xc0\n\n\x0eInstanceConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12O\n\x0b\x63onfig_type\x18\x05 \x01(\x0e\x32\x35.google.spanner.admin.instance.v1.InstanceConfig.TypeB\x03\xe0\x41\x03\x12?\n\x08replicas\x18\x03 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfo\x12M\n\x11optional_replicas\x18\x06 \x03(\x0b\x32-.google.spanner.admin.instance.v1.ReplicaInfoB\x03\xe0\x41\x03\x12?\n\x0b\x62\x61se_config\x18\x07 \x01(\tB*\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12L\n\x06labels\x18\x08 \x03(\x0b\x32<.google.spanner.admin.instance.v1.InstanceConfig.LabelsEntry\x12\x0c\n\x04\x65tag\x18\t \x01(\t\x12\x16\n\x0eleader_options\x18\x04 \x03(\t\x12\x18\n\x0breconciling\x18\n \x01(\x08\x42\x03\xe0\x41\x03\x12J\n\x05state\x18\x0b \x01(\x0e\x32\x36.google.spanner.admin.instance.v1.InstanceConfig.StateB\x03\xe0\x41\x03\x12r\n\x1a\x66ree_instance_availability\x18\x0c \x01(\x0e\x32I.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailabilityB\x03\xe0\x41\x03\x12U\n\x0bquorum_type\x18\x12 \x01(\x0e\x32;.google.spanner.admin.instance.v1.InstanceConfig.QuorumTypeB\x03\xe0\x41\x03\x12.\n!storage_limit_per_processing_unit\x18\x13 \x01(\x03\x42\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\"B\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eGOOGLE_MANAGED\x10\x01\x12\x10\n\x0cUSER_MANAGED\x10\x02\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"\x88\x01\n\x18\x46reeInstanceAvailability\x12*\n&FREE_INSTANCE_AVAILABILITY_UNSPECIFIED\x10\x00\x12\r\n\tAVAILABLE\x10\x01\x12\x0f\n\x0bUNSUPPORTED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x12\n\x0eQUOTA_EXCEEDED\x10\x04\"X\n\nQuorumType\x12\x1b\n\x17QUORUM_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06REGION\x10\x01\x12\x0f\n\x0b\x44UAL_REGION\x10\x02\x12\x10\n\x0cMULTI_REGION\x10\x03:\x81\x01\xea\x41~\n%spanner.googleapis.com/InstanceConfig\x12\x34projects/{project}/instanceConfigs/{instance_config}*\x0finstanceConfigs2\x0einstanceConfig\"\xb2\x01\n\x16ReplicaComputeCapacity\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x02 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x03 \x01(\x05H\x00\x42\x12\n\x10\x63ompute_capacity\"\x84\n\n\x11\x41utoscalingConfig\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x02\x12h\n\x13\x61utoscaling_targets\x18\x02 \x01(\x0b\x32\x46.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargetsB\x03\xe0\x41\x02\x12|\n\x1e\x61symmetric_autoscaling_options\x18\x03 \x03(\x0b\x32O.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOptionB\x03\xe0\x41\x01\x1a\x97\x01\n\x11\x41utoscalingLimits\x12\x13\n\tmin_nodes\x18\x01 \x01(\x05H\x00\x12\x1e\n\x14min_processing_units\x18\x02 \x01(\x05H\x00\x12\x13\n\tmax_nodes\x18\x03 \x01(\x05H\x01\x12\x1e\n\x14max_processing_units\x18\x04 \x01(\x05H\x01\x42\x0b\n\tmin_limitB\x0b\n\tmax_limit\x1a\x9e\x01\n\x12\x41utoscalingTargets\x12\x32\n%high_priority_cpu_utilization_percent\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12*\n\x1dtotal_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12(\n\x1bstorage_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1a\xe3\x04\n\x1b\x41symmetricAutoscalingOption\x12R\n\x11replica_selection\x18\x01 \x01(\x0b\x32\x32.google.spanner.admin.instance.v1.ReplicaSelectionB\x03\xe0\x41\x02\x12\x82\x01\n\toverrides\x18\x02 \x01(\x0b\x32j.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverridesB\x03\xe0\x41\x01\x1a\xea\x02\n\x1a\x41utoscalingConfigOverrides\x12\x66\n\x12\x61utoscaling_limits\x18\x01 \x01(\x0b\x32\x45.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\x03\xe0\x41\x01\x12\x45\n8autoscaling_target_high_priority_cpu_utilization_percent\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12=\n0autoscaling_target_total_cpu_utilization_percent\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x32\n%disable_high_priority_cpu_autoscaling\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12*\n\x1d\x64isable_total_cpu_autoscaling\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xaa\x0b\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nnode_count\x18\x05 \x01(\x05\x12\x18\n\x10processing_units\x18\t \x01(\x05\x12_\n\x18replica_compute_capacity\x18\x13 \x03(\x0b\x32\x38.google.spanner.admin.instance.v1.ReplicaComputeCapacityB\x03\xe0\x41\x03\x12T\n\x12\x61utoscaling_config\x18\x11 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x44\n\x05state\x18\x06 \x01(\x0e\x32\x30.google.spanner.admin.instance.v1.Instance.StateB\x03\xe0\x41\x03\x12\x46\n\x06labels\x18\x07 \x03(\x0b\x32\x36.google.spanner.admin.instance.v1.Instance.LabelsEntry\x12N\n\rinstance_type\x18\n \x01(\x0e\x32\x37.google.spanner.admin.instance.v1.Instance.InstanceType\x12\x15\n\rendpoint_uris\x18\x08 \x03(\t\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x16\x66ree_instance_metadata\x18\r \x01(\x0b\x32\x36.google.spanner.admin.instance.v1.FreeInstanceMetadata\x12H\n\x07\x65\x64ition\x18\x14 \x01(\x0e\x32\x32.google.spanner.admin.instance.v1.Instance.EditionB\x03\xe0\x41\x01\x12o\n\x1c\x64\x65\x66\x61ult_backup_schedule_type\x18\x17 \x01(\x0e\x32\x44.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleTypeB\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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\"Q\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bPROVISIONED\x10\x01\x12\x11\n\rFREE_INSTANCE\x10\x02\"U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03\"b\n\x19\x44\x65\x66\x61ultBackupScheduleType\x12,\n(DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\r\n\tAUTOMATIC\x10\x02:b\xea\x41_\n\x1fspanner.googleapis.com/Instance\x12\'projects/{project}/instances/{instance}*\tinstances2\x08instance\"\x88\x01\n\x1aListInstanceConfigsRequest\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\"\x82\x01\n\x1bListInstanceConfigsResponse\x12J\n\x10instance_configs\x18\x01 \x03(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x18GetInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\xea\x01\n\x1b\x43reateInstanceConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x1f\n\x12instance_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0finstance_config\x18\x03 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\xba\x01\n\x1bUpdateInstanceConfigRequest\x12N\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\x7f\n\x1b\x44\x65leteInstanceConfigRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\"\xa1\x01\n#ListInstanceConfigOperationsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"r\n$ListInstanceConfigOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"{\n\x12GetInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb9\x01\n\x15\x43reateInstanceRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x08instance\x18\x03 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\"\xc9\x01\n\x14ListInstancesRequest\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\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x35\n\x11instance_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x84\x01\n\x15ListInstancesResponse\x12=\n\tinstances\x18\x01 \x03(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x8f\x01\n\x15UpdateInstanceRequest\x12\x41\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.InstanceB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x15\x44\x65leteInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\"\xbf\x02\n\x16\x43reateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xbf\x02\n\x16UpdateInstanceMetadata\x12<\n\x08instance\x18\x01 \x01(\x0b\x32*.google.spanner.admin.instance.v1.Instance\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12X\n\x1b\x65xpected_fulfillment_period\x18\x05 \x01(\x0e\x32\x33.google.spanner.admin.instance.v1.FulfillmentPeriod\"\xce\x02\n\x14\x46reeInstanceMetadata\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0cupgrade_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12^\n\x0f\x65xpire_behavior\x18\x03 \x01(\x0e\x32\x45.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior\"i\n\x0e\x45xpireBehavior\x12\x1f\n\x1b\x45XPIRE_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x17\n\x13\x46REE_TO_PROVISIONED\x10\x01\x12\x1d\n\x19REMOVE_AFTER_GRACE_PERIOD\x10\x02\"\xe1\x01\n\x1c\x43reateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe1\x01\n\x1cUpdateInstanceConfigMetadata\x12I\n\x0finstance_config\x18\x01 \x01(\x0b\x32\x30.google.spanner.admin.instance.v1.InstanceConfig\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x06\n\x11InstancePartition\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x06\x63onfig\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\nnode_count\x18\x05 \x01(\x05H\x00\x12\x1a\n\x10processing_units\x18\x06 \x01(\x05H\x00\x12T\n\x12\x61utoscaling_config\x18\r \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12M\n\x05state\x18\x07 \x01(\x0e\x32\x39.google.spanner.admin.instance.v1.InstancePartition.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x15referencing_databases\x18\n \x03(\tB\x03\xe0\x41\x03\x12\"\n\x13referencing_backups\x18\x0b \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0c \x01(\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02:\xa6\x01\xea\x41\xa2\x01\n(spanner.googleapis.com/InstancePartition\x12Oprojects/{project}/instances/{instance}/instancePartitions/{instance_partition}*\x12instancePartitions2\x11instancePartitionB\x12\n\x10\x63ompute_capacity\"\x81\x02\n\x1f\x43reateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd3\x01\n\x1e\x43reateInstancePartitionRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\"\n\x15instance_partition_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x12instance_partition\x18\x03 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\"n\n\x1e\x44\x65leteInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\"]\n\x1bGetInstancePartitionRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(spanner.googleapis.com/InstancePartition\"\xab\x01\n\x1eUpdateInstancePartitionRequest\x12T\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartitionB\x03\xe0\x41\x02\x12\x33\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x81\x02\n\x1fUpdateInstancePartitionMetadata\x12O\n\x12instance_partition\x18\x01 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc5\x01\n\x1dListInstancePartitionsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x44\n\x1binstance_partition_deadline\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xa0\x01\n\x1eListInstancePartitionsResponse\x12P\n\x13instance_partitions\x18\x01 \x03(\x0b\x32\x33.google.spanner.admin.instance.v1.InstancePartition\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xed\x01\n&ListInstancePartitionOperationsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\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\x12\x44\n\x1binstance_partition_deadline\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x9e\x01\n\'ListInstancePartitionOperationsResponse\x12\x31\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.Operation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\'\n\x1funreachable_instance_partitions\x18\x03 \x03(\t\"\x92\x01\n\x13MoveInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Instance\x12\x44\n\rtarget_config\x18\x02 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%spanner.googleapis.com/InstanceConfig\"\x16\n\x14MoveInstanceResponse\"\xa5\x01\n\x14MoveInstanceMetadata\x12\x15\n\rtarget_config\x18\x01 \x01(\t\x12\x45\n\x08progress\x18\x02 \x01(\x0b\x32\x33.google.spanner.admin.instance.v1.OperationProgress\x12/\n\x0b\x63\x61ncel_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xda\'\n\rInstanceAdmin\x12\xcc\x01\n\x13ListInstanceConfigs\x12<.google.spanner.admin.instance.v1.ListInstanceConfigsRequest\x1a=.google.spanner.admin.instance.v1.ListInstanceConfigsResponse\"8\xda\x41\x06parent\x82\xd3\xe4\x93\x02)\x12\'/v1/{parent=projects/*}/instanceConfigs\x12\xb9\x01\n\x11GetInstanceConfig\x12:.google.spanner.admin.instance.v1.GetInstanceConfigRequest\x1a\x30.google.spanner.admin.instance.v1.InstanceConfig\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)\x12\'/v1/{name=projects/*/instanceConfigs/*}\x12\xc8\x02\n\x14\x43reateInstanceConfig\x12=.google.spanner.admin.instance.v1.CreateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd1\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.CreateInstanceConfigMetadata\xda\x41)parent,instance_config,instance_config_id\x82\xd3\xe4\x93\x02,\"\'/v1/{parent=projects/*}/instanceConfigs:\x01*\x12\xca\x02\n\x14UpdateInstanceConfig\x12=.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest\x1a\x1d.google.longrunning.Operation\"\xd3\x01\xca\x41p\n/google.spanner.admin.instance.v1.InstanceConfig\x12=google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata\xda\x41\x1binstance_config,update_mask\x82\xd3\xe4\x93\x02<27/v1/{instance_config.name=projects/*/instanceConfigs/*}:\x01*\x12\xa5\x01\n\x14\x44\x65leteInstanceConfig\x12=.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest\x1a\x16.google.protobuf.Empty\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)*\'/v1/{name=projects/*/instanceConfigs/*}\x12\xf0\x01\n\x1cListInstanceConfigOperations\x12\x45.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest\x1a\x46.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*}/instanceConfigOperations\x12\xb4\x01\n\rListInstances\x12\x36.google.spanner.admin.instance.v1.ListInstancesRequest\x1a\x37.google.spanner.admin.instance.v1.ListInstancesResponse\"2\xda\x41\x06parent\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=projects/*}/instances\x12\xe4\x01\n\x16ListInstancePartitions\x12?.google.spanner.admin.instance.v1.ListInstancePartitionsRequest\x1a@.google.spanner.admin.instance.v1.ListInstancePartitionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/instances/*}/instancePartitions\x12\xa1\x01\n\x0bGetInstance\x12\x34.google.spanner.admin.instance.v1.GetInstanceRequest\x1a*.google.spanner.admin.instance.v1.Instance\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=projects/*/instances/*}\x12\x9c\x02\n\x0e\x43reateInstance\x12\x37.google.spanner.admin.instance.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb1\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.CreateInstanceMetadata\xda\x41\x1bparent,instance_id,instance\x82\xd3\xe4\x93\x02&\"!/v1/{parent=projects/*}/instances:\x01*\x12\x9d\x02\n\x0eUpdateInstance\x12\x37.google.spanner.admin.instance.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\x64\n)google.spanner.admin.instance.v1.Instance\x12\x37google.spanner.admin.instance.v1.UpdateInstanceMetadata\xda\x41\x13instance,field_mask\x82\xd3\xe4\x93\x02/2*/v1/{instance.name=projects/*/instances/*}:\x01*\x12\x93\x01\n\x0e\x44\x65leteInstance\x12\x37.google.spanner.admin.instance.v1.DeleteInstanceRequest\x1a\x16.google.protobuf.Empty\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#*!/v1/{name=projects/*/instances/*}\x12\x9a\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"O\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:setIamPolicy:\x01*\x12\x93\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"H\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x37\"2/v1/{resource=projects/*/instances/*}:getIamPolicy:\x01*\x12\xc5\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"Z\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02=\"8/v1/{resource=projects/*/instances/*}:testIamPermissions:\x01*\x12\xd1\x01\n\x14GetInstancePartition\x12=.google.spanner.admin.instance.v1.GetInstancePartitionRequest\x1a\x33.google.spanner.admin.instance.v1.InstancePartition\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xe9\x02\n\x17\x43reateInstancePartition\x12@.google.spanner.admin.instance.v1.CreateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xec\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.CreateInstancePartitionMetadata\xda\x41/parent,instance_partition,instance_partition_id\x82\xd3\xe4\x93\x02;\"6/v1/{parent=projects/*/instances/*}/instancePartitions:\x01*\x12\xba\x01\n\x17\x44\x65leteInstancePartition\x12@.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/instances/*/instancePartitions/*}\x12\xea\x02\n\x17UpdateInstancePartition\x12@.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest\x1a\x1d.google.longrunning.Operation\"\xed\x01\xca\x41v\n2google.spanner.admin.instance.v1.InstancePartition\x12@google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata\xda\x41\x1dinstance_partition,field_mask\x82\xd3\xe4\x93\x02N2I/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}:\x01*\x12\x88\x02\n\x1fListInstancePartitionOperations\x12H.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest\x1aI.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/instances/*}/instancePartitionOperations\x12\x89\x02\n\x0cMoveInstance\x12\x35.google.spanner.admin.instance.v1.MoveInstanceRequest\x1a\x1d.google.longrunning.Operation\"\xa2\x01\xca\x41n\n5google.spanner.admin.instance.v1.MoveInstanceResponse\x12\x35google.spanner.admin.instance.v1.MoveInstanceMetadata\x82\xd3\xe4\x93\x02+\"&/v1/{name=projects/*/instances/*}:move:\x01*\x1ax\xca\x41\x16spanner.googleapis.com\xd2\x41\\https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.adminB\x8b\x02\n$com.google.spanner.admin.instance.v1B\x19SpannerInstanceAdminProtoP\x01ZFcloud.google.com/go/spanner/admin/instance/apiv1/instancepb;instancepb\xaa\x02&Google.Cloud.Spanner.Admin.Instance.V1\xca\x02&Google\\Cloud\\Spanner\\Admin\\Instance\\V1\xea\x02+Google::Cloud::Spanner::Admin::Instance::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - ReplicaInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo").msgclass - ReplicaInfo::ReplicaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType").enummodule - InstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig").msgclass - InstanceConfig::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.Type").enummodule - InstanceConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.State").enummodule - InstanceConfig::FreeInstanceAvailability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability").enummodule - InstanceConfig::QuorumType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig.QuorumType").enummodule - ReplicaComputeCapacity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaComputeCapacity").msgclass - AutoscalingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig").msgclass - AutoscalingConfig::AutoscalingLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits").msgclass - AutoscalingConfig::AutoscalingTargets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets").msgclass - AutoscalingConfig::AsymmetricAutoscalingOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption").msgclass - AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides").msgclass - Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance").msgclass - Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.State").enummodule - Instance::InstanceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.InstanceType").enummodule - Instance::Edition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.Edition").enummodule - Instance::DefaultBackupScheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType").enummodule - ListInstanceConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsRequest").msgclass - ListInstanceConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsResponse").msgclass - GetInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceConfigRequest").msgclass - CreateInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceConfigRequest").msgclass - UpdateInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceConfigRequest").msgclass - DeleteInstanceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstanceConfigRequest").msgclass - ListInstanceConfigOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest").msgclass - ListInstanceConfigOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse").msgclass - GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceRequest").msgclass - CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceRequest").msgclass - ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesRequest").msgclass - ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesResponse").msgclass - UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceRequest").msgclass - DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstanceRequest").msgclass - CreateInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceMetadata").msgclass - UpdateInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceMetadata").msgclass - FreeInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FreeInstanceMetadata").msgclass - FreeInstanceMetadata::ExpireBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior").enummodule - CreateInstanceConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceConfigMetadata").msgclass - UpdateInstanceConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata").msgclass - InstancePartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstancePartition").msgclass - InstancePartition::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstancePartition.State").enummodule - CreateInstancePartitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstancePartitionMetadata").msgclass - CreateInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstancePartitionRequest").msgclass - DeleteInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstancePartitionRequest").msgclass - GetInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstancePartitionRequest").msgclass - UpdateInstancePartitionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstancePartitionRequest").msgclass - UpdateInstancePartitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata").msgclass - ListInstancePartitionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionsRequest").msgclass - ListInstancePartitionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionsResponse").msgclass - ListInstancePartitionOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest").msgclass - ListInstancePartitionOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse").msgclass - MoveInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceRequest").msgclass - MoveInstanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceResponse").msgclass - MoveInstanceMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.MoveInstanceMetadata").msgclass - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb deleted file mode 100644 index d5b8848f47b8..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +++ /dev/null @@ -1,463 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/spanner/admin/instance/v1/spanner_instance_admin.proto for package 'Google.Cloud.Spanner.Admin.Instance.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/spanner/admin/instance/v1/spanner_instance_admin_pb' - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - module InstanceAdmin - # Cloud Spanner Instance Admin API - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner serving - # and storage resources to be used by Cloud Spanner databases. - # - # Each instance has a "configuration", which dictates where the - # serving resources for the Cloud Spanner instance are located (e.g., - # US-central, Europe). Configurations are created by Google based on - # resource availability. - # - # Cloud Spanner billing is based on the instances that exist and their - # sizes. After an instance exists, there are no additional - # per-database or per-operation charges for use of the instance - # (though there may be additional network bandwidth charges). - # Instances offer isolation: problems with databases in one instance - # will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the - # instance resources, fewer resources are available for other - # databases in that instance, and their performance may suffer. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.spanner.admin.instance.v1.InstanceAdmin' - - # Lists the supported instance configurations for a given project. - # - # Returns both Google-managed configurations and user-managed - # configurations. - rpc :ListInstanceConfigs, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse - # Gets information about a particular instance configuration. - rpc :GetInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig - # Creates an instance configuration and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance configuration. The instance configuration name is assigned by the - # caller. If the named instance configuration already exists, - # `CreateInstanceConfig` returns `ALREADY_EXISTS`. - # - # Immediately after the request returns: - # - # * The instance configuration is readable via the API, with all requested - # attributes. The instance configuration's - # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - # field is set to true. Its state is `CREATING`. - # - # While the operation is pending: - # - # * Cancelling the operation renders the instance configuration immediately - # unreadable via the API. - # * Except for deleting the creating resource, all other attempts to modify - # the instance configuration are rejected. - # - # Upon completion of the returned operation: - # - # * Instances can be created using the instance configuration. - # * The instance configuration's - # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - # field becomes false. Its state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # creation of the instance configuration. The - # metadata field type is - # [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - # The response field type is - # [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if - # successful. - # - # Authorization requires `spanner.instanceConfigs.create` permission on - # the resource - # [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. - rpc :CreateInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::Google::Longrunning::Operation - # Updates an instance configuration. The returned - # long-running operation can be used to track - # the progress of updating the instance. If the named instance configuration - # does not exist, returns `NOT_FOUND`. - # - # Only user-managed configurations can be updated. - # - # Immediately after the request returns: - # - # * The instance configuration's - # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - # field is set to true. - # - # While the operation is pending: - # - # * Cancelling the operation sets its metadata's - # [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. - # The operation is guaranteed to succeed at undoing all changes, after - # which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance configuration are rejected. - # * Reading the instance configuration via the API continues to give the - # pre-request values. - # - # Upon completion of the returned operation: - # - # * Creating instances using the instance configuration uses the new - # values. - # * The new values of the instance configuration are readable via the API. - # * The instance configuration's - # [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - # field becomes false. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to track - # the instance configuration modification. The - # metadata field type is - # [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. - # The response field type is - # [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if - # successful. - # - # Authorization requires `spanner.instanceConfigs.update` permission on - # the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. - rpc :UpdateInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::Google::Longrunning::Operation - # Deletes the instance configuration. Deletion is only allowed when no - # instances are using the configuration. If any instances are using - # the configuration, returns `FAILED_PRECONDITION`. - # - # Only user-managed configurations can be deleted. - # - # Authorization requires `spanner.instanceConfigs.delete` permission on - # the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. - rpc :DeleteInstanceConfig, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::Google::Protobuf::Empty - # Lists the user-managed instance configuration long-running - # operations in the given project. An instance - # configuration operation has a name of the form - # `projects//instanceConfigs//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting - # from the most recently started operation. - rpc :ListInstanceConfigOperations, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse - # Lists all instances in the given project. - rpc :ListInstances, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse - # Lists all instance partitions for the given instance. - rpc :ListInstancePartitions, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse - # Gets information about a particular instance. - rpc :GetInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::Instance - # Creates an instance and begins preparing it to begin serving. The - # returned long-running operation - # can be used to track the progress of preparing the new - # instance. The instance name is assigned by the caller. If the - # named instance already exists, `CreateInstance` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance is readable via the API, with all requested attributes - # but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance immediately unreadable - # via the API. - # * The instance can be deleted. - # * All other attempts to modify the instance are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can be created in the instance. - # * The instance's allocated resource levels are readable via the API. - # * The instance's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track creation of the instance. The - # metadata field type is - # [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. - # The response field type is - # [Instance][google.spanner.admin.instance.v1.Instance], if successful. - rpc :CreateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, ::Google::Longrunning::Operation - # Updates an instance, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance. If the named instance does not - # exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance's allocation - # has been requested, billing is based on the newly-requested level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance are rejected. - # * Reading the instance via the API continues to give the pre-request - # resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance's - # tables. - # * The instance's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format `/operations/` and - # can be used to track the instance modification. The - # metadata field type is - # [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. - # The response field type is - # [Instance][google.spanner.admin.instance.v1.Instance], if successful. - # - # Authorization requires `spanner.instances.update` permission on - # the resource [name][google.spanner.admin.instance.v1.Instance.name]. - rpc :UpdateInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, ::Google::Longrunning::Operation - # Deletes an instance. - # - # Immediately upon completion of the request: - # - # * Billing ceases for all of the instance's reserved resources. - # - # Soon afterward: - # - # * The instance and *all of its databases* immediately and - # irrevocably disappear from the API. All data in the databases - # is permanently deleted. - rpc :DeleteInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, ::Google::Protobuf::Empty - # Sets the access control policy on an instance resource. Replaces any - # existing policy. - # - # Authorization requires `spanner.instances.setIamPolicy` on - # [resource][google.iam.v1.SetIamPolicyRequest.resource]. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets the access control policy for an instance resource. Returns an empty - # policy if an instance exists but does not have a policy set. - # - # Authorization requires `spanner.instances.getIamPolicy` on - # [resource][google.iam.v1.GetIamPolicyRequest.resource]. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that the caller has on the specified instance resource. - # - # Attempting this RPC on a non-existent Cloud Spanner instance resource will - # result in a NOT_FOUND error if the user has `spanner.instances.list` - # permission on the containing Google Cloud Project. Otherwise returns an - # empty set of permissions. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Gets information about a particular instance partition. - rpc :GetInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition - # Creates an instance partition and begins preparing it to be used. The - # returned long-running operation - # can be used to track the progress of preparing the new instance partition. - # The instance partition name is assigned by the caller. If the named - # instance partition already exists, `CreateInstancePartition` returns - # `ALREADY_EXISTS`. - # - # Immediately upon completion of this request: - # - # * The instance partition is readable via the API, with all requested - # attributes but no allocated resources. Its state is `CREATING`. - # - # Until completion of the returned operation: - # - # * Cancelling the operation renders the instance partition immediately - # unreadable via the API. - # * The instance partition can be deleted. - # * All other attempts to modify the instance partition are rejected. - # - # Upon completion of the returned operation: - # - # * Billing for all successfully-allocated resources begins (some types - # may have lower than the requested levels). - # * Databases can start using this instance partition. - # * The instance partition's allocated resource levels are readable via the - # API. - # * The instance partition's state becomes `READY`. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track creation of the instance partition. The - # metadata field type is - # [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - # The response field type is - # [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if - # successful. - rpc :CreateInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, ::Google::Longrunning::Operation - # Deletes an existing instance partition. Requires that the - # instance partition is not used by any database or backup and is not the - # default instance partition of an instance. - # - # Authorization requires `spanner.instancePartitions.delete` permission on - # the resource - # [name][google.spanner.admin.instance.v1.InstancePartition.name]. - rpc :DeleteInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, ::Google::Protobuf::Empty - # Updates an instance partition, and begins allocating or releasing resources - # as requested. The returned long-running operation can be used to track the - # progress of updating the instance partition. If the named instance - # partition does not exist, returns `NOT_FOUND`. - # - # Immediately upon completion of this request: - # - # * For resource types for which a decrease in the instance partition's - # allocation has been requested, billing is based on the newly-requested - # level. - # - # Until completion of the returned operation: - # - # * Cancelling the operation sets its metadata's - # [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], - # and begins restoring resources to their pre-request values. The - # operation is guaranteed to succeed at undoing all resource changes, - # after which point it terminates with a `CANCELLED` status. - # * All other attempts to modify the instance partition are rejected. - # * Reading the instance partition via the API continues to give the - # pre-request resource levels. - # - # Upon completion of the returned operation: - # - # * Billing begins for all successfully-allocated resources (some types - # may have lower than the requested levels). - # * All newly-reserved resources are available for serving the instance - # partition's tables. - # * The instance partition's new resource levels are readable via the API. - # - # The returned long-running operation will - # have a name of the format - # `/operations/` and can be used to - # track the instance partition modification. The - # metadata field type is - # [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. - # The response field type is - # [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if - # successful. - # - # Authorization requires `spanner.instancePartitions.update` permission on - # the resource - # [name][google.spanner.admin.instance.v1.InstancePartition.name]. - rpc :UpdateInstancePartition, ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, ::Google::Longrunning::Operation - # Lists instance partition long-running operations in the given instance. - # An instance partition operation has a name of the form - # `projects//instances//instancePartitions//operations/`. - # The long-running operation - # metadata field type - # `metadata.type_url` describes the type of the metadata. Operations returned - # include those that have completed/failed/canceled within the last 7 days, - # and pending operations. Operations returned are ordered by - # `operation.metadata.value.start_time` in descending order starting from the - # most recently started operation. - # - # Authorization requires `spanner.instancePartitionOperations.list` - # permission on the resource - # [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. - rpc :ListInstancePartitionOperations, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse - # Moves an instance to the target instance configuration. You can use the - # returned long-running operation to track - # the progress of moving the instance. - # - # `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of - # the following criteria: - # - # * Is undergoing a move to a different instance configuration - # * Has backups - # * Has an ongoing update - # * Contains any CMEK-enabled databases - # * Is a free trial instance - # - # While the operation is pending: - # - # * All other attempts to modify the instance, including changes to its - # compute capacity, are rejected. - # * The following database and backup admin operations are rejected: - # - # * `DatabaseAdmin.CreateDatabase` - # * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is - # specified in the request.) - # * `DatabaseAdmin.RestoreDatabase` - # * `DatabaseAdmin.CreateBackup` - # * `DatabaseAdmin.CopyBackup` - # - # * Both the source and target instance configurations are subject to - # hourly compute and storage charges. - # * The instance might experience higher read-write latencies and a higher - # transaction abort rate. However, moving an instance doesn't cause any - # downtime. - # - # The returned long-running operation has - # a name of the format - # `/operations/` and can be used to track - # the move instance operation. The - # metadata field type is - # [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. - # The response field type is - # [Instance][google.spanner.admin.instance.v1.Instance], - # if successful. - # Cancelling the operation sets its metadata's - # [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. - # Cancellation is not immediate because it involves moving any data - # previously moved to the target instance configuration back to the original - # instance configuration. You can use this operation to track the progress of - # the cancellation. Upon successful completion of the cancellation, the - # operation terminates with `CANCELLED` status. - # - # If not cancelled, upon completion of the returned operation: - # - # * The instance successfully moves to the target instance - # configuration. - # * You are billed for compute and storage in target instance - # configuration. - # - # Authorization requires the `spanner.instances.update` permission on - # the resource [instance][google.spanner.admin.instance.v1.Instance]. - # - # For more details, see - # [Move an instance](https://cloud.google.com/spanner/docs/move-instance). - rpc :MoveInstance, ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md deleted file mode 100644 index ff5b3befac4d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Spanner Instance Admin 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-spanner-admin-instance-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb deleted file mode 100644 index 12175e5866ba..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/common.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - # Encapsulates progress related information for a Cloud Spanner long - # running instance operations. - # @!attribute [rw] progress_percent - # @return [::Integer] - # Percent completion of the operation. - # Values are between 0 and 100 inclusive. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Time the request was received. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # If set, the time at which this operation failed or was completed - # successfully. - class OperationProgress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ReplicaSelection identifies replicas with common properties. - # @!attribute [rw] location - # @return [::String] - # Required. Name of the location of the replicas (e.g., "us-central1"). - class ReplicaSelection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicates the expected fulfillment period of an operation. - module FulfillmentPeriod - # Not specified. - FULFILLMENT_PERIOD_UNSPECIFIED = 0 - - # Normal fulfillment period. The operation is expected to complete within - # minutes. - FULFILLMENT_PERIOD_NORMAL = 1 - - # Extended fulfillment period. It can take up to an hour for the operation - # to complete. - FULFILLMENT_PERIOD_EXTENDED = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb deleted file mode 100644 index d59b84381c11..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb +++ /dev/null @@ -1,1561 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module Admin - module Instance - module V1 - # @!attribute [rw] location - # @return [::String] - # The location of the serving resources, e.g., "us-central1". - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo::ReplicaType] - # The type of replica. - # @!attribute [rw] default_leader_location - # @return [::Boolean] - # If true, this location is designated as the default leader location where - # leader replicas are placed. See the [region types - # documentation](https://cloud.google.com/spanner/docs/instances#region_types) - # for more details. - class ReplicaInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the type of replica. See the [replica types - # documentation](https://cloud.google.com/spanner/docs/replication#replica_types) - # for more details. - module ReplicaType - # Not specified. - TYPE_UNSPECIFIED = 0 - - # Read-write replicas support both reads and writes. These replicas: - # - # * Maintain a full copy of your data. - # * Serve reads. - # * Can vote whether to commit a write. - # * Participate in leadership election. - # * Are eligible to become a leader. - READ_WRITE = 1 - - # Read-only replicas only support reads (not writes). Read-only replicas: - # - # * Maintain a full copy of your data. - # * Serve reads. - # * Do not participate in voting to commit writes. - # * Are not eligible to become a leader. - READ_ONLY = 2 - - # Witness replicas don't support reads but do participate in voting to - # commit writes. Witness replicas: - # - # * Do not maintain a full copy of data. - # * Do not serve reads. - # * Vote whether to commit writes. - # * Participate in leader election but are not eligible to become leader. - WITNESS = 3 - end - end - - # A possible configuration for a Cloud Spanner instance. Configurations - # define the geographic placement of nodes and their replication. - # @!attribute [rw] name - # @return [::String] - # A unique identifier for the instance configuration. Values - # are of the form - # `projects//instanceConfigs/[a-z][-a-z0-9]*`. - # - # User instance configuration must start with `custom-`. - # @!attribute [rw] display_name - # @return [::String] - # The name of this instance configuration as it appears in UIs. - # @!attribute [r] config_type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::Type] - # Output only. Whether this instance configuration is a Google-managed or - # user-managed configuration. - # @!attribute [rw] replicas - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo>] - # The geographic placement of nodes in this instance configuration and their - # replication properties. - # - # To create user-managed configurations, input - # `replicas` must include all replicas in `replicas` of the `base_config` - # and include one or more replicas in the `optional_replicas` of the - # `base_config`. - # @!attribute [r] optional_replicas - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaInfo>] - # Output only. The available optional replicas to choose from for - # user-managed configurations. Populated for Google-managed configurations. - # @!attribute [rw] base_config - # @return [::String] - # Base configuration name, e.g. projects//instanceConfigs/nam3, - # based on which this configuration is created. Only set for user-managed - # configurations. `base_config` must refer to a configuration of type - # `GOOGLE_MANAGED` in the same project as this configuration. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Cloud Labels are a flexible and lightweight mechanism for organizing cloud - # resources into groups that reflect a customer's organizational needs and - # deployment strategies. Cloud Labels can be used to filter collections of - # resources. They can be used to control how resource metrics are aggregated. - # And they can be used as arguments to policy management rules (e.g. route, - # firewall, load balancing, etc.). - # - # * Label keys must be between 1 and 63 characters long and must conform to - # the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - # * Label values must be between 0 and 63 characters long and must conform - # to the regular expression `[a-z0-9_-]{0,63}`. - # * No more than 64 labels can be associated with a given resource. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - # - # If you plan to use labels in your own code, please note that additional - # characters may be allowed in the future. Therefore, you are advised to use - # an internal label representation, such as JSON, which doesn't rely upon - # specific characters being disallowed. For example, representing labels - # as the string: name + "_" + value would prove problematic if we were to - # allow "_" in a future release. - # @!attribute [rw] etag - # @return [::String] - # etag is used for optimistic concurrency control as a way - # to help prevent simultaneous updates of a instance configuration from - # overwriting each other. It is strongly suggested that systems make use of - # the etag in the read-modify-write cycle to perform instance configuration - # updates in order to avoid race conditions: An etag is returned in the - # response which contains instance configurations, and systems are expected - # to put that etag in the request to update instance configuration to ensure - # that their change is applied to the same version of the instance - # configuration. If no etag is provided in the call to update the instance - # configuration, then the existing instance configuration is overwritten - # blindly. - # @!attribute [rw] leader_options - # @return [::Array<::String>] - # Allowed values of the "default_leader" schema option for databases in - # instances that use this instance configuration. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. If true, the instance configuration is being created or - # updated. If false, there are no ongoing operations for the instance - # configuration. - # @!attribute [r] state - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::State] - # Output only. The current instance configuration state. Applicable only for - # `USER_MANAGED` configurations. - # @!attribute [r] free_instance_availability - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::FreeInstanceAvailability] - # Output only. Describes whether free instances are available to be created - # in this instance configuration. - # @!attribute [r] quorum_type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig::QuorumType] - # Output only. The `QuorumType` of the instance configuration. - # @!attribute [r] storage_limit_per_processing_unit - # @return [::Integer] - # Output only. The storage limit in bytes per processing unit. - class InstanceConfig - 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 - - # The type of this configuration. - module Type - # Unspecified. - TYPE_UNSPECIFIED = 0 - - # Google-managed configuration. - GOOGLE_MANAGED = 1 - - # User-managed configuration. - USER_MANAGED = 2 - end - - # Indicates the current state of the instance configuration. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The instance configuration is still being created. - CREATING = 1 - - # The instance configuration is fully created and ready to be used to - # create instances. - READY = 2 - end - - # Describes the availability for free instances to be created in an instance - # configuration. - module FreeInstanceAvailability - # Not specified. - FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0 - - # Indicates that free instances are available to be created in this - # instance configuration. - AVAILABLE = 1 - - # Indicates that free instances are not supported in this instance - # configuration. - UNSUPPORTED = 2 - - # Indicates that free instances are currently not available to be created - # in this instance configuration. - DISABLED = 3 - - # Indicates that additional free instances cannot be created in this - # instance configuration because the project has reached its limit of free - # instances. - QUOTA_EXCEEDED = 4 - end - - # Indicates the quorum type of this instance configuration. - module QuorumType - # Quorum type not specified. - QUORUM_TYPE_UNSPECIFIED = 0 - - # An instance configuration tagged with `REGION` quorum type forms a write - # quorum in a single region. - REGION = 1 - - # An instance configuration tagged with the `DUAL_REGION` quorum type forms - # a write quorum with exactly two read-write regions in a multi-region - # configuration. - # - # This instance configuration requires failover in the event of - # regional failures. - DUAL_REGION = 2 - - # An instance configuration tagged with the `MULTI_REGION` quorum type - # forms a write quorum from replicas that are spread across more than one - # region in a multi-region configuration. - MULTI_REGION = 3 - end - end - - # ReplicaComputeCapacity describes the amount of server resources that are - # allocated to each replica identified by the replica selection. - # @!attribute [rw] replica_selection - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaSelection] - # Required. Identifies replicas by specified properties. - # All replicas in the selection have the same amount of compute capacity. - # @!attribute [rw] node_count - # @return [::Integer] - # The number of nodes allocated to each replica. - # - # This may be zero in API responses for instances that are not yet in - # state `READY`. - # - # Note: The following fields are mutually exclusive: `node_count`, `processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] processing_units - # @return [::Integer] - # The number of processing units allocated to each replica. - # - # This may be zero in API responses for instances that are not yet in - # state `READY`. - # - # Note: The following fields are mutually exclusive: `processing_units`, `node_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReplicaComputeCapacity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Autoscaling configuration for an instance. - # @!attribute [rw] autoscaling_limits - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingLimits] - # Required. Autoscaling limits for an instance. - # @!attribute [rw] autoscaling_targets - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets] - # Required. The autoscaling targets for an instance. - # @!attribute [rw] asymmetric_autoscaling_options - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption>] - # Optional. Optional asymmetric autoscaling options. - # Replicas matching the replica selection criteria will be autoscaled - # independently from other replicas. The autoscaler will scale the replicas - # based on the utilization of replicas identified by the replica selection. - # Replica selections should not overlap with each other. - # - # Other replicas (those do not match any replica selection) will be - # autoscaled together and will have the same compute capacity allocated to - # them. - class AutoscalingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The autoscaling limits for the instance. Users can define the minimum and - # maximum compute capacity allocated to the instance, and the autoscaler will - # only scale within that range. Users can either use nodes or processing - # units to specify the limits, but should use the same unit to set both the - # min_limit and max_limit. - # @!attribute [rw] min_nodes - # @return [::Integer] - # Minimum number of nodes allocated to the instance. If set, this number - # should be greater than or equal to 1. - # - # Note: The following fields are mutually exclusive: `min_nodes`, `min_processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] min_processing_units - # @return [::Integer] - # Minimum number of processing units allocated to the instance. If set, - # this number should be multiples of 1000. - # - # Note: The following fields are mutually exclusive: `min_processing_units`, `min_nodes`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] max_nodes - # @return [::Integer] - # Maximum number of nodes allocated to the instance. If set, this number - # should be greater than or equal to min_nodes. - # - # Note: The following fields are mutually exclusive: `max_nodes`, `max_processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] max_processing_units - # @return [::Integer] - # Maximum number of processing units allocated to the instance. If set, - # this number should be multiples of 1000 and be greater than or equal to - # min_processing_units. - # - # Note: The following fields are mutually exclusive: `max_processing_units`, `max_nodes`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AutoscalingLimits - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The autoscaling targets for an instance. - # @!attribute [rw] high_priority_cpu_utilization_percent - # @return [::Integer] - # Optional. The target high priority cpu utilization percentage that the - # autoscaler should be trying to achieve for the instance. This number is - # on a scale from 0 (no utilization) to 100 (full utilization). The valid - # range is [10, 90] inclusive. If not specified or set to 0, the autoscaler - # skips scaling based on high priority CPU utilization. - # @!attribute [rw] total_cpu_utilization_percent - # @return [::Integer] - # Optional. The target total CPU utilization percentage that the autoscaler - # should be trying to achieve for the instance. This number is on a scale - # from 0 (no utilization) to 100 (full utilization). The valid range is - # [10, 90] inclusive. If not specified or set to 0, the autoscaler skips - # scaling based on total CPU utilization. If both - # `high_priority_cpu_utilization_percent` and - # `total_cpu_utilization_percent` are specified, the autoscaler provisions - # the larger of the two required compute capacities to satisfy both - # targets. - # @!attribute [rw] storage_utilization_percent - # @return [::Integer] - # Required. The target storage utilization percentage that the autoscaler - # should be trying to achieve for the instance. This number is on a scale - # from 0 (no utilization) to 100 (full utilization). The valid range is - # [10, 99] inclusive. - class AutoscalingTargets - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AsymmetricAutoscalingOption specifies the scaling of replicas identified by - # the given selection. - # @!attribute [rw] replica_selection - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaSelection] - # Required. Selects the replicas to which this AsymmetricAutoscalingOption - # applies. Only read-only replicas are supported. - # @!attribute [rw] overrides - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides] - # Optional. Overrides applied to the top-level autoscaling configuration - # for the selected replicas. - class AsymmetricAutoscalingOption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Overrides the top-level autoscaling configuration for the replicas - # identified by `replica_selection`. All fields in this message are - # optional. Any unspecified fields will use the corresponding values from - # the top-level autoscaling configuration. - # @!attribute [rw] autoscaling_limits - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingLimits] - # Optional. If specified, overrides the min/max limit in the top-level - # autoscaling configuration for the selected replicas. - # @!attribute [rw] autoscaling_target_high_priority_cpu_utilization_percent - # @return [::Integer] - # Optional. If specified, overrides the autoscaling target - # high_priority_cpu_utilization_percent in the top-level autoscaling - # configuration for the selected replicas. - # @!attribute [rw] autoscaling_target_total_cpu_utilization_percent - # @return [::Integer] - # Optional. If specified, overrides the - # autoscaling target `total_cpu_utilization_percent` - # in the top-level autoscaling configuration for the selected replicas. - # @!attribute [rw] disable_high_priority_cpu_autoscaling - # @return [::Boolean] - # Optional. If true, disables high priority CPU autoscaling for the - # selected replicas and ignores - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} - # in the top-level autoscaling configuration. - # - # When setting this field to true, setting - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} - # field to a non-zero value for the same replica is not supported. - # - # If false, the - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_high_priority_cpu_utilization_percent autoscaling_target_high_priority_cpu_utilization_percent} - # field in the replica will be used if set to a non-zero value. - # Otherwise, the - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#high_priority_cpu_utilization_percent high_priority_cpu_utilization_percent} - # field in the top-level autoscaling configuration will be used. - # - # Setting both - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} - # and - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} - # to true for the same replica is not supported. - # @!attribute [rw] disable_total_cpu_autoscaling - # @return [::Boolean] - # Optional. If true, disables total CPU autoscaling for the selected - # replicas and ignores - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} - # in the top-level autoscaling configuration. - # - # When setting this field to true, setting - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} - # field to a non-zero value for the same replica is not supported. - # - # If false, the - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#autoscaling_target_total_cpu_utilization_percent autoscaling_target_total_cpu_utilization_percent} - # field in the replica will be used if set to a non-zero value. - # Otherwise, the - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AutoscalingTargets#total_cpu_utilization_percent total_cpu_utilization_percent} - # field in the top-level autoscaling configuration will be used. - # - # Setting both - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_high_priority_cpu_autoscaling disable_high_priority_cpu_autoscaling} - # and - # {::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig::AsymmetricAutoscalingOption::AutoscalingConfigOverrides#disable_total_cpu_autoscaling disable_total_cpu_autoscaling} - # to true for the same replica is not supported. - class AutoscalingConfigOverrides - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # An isolated set of Cloud Spanner resources on which databases can be hosted. - # @!attribute [rw] name - # @return [::String] - # Required. A unique identifier for the instance, which cannot be changed - # after the instance is created. Values are of the form - # `projects//instances/[a-z][-a-z0-9]*[a-z0-9]`. The final - # segment of the name must be between 2 and 64 characters in length. - # @!attribute [rw] config - # @return [::String] - # Required. The name of the instance's configuration. Values are of the form - # `projects//instanceConfigs/`. See - # also {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} and - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. - # @!attribute [rw] display_name - # @return [::String] - # Required. The descriptive name for this instance as it appears in UIs. - # Must be unique per project and between 4 and 30 characters in length. - # @!attribute [rw] node_count - # @return [::Integer] - # The number of nodes allocated to this instance. At most, one of either - # `node_count` or `processing_units` should be present in the message. - # - # Users can set the `node_count` field to specify the target number of nodes - # allocated to the instance. - # - # If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` - # field and reflects the current number of nodes allocated to the instance. - # - # This might be zero in API responses for instances that are not yet in the - # `READY` state. - # - # - # For more information, see - # [Compute capacity, nodes, and processing - # units](https://cloud.google.com/spanner/docs/compute-capacity). - # @!attribute [rw] processing_units - # @return [::Integer] - # The number of processing units allocated to this instance. At most, one of - # either `processing_units` or `node_count` should be present in the message. - # - # Users can set the `processing_units` field to specify the target number of - # processing units allocated to the instance. - # - # If autoscaling is enabled, `processing_units` is treated as an - # `OUTPUT_ONLY` field and reflects the current number of processing units - # allocated to the instance. - # - # This might be zero in API responses for instances that are not yet in the - # `READY` state. - # - # - # For more information, see - # [Compute capacity, nodes and processing - # units](https://cloud.google.com/spanner/docs/compute-capacity). - # @!attribute [r] replica_compute_capacity - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::ReplicaComputeCapacity>] - # Output only. Lists the compute capacity per ReplicaSelection. A replica - # selection identifies a set of replicas with common properties. Replicas - # identified by a ReplicaSelection are scaled with the same compute capacity. - # @!attribute [rw] autoscaling_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig] - # Optional. The autoscaling configuration. Autoscaling is enabled if this - # field is set. When autoscaling is enabled, node_count and processing_units - # are treated as OUTPUT_ONLY fields and reflect the current compute capacity - # allocated to the instance. - # @!attribute [r] state - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::State] - # Output only. The current instance state. For - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}, - # the state must be either omitted or set to `CREATING`. For - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}, - # the state must be either omitted or set to `READY`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Cloud Labels are a flexible and lightweight mechanism for organizing cloud - # resources into groups that reflect a customer's organizational needs and - # deployment strategies. Cloud Labels can be used to filter collections of - # resources. They can be used to control how resource metrics are aggregated. - # And they can be used as arguments to policy management rules (e.g. route, - # firewall, load balancing, etc.). - # - # * Label keys must be between 1 and 63 characters long and must conform to - # the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - # * Label values must be between 0 and 63 characters long and must conform - # to the regular expression `[a-z0-9_-]{0,63}`. - # * No more than 64 labels can be associated with a given resource. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - # - # If you plan to use labels in your own code, please note that additional - # characters may be allowed in the future. And so you are advised to use an - # internal label representation, such as JSON, which doesn't rely upon - # specific characters being disallowed. For example, representing labels - # as the string: name + "_" + value would prove problematic if we were to - # allow "_" in a future release. - # @!attribute [rw] instance_type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::InstanceType] - # The `InstanceType` of the current instance. - # @!attribute [rw] endpoint_uris - # @return [::Array<::String>] - # Deprecated. This field is not populated. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the instance was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the instance was most recently updated. - # @!attribute [rw] free_instance_metadata - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FreeInstanceMetadata] - # Free instance metadata. Only populated for free instances. - # @!attribute [rw] edition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::Edition] - # Optional. The `Edition` of the current instance. - # @!attribute [rw] default_backup_schedule_type - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance::DefaultBackupScheduleType] - # Optional. Controls the default backup schedule behavior for new databases - # within the instance. By default, a backup schedule is created automatically - # when a new database is created in a new instance. - # - # Note that the `AUTOMATIC` value isn't permitted for free instances, - # as backups and backup schedules aren't supported for free instances. - # - # In the `GetInstance` or `ListInstances` response, if the value of - # `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't - # create a default backup schedule for new databases in the instance. - class Instance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicates the current state of the instance. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The instance is still being created. Resources may not be - # available yet, and operations such as database creation may not - # work. - CREATING = 1 - - # The instance is fully created and ready to do work such as - # creating databases. - READY = 2 - end - - # The type of this instance. The type can be used to distinguish product - # variants, that can affect aspects like: usage restrictions, quotas and - # billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED - # instances. - module InstanceType - # Not specified. - INSTANCE_TYPE_UNSPECIFIED = 0 - - # Provisioned instances have dedicated resources, standard usage limits and - # support. - PROVISIONED = 1 - - # Free instances provide no guarantee for dedicated resources, - # [node_count, processing_units] should be 0. They come - # with stricter usage limits and limited support. - FREE_INSTANCE = 2 - end - - # The edition selected for this instance. Different editions provide - # different capabilities at different price points. - module Edition - # Edition not specified. - EDITION_UNSPECIFIED = 0 - - # Standard edition. - STANDARD = 1 - - # Enterprise edition. - ENTERPRISE = 2 - - # Enterprise Plus edition. - ENTERPRISE_PLUS = 3 - end - - # Indicates the - # [default backup - # schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules) - # behavior for new databases within the instance. - module DefaultBackupScheduleType - # Not specified. - DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0 - - # A default backup schedule isn't created automatically when a new database - # is created in the instance. - NONE = 1 - - # A default backup schedule is created automatically when a new database - # is created in the instance. The default backup schedule creates a full - # backup every 24 hours. These full backups are retained for 7 days. - # You can edit or delete the default backup schedule once it's created. - AUTOMATIC = 2 - end - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project for which a list of supported instance - # configurations is requested. Values are of the form - # `projects/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of instance configurations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}. - class ListInstanceConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. - # @!attribute [rw] instance_configs - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>] - # The list of requested instance configurations. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs} - # call to fetch more of the matching instance configurations. - class ListInstanceConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config GetInstanceConfigRequest}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested instance configuration. Values are of - # the form `projects//instanceConfigs/`. - class GetInstanceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which to create the instance - # configuration. Values are of the form `projects/`. - # @!attribute [rw] instance_config_id - # @return [::String] - # Required. The ID of the instance configuration to create. Valid identifiers - # are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. The `custom-` prefix is required to avoid name - # conflicts with Google-managed configurations. - # @!attribute [rw] instance_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # Required. The `InstanceConfig` proto of the configuration to create. - # `instance_config.name` must be - # `/instanceConfigs/`. - # `instance_config.base_config` must be a Google-managed configuration name, - # e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. - # @!attribute [rw] validate_only - # @return [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - class CreateInstanceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig}. - # @!attribute [rw] instance_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # Required. The user instance configuration to update, which must always - # include the instance configuration name. Otherwise, only fields mentioned - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask} - # need be included. To prevent conflicts of concurrent updates, - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can - # be used. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be - # updated. The field mask must always be specified; this prevents any future - # fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} - # from being erased accidentally by clients that do not know about them. Only - # display_name and labels can be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - class UpdateInstanceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config DeleteInstanceConfig}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the instance configuration to be deleted. - # Values are of the form - # `projects//instanceConfigs/` - # @!attribute [rw] etag - # @return [::String] - # Used for optimistic concurrency control as a way to help prevent - # simultaneous deletes of an instance configuration from overwriting each - # other. If not empty, the API - # only deletes the instance configuration when the etag provided matches the - # current status of the requested instance configuration. Otherwise, deletes - # the instance configuration without checking the current status of the - # requested instance configuration. - # @!attribute [rw] validate_only - # @return [::Boolean] - # An option to validate, but not actually execute, a request, - # and provide the same response. - class DeleteInstanceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project of the instance configuration operations. - # Values are of the form `projects/`. - # @!attribute [rw] filter - # @return [::String] - # An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) - # AND` \ - # `(metadata.instance_config.name:custom-config) AND` \ - # `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}. - # * The instance configuration name contains "custom-config". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse} - # to the same `parent` and with the same `filter`. - class ListInstanceConfigOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations}. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # The list of matching instance configuration long-running operations. Each - # operation's name will be - # prefixed by the name of the instance configuration. The operation's - # metadata field type - # `metadata.type_url` describes the type of the metadata. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations ListInstanceConfigOperations} - # call to fetch more of the matching metadata. - class ListInstanceConfigOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance GetInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested instance. Values are of the form - # `projects//instances/`. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # If field_mask is present, specifies the subset of - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be - # returned. If absent, all - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned. - class GetInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which to create the instance. Values - # are of the form `projects/`. - # @!attribute [rw] instance_id - # @return [::String] - # Required. The ID of the instance to create. Valid identifiers are of the - # form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 characters in - # length. - # @!attribute [rw] instance - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # Required. The instance to create. The name may be omitted, but if - # specified must be `/instances/`. - class CreateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project for which a list of instances is - # requested. Values are of the form `projects/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of instances to be returned in the response. If 0 or less, defaults - # to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - # @!attribute [rw] filter - # @return [::String] - # An expression for filtering the results of the request. Filter rules are - # case insensitive. The fields eligible for filtering are: - # - # * `name` - # * `display_name` - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `name:*` --> The instance has a name. - # * `name:Howl` --> The instance's name contains the string "howl". - # * `name:HOWL` --> Equivalent to above. - # * `NAME:howl` --> Equivalent to above. - # * `labels.env:*` --> The instance has the label "env". - # * `labels.env:dev` --> The instance has the label "env" and the value of - # the label contains the string "dev". - # * `name:howl labels.env:dev` --> The instance's name contains "howl" and - # it has the label "env" with its value - # containing "dev". - # @!attribute [rw] instance_deadline - # @return [::Google::Protobuf::Timestamp] - # Deadline used while retrieving metadata for instances. - # Instances whose metadata cannot be retrieved within this deadline will be - # added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}. - class ListInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances}. - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>] - # The list of requested instances. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances ListInstances} - # call to fetch more of the matching instances. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # The list of unreachable instances. - # It includes the names of instances whose metadata could not be retrieved - # within - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest#instance_deadline instance_deadline}. - class ListInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}. - # @!attribute [rw] instance - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # Required. The instance to update, which must always include the instance - # name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask} - # need be included. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated. - # The field mask must always be specified; this prevents any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased - # accidentally by clients that do not know about them. - class UpdateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance DeleteInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the instance to be deleted. Values are of the form - # `projects//instances/` - class DeleteInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance}. - # @!attribute [rw] instance - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # The instance being created. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance CreateInstance} - # request was received. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. If set, this operation is - # in the process of undoing itself (which is guaranteed to succeed) and - # cannot be cancelled again. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation failed or was completed successfully. - # @!attribute [rw] expected_fulfillment_period - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FulfillmentPeriod] - # The expected fulfillment period of this create operation. - class CreateInstanceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance}. - # @!attribute [rw] instance - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::Instance] - # The desired end state of the update. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance UpdateInstance} - # request was received. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. If set, this operation is - # in the process of undoing itself (which is guaranteed to succeed) and - # cannot be cancelled again. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation failed or was completed successfully. - # @!attribute [rw] expected_fulfillment_period - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FulfillmentPeriod] - # The expected fulfillment period of this update operation. - class UpdateInstanceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Free instance specific metadata that is kept even after an instance has been - # upgraded for tracking purposes. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp after which the instance will either be upgraded or - # scheduled for deletion after a grace period. ExpireBehavior is used to - # choose between upgrading or scheduling the free instance for deletion. This - # timestamp is set during the creation of a free instance. - # @!attribute [r] upgrade_time - # @return [::Google::Protobuf::Timestamp] - # Output only. If present, the timestamp at which the free instance was - # upgraded to a provisioned instance. - # @!attribute [rw] expire_behavior - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::FreeInstanceMetadata::ExpireBehavior] - # Specifies the expiration behavior of a free instance. The default of - # ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during - # or after creation, and before expiration. - class FreeInstanceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Allows users to change behavior when a free instance expires. - module ExpireBehavior - # Not specified. - EXPIRE_BEHAVIOR_UNSPECIFIED = 0 - - # When the free instance expires, upgrade the instance to a provisioned - # instance. - FREE_TO_PROVISIONED = 1 - - # When the free instance expires, disable the instance, and delete it - # after the grace period passes if it has not been upgraded. - REMOVE_AFTER_GRACE_PERIOD = 2 - end - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig}. - # @!attribute [rw] instance_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # The target instance configuration end state. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config CreateInstanceConfig} - # operation. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. - class CreateInstanceConfigMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig}. - # @!attribute [rw] instance_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig] - # The desired instance configuration after updating. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config UpdateInstanceConfig} - # operation. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. - class UpdateInstanceConfigMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An isolated set of Cloud Spanner resources that databases can define - # placements on. - # @!attribute [rw] name - # @return [::String] - # Required. A unique identifier for the instance partition. Values are of the - # form - # `projects//instances//instancePartitions/[a-z][-a-z0-9]*[a-z0-9]`. - # The final segment of the name must be between 2 and 64 characters in - # length. An instance partition's name cannot be changed after the instance - # partition is created. - # @!attribute [rw] config - # @return [::String] - # Required. The name of the instance partition's configuration. Values are of - # the form `projects//instanceConfigs/`. See also - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} and - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs ListInstanceConfigs}. - # @!attribute [rw] display_name - # @return [::String] - # Required. The descriptive name for this instance partition as it appears in - # UIs. Must be unique per project and between 4 and 30 characters in length. - # @!attribute [rw] node_count - # @return [::Integer] - # The number of nodes allocated to this instance partition. - # - # Users can set the `node_count` field to specify the target number of - # nodes allocated to the instance partition. - # - # This may be zero in API responses for instance partitions that are not - # yet in state `READY`. - # - # Note: The following fields are mutually exclusive: `node_count`, `processing_units`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] processing_units - # @return [::Integer] - # The number of processing units allocated to this instance partition. - # - # Users can set the `processing_units` field to specify the target number - # of processing units allocated to the instance partition. - # - # This might be zero in API responses for instance partitions that are not - # yet in the `READY` state. - # - # Note: The following fields are mutually exclusive: `processing_units`, `node_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] autoscaling_config - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::AutoscalingConfig] - # Optional. The autoscaling configuration. Autoscaling is enabled if this - # field is set. When autoscaling is enabled, fields in compute_capacity are - # treated as OUTPUT_ONLY fields and reflect the current compute capacity - # allocated to the instance partition. - # @!attribute [r] state - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition::State] - # Output only. The current instance partition state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the instance partition was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the instance partition was most recently - # updated. - # @!attribute [r] referencing_databases - # @return [::Array<::String>] - # Output only. The names of the databases that reference this - # instance partition. Referencing databases should share the parent instance. - # The existence of any referencing database prevents the instance partition - # from being deleted. - # @!attribute [r] referencing_backups - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # Output only. Deprecated: This field is not populated. - # Output only. The names of the backups that reference this instance - # partition. Referencing backups should share the parent instance. The - # existence of any referencing backup prevents the instance partition from - # being deleted. - # @!attribute [rw] etag - # @return [::String] - # Used for optimistic concurrency control as a way - # to help prevent simultaneous updates of a instance partition from - # overwriting each other. It is strongly suggested that systems make use of - # the etag in the read-modify-write cycle to perform instance partition - # updates in order to avoid race conditions: An etag is returned in the - # response which contains instance partitions, and systems are expected to - # put that etag in the request to update instance partitions to ensure that - # their change will be applied to the same version of the instance partition. - # If no etag is provided in the call to update instance partition, then the - # existing instance partition is overwritten blindly. - class InstancePartition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the current state of the instance partition. - module State - # Not specified. - STATE_UNSPECIFIED = 0 - - # The instance partition is still being created. Resources may not be - # available yet, and operations such as creating placements using this - # instance partition may not work. - CREATING = 1 - - # The instance partition is fully created and ready to do work such as - # creating placements and using in databases. - READY = 2 - end - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition}. - # @!attribute [rw] instance_partition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # The instance partition being created. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition} - # request was received. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. If set, this operation is - # in the process of undoing itself (which is guaranteed to succeed) and - # cannot be cancelled again. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation failed or was completed successfully. - class CreateInstancePartitionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition CreateInstancePartition}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the instance in which to create the instance - # partition. Values are of the form - # `projects//instances/`. - # @!attribute [rw] instance_partition_id - # @return [::String] - # Required. The ID of the instance partition to create. Valid identifiers are - # of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64 - # characters in length. - # @!attribute [rw] instance_partition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # Required. The instance partition to create. The instance_partition.name may - # be omitted, but if specified must be - # `/instancePartitions/`. - class CreateInstancePartitionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition DeleteInstancePartition}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the instance partition to be deleted. - # Values are of the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}` - # @!attribute [rw] etag - # @return [::String] - # Optional. If not empty, the API only deletes the instance partition when - # the etag provided matches the current status of the requested instance - # partition. Otherwise, deletes the instance partition without checking the - # current status of the requested instance partition. - class DeleteInstancePartitionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition GetInstancePartition}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested instance partition. Values are of - # the form - # `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`. - class GetInstancePartitionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition}. - # @!attribute [rw] instance_partition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # Required. The instance partition to update, which must always include the - # instance partition name. Otherwise, only fields mentioned in - # {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest#field_mask field_mask} - # need be included. - # @!attribute [rw] field_mask - # @return [::Google::Protobuf::FieldMask] - # Required. A mask specifying which fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # should be updated. The field mask must always be specified; this prevents - # any future fields in - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition InstancePartition} - # from being erased accidentally by clients that do not know about them. - class UpdateInstancePartitionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition}. - # @!attribute [rw] instance_partition - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition] - # The desired end state of the update. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition UpdateInstancePartition} - # request was received. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. If set, this operation is - # in the process of undoing itself (which is guaranteed to succeed) and - # cannot be cancelled again. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation failed or was completed successfully. - class UpdateInstancePartitionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The instance whose instance partitions should be listed. Values - # are of the form `projects//instances/`. Use `{instance} - # = '-'` to list instance partitions for all Instances in a project, e.g., - # `projects/myproject/instances/-`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of instance partitions to be returned in the response. If 0 or less, - # defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - # @!attribute [rw] instance_partition_deadline - # @return [::Google::Protobuf::Timestamp] - # Optional. Deadline used while retrieving metadata for instance partitions. - # Instance partitions whose metadata cannot be retrieved within this deadline - # will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse#unreachable unreachable} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse ListInstancePartitionsResponse}. - class ListInstancePartitionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions}. - # @!attribute [rw] instance_partitions - # @return [::Array<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>] - # The list of requested instancePartitions. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions ListInstancePartitions} - # call to fetch more of the matching instance partitions. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # The list of unreachable instances or instance partitions. - # It includes the names of instances or instance partitions whose metadata - # could not be retrieved within - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest#instance_partition_deadline instance_partition_deadline}. - class ListInstancePartitionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent instance of the instance partition operations. - # Values are of the form `projects//instances/`. - # @!attribute [rw] filter - # @return [::String] - # Optional. An expression that filters the list of returned operations. - # - # A filter expression consists of a field name, a - # comparison operator, and a value for filtering. - # The value must be a string, a number, or a boolean. The comparison operator - # must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. - # Colon `:` is the contains operator. Filter rules are not case sensitive. - # - # The following fields in the Operation are eligible for filtering: - # - # * `name` - The name of the long-running operation - # * `done` - False if the operation is in progress, else true. - # * `metadata.@type` - the type of metadata. For example, the type string - # for - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata} - # is - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`. - # * `metadata.` - any field in metadata.value. - # `metadata.@type` must be specified first, if filtering on metadata - # fields. - # * `error` - Error associated with the long-running operation. - # * `response.@type` - the type of response. - # * `response.` - any field in response.value. - # - # You can combine multiple expressions by enclosing each expression in - # parentheses. By default, expressions are combined with AND logic. However, - # you can specify AND, OR, and NOT logic explicitly. - # - # Here are a few examples: - # - # * `done:true` - The operation is complete. - # * `(metadata.@type=` \ - # `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) - # AND` \ - # `(metadata.instance_partition.name:custom-instance-partition) AND` \ - # `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \ - # `(error:*)` - Return operations where: - # * The operation's metadata type is - # {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionMetadata CreateInstancePartitionMetadata}. - # * The instance partition name contains "custom-instance-partition". - # * The operation started before 2021-03-28T14:50:00Z. - # * The operation resulted in an error. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Number of operations to be returned in the response. If 0 or - # less, defaults to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # Optional. If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse} - # to the same `parent` and with the same `filter`. - # @!attribute [rw] instance_partition_deadline - # @return [::Google::Protobuf::Timestamp] - # Optional. Deadline used while retrieving metadata for instance partition - # operations. Instance partitions whose operation metadata cannot be - # retrieved within this deadline will be added to - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse#unreachable_instance_partitions unreachable_instance_partitions} - # in - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse ListInstancePartitionOperationsResponse}. - class ListInstancePartitionOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations}. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # The list of matching instance partition long-running operations. Each - # operation's name will be - # prefixed by the instance partition's name. The operation's - # metadata field type - # `metadata.type_url` describes the type of the metadata. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations ListInstancePartitionOperations} - # call to fetch more of the matching metadata. - # @!attribute [rw] unreachable_instance_partitions - # @return [::Array<::String>] - # The list of unreachable instance partitions. - # It includes the names of instance partitions whose operation metadata could - # not be retrieved within - # {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest#instance_partition_deadline instance_partition_deadline}. - class ListInstancePartitionOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. - # @!attribute [rw] name - # @return [::String] - # Required. The instance to move. - # Values are of the form `projects//instances/`. - # @!attribute [rw] target_config - # @return [::String] - # Required. The target instance configuration where to move the instance. - # Values are of the form `projects//instanceConfigs/`. - class MoveInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. - class MoveInstanceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata type for the operation returned by - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance}. - # @!attribute [rw] target_config - # @return [::String] - # The target instance configuration where to move the instance. - # Values are of the form `projects//instanceConfigs/`. - # @!attribute [rw] progress - # @return [::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress] - # The progress of the - # {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance MoveInstance} - # operation. - # {::Google::Cloud::Spanner::Admin::Instance::V1::OperationProgress#progress_percent progress_percent} - # is reset when cancellation is requested. - # @!attribute [rw] cancel_time - # @return [::Google::Protobuf::Timestamp] - # The time at which this operation was cancelled. - class MoveInstanceMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/Gemfile deleted file mode 100644 index 948960481f0c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1", path: "../" -else - gem "google-cloud-spanner-admin-instance-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-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb deleted file mode 100644 index 2348ff40f605..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_CreateInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the create_instance call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance. -# -def create_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new - - # Call the create_instance method. - result = client.create_instance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb deleted file mode 100644 index c3a27669fdae..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the create_instance_config call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config. -# -def create_instance_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new - - # Call the create_instance_config method. - result = client.create_instance_config request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb deleted file mode 100644 index d21b55b5b196..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_partition.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the create_instance_partition call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition. -# -def create_instance_partition - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new - - # Call the create_instance_partition method. - result = client.create_instance_partition request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb deleted file mode 100644 index 69724c0b1606..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_DeleteInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the delete_instance call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance. -# -def delete_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new - - # Call the delete_instance method. - result = client.delete_instance request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_InstanceAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb deleted file mode 100644 index 4a1f618dbf0e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_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 spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the delete_instance_config call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config. -# -def delete_instance_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new - - # Call the delete_instance_config method. - result = client.delete_instance_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb deleted file mode 100644 index e0a538237a72..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_partition.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the delete_instance_partition call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition. -# -def delete_instance_partition - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new - - # Call the delete_instance_partition method. - result = client.delete_instance_partition request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb deleted file mode 100644 index 87a8c0c3714a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the get_iam_policy call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb deleted file mode 100644 index a1cca2d1c9dc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_GetInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the get_instance call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance. -# -def get_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new - - # Call the get_instance method. - result = client.get_instance request - - # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. - p result -end -# [END spanner_v1_generated_InstanceAdmin_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb deleted file mode 100644 index ba21ffeef8ab..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_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 spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the get_instance_config call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config. -# -def get_instance_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new - - # Call the get_instance_config method. - result = client.get_instance_config request - - # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - p result -end -# [END spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb deleted file mode 100644 index 9654b300ce3f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_partition.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the get_instance_partition call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition. -# -def get_instance_partition - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new - - # Call the get_instance_partition method. - result = client.get_instance_partition request - - # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. - p result -end -# [END spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb deleted file mode 100644 index a43ab8906614..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instance_config_operations call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations. -# -def list_instance_config_operations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new - - # Call the list_instance_config_operations method. - result = client.list_instance_config_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 -end -# [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb deleted file mode 100644 index ebe64e95ead6..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instance_configs call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs. -# -def list_instance_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new - - # Call the list_instance_configs method. - result = client.list_instance_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - p item - end -end -# [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb deleted file mode 100644 index a30b5cab92b1..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partition_operations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instance_partition_operations call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations. -# -def list_instance_partition_operations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new - - # Call the list_instance_partition_operations method. - result = client.list_instance_partition_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 -end -# [END spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.rb deleted file mode 100644 index 7a571906f7d2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_partitions.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 spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instance_partitions call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions. -# -def list_instance_partitions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new - - # Call the list_instance_partitions method. - result = client.list_instance_partitions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition. - p item - end -end -# [END spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb deleted file mode 100644 index 07eef9c99042..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_ListInstances_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the list_instances call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances. -# -def list_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new - - # Call the list_instances method. - result = client.list_instances request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::Instance. - p item - end -end -# [END spanner_v1_generated_InstanceAdmin_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb deleted file mode 100644 index d1260ae8c95f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/move_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_MoveInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the move_instance call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance. -# -def move_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new - - # Call the move_instance method. - result = client.move_instance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_MoveInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb deleted file mode 100644 index bf36a3b73464..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the set_iam_policy call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb deleted file mode 100644 index 4f9cc75a5905..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the test_iam_permissions call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb deleted file mode 100644 index 16786ba2e441..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_UpdateInstance_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the update_instance call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance. -# -def update_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new - - # Call the update_instance method. - result = client.update_instance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb deleted file mode 100644 index 4dcaf1b12731..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the update_instance_config call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config. -# -def update_instance_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new - - # Call the update_instance_config method. - result = client.update_instance_config request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb deleted file mode 100644 index 38c1442fe587..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_partition.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync] -require "google/cloud/spanner/admin/instance/v1" - -## -# Snippet for the update_instance_partition call in the InstanceAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition. -# -def update_instance_partition - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new - - # Call the update_instance_partition method. - result = client.update_instance_partition request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync] diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json deleted file mode 100644 index d91b8bef1312..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json +++ /dev/null @@ -1,855 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-spanner-admin-instance-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.spanner.admin.instance.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync", - "title": "Snippet for the list_instance_configs call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs.", - "file": "instance_admin/list_instance_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instance_configs", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstanceConfigs", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync", - "title": "Snippet for the get_instance_config call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config.", - "file": "instance_admin/get_instance_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance_config", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "GetInstanceConfig", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync", - "title": "Snippet for the create_instance_config call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config.", - "file": "instance_admin/create_instance_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance_config", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "CreateInstanceConfig", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync", - "title": "Snippet for the update_instance_config call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config.", - "file": "instance_admin/update_instance_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_instance_config", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "UpdateInstanceConfig", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync", - "title": "Snippet for the delete_instance_config call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config.", - "file": "instance_admin/delete_instance_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance_config", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "DeleteInstanceConfig", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync", - "title": "Snippet for the list_instance_config_operations call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations.", - "file": "instance_admin/list_instance_config_operations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instance_config_operations", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstanceConfigOperations", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstances_sync", - "title": "Snippet for the list_instances call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances.", - "file": "instance_admin/list_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instances", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstances", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstances", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstancePartitions_sync", - "title": "Snippet for the list_instance_partitions call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions.", - "file": "instance_admin/list_instance_partitions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instance_partitions", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partitions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstancePartitions", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstance_sync", - "title": "Snippet for the get_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance.", - "file": "instance_admin/get_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::Instance", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "GetInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstance_sync", - "title": "Snippet for the create_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance.", - "file": "instance_admin/create_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "CreateInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstance_sync", - "title": "Snippet for the update_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance.", - "file": "instance_admin/update_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "UpdateInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstance_sync", - "title": "Snippet for the delete_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance.", - "file": "instance_admin/delete_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "DeleteInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy.", - "file": "instance_admin/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.SetIamPolicy", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy.", - "file": "instance_admin/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetIamPolicy", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions.", - "file": "instance_admin/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.TestIamPermissions", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_GetInstancePartition_sync", - "title": "Snippet for the get_instance_partition call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition.", - "file": "instance_admin/get_instance_partition.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance_partition", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_partition", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "GetInstancePartition", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartition", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_CreateInstancePartition_sync", - "title": "Snippet for the create_instance_partition call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition.", - "file": "instance_admin/create_instance_partition.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance_partition", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_partition", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "CreateInstancePartition", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_DeleteInstancePartition_sync", - "title": "Snippet for the delete_instance_partition call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition.", - "file": "instance_admin/delete_instance_partition.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance_partition", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_partition", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "DeleteInstancePartition", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartition", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_UpdateInstancePartition_sync", - "title": "Snippet for the update_instance_partition call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition.", - "file": "instance_admin/update_instance_partition.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_instance_partition", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_partition", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "UpdateInstancePartition", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_ListInstancePartitionOperations_sync", - "title": "Snippet for the list_instance_partition_operations call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations.", - "file": "instance_admin/list_instance_partition_operations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instance_partition_operations", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_partition_operations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "ListInstancePartitionOperations", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_InstanceAdmin_MoveInstance_sync", - "title": "Snippet for the move_instance call in the InstanceAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance.", - "file": "instance_admin/move_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "move_instance", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#move_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "InstanceAdmin::Client", - "full_name": "::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client" - }, - "method": { - "short_name": "MoveInstance", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin.MoveInstance", - "service": { - "short_name": "InstanceAdmin", - "full_name": "google.spanner.admin.instance.v1.InstanceAdmin" - } - } - }, - "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-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb deleted file mode 100644 index 14acadf19511..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_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/spanner/admin/instance/v1/spanner_instance_admin_pb" -require "google/spanner/admin/instance/v1/spanner_instance_admin_services_pb" -require "google/cloud/spanner/admin/instance/v1/instance_admin" - -class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb deleted file mode 100644 index 25bc1dce8a0a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/spanner/admin/instance/v1/instance_admin" - -class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_instance_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_path project: "value0", instance: "value1" - assert_equal "projects/value0/instances/value1", path - end - end - - def test_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_config_path project: "value0", instance_config: "value1" - assert_equal "projects/value0/instanceConfigs/value1", path - end - end - - def test_instance_partition_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_partition_path project: "value0", instance: "value1", instance_partition: "value2" - assert_equal "projects/value0/instances/value1/instancePartitions/value2", 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::Spanner::Admin::Instance::V1::InstanceAdmin::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-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb deleted file mode 100644 index a4f875fb92b0..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb +++ /dev/null @@ -1,1269 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/spanner/admin/instance/v1/spanner_instance_admin_pb" -require "google/cloud/spanner/admin/instance/v1/instance_admin/rest" - - -class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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_instance_configs - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.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_instance_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instance_configs_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instance_configs parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instance_configs ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.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_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instance_configs(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.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_instance_configs_client_stub.call_count - end - end - end - - def test_get_instance_config - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_config_client_stub.call_count - end - end - end - - def test_create_instance_config - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_config_id = "hello world" - instance_config = {} - validate_only = true - - create_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance_config parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_instance_config_client_stub.call_count - end - end - end - - def test_update_instance_config - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - instance_config = {} - update_mask = {} - validate_only = true - - update_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_instance_config({ instance_config: instance_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_instance_config instance_config: instance_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_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_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_instance_config({ instance_config: instance_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_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_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_instance_config_client_stub.call_count - end - end - end - - def test_delete_instance_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - - delete_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance_config name: name, etag: etag, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_instance_config_client_stub.call_count - end - end - end - - def test_list_instance_config_operations - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_instance_config_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_config_operations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instance_config_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instance_config_operations({ parent: parent, 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.list_instance_config_operations parent: parent, 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.list_instance_config_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, 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.list_instance_config_operations({ parent: parent, 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.list_instance_config_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, 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, list_instance_config_operations_client_stub.call_count - end - end - end - - def test_list_instances - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - instance_deadline = {} - - list_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instances ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instances(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instances_client_stub.call_count - end - end - end - - def test_list_instance_partitions - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.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" - instance_partition_deadline = {} - - list_instance_partitions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_partitions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instance_partitions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instance_partitions parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instance_partitions ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instance_partitions(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instance_partitions_client_stub.call_count - end - end - end - - def test_get_instance - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - field_mask = {} - - get_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance({ name: name, field_mask: field_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance name: name, field_mask: field_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance({ name: name, field_mask: field_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_client_stub.call_count - end - end - end - - def test_create_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_id = "hello world" - instance = {} - - create_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance parent: parent, instance_id: instance_id, instance: instance do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_instance(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_instance_client_stub.call_count - end - end - end - - def test_update_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - instance = {} - field_mask = {} - - update_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_instance({ instance: instance, field_mask: field_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_instance instance: instance, field_mask: field_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_instance ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_instance({ instance: instance, field_mask: field_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_instance(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_instance_client_stub.call_count - end - end - end - - def test_delete_instance - # 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_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_instance({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_instance(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_instance_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_get_instance_partition - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_get_instance_partition_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance_partition({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance_partition name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance_partition({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_partition_client_stub.call_count - end - end - end - - def test_create_instance_partition - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_partition_id = "hello world" - instance_partition = {} - - create_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_create_instance_partition_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance_partition parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_instance_partition_client_stub.call_count - end - end - end - - def test_delete_instance_partition - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - delete_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_delete_instance_partition_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance_partition({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance_partition name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_instance_partition({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_instance_partition_client_stub.call_count - end - end - end - - def test_update_instance_partition - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - instance_partition = {} - field_mask = {} - - update_instance_partition_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_update_instance_partition_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_instance_partition instance_partition: instance_partition, field_mask: field_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_instance_partition_client_stub.call_count - end - end - end - - def test_list_instance_partition_operations - # Create test objects. - client_result = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - instance_partition_deadline = {} - - list_instance_partition_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_list_instance_partition_operations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instance_partition_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instance_partition_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instance_partition_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instance_partition_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instance_partition_operations_client_stub.call_count - end - end - end - - def test_move_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - target_config = "hello world" - - move_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::ServiceStub.stub :transcode_move_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, move_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.move_instance({ name: name, target_config: target_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.move_instance name: name, target_config: target_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.move_instance ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.move_instance({ name: name, target_config: target_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.move_instance(::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, move_instance_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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb deleted file mode 100644 index a00bf9333f7b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_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/spanner/admin/instance/v1/spanner_instance_admin_pb" -require "google/cloud/spanner/admin/instance/v1/instance_admin" - -class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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_instance_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_instance_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instance_configs, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest, 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_instance_configs_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_instance_configs parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_instance_configs ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.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_instance_configs({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_instance_configs(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.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_instance_configs_client_stub.call_rpc_count - end - end - - def test_get_instance_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance_config, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance_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_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_instance_config_client_stub.call_rpc_count - end - end - - def test_create_instance_config - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_config_id = "hello world" - instance_config = {} - validate_only = true - - create_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance_config, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_config_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig), request["instance_config"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_instance_config parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_instance_config({ parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new(parent: parent, instance_config_id: instance_config_id, instance_config: instance_config, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_instance_config_client_stub.call_rpc_count - end - end - - def test_update_instance_config - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - instance_config = {} - update_mask = {} - validate_only = true - - update_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_instance_config, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig), request["instance_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_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_instance_config instance_config: instance_config, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_instance_config({ instance_config: instance_config, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new(instance_config: instance_config, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_instance_config_client_stub.call_rpc_count - end - end - - def test_delete_instance_config - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - - delete_instance_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance_config, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_config_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_instance_config name: name, etag: etag, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_instance_config ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_instance_config({ name: name, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_instance_config(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new(name: name, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_instance_config_client_stub.call_rpc_count - end - end - - def test_list_instance_config_operations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_instance_config_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instance_config_operations, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instance_config_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instance_config_operations({ parent: parent, 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.list_instance_config_operations parent: parent, 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.list_instance_config_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, 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.list_instance_config_operations({ parent: parent, 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.list_instance_config_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new(parent: parent, 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, list_instance_config_operations_client_stub.call_rpc_count - end - end - - def test_list_instances - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - instance_deadline = {} - - list_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instances, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_deadline"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_instances ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_instances(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, instance_deadline: instance_deadline), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_instances_client_stub.call_rpc_count - end - end - - def test_list_instance_partitions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - instance_partition_deadline = {} - - list_instance_partitions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instance_partitions, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_partition_deadline"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instance_partitions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_instance_partitions parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_instance_partitions ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_instance_partitions({ parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_instance_partitions(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_instance_partitions_client_stub.call_rpc_count - end - end - - def test_get_instance - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::Instance.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - field_mask = {} - - get_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance({ name: name, field_mask: field_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance name: name, field_mask: field_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance({ name: name, field_mask: field_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_instance(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new(name: name, field_mask: field_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_instance_client_stub.call_rpc_count - end - end - - def test_create_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_id = "hello world" - instance = {} - - create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::Instance), request["instance"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_instance parent: parent, instance_id: instance_id, instance: instance do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_instance ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_instance(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_instance_client_stub.call_rpc_count - end - end - - def test_update_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - instance = {} - field_mask = {} - - update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::Instance), request["instance"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_instance({ instance: instance, field_mask: field_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_instance instance: instance, field_mask: field_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_instance ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_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_instance({ instance: instance, field_mask: field_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_instance(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new(instance: instance, field_mask: field_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_instance_client_stub.call_rpc_count - end - end - - def test_delete_instance - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_instance name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_instance({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_instance(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new(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_instance_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_get_instance_partition - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance_partition, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance_partition({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance_partition name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance_partition({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_instance_partition_client_stub.call_rpc_count - end - end - - def test_create_instance_partition - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_partition_id = "hello world" - instance_partition = {} - - create_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance_partition, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_partition_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition), request["instance_partition"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_instance_partition parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_instance_partition({ parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest.new(parent: parent, instance_partition_id: instance_partition_id, instance_partition: instance_partition), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_instance_partition_client_stub.call_rpc_count - end - end - - def test_delete_instance_partition - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - delete_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance_partition, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance_partition({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_instance_partition name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_instance_partition({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_instance_partition_client_stub.call_rpc_count - end - end - - def test_update_instance_partition - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - instance_partition = {} - field_mask = {} - - update_instance_partition_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_instance_partition, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition), request["instance_partition"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["field_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_instance_partition_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_instance_partition({ instance_partition: instance_partition, field_mask: field_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_instance_partition instance_partition: instance_partition, field_mask: field_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_instance_partition ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_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_instance_partition({ instance_partition: instance_partition, field_mask: field_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_instance_partition(::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest.new(instance_partition: instance_partition, field_mask: field_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_instance_partition_client_stub.call_rpc_count - end - end - - def test_list_instance_partition_operations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - instance_partition_deadline = {} - - list_instance_partition_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instance_partition_operations, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["instance_partition_deadline"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instance_partition_operations_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_instance_partition_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_instance_partition_operations ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_instance_partition_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_instance_partition_operations(::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, instance_partition_deadline: instance_partition_deadline), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_instance_partition_operations_client_stub.call_rpc_count - end - end - - def test_move_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - target_config = "hello world" - - move_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :move_instance, name - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["target_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, move_instance_client_stub do - # Create client - client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.move_instance({ name: name, target_config: target_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.move_instance name: name, target_config: target_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.move_instance ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_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.move_instance({ name: name, target_config: target_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.move_instance(::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new(name: name, target_config: target_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, move_instance_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::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::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-admin-instance-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-spanner-v1/.gitignore b/owl-bot-staging/google-cloud-spanner-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json deleted file mode 100644 index 97ae30d48f35..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "spanner.googleapis.com", - "api_shortname": "spanner", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest", - "distribution_name": "google-cloud-spanner-v1", - "is_cloud": true, - "language": "ruby", - "name": "spanner", - "name_pretty": "Cloud Spanner V1 API", - "product_documentation": "https://cloud.google.com/spanner", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SPANNER", - "ruby-cloud-product-url": "https://cloud.google.com/spanner", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml b/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml deleted file mode 100644 index c29064123444..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-spanner-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-spanner-v1.rb" diff --git a/owl-bot-staging/google-cloud-spanner-v1/.toys.rb b/owl-bot-staging/google-cloud-spanner-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/.yardopts b/owl-bot-staging/google-cloud-spanner-v1/.yardopts deleted file mode 100644 index 62c084b2c082..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Spanner 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-spanner-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md deleted file mode 100644 index a4d7b47836ad..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-spanner-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-spanner-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/spanner/v1" - -client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/spanner/v1" - -::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Spanner::V1::Spanner::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-spanner-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/spanner/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Spanner::V1::Spanner::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-spanner-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-spanner-v1/Gemfile b/owl-bot-staging/google-cloud-spanner-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md b/owl-bot-staging/google-cloud-spanner-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/README.md b/owl-bot-staging/google-cloud-spanner-v1/README.md deleted file mode 100644 index 1ff29659d58a..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Spanner V1 API - -Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. - - -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 Spanner V1 API. Most users should consider using -the main client gem, -[google-cloud-spanner](https://rubygems.org/gems/google-cloud-spanner). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-spanner-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/spanner.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/spanner/v1" - -client = ::Google::Cloud::Spanner::V1::Spanner::Client.new -request = ::Google::Cloud::Spanner::V1::CreateSessionRequest.new # (request fields as keyword arguments...) -response = client.create_session request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/spanner) -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/spanner/v1" -require "logger" - -client = ::Google::Cloud::Spanner::V1::Spanner::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-spanner`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-spanner-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-spanner`. -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-spanner-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-spanner-v1/Rakefile b/owl-bot-staging/google-cloud-spanner-v1/Rakefile deleted file mode 100644 index b18de45c0a03..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SPANNER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SPANNER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SPANNER_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 SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/spanner/v1/spanner/credentials" - ::Google::Cloud::Spanner::V1::Spanner::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SPANNER_PROJECT"] = project - ENV["SPANNER_TEST_PROJECT"] = project - ENV["SPANNER_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-spanner-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-spanner-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-spanner-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-spanner-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-spanner-v1" - header "google-cloud-spanner-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-spanner-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-spanner-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-spanner-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-spanner-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-spanner-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json deleted file mode 100644 index 5d46cd55f5fb..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/gapic_metadata.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.spanner.v1", - "libraryPackage": "::Google::Cloud::Spanner::V1", - "services": { - "Spanner": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Spanner::V1::Spanner::Client", - "rpcs": { - "CreateSession": { - "methods": [ - "create_session" - ] - }, - "BatchCreateSessions": { - "methods": [ - "batch_create_sessions" - ] - }, - "GetSession": { - "methods": [ - "get_session" - ] - }, - "ListSessions": { - "methods": [ - "list_sessions" - ] - }, - "DeleteSession": { - "methods": [ - "delete_session" - ] - }, - "ExecuteSql": { - "methods": [ - "execute_sql" - ] - }, - "ExecuteStreamingSql": { - "methods": [ - "execute_streaming_sql" - ] - }, - "ExecuteBatchDml": { - "methods": [ - "execute_batch_dml" - ] - }, - "Read": { - "methods": [ - "read" - ] - }, - "StreamingRead": { - "methods": [ - "streaming_read" - ] - }, - "BeginTransaction": { - "methods": [ - "begin_transaction" - ] - }, - "Commit": { - "methods": [ - "commit" - ] - }, - "Rollback": { - "methods": [ - "rollback" - ] - }, - "PartitionQuery": { - "methods": [ - "partition_query" - ] - }, - "PartitionRead": { - "methods": [ - "partition_read" - ] - }, - "BatchWrite": { - "methods": [ - "batch_write" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec b/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec deleted file mode 100644 index ccade5d97a84..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/google-cloud-spanner-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/spanner/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-spanner-v1" - gem.version = Google::Cloud::Spanner::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details." - gem.summary = "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-v1.rb deleted file mode 100644 index 2f3a79fec01f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google-cloud-spanner-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/spanner/v1" diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1.rb deleted file mode 100644 index 031d8a0b49f6..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/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/spanner/v1/spanner" -require "google/cloud/spanner/v1/version" - -module Google - module Cloud - module Spanner - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/spanner/v1" - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/spanner/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.rb deleted file mode 100644 index 50df58fbcc65..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner.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/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/spanner/v1/version" - -require "google/cloud/spanner/v1/spanner/credentials" -require "google/cloud/spanner/v1/spanner/paths" -require "google/cloud/spanner/v1/spanner/client" - -module Google - module Cloud - module Spanner - module V1 - ## - # Cloud Spanner API - # - # The Cloud Spanner API can be used to manage sessions and execute - # transactions on data stored in Cloud Spanner databases. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/spanner/v1/spanner" - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new - # - module Spanner - end - end - end - end -end - -helper_path = ::File.join __dir__, "spanner", "helpers.rb" -require "google/cloud/spanner/v1/spanner/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb deleted file mode 100644 index 9ee4c79a9513..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/client.rb +++ /dev/null @@ -1,2636 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/spanner/v1/spanner_pb" - -module Google - module Cloud - module Spanner - module V1 - module Spanner - ## - # Client for the Spanner service. - # - # Cloud Spanner API - # - # The Cloud Spanner API can be used to manage sessions and execute - # transactions on data stored in Cloud Spanner databases. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :spanner_stub - - ## - # Configure the Spanner Client class. - # - # See {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Spanner clients - # ::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Spanner", "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_session.timeout = 30.0 - default_config.rpcs.create_session.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.batch_create_sessions.timeout = 60.0 - default_config.rpcs.batch_create_sessions.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.get_session.timeout = 30.0 - default_config.rpcs.get_session.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.list_sessions.timeout = 3600.0 - default_config.rpcs.list_sessions.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.delete_session.timeout = 30.0 - default_config.rpcs.delete_session.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.execute_sql.timeout = 30.0 - default_config.rpcs.execute_sql.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.execute_streaming_sql.timeout = 3600.0 - - default_config.rpcs.execute_batch_dml.timeout = 30.0 - default_config.rpcs.execute_batch_dml.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.read.timeout = 30.0 - default_config.rpcs.read.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.streaming_read.timeout = 3600.0 - - default_config.rpcs.begin_transaction.timeout = 30.0 - default_config.rpcs.begin_transaction.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.commit.timeout = 3600.0 - default_config.rpcs.commit.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.rollback.timeout = 30.0 - default_config.rpcs.rollback.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.partition_query.timeout = 30.0 - default_config.rpcs.partition_query.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.partition_read.timeout = 30.0 - default_config.rpcs.partition_read.retry_policy = { - initial_delay: 0.25, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 8] - } - - default_config.rpcs.batch_write.timeout = 3600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Spanner Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @spanner_stub.universe_domain - end - - ## - # Create a new Spanner client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Spanner 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/spanner/v1/spanner_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 - - @spanner_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Spanner::V1::Spanner::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 - ) - - @spanner_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 - @spanner_stub.logger - end - - # Service calls - - ## - # Creates a new session. A session can be used to perform - # transactions that read and/or modify data in a Cloud Spanner database. - # Sessions are meant to be reused for many consecutive - # transactions. - # - # Sessions can only execute one transaction at a time. To execute - # multiple concurrent read-write/write-only transactions, create - # multiple sessions. Note that standalone reads and queries use a - # transaction internally, and count toward the one transaction - # limit. - # - # Active sessions use additional server resources, so it's a good idea to - # delete idle and unneeded sessions. - # Aside from explicit deletes, Cloud Spanner can delete sessions when no - # operations are sent for more than an hour. If a session is deleted, - # requests to it return `NOT_FOUND`. - # - # Idle sessions can be kept alive by sending a trivial SQL query - # periodically, for example, `"SELECT 1"`. - # - # @overload create_session(request, options = nil) - # Pass arguments to `create_session` via a request object, either of type - # {::Google::Cloud::Spanner::V1::CreateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::CreateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_session(database: nil, session: nil) - # Pass arguments to `create_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database in which the new session is created. - # @param session [::Google::Cloud::Spanner::V1::Session, ::Hash] - # Required. The session to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::CreateSessionRequest.new - # - # # Call the create_session method. - # result = client.create_session request - # - # # The returned object is of type Google::Cloud::Spanner::V1::Session. - # p result - # - def create_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::CreateSessionRequest - - # Converts hash and nil to 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_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_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_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :create_session, request, 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 multiple new sessions. - # - # This API can be used to initialize a session cache on the clients. - # See https://goo.gl/TgSFN2 for best practices on session cache management. - # - # @overload batch_create_sessions(request, options = nil) - # Pass arguments to `batch_create_sessions` via a request object, either of type - # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_create_sessions(database: nil, session_template: nil, session_count: nil) - # Pass arguments to `batch_create_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database in which the new sessions are created. - # @param session_template [::Google::Cloud::Spanner::V1::Session, ::Hash] - # Parameters to apply to each created session. - # @param session_count [::Integer] - # Required. The number of sessions to be created in this batch call. At least - # one session is created. The API can return fewer than the requested number - # of sessions. If a specific number of sessions are desired, the client can - # make additional calls to `BatchCreateSessions` (adjusting - # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} - # as necessary). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new - # - # # Call the batch_create_sessions method. - # result = client.batch_create_sessions request - # - # # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. - # p result - # - def batch_create_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_create_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_create_sessions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :batch_create_sessions, request, 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 session. Returns `NOT_FOUND` if the session doesn't exist. - # This is mainly useful for determining whether a session is still - # alive. - # - # @overload get_session(request, options = nil) - # Pass arguments to `get_session` via a request object, either of type - # {::Google::Cloud::Spanner::V1::GetSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::GetSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_session(name: nil) - # Pass arguments to `get_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 session to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::GetSessionRequest.new - # - # # Call the get_session method. - # result = client.get_session request - # - # # The returned object is of type Google::Cloud::Spanner::V1::Session. - # p result - # - def get_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::GetSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :get_session, request, 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 sessions in a given database. - # - # @overload list_sessions(request, options = nil) - # Pass arguments to `list_sessions` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ListSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ListSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_sessions(database: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database in which to list sessions. - # @param page_size [::Integer] - # Number of sessions to be returned in the response. If 0 or less, defaults - # to the server's maximum allowed page size. - # @param page_token [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::V1::ListSessionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::V1::ListSessionsResponse ListSessionsResponse}. - # @param filter [::String] - # An expression for filtering the results of the request. Filter rules are - # case insensitive. The fields eligible for filtering are: - # - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `labels.env:*` --> The session has the label "env". - # * `labels.env:dev` --> The session has the label "env" and the value of - # the label contains the string "dev". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::V1::Session>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::V1::Session>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ListSessionsRequest.new - # - # # Call the list_sessions method. - # result = client.list_sessions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Spanner::V1::Session. - # p item - # end - # - def list_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ListSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :list_sessions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @spanner_stub, :list_sessions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Ends a session, releasing server resources associated with it. This - # asynchronously triggers the cancellation of any operations that are running - # with this session. - # - # @overload delete_session(request, options = nil) - # Pass arguments to `delete_session` via a request object, either of type - # {::Google::Cloud::Spanner::V1::DeleteSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::DeleteSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_session(name: nil) - # Pass arguments to `delete_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 session to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new - # - # # Call the delete_session method. - # result = client.delete_session request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::DeleteSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :delete_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Executes an SQL statement, returning all results in a single reply. This - # method can't be used to return a result set larger than 10 MiB; - # if the query yields more data than that, the query fails with - # a `FAILED_PRECONDITION` error. - # - # Operations inside read-write transactions might return `ABORTED`. If - # this occurs, the application should restart the transaction from - # the beginning. See {::Google::Cloud::Spanner::V1::Transaction Transaction} for more - # details. - # - # Larger result sets can be fetched in streaming fashion by calling - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql} - # instead. - # - # The query string can be SQL or [Graph Query Language - # (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - # - # @overload execute_sql(request, options = nil) - # Pass arguments to `execute_sql` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ExecuteSqlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload execute_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, last_statement: nil, routing_hint: nil) - # Pass arguments to `execute_sql` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the SQL query should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # The transaction to use. - # - # For queries, if none is provided, the default is a temporary read-only - # transaction with strong concurrency. - # - # Standard DML statements require a read-write transaction. To protect - # against replays, single-use transactions are not supported. The caller - # must either supply an existing transaction ID or begin a new transaction. - # - # Partitioned DML requires an existing Partitioned DML transaction ID. - # @param sql [::String] - # Required. The SQL string. - # @param params [::Google::Protobuf::Struct, ::Hash] - # Parameter names and values that bind to placeholders in the SQL string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names must conform - # to the naming requirements of identifiers as specified at - # https://cloud.google.com/spanner/docs/lexical#identifiers. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. - # - # In these cases, you can use `param_types` to specify the exact - # SQL type for some or all of the SQL statement parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @param resume_token [::String] - # If this request is resuming a previously interrupted SQL statement - # execution, `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new SQL statement execution to resume - # where the last one left off. The rest of the request parameters must - # exactly match the request that yielded this token. - # @param query_mode [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] - # Used to control the amount of debugging information returned in - # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is - # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only - # be set to - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. - # @param partition_token [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionQuery`. There must be an exact - # match for the values of fields common to this message and the - # `PartitionQueryRequest` message used to create this `partition_token`. - # @param seqno [::Integer] - # A per-transaction sequence number used to identify this request. This field - # makes each request idempotent such that if the request is received multiple - # times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction can be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # - # Required for DML statements. Ignored for queries. - # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash] - # Query optimizer configuration to use for the given query. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] - # Directed read options for this request. - # @param data_boost_enabled [::Boolean] - # If this is for a partitioned query and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @param last_statement [::Boolean] - # Optional. If set to `true`, this statement marks the end of the - # transaction. After this statement executes, you must commit or abort the - # transaction. Attempts to execute any other requests against this - # transaction (including reads and queries) are rejected. - # - # For DML statements, setting this option might cause some error reporting to - # be deferred until commit time (for example, validation of unique - # constraints). Given this, successful execution of a DML statement shouldn't - # be assumed until a subsequent `Commit` call completes successfully. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::ResultSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new - # - # # Call the execute_sql method. - # result = client.execute_sql request - # - # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. - # p result - # - def execute_sql request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.execute_sql.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.execute_sql.timeout, - metadata: metadata, - retry_policy: @config.rpcs.execute_sql.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :execute_sql, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Like {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, except returns the - # result set as a stream. Unlike - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, there is no limit on - # the size of the returned result set. However, no individual row in the - # result set can exceed 100 MiB, and no column value can exceed 10 MiB. - # - # The query string can be SQL or [Graph Query Language - # (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro). - # - # @overload execute_streaming_sql(request, options = nil) - # Pass arguments to `execute_streaming_sql` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ExecuteSqlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload execute_streaming_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, last_statement: nil, routing_hint: nil) - # Pass arguments to `execute_streaming_sql` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the SQL query should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # The transaction to use. - # - # For queries, if none is provided, the default is a temporary read-only - # transaction with strong concurrency. - # - # Standard DML statements require a read-write transaction. To protect - # against replays, single-use transactions are not supported. The caller - # must either supply an existing transaction ID or begin a new transaction. - # - # Partitioned DML requires an existing Partitioned DML transaction ID. - # @param sql [::String] - # Required. The SQL string. - # @param params [::Google::Protobuf::Struct, ::Hash] - # Parameter names and values that bind to placeholders in the SQL string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names must conform - # to the naming requirements of identifiers as specified at - # https://cloud.google.com/spanner/docs/lexical#identifiers. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. - # - # In these cases, you can use `param_types` to specify the exact - # SQL type for some or all of the SQL statement parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @param resume_token [::String] - # If this request is resuming a previously interrupted SQL statement - # execution, `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new SQL statement execution to resume - # where the last one left off. The rest of the request parameters must - # exactly match the request that yielded this token. - # @param query_mode [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] - # Used to control the amount of debugging information returned in - # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is - # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only - # be set to - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. - # @param partition_token [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionQuery`. There must be an exact - # match for the values of fields common to this message and the - # `PartitionQueryRequest` message used to create this `partition_token`. - # @param seqno [::Integer] - # A per-transaction sequence number used to identify this request. This field - # makes each request idempotent such that if the request is received multiple - # times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction can be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # - # Required for DML statements. Ignored for queries. - # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash] - # Query optimizer configuration to use for the given query. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] - # Directed read options for this request. - # @param data_boost_enabled [::Boolean] - # If this is for a partitioned query and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @param last_statement [::Boolean] - # Optional. If set to `true`, this statement marks the end of the - # transaction. After this statement executes, you must commit or abort the - # transaction. Attempts to execute any other requests against this - # transaction (including reads and queries) are rejected. - # - # For DML statements, setting this option might cause some error reporting to - # be deferred until commit time (for example, validation of unique - # constraints). Given this, successful execution of a DML statement shouldn't - # be assumed until a subsequent `Commit` call completes successfully. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new - # - # # Call the execute_streaming_sql method to start streaming. - # output = client.execute_streaming_sql request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Spanner::V1::PartialResultSet - # output.each do |current_response| - # p current_response - # end - # - def execute_streaming_sql request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.execute_streaming_sql.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.execute_streaming_sql.timeout, - metadata: metadata, - retry_policy: @config.rpcs.execute_streaming_sql.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :execute_streaming_sql, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Executes a batch of SQL DML statements. This method allows many statements - # to be run with lower latency than submitting them sequentially with - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. - # - # Statements are executed in sequential order. A request can succeed even if - # a statement fails. The - # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse#status ExecuteBatchDmlResponse.status} - # field in the response provides information about the statement that failed. - # Clients must inspect this field to determine whether an error occurred. - # - # Execution stops after the first failed statement; the remaining statements - # are not executed. - # - # @overload execute_batch_dml(request, options = nil) - # Pass arguments to `execute_batch_dml` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload execute_batch_dml(session: nil, transaction: nil, statements: nil, seqno: nil, request_options: nil, last_statements: nil) - # Pass arguments to `execute_batch_dml` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the DML statements should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # Required. The transaction to use. Must be a read-write transaction. - # - # To protect against replays, single-use transactions are not supported. The - # caller must either supply an existing transaction ID or begin a new - # transaction. - # @param statements [::Array<::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement, ::Hash>] - # Required. The list of statements to execute in this batch. Statements are - # executed serially, such that the effects of statement `i` are visible to - # statement `i+1`. Each statement must be a DML statement. Execution stops at - # the first failed statement; the remaining statements are not executed. - # - # Callers must provide at least one statement. - # @param seqno [::Integer] - # Required. A per-transaction sequence number used to identify this request. - # This field makes each request idempotent such that if the request is - # received multiple times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction might be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param last_statements [::Boolean] - # Optional. If set to `true`, this request marks the end of the transaction. - # After these statements execute, you must commit or abort the transaction. - # Attempts to execute any other requests against this transaction - # (including reads and queries) are rejected. - # - # Setting this option might cause some error reporting to be deferred until - # commit time (for example, validation of unique constraints). Given this, - # successful execution of statements shouldn't be assumed until a subsequent - # `Commit` call completes successfully. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new - # - # # Call the execute_batch_dml method. - # result = client.execute_batch_dml request - # - # # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. - # p result - # - def execute_batch_dml request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.execute_batch_dml.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.execute_batch_dml.timeout, - metadata: metadata, - retry_policy: @config.rpcs.execute_batch_dml.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :execute_batch_dml, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Reads rows from the database using key lookups and scans, as a - # simple key/value style alternative to - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. This method can't be - # used to return a result set larger than 10 MiB; if the read matches more - # data than that, the read fails with a `FAILED_PRECONDITION` - # error. - # - # Reads inside read-write transactions might return `ABORTED`. If - # this occurs, the application should restart the transaction from - # the beginning. See {::Google::Cloud::Spanner::V1::Transaction Transaction} for more - # details. - # - # Larger result sets can be yielded in streaming fashion by calling - # {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead} instead. - # - # @overload read(request, options = nil) - # Pass arguments to `read` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ReadRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ReadRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, order_by: nil, lock_hint: nil, routing_hint: nil) - # Pass arguments to `read` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the read should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # The transaction to use. If none is provided, the default is a - # temporary read-only transaction with strong concurrency. - # @param table [::String] - # Required. The name of the table in the database to be read. - # @param index [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of - # the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. - # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further - # information. - # @param columns [::Array<::String>] - # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be - # returned for each row matching this request. - # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to - # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. - # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys - # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. - # - # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} - # field is empty, rows are yielded in table primary key order (if - # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order - # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the - # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field - # isn't empty, rows are yielded in an unspecified order. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @param limit [::Integer] - # If greater than zero, only the first `limit` rows are yielded. If `limit` - # is zero, the default is no limit. A limit can't be specified if - # `partition_token` is set. - # @param resume_token [::String] - # If this request is resuming a previously interrupted read, - # `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new read to resume where the last read - # left off. The rest of the request parameters must exactly match the request - # that yielded this token. - # @param partition_token [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionRead`. There must be an exact - # match for the values of fields common to this message and the - # PartitionReadRequest message used to create this partition_token. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] - # Directed read options for this request. - # @param data_boost_enabled [::Boolean] - # If this is for a partitioned read and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @param order_by [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] - # Optional. Order for the returned rows. - # - # By default, Spanner returns result rows in primary key order except for - # PartitionRead requests. For applications that don't require rows to be - # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - # resulting in lower latencies in certain cases (for example, bulk point - # lookups). - # @param lock_hint [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] - # Optional. Lock Hint for the request, it can only be used with read-write - # transactions. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::ResultSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ReadRequest.new - # - # # Call the read method. - # result = client.read request - # - # # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. - # p result - # - def read request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ReadRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.read.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.read.timeout, - metadata: metadata, - retry_policy: @config.rpcs.read.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :read, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Like {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, except returns the result set - # as a stream. Unlike {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, there is no - # limit on the size of the returned result set. However, no individual row in - # the result set can exceed 100 MiB, and no column value can exceed - # 10 MiB. - # - # @overload streaming_read(request, options = nil) - # Pass arguments to `streaming_read` via a request object, either of type - # {::Google::Cloud::Spanner::V1::ReadRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::ReadRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload streaming_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil, directed_read_options: nil, data_boost_enabled: nil, order_by: nil, lock_hint: nil, routing_hint: nil) - # Pass arguments to `streaming_read` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the read should be performed. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # The transaction to use. If none is provided, the default is a - # temporary read-only transaction with strong concurrency. - # @param table [::String] - # Required. The name of the table in the database to be read. - # @param index [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of - # the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. - # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further - # information. - # @param columns [::Array<::String>] - # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be - # returned for each row matching this request. - # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to - # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. - # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys - # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. - # - # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} - # field is empty, rows are yielded in table primary key order (if - # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order - # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the - # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field - # isn't empty, rows are yielded in an unspecified order. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @param limit [::Integer] - # If greater than zero, only the first `limit` rows are yielded. If `limit` - # is zero, the default is no limit. A limit can't be specified if - # `partition_token` is set. - # @param resume_token [::String] - # If this request is resuming a previously interrupted read, - # `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new read to resume where the last read - # left off. The rest of the request parameters must exactly match the request - # that yielded this token. - # @param partition_token [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionRead`. There must be an exact - # match for the values of fields common to this message and the - # PartitionReadRequest message used to create this partition_token. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param directed_read_options [::Google::Cloud::Spanner::V1::DirectedReadOptions, ::Hash] - # Directed read options for this request. - # @param data_boost_enabled [::Boolean] - # If this is for a partitioned read and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @param order_by [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] - # Optional. Order for the returned rows. - # - # By default, Spanner returns result rows in primary key order except for - # PartitionRead requests. For applications that don't require rows to be - # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - # resulting in lower latencies in certain cases (for example, bulk point - # lookups). - # @param lock_hint [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] - # Optional. Lock Hint for the request, it can only be used with read-write - # transactions. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::ReadRequest.new - # - # # Call the streaming_read method to start streaming. - # output = client.streaming_read request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Spanner::V1::PartialResultSet - # output.each do |current_response| - # p current_response - # end - # - def streaming_read request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::ReadRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.streaming_read.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.streaming_read.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_read.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :streaming_read, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins a new transaction. This step can often be skipped: - # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} can begin a new transaction as a - # side-effect. - # - # @overload begin_transaction(request, options = nil) - # Pass arguments to `begin_transaction` via a request object, either of type - # {::Google::Cloud::Spanner::V1::BeginTransactionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::BeginTransactionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload begin_transaction(session: nil, options: nil, request_options: nil, mutation_key: nil, routing_hint: nil) - # Pass arguments to `begin_transaction` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the transaction runs. - # @param options [::Google::Cloud::Spanner::V1::TransactionOptions, ::Hash] - # Required. Options for the new transaction. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # Priority is ignored for this request. Setting the priority in this - # `request_options` struct doesn't do anything. To set the priority for a - # transaction, set it on the reads and writes that are part of this - # transaction instead. - # @param mutation_key [::Google::Cloud::Spanner::V1::Mutation, ::Hash] - # Optional. Required for read-write transactions on a multiplexed session - # that commit mutations but don't perform any reads or queries. You must - # randomly select one of the mutations from the mutation set and send it as a - # part of this request. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::Transaction] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::Transaction] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new - # - # # Call the begin_transaction method. - # result = client.begin_transaction request - # - # # The returned object is of type Google::Cloud::Spanner::V1::Transaction. - # p result - # - def begin_transaction request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BeginTransactionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.begin_transaction.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout, - metadata: metadata, - retry_policy: @config.rpcs.begin_transaction.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :begin_transaction, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Commits a transaction. The request includes the mutations to be - # applied to rows in the database. - # - # `Commit` might return an `ABORTED` error. This can occur at any time; - # commonly, the cause is conflicts with concurrent - # transactions. However, it can also happen for a variety of other - # reasons. If `Commit` returns `ABORTED`, the caller should retry - # the transaction from the beginning, reusing the same session. - # - # On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, - # for example, if the client job experiences a 1+ hour networking failure. - # At that point, Cloud Spanner has lost track of the transaction outcome and - # we recommend that you perform another read from the database to see the - # state of things as they are now. - # - # @overload commit(request, options = nil) - # Pass arguments to `commit` via a request object, either of type - # {::Google::Cloud::Spanner::V1::CommitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::CommitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload commit(session: nil, transaction_id: nil, single_use_transaction: nil, mutations: nil, return_commit_stats: nil, max_commit_delay: nil, request_options: nil, precommit_token: nil, routing_hint: nil) - # Pass arguments to `commit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the transaction to be committed is running. - # @param transaction_id [::String] - # Commit a previously-started transaction. - # - # Note: The following parameters are mutually exclusive: `transaction_id`, `single_use_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param single_use_transaction [::Google::Cloud::Spanner::V1::TransactionOptions, ::Hash] - # Execute mutations in a temporary transaction. Note that unlike - # commit of a previously-started transaction, commit with a - # temporary transaction is non-idempotent. That is, if the - # `CommitRequest` is sent to Cloud Spanner more than once (for - # instance, due to retries in the application, or in the - # transport library), it's possible that the mutations are - # executed more than once. If this is undesirable, use - # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} instead. - # - # Note: The following parameters are mutually exclusive: `single_use_transaction`, `transaction_id`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param mutations [::Array<::Google::Cloud::Spanner::V1::Mutation, ::Hash>] - # The mutations to be executed when this transaction commits. All - # mutations are applied atomically, in the order they appear in - # this list. - # @param return_commit_stats [::Boolean] - # If `true`, then statistics related to the transaction is included in - # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. - # Default value is `false`. - # @param max_commit_delay [::Google::Protobuf::Duration, ::Hash] - # Optional. The amount of latency this request is configured to incur in - # order to improve throughput. If this field isn't set, Spanner assumes - # requests are relatively latency sensitive and automatically determines an - # appropriate delay time. You can specify a commit delay value between 0 and - # 500 ms. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param precommit_token [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken, ::Hash] - # Optional. If the read-write transaction was executed on a multiplexed - # session, then you must include the precommit token with the highest - # sequence number received in this transaction attempt. Failing to do so - # results in a `FailedPrecondition` error. - # @param routing_hint [::Google::Cloud::Spanner::V1::RoutingHint, ::Hash] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::CommitResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::CommitResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::CommitRequest.new - # - # # Call the commit method. - # result = client.commit request - # - # # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. - # p result - # - def commit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::CommitRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.commit.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.commit.timeout, - metadata: metadata, - retry_policy: @config.rpcs.commit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :commit, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rolls back a transaction, releasing any locks it holds. It's a good - # idea to call this for any transaction that includes one or more - # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} requests and ultimately - # decides not to commit. - # - # `Rollback` returns `OK` if it successfully aborts the transaction, the - # transaction was already aborted, or the transaction isn't - # found. `Rollback` never returns `ABORTED`. - # - # @overload rollback(request, options = nil) - # Pass arguments to `rollback` via a request object, either of type - # {::Google::Cloud::Spanner::V1::RollbackRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::RollbackRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload rollback(session: nil, transaction_id: nil) - # Pass arguments to `rollback` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the transaction to roll back is running. - # @param transaction_id [::String] - # Required. The transaction to roll back. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::RollbackRequest.new - # - # # Call the rollback method. - # result = client.rollback request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def rollback request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::RollbackRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.rollback.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.rollback.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rollback.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :rollback, request, 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 set of partition tokens that can be used to execute a query - # operation in parallel. Each of the returned partition tokens can be used - # by {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql} to - # specify a subset of the query result to read. The same session and - # read-only transaction must be used by the `PartitionQueryRequest` used to - # create the partition tokens and the `ExecuteSqlRequests` that use the - # partition tokens. - # - # Partition tokens become invalid when the session used to create them - # is deleted, is idle for too long, begins a new transaction, or becomes too - # old. When any of these happen, it isn't possible to resume the query, and - # the whole operation must be restarted from the beginning. - # - # @overload partition_query(request, options = nil) - # Pass arguments to `partition_query` via a request object, either of type - # {::Google::Cloud::Spanner::V1::PartitionQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::PartitionQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload partition_query(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, partition_options: nil) - # Pass arguments to `partition_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session used to create the partitions. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # Read-only snapshot transactions are supported, read and write and - # single-use transactions are not. - # @param sql [::String] - # Required. The query request to generate partitions for. The request fails - # if the query isn't root partitionable. For a query to be root - # partitionable, it needs to satisfy a few conditions. For example, if the - # query execution plan contains a distributed union operator, then it must be - # the first operator in the plan. For more information about other - # conditions, see [Read data in - # parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). - # - # The query request must not contain DML commands, such as `INSERT`, - # `UPDATE`, or `DELETE`. Use - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql `ExecuteStreamingSql`} with - # a `PartitionedDml` transaction for large, partition-friendly DML - # operations. - # @param params [::Google::Protobuf::Struct, ::Hash] - # Optional. Parameter names and values that bind to placeholders in the SQL - # string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names can contain - # letters, numbers, and underscores. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @param param_types [::Hash{::String => ::Google::Cloud::Spanner::V1::Type, ::Hash}] - # Optional. It isn't always possible for Cloud Spanner to infer the right SQL - # type from a JSON value. For example, values of type `BYTES` and values of - # type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. - # - # In these cases, `param_types` can be used to specify the exact - # SQL type for some or all of the SQL query parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @param partition_options [::Google::Cloud::Spanner::V1::PartitionOptions, ::Hash] - # Additional options that affect how many partitions are created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::PartitionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::PartitionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new - # - # # Call the partition_query method. - # result = client.partition_query request - # - # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. - # p result - # - def partition_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::PartitionQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.partition_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.partition_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.partition_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :partition_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a set of partition tokens that can be used to execute a read - # operation in parallel. Each of the returned partition tokens can be used - # by {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead} to specify a - # subset of the read result to read. The same session and read-only - # transaction must be used by the `PartitionReadRequest` used to create the - # partition tokens and the `ReadRequests` that use the partition tokens. - # There are no ordering guarantees on rows returned among the returned - # partition tokens, or even within each individual `StreamingRead` call - # issued with a `partition_token`. - # - # Partition tokens become invalid when the session used to create them - # is deleted, is idle for too long, begins a new transaction, or becomes too - # old. When any of these happen, it isn't possible to resume the read, and - # the whole operation must be restarted from the beginning. - # - # @overload partition_read(request, options = nil) - # Pass arguments to `partition_read` via a request object, either of type - # {::Google::Cloud::Spanner::V1::PartitionReadRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::PartitionReadRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload partition_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, partition_options: nil) - # Pass arguments to `partition_read` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session used to create the partitions. - # @param transaction [::Google::Cloud::Spanner::V1::TransactionSelector, ::Hash] - # Read only snapshot transactions are supported, read/write and single use - # transactions are not. - # @param table [::String] - # Required. The name of the table in the database to be read. - # @param index [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table}. This index is used - # instead of the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting - # result rows. See {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} - # for further information. - # @param columns [::Array<::String>] - # The columns of {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be - # returned for each row matching this request. - # @param key_set [::Google::Cloud::Spanner::V1::KeySet, ::Hash] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present. If - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} instead names - # index keys in {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index}. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @param partition_options [::Google::Cloud::Spanner::V1::PartitionOptions, ::Hash] - # Additional options that affect how many partitions are created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Spanner::V1::PartitionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Spanner::V1::PartitionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::PartitionReadRequest.new - # - # # Call the partition_read method. - # result = client.partition_read request - # - # # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. - # p result - # - def partition_read request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::PartitionReadRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.partition_read.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.partition_read.timeout, - metadata: metadata, - retry_policy: @config.rpcs.partition_read.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :partition_read, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Batches the supplied mutation groups in a collection of efficient - # transactions. All mutations in a group are committed atomically. However, - # mutations across groups can be committed non-atomically in an unspecified - # order and thus, they must be independent of each other. Partial failure is - # possible, that is, some groups might have been committed successfully, - # while some might have failed. The results of individual batches are - # streamed into the response as the batches are applied. - # - # `BatchWrite` requests are not replay protected, meaning that each mutation - # group can be applied more than once. Replays of non-idempotent mutations - # can have undesirable effects. For example, replays of an insert mutation - # can produce an already exists error or if you use generated or commit - # timestamp-based keys, it can result in additional rows being added to the - # mutation's table. We recommend structuring your mutation groups to be - # idempotent to avoid this issue. - # - # @overload batch_write(request, options = nil) - # Pass arguments to `batch_write` via a request object, either of type - # {::Google::Cloud::Spanner::V1::BatchWriteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Spanner::V1::BatchWriteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_write(session: nil, request_options: nil, mutation_groups: nil, exclude_txn_from_change_streams: nil) - # Pass arguments to `batch_write` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::String] - # Required. The session in which the batch request is to be run. - # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash] - # Common options for this request. - # @param mutation_groups [::Array<::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup, ::Hash>] - # Required. The groups of mutations to be applied. - # @param exclude_txn_from_change_streams [::Boolean] - # Optional. If you don't set the `exclude_txn_from_change_streams` option or - # if it's set to `false`, then any change streams monitoring columns modified - # by transactions will capture the updates made within that transaction. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::BatchWriteResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Spanner::V1::BatchWriteResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/spanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Spanner::V1::Spanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Spanner::V1::BatchWriteRequest.new - # - # # Call the batch_write method to start streaming. - # output = client.batch_write request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Spanner::V1::BatchWriteResponse - # output.each do |current_response| - # p current_response - # end - # - def batch_write request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::V1::BatchWriteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_write.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Spanner::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_write.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_write.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @spanner_stub.call_rpc :batch_write, request, 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 Spanner API. - # - # This class represents the configuration for Spanner, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Spanner::V1::Spanner::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_session to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Spanner::V1::Spanner::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Spanner::V1::Spanner::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "spanner.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Spanner API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session - ## - # RPC-specific configuration for `batch_create_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_sessions - ## - # RPC-specific configuration for `get_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session - ## - # RPC-specific configuration for `list_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sessions - ## - # RPC-specific configuration for `delete_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session - ## - # RPC-specific configuration for `execute_sql` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_sql - ## - # RPC-specific configuration for `execute_streaming_sql` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_streaming_sql - ## - # RPC-specific configuration for `execute_batch_dml` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_batch_dml - ## - # RPC-specific configuration for `read` - # @return [::Gapic::Config::Method] - # - attr_reader :read - ## - # RPC-specific configuration for `streaming_read` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_read - ## - # RPC-specific configuration for `begin_transaction` - # @return [::Gapic::Config::Method] - # - attr_reader :begin_transaction - ## - # RPC-specific configuration for `commit` - # @return [::Gapic::Config::Method] - # - attr_reader :commit - ## - # RPC-specific configuration for `rollback` - # @return [::Gapic::Config::Method] - # - attr_reader :rollback - ## - # RPC-specific configuration for `partition_query` - # @return [::Gapic::Config::Method] - # - attr_reader :partition_query - ## - # RPC-specific configuration for `partition_read` - # @return [::Gapic::Config::Method] - # - attr_reader :partition_read - ## - # RPC-specific configuration for `batch_write` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_write - - # @private - def initialize parent_rpcs = nil - create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session - @create_session = ::Gapic::Config::Method.new create_session_config - batch_create_sessions_config = parent_rpcs.batch_create_sessions if parent_rpcs.respond_to? :batch_create_sessions - @batch_create_sessions = ::Gapic::Config::Method.new batch_create_sessions_config - get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session - @get_session = ::Gapic::Config::Method.new get_session_config - list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions - @list_sessions = ::Gapic::Config::Method.new list_sessions_config - delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session - @delete_session = ::Gapic::Config::Method.new delete_session_config - execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql - @execute_sql = ::Gapic::Config::Method.new execute_sql_config - execute_streaming_sql_config = parent_rpcs.execute_streaming_sql if parent_rpcs.respond_to? :execute_streaming_sql - @execute_streaming_sql = ::Gapic::Config::Method.new execute_streaming_sql_config - execute_batch_dml_config = parent_rpcs.execute_batch_dml if parent_rpcs.respond_to? :execute_batch_dml - @execute_batch_dml = ::Gapic::Config::Method.new execute_batch_dml_config - read_config = parent_rpcs.read if parent_rpcs.respond_to? :read - @read = ::Gapic::Config::Method.new read_config - streaming_read_config = parent_rpcs.streaming_read if parent_rpcs.respond_to? :streaming_read - @streaming_read = ::Gapic::Config::Method.new streaming_read_config - begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction - @begin_transaction = ::Gapic::Config::Method.new begin_transaction_config - commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit - @commit = ::Gapic::Config::Method.new commit_config - rollback_config = parent_rpcs.rollback if parent_rpcs.respond_to? :rollback - @rollback = ::Gapic::Config::Method.new rollback_config - partition_query_config = parent_rpcs.partition_query if parent_rpcs.respond_to? :partition_query - @partition_query = ::Gapic::Config::Method.new partition_query_config - partition_read_config = parent_rpcs.partition_read if parent_rpcs.respond_to? :partition_read - @partition_read = ::Gapic::Config::Method.new partition_read_config - batch_write_config = parent_rpcs.batch_write if parent_rpcs.respond_to? :batch_write - @batch_write = ::Gapic::Config::Method.new batch_write_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb deleted file mode 100644 index 1970ece8b929..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Spanner - module V1 - module Spanner - # Credentials for the Spanner API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/spanner.data" - ] - self.env_vars = [ - "SPANNER_CREDENTIALS", - "SPANNER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPANNER_CREDENTIALS_JSON", - "SPANNER_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-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/paths.rb deleted file mode 100644 index ef5cfd6c6bab..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/spanner/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 Spanner - module V1 - module Spanner - # Path helper methods for the Spanner API. - module Paths - ## - # Create a fully-qualified Database resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/databases/{database}` - # - # @param project [String] - # @param instance [String] - # @param database [String] - # - # @return [::String] - def database_path project:, instance:, database: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/databases/#{database}" - end - - ## - # Create a fully-qualified Session resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/instances/{instance}/databases/{database}/sessions/{session}` - # - # @param project [String] - # @param instance [String] - # @param database [String] - # @param session [String] - # - # @return [::String] - def session_path project:, instance:, database:, session: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" - raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/" - - "projects/#{project}/instances/#{instance}/databases/#{database}/sessions/#{session}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/v1/version.rb deleted file mode 100644 index d42f1a645d00..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/cloud/spanner/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 Spanner - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb deleted file mode 100644 index 4d36ea2bd9bf..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/change_stream_pb.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/change_stream.proto - -require 'google/protobuf' - -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/spanner/v1/type_pb' - - -descriptor_data = "\n%google/spanner/v1/change_stream.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x96\x14\n\x12\x43hangeStreamRecord\x12T\n\x12\x64\x61ta_change_record\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.ChangeStreamRecord.DataChangeRecordH\x00\x12Q\n\x10heartbeat_record\x18\x02 \x01(\x0b\x32\x35.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordH\x00\x12\\\n\x16partition_start_record\x18\x03 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordH\x00\x12X\n\x14partition_end_record\x18\x04 \x01(\x0b\x32\x38.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordH\x00\x12\\\n\x16partition_event_record\x18\x05 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordH\x00\x1a\xd2\n\n\x10\x44\x61taChangeRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x1d\n\x15server_transaction_id\x18\x03 \x01(\t\x12\x32\n*is_last_record_in_transaction_in_partition\x18\x04 \x01(\x08\x12\r\n\x05table\x18\x05 \x01(\t\x12^\n\x0f\x63olumn_metadata\x18\x06 \x03(\x0b\x32\x45.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata\x12H\n\x04mods\x18\x07 \x03(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod\x12P\n\x08mod_type\x18\x08 \x01(\x0e\x32>.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType\x12\x63\n\x12value_capture_type\x18\t \x01(\x0e\x32G.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType\x12(\n number_of_records_in_transaction\x18\n \x01(\x05\x12+\n#number_of_partitions_in_transaction\x18\x0b \x01(\x05\x12\x17\n\x0ftransaction_tag\x18\x0c \x01(\t\x12\x1d\n\x15is_system_transaction\x18\r \x01(\x08\x1aw\n\x0e\x43olumnMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type\x12\x16\n\x0eis_primary_key\x18\x03 \x01(\x08\x12\x18\n\x10ordinal_position\x18\x04 \x01(\x03\x1aP\n\x08ModValue\x12\x1d\n\x15\x63olumn_metadata_index\x18\x01 \x01(\x05\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\xfe\x01\n\x03Mod\x12M\n\x04keys\x18\x01 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nold_values\x18\x02 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nnew_values\x18\x03 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\"G\n\x07ModType\x12\x18\n\x14MOD_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INSERT\x10\n\x12\n\n\x06UPDATE\x10\x14\x12\n\n\x06\x44\x45LETE\x10\x1e\"\x87\x01\n\x10ValueCaptureType\x12\"\n\x1eVALUE_CAPTURE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12OLD_AND_NEW_VALUES\x10\n\x12\x0e\n\nNEW_VALUES\x10\x14\x12\x0b\n\x07NEW_ROW\x10\x1e\x12\x1a\n\x16NEW_ROW_AND_OLD_VALUES\x10(\x1a@\n\x0fHeartbeatRecord\x12-\n\ttimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a~\n\x14PartitionStartRecord\x12\x33\n\x0fstart_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x18\n\x10partition_tokens\x18\x03 \x03(\t\x1ay\n\x12PartitionEndRecord\x12\x31\n\rend_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x1a\xa4\x03\n\x14PartitionEventRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x12^\n\x0emove_in_events\x18\x04 \x03(\x0b\x32\x46.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent\x12`\n\x0fmove_out_events\x18\x05 \x03(\x0b\x32G.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent\x1a-\n\x0bMoveInEvent\x12\x1e\n\x16source_partition_token\x18\x01 \x01(\t\x1a\x33\n\x0cMoveOutEvent\x12#\n\x1b\x64\x65stination_partition_token\x18\x01 \x01(\tB\x08\n\x06recordB\xb4\x01\n\x15\x63om.google.spanner.v1B\x11\x43hangeStreamProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module V1 - ChangeStreamRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord").msgclass - ChangeStreamRecord::DataChangeRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord").msgclass - ChangeStreamRecord::DataChangeRecord::ColumnMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata").msgclass - ChangeStreamRecord::DataChangeRecord::ModValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue").msgclass - ChangeStreamRecord::DataChangeRecord::Mod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod").msgclass - ChangeStreamRecord::DataChangeRecord::ModType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType").enummodule - ChangeStreamRecord::DataChangeRecord::ValueCaptureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType").enummodule - ChangeStreamRecord::HeartbeatRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.HeartbeatRecord").msgclass - ChangeStreamRecord::PartitionStartRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionStartRecord").msgclass - ChangeStreamRecord::PartitionEndRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEndRecord").msgclass - ChangeStreamRecord::PartitionEventRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord").msgclass - ChangeStreamRecord::PartitionEventRecord::MoveInEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent").msgclass - ChangeStreamRecord::PartitionEventRecord::MoveOutEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb deleted file mode 100644 index eac6aebcce64..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/commit_response_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/commit_response.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' -require 'google/spanner/v1/location_pb' -require 'google/spanner/v1/transaction_pb' - - -descriptor_data = "\n\'google/spanner/v1/commit_response.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a google/spanner/v1/location.proto\x1a#google/spanner/v1/transaction.proto\"\x90\x03\n\x0e\x43ommitResponse\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x0c\x63ommit_stats\x18\x02 \x01(\x0b\x32-.google.spanner.v1.CommitResponse.CommitStats\x12N\n\x0fprecommit_token\x18\x04 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenH\x00\x12\x36\n\x12snapshot_timestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x39\n\x0c\x63\x61\x63he_update\x18\x06 \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\x1a%\n\x0b\x43ommitStats\x12\x16\n\x0emutation_count\x18\x01 \x01(\x03\x42\x19\n\x17MultiplexedSessionRetryB\xb6\x01\n\x15\x63om.google.spanner.v1B\x13\x43ommitResponseProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module V1 - CommitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse").msgclass - CommitResponse::CommitStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse.CommitStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb deleted file mode 100644 index 8e8743e95c42..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/keys_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/keys.proto - -require 'google/protobuf' - -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n\x1cgoogle/spanner/v1/keys.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\"\xf4\x01\n\x08KeyRange\x12\x32\n\x0cstart_closed\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x00\x12\x30\n\nstart_open\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x00\x12\x30\n\nend_closed\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x01\x12.\n\x08\x65nd_open\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x01\x42\x10\n\x0estart_key_typeB\x0e\n\x0c\x65nd_key_type\"l\n\x06KeySet\x12(\n\x04keys\x18\x01 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12+\n\x06ranges\x18\x02 \x03(\x0b\x32\x1b.google.spanner.v1.KeyRange\x12\x0b\n\x03\x61ll\x18\x03 \x01(\x08\x42\xac\x01\n\x15\x63om.google.spanner.v1B\tKeysProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module V1 - KeyRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRange").msgclass - KeySet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeySet").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb deleted file mode 100644 index 911d7f698ff7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/location_pb.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/location.proto - -require 'google/protobuf' - -require 'google/protobuf/struct_pb' -require 'google/spanner/v1/type_pb' - - -descriptor_data = "\n google/spanner/v1/location.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1cgoogle/spanner/v1/type.proto\"f\n\x05Range\x12\x11\n\tstart_key\x18\x01 \x01(\x0c\x12\x11\n\tlimit_key\x18\x02 \x01(\x0c\x12\x11\n\tgroup_uid\x18\x03 \x01(\x04\x12\x10\n\x08split_id\x18\x04 \x01(\x04\x12\x12\n\ngeneration\x18\x05 \x01(\x0c\"\xe6\x01\n\x06Tablet\x12\x12\n\ntablet_uid\x18\x01 \x01(\x04\x12\x16\n\x0eserver_address\x18\x02 \x01(\t\x12\x10\n\x08location\x18\x03 \x01(\t\x12,\n\x04role\x18\x04 \x01(\x0e\x32\x1e.google.spanner.v1.Tablet.Role\x12\x13\n\x0bincarnation\x18\x05 \x01(\x0c\x12\x10\n\x08\x64istance\x18\x06 \x01(\r\x12\x0c\n\x04skip\x18\x07 \x01(\x08\";\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\"p\n\x05Group\x12\x11\n\tgroup_uid\x18\x01 \x01(\x04\x12*\n\x07tablets\x18\x02 \x03(\x0b\x32\x19.google.spanner.v1.Tablet\x12\x14\n\x0cleader_index\x18\x03 \x01(\x05\x12\x12\n\ngeneration\x18\x04 \x01(\x0c\"\xd3\x04\n\tKeyRecipe\x12\x14\n\ntable_name\x18\x01 \x01(\tH\x00\x12\x14\n\nindex_name\x18\x02 \x01(\tH\x00\x12\x17\n\roperation_uid\x18\x03 \x01(\x04H\x00\x12/\n\x04part\x18\x04 \x03(\x0b\x32!.google.spanner.v1.KeyRecipe.Part\x1a\xc5\x03\n\x04Part\x12\x0b\n\x03tag\x18\x01 \x01(\r\x12\x36\n\x05order\x18\x02 \x01(\x0e\x32\'.google.spanner.v1.KeyRecipe.Part.Order\x12?\n\nnull_order\x18\x03 \x01(\x0e\x32+.google.spanner.v1.KeyRecipe.Part.NullOrder\x12%\n\x04type\x18\x04 \x01(\x0b\x32\x17.google.spanner.v1.Type\x12\x14\n\nidentifier\x18\x05 \x01(\tH\x00\x12\'\n\x05value\x18\x06 \x01(\x0b\x32\x16.google.protobuf.ValueH\x00\x12\x10\n\x06random\x18\x08 \x01(\x08H\x00\x12\x1a\n\x12struct_identifiers\x18\x07 \x03(\x05\"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"V\n\tNullOrder\x12\x1a\n\x16NULL_ORDER_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNULLS_FIRST\x10\x01\x12\x0e\n\nNULLS_LAST\x10\x02\x12\x0c\n\x08NOT_NULL\x10\x03\x42\x0c\n\nvalue_typeB\x08\n\x06target\"U\n\nRecipeList\x12\x19\n\x11schema_generation\x18\x01 \x01(\x0c\x12,\n\x06recipe\x18\x03 \x03(\x0b\x32\x1c.google.spanner.v1.KeyRecipe\"\xa8\x01\n\x0b\x43\x61\x63heUpdate\x12\x13\n\x0b\x64\x61tabase_id\x18\x01 \x01(\x04\x12\'\n\x05range\x18\x02 \x03(\x0b\x32\x18.google.spanner.v1.Range\x12\'\n\x05group\x18\x03 \x03(\x0b\x32\x18.google.spanner.v1.Group\x12\x32\n\x0bkey_recipes\x18\x05 \x01(\x0b\x32\x1d.google.spanner.v1.RecipeList\"\xca\x02\n\x0bRoutingHint\x12\x15\n\roperation_uid\x18\x01 \x01(\x04\x12\x13\n\x0b\x64\x61tabase_id\x18\x02 \x01(\x04\x12\x19\n\x11schema_generation\x18\x03 \x01(\x0c\x12\x0b\n\x03key\x18\x04 \x01(\x0c\x12\x11\n\tlimit_key\x18\x05 \x01(\x0c\x12\x11\n\tgroup_uid\x18\x06 \x01(\x04\x12\x10\n\x08split_id\x18\x07 \x01(\x04\x12\x12\n\ntablet_uid\x18\x08 \x01(\x04\x12H\n\x12skipped_tablet_uid\x18\t \x03(\x0b\x32,.google.spanner.v1.RoutingHint.SkippedTablet\x12\x17\n\x0f\x63lient_location\x18\n \x01(\t\x1a\x38\n\rSkippedTablet\x12\x12\n\ntablet_uid\x18\x01 \x01(\x04\x12\x13\n\x0bincarnation\x18\x02 \x01(\x0c\x42\xb0\x01\n\x15\x63om.google.spanner.v1B\rLocationProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module V1 - Range = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Range").msgclass - Tablet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Tablet").msgclass - Tablet::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Tablet.Role").enummodule - Group = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Group").msgclass - KeyRecipe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe").msgclass - KeyRecipe::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part").msgclass - KeyRecipe::Part::Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part.Order").enummodule - KeyRecipe::Part::NullOrder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRecipe.Part.NullOrder").enummodule - RecipeList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RecipeList").msgclass - CacheUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CacheUpdate").msgclass - RoutingHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RoutingHint").msgclass - RoutingHint::SkippedTablet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RoutingHint.SkippedTablet").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb deleted file mode 100644 index b84e466d4627..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/mutation_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/mutation.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/spanner/v1/keys_pb' - - -descriptor_data = "\n google/spanner/v1/mutation.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/spanner/v1/keys.proto\"\xc0\x06\n\x08Mutation\x12\x33\n\x06insert\x18\x01 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x33\n\x06update\x18\x02 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12=\n\x10insert_or_update\x18\x03 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x34\n\x07replace\x18\x04 \x01(\x0b\x32!.google.spanner.v1.Mutation.WriteH\x00\x12\x34\n\x06\x64\x65lete\x18\x05 \x01(\x0b\x32\".google.spanner.v1.Mutation.DeleteH\x00\x12\x30\n\x04send\x18\x06 \x01(\x0b\x32 .google.spanner.v1.Mutation.SendH\x00\x12.\n\x03\x61\x63k\x18\x07 \x01(\x0b\x32\x1f.google.spanner.v1.Mutation.AckH\x00\x1aX\n\x05Write\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07\x63olumns\x18\x02 \x03(\t\x12*\n\x06values\x18\x03 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x1aM\n\x06\x44\x65lete\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x02 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x1a\xa3\x01\n\x04Send\x12\x12\n\x05queue\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\x03key\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueB\x03\xe0\x41\x02\x12\x30\n\x0c\x64\x65liver_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x07payload\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\x61\n\x03\x41\x63k\x12\x12\n\x05queue\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\x03key\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValueB\x03\xe0\x41\x02\x12\x18\n\x10ignore_not_found\x18\x03 \x01(\x08\x42\x0b\n\toperationB\xb0\x01\n\x15\x63om.google.spanner.v1B\rMutationProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module V1 - Mutation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation").msgclass - Mutation::Write = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Write").msgclass - Mutation::Delete = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Delete").msgclass - Mutation::Send = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Send").msgclass - Mutation::Ack = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Ack").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb deleted file mode 100644 index 143949a764c5..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/query_plan_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/query_plan.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n\"google/spanner/v1/query_plan.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xf8\x04\n\x08PlanNode\x12\r\n\x05index\x18\x01 \x01(\x05\x12.\n\x04kind\x18\x02 \x01(\x0e\x32 .google.spanner.v1.PlanNode.Kind\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12:\n\x0b\x63hild_links\x18\x04 \x03(\x0b\x32%.google.spanner.v1.PlanNode.ChildLink\x12M\n\x14short_representation\x18\x05 \x01(\x0b\x32/.google.spanner.v1.PlanNode.ShortRepresentation\x12)\n\x08metadata\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x30\n\x0f\x65xecution_stats\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a@\n\tChildLink\x12\x13\n\x0b\x63hild_index\x18\x01 \x01(\x05\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x10\n\x08variable\x18\x03 \x01(\t\x1a\xb2\x01\n\x13ShortRepresentation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12S\n\nsubqueries\x18\x02 \x03(\x0b\x32?.google.spanner.v1.PlanNode.ShortRepresentation.SubqueriesEntry\x1a\x31\n\x0fSubqueriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"8\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x0e\n\nRELATIONAL\x10\x01\x12\n\n\x06SCALAR\x10\x02\"\xa4\x01\n\x12QueryAdvisorResult\x12L\n\x0cindex_advice\x18\x01 \x03(\x0b\x32\x31.google.spanner.v1.QueryAdvisorResult.IndexAdviceB\x03\xe0\x41\x01\x1a@\n\x0bIndexAdvice\x12\x10\n\x03\x64\x64l\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\x12improvement_factor\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\"~\n\tQueryPlan\x12/\n\nplan_nodes\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.PlanNode\x12@\n\x0cquery_advice\x18\x02 \x01(\x0b\x32%.google.spanner.v1.QueryAdvisorResultB\x03\xe0\x41\x01\x42\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eQueryPlanProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module V1 - PlanNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode").msgclass - PlanNode::ChildLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ChildLink").msgclass - PlanNode::ShortRepresentation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ShortRepresentation").msgclass - PlanNode::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.Kind").enummodule - QueryAdvisorResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryAdvisorResult").msgclass - QueryAdvisorResult::IndexAdvice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryAdvisorResult.IndexAdvice").msgclass - QueryPlan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryPlan").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb deleted file mode 100644 index 687b6efa6936..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/result_set_pb.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/result_set.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/struct_pb' -require 'google/spanner/v1/location_pb' -require 'google/spanner/v1/query_plan_pb' -require 'google/spanner/v1/transaction_pb' -require 'google/spanner/v1/type_pb' - - -descriptor_data = "\n\"google/spanner/v1/result_set.proto\x12\x11google.spanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a google/spanner/v1/location.proto\x1a\"google/spanner/v1/query_plan.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\xad\x02\n\tResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12(\n\x04rows\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12\x30\n\x05stats\x18\x03 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x05 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\x06 \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xf2\x02\n\x10PartialResultSet\x12\x36\n\x08metadata\x18\x01 \x01(\x0b\x32$.google.spanner.v1.ResultSetMetadata\x12&\n\x06values\x18\x02 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x15\n\rchunked_value\x18\x03 \x01(\x08\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12\x30\n\x05stats\x18\x05 \x01(\x0b\x32!.google.spanner.v1.ResultSetStats\x12Q\n\x0fprecommit_token\x18\x08 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x11\n\x04last\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0c\x63\x61\x63he_update\x18\n \x01(\x0b\x32\x1e.google.spanner.v1.CacheUpdateB\x03\xe0\x41\x01\"\xb7\x01\n\x11ResultSetMetadata\x12/\n\x08row_type\x18\x01 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\x12<\n\x15undeclared_parameters\x18\x03 \x01(\x0b\x32\x1d.google.spanner.v1.StructType\"\xb9\x01\n\x0eResultSetStats\x12\x30\n\nquery_plan\x18\x01 \x01(\x0b\x32\x1c.google.spanner.v1.QueryPlan\x12,\n\x0bquery_stats\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x19\n\x0frow_count_exact\x18\x03 \x01(\x03H\x00\x12\x1f\n\x15row_count_lower_bound\x18\x04 \x01(\x03H\x00\x42\x0b\n\trow_countB\xb1\x01\n\x15\x63om.google.spanner.v1B\x0eResultSetProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module V1 - ResultSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSet").msgclass - PartialResultSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PartialResultSet").msgclass - ResultSetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetMetadata").msgclass - ResultSetStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb b/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb deleted file mode 100644 index 22aa0b12b595..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/lib/google/spanner/v1/spanner_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/spanner/v1/spanner.proto - -require 'google/protobuf' - -require 'google/spanner/v1/commit_response_pb' -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/spanner/v1/keys_pb' -require 'google/spanner/v1/location_pb' -require 'google/spanner/v1/mutation_pb' -require 'google/spanner/v1/result_set_pb' -require 'google/spanner/v1/transaction_pb' -require 'google/spanner/v1/type_pb' - - -descriptor_data = "\n\x1fgoogle/spanner/v1/spanner.proto\x12\x11google.spanner.v1\x1a\'google/spanner/v1/commit_response.proto\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\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x1cgoogle/spanner/v1/keys.proto\x1a google/spanner/v1/location.proto\x1a google/spanner/v1/mutation.proto\x1a\"google/spanner/v1/result_set.proto\x1a#google/spanner/v1/transaction.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x83\x01\n\x14\x43reateSessionRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x30\n\x07session\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.SessionB\x03\xe0\x41\x02\"\xa9\x01\n\x1a\x42\x61tchCreateSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\x12\x34\n\x10session_template\x18\x02 \x01(\x0b\x32\x1a.google.spanner.v1.Session\x12\x1a\n\rsession_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"J\n\x1b\x42\x61tchCreateSessionsResponse\x12+\n\x07session\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\"\xb8\x03\n\x07Session\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.google.spanner.v1.Session.LabelsEntry\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x19\x61pproximate_last_use_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x0c\x63reator_role\x18\x05 \x01(\t\x12\x18\n\x0bmultiplexed\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x88\x01\xea\x41\x84\x01\n\x1espanner.googleapis.com/Session\x12Oprojects/{project}/instances/{instance}/databases/{database}/sessions/{session}*\x08sessions2\x07session\"I\n\x11GetSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\x87\x01\n\x13ListSessionsRequest\x12\x39\n\x08\x64\x61tabase\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspanner.googleapis.com/Database\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\"]\n\x14ListSessionsResponse\x12,\n\x08sessions\x18\x01 \x03(\x0b\x32\x1a.google.spanner.v1.Session\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x14\x44\x65leteSessionRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\"\xeb\x03\n\x0eRequestOptions\x12<\n\x08priority\x18\x01 \x01(\x0e\x32*.google.spanner.v1.RequestOptions.Priority\x12\x13\n\x0brequest_tag\x18\x02 \x01(\t\x12\x17\n\x0ftransaction_tag\x18\x03 \x01(\t\x12L\n\x0e\x63lient_context\x18\x04 \x01(\x0b\x32/.google.spanner.v1.RequestOptions.ClientContextB\x03\xe0\x41\x01\x1a\xbe\x01\n\rClientContext\x12_\n\x0esecure_context\x18\x01 \x03(\x0b\x32\x42.google.spanner.v1.RequestOptions.ClientContext.SecureContextEntryB\x03\xe0\x41\x01\x1aL\n\x12SecureContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"^\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x10\n\x0cPRIORITY_LOW\x10\x01\x12\x13\n\x0fPRIORITY_MEDIUM\x10\x02\x12\x11\n\rPRIORITY_HIGH\x10\x03\"\xea\x04\n\x13\x44irectedReadOptions\x12R\n\x10include_replicas\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.IncludeReplicasH\x00\x12R\n\x10\x65xclude_replicas\x18\x02 \x01(\x0b\x32\x36.google.spanner.v1.DirectedReadOptions.ExcludeReplicasH\x00\x1a\xad\x01\n\x10ReplicaSelection\x12\x10\n\x08location\x18\x01 \x01(\t\x12J\n\x04type\x18\x02 \x01(\x0e\x32<.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nREAD_WRITE\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x1a\x86\x01\n\x0fIncludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelection\x12\x1e\n\x16\x61uto_failover_disabled\x18\x02 \x01(\x08\x1a\x66\n\x0f\x45xcludeReplicas\x12S\n\x12replica_selections\x18\x01 \x03(\x0b\x32\x37.google.spanner.v1.DirectedReadOptions.ReplicaSelectionB\n\n\x08replicas\"\xc8\x07\n\x11\x45xecuteSqlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12I\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x34.google.spanner.v1.ExecuteSqlRequest.ParamTypesEntry\x12\x14\n\x0cresume_token\x18\x06 \x01(\x0c\x12\x42\n\nquery_mode\x18\x07 \x01(\x0e\x32..google.spanner.v1.ExecuteSqlRequest.QueryMode\x12\x17\n\x0fpartition_token\x18\x08 \x01(\x0c\x12\r\n\x05seqno\x18\t \x01(\x03\x12H\n\rquery_options\x18\n \x01(\x0b\x32\x31.google.spanner.v1.ExecuteSqlRequest.QueryOptions\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0f \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x10 \x01(\x08\x12\x1b\n\x0elast_statement\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\x1aO\n\x0cQueryOptions\x12\x19\n\x11optimizer_version\x18\x01 \x01(\t\x12$\n\x1coptimizer_statistics_package\x18\x02 \x01(\t\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"W\n\tQueryMode\x12\n\n\x06NORMAL\x10\x00\x12\x08\n\x04PLAN\x10\x01\x12\x0b\n\x07PROFILE\x10\x02\x12\x0e\n\nWITH_STATS\x10\x03\x12\x17\n\x13WITH_PLAN_AND_STATS\x10\x04\"\xbe\x04\n\x16\x45xecuteBatchDmlRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12@\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelectorB\x03\xe0\x41\x02\x12L\n\nstatements\x18\x03 \x03(\x0b\x32\x33.google.spanner.v1.ExecuteBatchDmlRequest.StatementB\x03\xe0\x41\x02\x12\x12\n\x05seqno\x18\x04 \x01(\x03\x42\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x05 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x1c\n\x0flast_statements\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xec\x01\n\tStatement\x12\x10\n\x03sql\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\'\n\x06params\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12X\n\x0bparam_types\x18\x03 \x03(\x0b\x32\x43.google.spanner.v1.ExecuteBatchDmlRequest.Statement.ParamTypesEntry\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xc3\x01\n\x17\x45xecuteBatchDmlResponse\x12\x31\n\x0bresult_sets\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.ResultSet\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12Q\n\x0fprecommit_token\x18\x03 \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\"H\n\x10PartitionOptions\x12\x1c\n\x14partition_size_bytes\x18\x01 \x01(\x03\x12\x16\n\x0emax_partitions\x18\x02 \x01(\x03\"\xad\x03\n\x15PartitionQueryRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x10\n\x03sql\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12,\n\x06params\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12R\n\x0bparam_types\x18\x05 \x03(\x0b\x32\x38.google.spanner.v1.PartitionQueryRequest.ParamTypesEntryB\x03\xe0\x41\x01\x12>\n\x11partition_options\x18\x06 \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\x1aJ\n\x0fParamTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type:\x02\x38\x01\"\xb1\x02\n\x14PartitionReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x0f\n\x07\x63olumns\x18\x05 \x03(\t\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12>\n\x11partition_options\x18\t \x01(\x0b\x32#.google.spanner.v1.PartitionOptions\"$\n\tPartition\x12\x17\n\x0fpartition_token\x18\x01 \x01(\x0c\"z\n\x11PartitionResponse\x12\x30\n\npartitions\x18\x01 \x03(\x0b\x32\x1c.google.spanner.v1.Partition\x12\x33\n\x0btransaction\x18\x02 \x01(\x0b\x32\x1e.google.spanner.v1.Transaction\"\xb1\x06\n\x0bReadRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x0btransaction\x18\x02 \x01(\x0b\x32&.google.spanner.v1.TransactionSelector\x12\x12\n\x05table\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05index\x18\x04 \x01(\t\x12\x14\n\x07\x63olumns\x18\x05 \x03(\tB\x03\xe0\x41\x02\x12/\n\x07key_set\x18\x06 \x01(\x0b\x32\x19.google.spanner.v1.KeySetB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x08 \x01(\x03\x12\x14\n\x0cresume_token\x18\t \x01(\x0c\x12\x17\n\x0fpartition_token\x18\n \x01(\x0c\x12:\n\x0frequest_options\x18\x0b \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x45\n\x15\x64irected_read_options\x18\x0e \x01(\x0b\x32&.google.spanner.v1.DirectedReadOptions\x12\x1a\n\x12\x64\x61ta_boost_enabled\x18\x0f \x01(\x08\x12=\n\x08order_by\x18\x10 \x01(\x0e\x32&.google.spanner.v1.ReadRequest.OrderByB\x03\xe0\x41\x01\x12?\n\tlock_hint\x18\x11 \x01(\x0e\x32\'.google.spanner.v1.ReadRequest.LockHintB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x12 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\"T\n\x07OrderBy\x12\x18\n\x14ORDER_BY_UNSPECIFIED\x10\x00\x12\x18\n\x14ORDER_BY_PRIMARY_KEY\x10\x01\x12\x15\n\x11ORDER_BY_NO_ORDER\x10\x02\"T\n\x08LockHint\x12\x19\n\x15LOCK_HINT_UNSPECIFIED\x10\x00\x12\x14\n\x10LOCK_HINT_SHARED\x10\x01\x12\x17\n\x13LOCK_HINT_EXCLUSIVE\x10\x02\"\xbe\x02\n\x17\x42\x65ginTransactionRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12;\n\x07options\x18\x02 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsB\x03\xe0\x41\x02\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12\x36\n\x0cmutation_key\x18\x04 \x01(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\x05 \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\"\x8b\x04\n\rCommitRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x18\n\x0etransaction_id\x18\x02 \x01(\x0cH\x00\x12G\n\x16single_use_transaction\x18\x03 \x01(\x0b\x32%.google.spanner.v1.TransactionOptionsH\x00\x12.\n\tmutations\x18\x04 \x03(\x0b\x32\x1b.google.spanner.v1.Mutation\x12\x1b\n\x13return_commit_stats\x18\x05 \x01(\x08\x12\x38\n\x10max_commit_delay\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12:\n\x0frequest_options\x18\x06 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12Q\n\x0fprecommit_token\x18\t \x01(\x0b\x32\x33.google.spanner.v1.MultiplexedSessionPrecommitTokenB\x03\xe0\x41\x01\x12\x39\n\x0crouting_hint\x18\n \x01(\x0b\x32\x1e.google.spanner.v1.RoutingHintB\x03\xe0\x41\x01\x42\r\n\x0btransaction\"g\n\x0fRollbackRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12\x1b\n\x0etransaction_id\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"\xce\x02\n\x11\x42\x61tchWriteRequest\x12\x37\n\x07session\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1espanner.googleapis.com/Session\x12:\n\x0frequest_options\x18\x03 \x01(\x0b\x32!.google.spanner.v1.RequestOptions\x12P\n\x0fmutation_groups\x18\x04 \x03(\x0b\x32\x32.google.spanner.v1.BatchWriteRequest.MutationGroupB\x03\xe0\x41\x02\x12,\n\x1f\x65xclude_txn_from_change_streams\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x44\n\rMutationGroup\x12\x33\n\tmutations\x18\x01 \x03(\x0b\x32\x1b.google.spanner.v1.MutationB\x03\xe0\x41\x02\"\x7f\n\x12\x42\x61tchWriteResponse\x12\x0f\n\x07indexes\x18\x01 \x03(\x05\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x34\n\x10\x63ommit_timestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x8b\x18\n\x07Spanner\x12\xa6\x01\n\rCreateSession\x12\'.google.spanner.v1.CreateSessionRequest\x1a\x1a.google.spanner.v1.Session\"P\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02?\":/v1/{database=projects/*/instances/*/databases/*}/sessions:\x01*\x12\xe0\x01\n\x13\x42\x61tchCreateSessions\x12-.google.spanner.v1.BatchCreateSessionsRequest\x1a..google.spanner.v1.BatchCreateSessionsResponse\"j\xda\x41\x16\x64\x61tabase,session_count\x82\xd3\xe4\x93\x02K\"F/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate:\x01*\x12\x97\x01\n\nGetSession\x12$.google.spanner.v1.GetSessionRequest\x1a\x1a.google.spanner.v1.Session\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xae\x01\n\x0cListSessions\x12&.google.spanner.v1.ListSessionsRequest\x1a\'.google.spanner.v1.ListSessionsResponse\"M\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02<\x12:/v1/{database=projects/*/instances/*/databases/*}/sessions\x12\x99\x01\n\rDeleteSession\x12\'.google.spanner.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/instances/*/databases/*/sessions/*}\x12\xa3\x01\n\nExecuteSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a\x1c.google.spanner.v1.ResultSet\"Q\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql:\x01*\x12\xbe\x01\n\x13\x45xecuteStreamingSql\x12$.google.spanner.v1.ExecuteSqlRequest\x1a#.google.spanner.v1.PartialResultSet\"Z\x82\xd3\xe4\x93\x02T\"O/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeStreamingSql:\x01*0\x01\x12\xc0\x01\n\x0f\x45xecuteBatchDml\x12).google.spanner.v1.ExecuteBatchDmlRequest\x1a*.google.spanner.v1.ExecuteBatchDmlResponse\"V\x82\xd3\xe4\x93\x02P\"K/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeBatchDml:\x01*\x12\x91\x01\n\x04Read\x12\x1e.google.spanner.v1.ReadRequest\x1a\x1c.google.spanner.v1.ResultSet\"K\x82\xd3\xe4\x93\x02\x45\"@/v1/{session=projects/*/instances/*/databases/*/sessions/*}:read:\x01*\x12\xac\x01\n\rStreamingRead\x12\x1e.google.spanner.v1.ReadRequest\x1a#.google.spanner.v1.PartialResultSet\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:streamingRead:\x01*0\x01\x12\xc9\x01\n\x10\x42\x65ginTransaction\x12*.google.spanner.v1.BeginTransactionRequest\x1a\x1e.google.spanner.v1.Transaction\"i\xda\x41\x0fsession,options\x82\xd3\xe4\x93\x02Q\"L/v1/{session=projects/*/instances/*/databases/*/sessions/*}:beginTransaction:\x01*\x12\xeb\x01\n\x06\x43ommit\x12 .google.spanner.v1.CommitRequest\x1a!.google.spanner.v1.CommitResponse\"\x9b\x01\xda\x41 session,transaction_id,mutations\xda\x41(session,single_use_transaction,mutations\x82\xd3\xe4\x93\x02G\"B/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit:\x01*\x12\xb0\x01\n\x08Rollback\x12\".google.spanner.v1.RollbackRequest\x1a\x16.google.protobuf.Empty\"h\xda\x41\x16session,transaction_id\x82\xd3\xe4\x93\x02I\"D/v1/{session=projects/*/instances/*/databases/*/sessions/*}:rollback:\x01*\x12\xb7\x01\n\x0ePartitionQuery\x12(.google.spanner.v1.PartitionQueryRequest\x1a$.google.spanner.v1.PartitionResponse\"U\x82\xd3\xe4\x93\x02O\"J/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery:\x01*\x12\xb4\x01\n\rPartitionRead\x12\'.google.spanner.v1.PartitionReadRequest\x1a$.google.spanner.v1.PartitionResponse\"T\x82\xd3\xe4\x93\x02N\"I/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead:\x01*\x12\xc8\x01\n\nBatchWrite\x12$.google.spanner.v1.BatchWriteRequest\x1a%.google.spanner.v1.BatchWriteResponse\"k\xda\x41\x17session,mutation_groups\x82\xd3\xe4\x93\x02K\"F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:batchWrite:\x01*0\x01\x1aw\xca\x41\x16spanner.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spanner.dataB\x91\x02\n\x15\x63om.google.spanner.v1B\x0cSpannerProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1\xea\x41_\n\x1fspanner.googleapis.com/Database\x12\n\x0ftype_annotation\x18\x04 \x01(\x0e\x32%.google.spanner.v1.TypeAnnotationCode\x12\x16\n\x0eproto_type_fqn\x18\x05 \x01(\t\"\x7f\n\nStructType\x12\x33\n\x06\x66ields\x18\x01 \x03(\x0b\x32#.google.spanner.v1.StructType.Field\x1a<\n\x05\x46ield\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type*\xdf\x01\n\x08TypeCode\x12\x19\n\x15TYPE_CODE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42OOL\x10\x01\x12\t\n\x05INT64\x10\x02\x12\x0b\n\x07\x46LOAT64\x10\x03\x12\x0b\n\x07\x46LOAT32\x10\x0f\x12\r\n\tTIMESTAMP\x10\x04\x12\x08\n\x04\x44\x41TE\x10\x05\x12\n\n\x06STRING\x10\x06\x12\t\n\x05\x42YTES\x10\x07\x12\t\n\x05\x41RRAY\x10\x08\x12\n\n\x06STRUCT\x10\t\x12\x0b\n\x07NUMERIC\x10\n\x12\x08\n\x04JSON\x10\x0b\x12\t\n\x05PROTO\x10\r\x12\x08\n\x04\x45NUM\x10\x0e\x12\x0c\n\x08INTERVAL\x10\x10\x12\x08\n\x04UUID\x10\x11*d\n\x12TypeAnnotationCode\x12$\n TYPE_ANNOTATION_CODE_UNSPECIFIED\x10\x00\x12\x0e\n\nPG_NUMERIC\x10\x02\x12\x0c\n\x08PG_JSONB\x10\x03\x12\n\n\x06PG_OID\x10\x04\x42\xac\x01\n\x15\x63om.google.spanner.v1B\tTypeProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Spanner - module V1 - Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Type").msgclass - StructType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType").msgclass - StructType::Field = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.StructType.Field").msgclass - TypeCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeCode").enummodule - TypeAnnotationCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.TypeAnnotationCode").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md deleted file mode 100644 index 9e764966d911..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Spanner 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-spanner-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb deleted file mode 100644 index 977e81d500bc..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/change_stream.rb +++ /dev/null @@ -1,488 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # Spanner Change Streams enable customers to capture and stream out changes to - # their Spanner databases in real-time. A change stream - # can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or - # partition_mode='MUTABLE_KEY_RANGE'. - # - # This message is only used in Change Streams created with the option - # partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special - # Table-Valued Function (TVF) along with each Change Streams. The function - # provides access to the change stream's records. The function is named - # READ_ (where is the - # name of the change stream), and it returns a table with only one column - # called ChangeRecord. - # @!attribute [rw] data_change_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord] - # Data change record describing a data change for a change stream - # partition. - # - # Note: The following fields are mutually exclusive: `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] heartbeat_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::HeartbeatRecord] - # Heartbeat record describing a heartbeat for a change stream partition. - # - # Note: The following fields are mutually exclusive: `heartbeat_record`, `data_change_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] partition_start_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionStartRecord] - # Partition start record describing a new change stream partition. - # - # Note: The following fields are mutually exclusive: `partition_start_record`, `data_change_record`, `heartbeat_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] partition_end_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord] - # Partition end record describing a terminated change stream partition. - # - # Note: The following fields are mutually exclusive: `partition_end_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] partition_event_record - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord] - # Partition event record describing key range changes for a change stream - # partition. - # - # Note: The following fields are mutually exclusive: `partition_event_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ChangeStreamRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A data change record contains a set of changes to a table with the same - # modification type (insert, update, or delete) committed at the same commit - # timestamp in one change stream partition for the same transaction. Multiple - # data change records can be returned for the same transaction across - # multiple change stream partitions. - # @!attribute [rw] commit_timestamp - # @return [::Google::Protobuf::Timestamp] - # Indicates the timestamp in which the change was committed. - # DataChangeRecord.commit_timestamps, - # PartitionStartRecord.start_timestamps, - # PartitionEventRecord.commit_timestamps, and - # PartitionEndRecord.end_timestamps can have the same value in the same - # partition. - # @!attribute [rw] record_sequence - # @return [::String] - # Record sequence numbers are unique and monotonically increasing (but not - # necessarily contiguous) for a specific timestamp across record - # types in the same partition. To guarantee ordered processing, the reader - # should process records (of potentially different types) in - # record_sequence order for a specific timestamp in the same partition. - # - # The record sequence number ordering across partitions is only meaningful - # in the context of a specific transaction. Record sequence numbers are - # unique across partitions for a specific transaction. Sort the - # DataChangeRecords for the same - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#server_transaction_id server_transaction_id} - # by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#record_sequence record_sequence} - # to reconstruct the ordering of the changes within the transaction. - # @!attribute [rw] server_transaction_id - # @return [::String] - # Provides a globally unique string that represents the transaction in - # which the change was committed. Multiple transactions can have the same - # commit timestamp, but each transaction has a unique - # server_transaction_id. - # @!attribute [rw] is_last_record_in_transaction_in_partition - # @return [::Boolean] - # Indicates whether this is the last record for a transaction in the - # current partition. Clients can use this field to determine when all - # records for a transaction in the current partition have been received. - # @!attribute [rw] table - # @return [::String] - # Name of the table affected by the change. - # @!attribute [rw] column_metadata - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ColumnMetadata>] - # Provides metadata describing the columns associated with the - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#mods mods} listed - # below. - # @!attribute [rw] mods - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod>] - # Describes the changes that were made. - # @!attribute [rw] mod_type - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType] - # Describes the type of change. - # @!attribute [rw] value_capture_type - # @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType] - # Describes the value capture type that was specified in the change stream - # configuration when this change was captured. - # @!attribute [rw] number_of_records_in_transaction - # @return [::Integer] - # Indicates the number of data change records that are part of this - # transaction across all change stream partitions. This value can be used - # to assemble all the records associated with a particular transaction. - # @!attribute [rw] number_of_partitions_in_transaction - # @return [::Integer] - # Indicates the number of partitions that return data change records for - # this transaction. This value can be helpful in assembling all records - # associated with a particular transaction. - # @!attribute [rw] transaction_tag - # @return [::String] - # Indicates the transaction tag associated with this transaction. - # @!attribute [rw] is_system_transaction - # @return [::Boolean] - # Indicates whether the transaction is a system transaction. System - # transactions include those issued by time-to-live (TTL), column backfill, - # etc. - class DataChangeRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metadata for a column. - # @!attribute [rw] name - # @return [::String] - # Name of the column. - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::V1::Type] - # Type of the column. - # @!attribute [rw] is_primary_key - # @return [::Boolean] - # Indicates whether the column is a primary key column. - # @!attribute [rw] ordinal_position - # @return [::Integer] - # Ordinal position of the column based on the original table definition - # in the schema starting with a value of 1. - class ColumnMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Returns the value and associated metadata for a particular field of the - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod Mod}. - # @!attribute [rw] column_metadata_index - # @return [::Integer] - # Index within the repeated - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#column_metadata column_metadata} - # field, to obtain the column metadata for the column that was modified. - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - # The value of the column. - class ModValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A mod describes all data changes in a watched table row. - # @!attribute [rw] keys - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] - # Returns the value of the primary key of the modified row. - # @!attribute [rw] old_values - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] - # Returns the old values before the change for the modified columns. - # Always empty for - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::INSERT INSERT}, - # or if old values are not being captured specified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType value_capture_type}. - # @!attribute [rw] new_values - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>] - # Returns the new values after the change for the modified columns. - # Always empty for - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::DELETE DELETE}. - class Mod - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Mod type describes the type of change Spanner applied to the data. For - # example, if the client submits an INSERT_OR_UPDATE request, Spanner will - # perform an insert if there is no existing row and return ModType INSERT. - # Alternatively, if there is an existing row, Spanner will perform an - # update and return ModType UPDATE. - module ModType - # Not specified. - MOD_TYPE_UNSPECIFIED = 0 - - # Indicates data was inserted. - INSERT = 10 - - # Indicates existing data was updated. - UPDATE = 20 - - # Indicates existing data was deleted. - DELETE = 30 - end - - # Value capture type describes which values are recorded in the data - # change record. - module ValueCaptureType - # Not specified. - VALUE_CAPTURE_TYPE_UNSPECIFIED = 0 - - # Records both old and new values of the modified watched columns. - OLD_AND_NEW_VALUES = 10 - - # Records only new values of the modified watched columns. - NEW_VALUES = 20 - - # Records new values of all watched columns, including modified and - # unmodified columns. - NEW_ROW = 30 - - # Records the new values of all watched columns, including modified and - # unmodified columns. Also records the old values of the modified - # columns. - NEW_ROW_AND_OLD_VALUES = 40 - end - end - - # A heartbeat record is returned as a progress indicator, when there are no - # data changes or any other partition record types in the change stream - # partition. - # @!attribute [rw] timestamp - # @return [::Google::Protobuf::Timestamp] - # Indicates the timestamp at which the query has returned all the records - # in the change stream partition with timestamp <= heartbeat timestamp. - # The heartbeat timestamp will not be the same as the timestamps of other - # record types in the same partition. - class HeartbeatRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A partition start record serves as a notification that the client should - # schedule the partitions to be queried. PartitionStartRecord returns - # information about one or more partitions. - # @!attribute [rw] start_timestamp - # @return [::Google::Protobuf::Timestamp] - # Start timestamp at which the partitions should be queried to return - # change stream records with timestamps >= start_timestamp. - # DataChangeRecord.commit_timestamps, - # PartitionStartRecord.start_timestamps, - # PartitionEventRecord.commit_timestamps, and - # PartitionEndRecord.end_timestamps can have the same value in the same - # partition. - # @!attribute [rw] record_sequence - # @return [::String] - # Record sequence numbers are unique and monotonically increasing (but not - # necessarily contiguous) for a specific timestamp across record - # types in the same partition. To guarantee ordered processing, the reader - # should process records (of potentially different types) in - # record_sequence order for a specific timestamp in the same partition. - # @!attribute [rw] partition_tokens - # @return [::Array<::String>] - # Unique partition identifiers to be used in queries. - class PartitionStartRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A partition end record serves as a notification that the client should stop - # reading the partition. No further records are expected to be retrieved on - # it. - # @!attribute [rw] end_timestamp - # @return [::Google::Protobuf::Timestamp] - # End timestamp at which the change stream partition is terminated. All - # changes generated by this partition will have timestamps <= - # end_timestamp. DataChangeRecord.commit_timestamps, - # PartitionStartRecord.start_timestamps, - # PartitionEventRecord.commit_timestamps, and - # PartitionEndRecord.end_timestamps can have the same value in the same - # partition. PartitionEndRecord is the last record returned for a - # partition. - # @!attribute [rw] record_sequence - # @return [::String] - # Record sequence numbers are unique and monotonically increasing (but not - # necessarily contiguous) for a specific timestamp across record - # types in the same partition. To guarantee ordered processing, the reader - # should process records (of potentially different types) in - # record_sequence order for a specific timestamp in the same partition. - # @!attribute [rw] partition_token - # @return [::String] - # Unique partition identifier describing the terminated change stream - # partition. - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord#partition_token partition_token} - # is equal to the partition token of the change stream partition currently - # queried to return this PartitionEndRecord. - class PartitionEndRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A partition event record describes key range changes for a change stream - # partition. The changes to a row defined by its primary key can be captured - # in one change stream partition for a specific time range, and then be - # captured in a different change stream partition for a different time range. - # This movement of key ranges across change stream partitions is a reflection - # of activities, such as Spanner's dynamic splitting and load balancing, etc. - # Processing this event is needed if users want to guarantee processing of - # the changes for any key in timestamp order. If time ordered processing of - # changes for a primary key is not needed, this event can be ignored. - # To guarantee time ordered processing for each primary key, if the event - # describes move-ins, the reader of this partition needs to wait until the - # readers of the source partitions have processed all records with timestamps - # <= this PartitionEventRecord.commit_timestamp, before advancing beyond this - # PartitionEventRecord. If the event describes move-outs, the reader can - # notify the readers of the destination partitions that they can continue - # processing. - # @!attribute [rw] commit_timestamp - # @return [::Google::Protobuf::Timestamp] - # Indicates the commit timestamp at which the key range change occurred. - # DataChangeRecord.commit_timestamps, - # PartitionStartRecord.start_timestamps, - # PartitionEventRecord.commit_timestamps, and - # PartitionEndRecord.end_timestamps can have the same value in the same - # partition. - # @!attribute [rw] record_sequence - # @return [::String] - # Record sequence numbers are unique and monotonically increasing (but not - # necessarily contiguous) for a specific timestamp across record - # types in the same partition. To guarantee ordered processing, the reader - # should process records (of potentially different types) in - # record_sequence order for a specific timestamp in the same partition. - # @!attribute [rw] partition_token - # @return [::String] - # Unique partition identifier describing the partition this event - # occurred on. - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} - # is equal to the partition token of the change stream partition currently - # queried to return this PartitionEventRecord. - # @!attribute [rw] move_in_events - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveInEvent>] - # Set when one or more key ranges are moved into the change stream - # partition identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. - # - # Example: Two key ranges are moved into partition (P1) from partition (P2) - # and partition (P3) in a single transaction at timestamp T. - # - # The PartitionEventRecord returned in P1 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P1" - # move_in_events { - # source_partition_token: "P2" - # } - # move_in_events { - # source_partition_token: "P3" - # } - # } - # - # The PartitionEventRecord returned in P2 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P2" - # move_out_events { - # destination_partition_token: "P1" - # } - # } - # - # The PartitionEventRecord returned in P3 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P3" - # move_out_events { - # destination_partition_token: "P1" - # } - # } - # @!attribute [rw] move_out_events - # @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent>] - # Set when one or more key ranges are moved out of the change stream - # partition identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. - # - # Example: Two key ranges are moved out of partition (P1) to partition (P2) - # and partition (P3) in a single transaction at timestamp T. - # - # The PartitionEventRecord returned in P1 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P1" - # move_out_events { - # destination_partition_token: "P2" - # } - # move_out_events { - # destination_partition_token: "P3" - # } - # } - # - # The PartitionEventRecord returned in P2 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P2" - # move_in_events { - # source_partition_token: "P1" - # } - # } - # - # The PartitionEventRecord returned in P3 will reflect the move as: - # - # PartitionEventRecord { - # commit_timestamp: T - # partition_token: "P3" - # move_in_events { - # source_partition_token: "P1" - # } - # } - class PartitionEventRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes move-in of the key ranges into the change stream partition - # identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. - # - # To maintain processing the changes for a particular key in timestamp - # order, the query processing the change stream partition identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} - # should not advance beyond the partition event record commit timestamp - # until the queries processing the source change stream partitions have - # processed all change stream records with timestamps <= the partition - # event record commit timestamp. - # @!attribute [rw] source_partition_token - # @return [::String] - # An unique partition identifier describing the source change stream - # partition that recorded changes for the key range that is moving - # into this partition. - class MoveInEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes move-out of the key ranges out of the change stream partition - # identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}. - # - # To maintain processing the changes for a particular key in timestamp - # order, the query processing the - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent MoveOutEvent} - # in the partition identified by - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token} - # should inform the queries processing the destination partitions that - # they can unblock and proceed processing records past the - # {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#commit_timestamp commit_timestamp}. - # @!attribute [rw] destination_partition_token - # @return [::String] - # An unique partition identifier describing the destination change - # stream partition that will record changes for the key range that is - # moving out of this partition. - class MoveOutEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.rb deleted file mode 100644 index 85e535abbe41..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/commit_response.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 Spanner - module V1 - # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}. - # @!attribute [rw] commit_timestamp - # @return [::Google::Protobuf::Timestamp] - # The Cloud Spanner timestamp at which the transaction committed. - # @!attribute [rw] commit_stats - # @return [::Google::Cloud::Spanner::V1::CommitResponse::CommitStats] - # The statistics about this `Commit`. Not returned by default. - # For more information, see - # {::Google::Cloud::Spanner::V1::CommitRequest#return_commit_stats CommitRequest.return_commit_stats}. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # If specified, transaction has not committed yet. - # You must retry the commit with the new precommit token. - # @!attribute [rw] snapshot_timestamp - # @return [::Google::Protobuf::Timestamp] - # If `TransactionOptions.isolation_level` is set to - # `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the - # timestamp at which all reads in the transaction ran. This timestamp is - # never returned. - # @!attribute [rw] cache_update - # @return [::Google::Cloud::Spanner::V1::CacheUpdate] - # Optional. A cache update expresses a set of changes the client should - # incorporate into its location cache. The client should discard the changes - # if they are older than the data it already has. This data can be obtained - # in response to requests that included a `RoutingHint` field, but may also - # be obtained by explicit location-fetching RPCs which may be added in the - # future. - class CommitResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Additional statistics about a commit. - # @!attribute [rw] mutation_count - # @return [::Integer] - # The total number of mutations for the transaction. Knowing the - # `mutation_count` value can help you maximize the number of mutations - # in a transaction and minimize the number of API round trips. You can - # also monitor this value to prevent transactions from exceeding the system - # [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data). - # If the number of mutations exceeds the limit, the server returns - # [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT). - class CommitStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb deleted file mode 100644 index 5faebc2232ef..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/keys.rb +++ /dev/null @@ -1,170 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # KeyRange represents a range of rows in a table or index. - # - # A range has a start key and an end key. These keys can be open or - # closed, indicating if the range includes rows with that key. - # - # Keys are represented by lists, where the ith value in the list - # corresponds to the ith component of the table or index primary key. - # Individual values are encoded as described - # {::Google::Cloud::Spanner::V1::TypeCode here}. - # - # For example, consider the following table definition: - # - # CREATE TABLE UserEvents ( - # UserName STRING(MAX), - # EventDate STRING(10) - # ) PRIMARY KEY(UserName, EventDate); - # - # The following keys name rows in this table: - # - # ["Bob", "2014-09-23"] - # ["Alfred", "2015-06-12"] - # - # Since the `UserEvents` table's `PRIMARY KEY` clause names two - # columns, each `UserEvents` key has two elements; the first is the - # `UserName`, and the second is the `EventDate`. - # - # Key ranges with multiple components are interpreted - # lexicographically by component using the table or index key's declared - # sort order. For example, the following range returns all events for - # user `"Bob"` that occurred in the year 2015: - # - # "start_closed": ["Bob", "2015-01-01"] - # "end_closed": ["Bob", "2015-12-31"] - # - # Start and end keys can omit trailing key components. This affects the - # inclusion and exclusion of rows that exactly match the provided key - # components: if the key is closed, then rows that exactly match the - # provided components are included; if the key is open, then rows - # that exactly match are not included. - # - # For example, the following range includes all events for `"Bob"` that - # occurred during and after the year 2000: - # - # "start_closed": ["Bob", "2000-01-01"] - # "end_closed": ["Bob"] - # - # The next example retrieves all events for `"Bob"`: - # - # "start_closed": ["Bob"] - # "end_closed": ["Bob"] - # - # To retrieve events before the year 2000: - # - # "start_closed": ["Bob"] - # "end_open": ["Bob", "2000-01-01"] - # - # The following range includes all rows in the table: - # - # "start_closed": [] - # "end_closed": [] - # - # This range returns all users whose `UserName` begins with any - # character from A to C: - # - # "start_closed": ["A"] - # "end_open": ["D"] - # - # This range returns all users whose `UserName` begins with B: - # - # "start_closed": ["B"] - # "end_open": ["C"] - # - # Key ranges honor column sort order. For example, suppose a table is - # defined as follows: - # - # CREATE TABLE DescendingSortedTable { - # Key INT64, - # ... - # ) PRIMARY KEY(Key DESC); - # - # The following range retrieves all rows with key values between 1 - # and 100 inclusive: - # - # "start_closed": ["100"] - # "end_closed": ["1"] - # - # Note that 100 is passed as the start, and 1 is passed as the end, - # because `Key` is a descending column in the schema. - # @!attribute [rw] start_closed - # @return [::Google::Protobuf::ListValue] - # If the start is closed, then the range includes all rows whose - # first `len(start_closed)` key columns exactly match `start_closed`. - # - # Note: The following fields are mutually exclusive: `start_closed`, `start_open`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] start_open - # @return [::Google::Protobuf::ListValue] - # If the start is open, then the range excludes rows whose first - # `len(start_open)` key columns exactly match `start_open`. - # - # Note: The following fields are mutually exclusive: `start_open`, `start_closed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] end_closed - # @return [::Google::Protobuf::ListValue] - # If the end is closed, then the range includes all rows whose - # first `len(end_closed)` key columns exactly match `end_closed`. - # - # Note: The following fields are mutually exclusive: `end_closed`, `end_open`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] end_open - # @return [::Google::Protobuf::ListValue] - # If the end is open, then the range excludes rows whose first - # `len(end_open)` key columns exactly match `end_open`. - # - # Note: The following fields are mutually exclusive: `end_open`, `end_closed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class KeyRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All - # the keys are expected to be in the same table or index. The keys need - # not be sorted in any particular way. - # - # If the same key is specified multiple times in the set (for example - # if two ranges, two keys, or a key and a range overlap), Cloud Spanner - # behaves as if the key were only specified once. - # @!attribute [rw] keys - # @return [::Array<::Google::Protobuf::ListValue>] - # A list of specific keys. Entries in `keys` should have exactly as - # many elements as there are columns in the primary or index key - # with which this `KeySet` is used. Individual key values are - # encoded as described {::Google::Cloud::Spanner::V1::TypeCode here}. - # @!attribute [rw] ranges - # @return [::Array<::Google::Cloud::Spanner::V1::KeyRange>] - # A list of key ranges. See {::Google::Cloud::Spanner::V1::KeyRange KeyRange} for more - # information about key range specifications. - # @!attribute [rw] all - # @return [::Boolean] - # For convenience `all` can be set to `true` to indicate that this - # `KeySet` matches all keys in the table or index. Note that any keys - # specified in `keys` or `ranges` are only yielded once. - class KeySet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb deleted file mode 100644 index d79971bad844..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/location.rb +++ /dev/null @@ -1,417 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # A `Range` represents a range of keys in a database. The keys themselves - # are encoded in "sortable string format", also known as ssformat. Consult - # Spanner's open source client libraries for details on the encoding. - # - # Each range represents a contiguous range of rows, possibly from multiple - # tables/indexes. Each range is associated with a single paxos group (known as - # a "group" throughout this API), a split (which names the exact range within - # the group), and a generation that can be used to determine whether a given - # `Range` represents a newer or older location for the key range. - # @!attribute [rw] start_key - # @return [::String] - # The start key of the range, inclusive. Encoded in "sortable string format" - # (ssformat). - # @!attribute [rw] limit_key - # @return [::String] - # The limit key of the range, exclusive. Encoded in "sortable string format" - # (ssformat). - # @!attribute [rw] group_uid - # @return [::Integer] - # The UID of the paxos group where this range is stored. UIDs are unique - # within the database. References `Group.group_uid`. - # @!attribute [rw] split_id - # @return [::Integer] - # A group can store multiple ranges of keys. Each key range is named by an - # ID (the split ID). Within a group, split IDs are unique. The `split_id` - # names the exact split in `group_uid` where this range is stored. - # @!attribute [rw] generation - # @return [::String] - # `generation` indicates the freshness of the range information contained - # in this proto. Generations can be compared lexicographically; if generation - # A is greater than generation B, then the `Range` corresponding to A is - # newer than the `Range` corresponding to B, and should be used - # preferentially. - class Range - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `Tablet` represents a single replica of a `Group`. A tablet is served by a - # single server at a time, and can move between servers due to server death or - # simply load balancing. - # @!attribute [rw] tablet_uid - # @return [::Integer] - # The UID of the tablet, unique within the database. Matches the - # `tablet_uids` and `leader_tablet_uid` fields in `Group`. - # @!attribute [rw] server_address - # @return [::String] - # The address of the server that is serving this tablet -- either an IP - # address or DNS hostname and a port number. - # @!attribute [rw] location - # @return [::String] - # Where this tablet is located. This is the name of a Google Cloud region, - # such as "us-central1". - # @!attribute [rw] role - # @return [::Google::Cloud::Spanner::V1::Tablet::Role] - # The role of the tablet. - # @!attribute [rw] incarnation - # @return [::String] - # `incarnation` indicates the freshness of the tablet information contained - # in this proto. Incarnations can be compared lexicographically; if - # incarnation A is greater than incarnation B, then the `Tablet` - # corresponding to A is newer than the `Tablet` corresponding to B, and - # should be used preferentially. - # @!attribute [rw] distance - # @return [::Integer] - # Distances help the client pick the closest tablet out of the list of - # tablets for a given request. Tablets with lower distances should generally - # be preferred. Tablets with the same distance are approximately equally - # close; the client can choose arbitrarily. - # - # Distances do not correspond precisely to expected latency, geographical - # distance, or anything else. Distances should be compared only between - # tablets of the same group; they are not meaningful between different - # groups. - # - # A value of zero indicates that the tablet may be in the same zone as - # the client, and have minimum network latency. A value less than or equal to - # five indicates that the tablet is thought to be in the same region as the - # client, and may have a few milliseconds of network latency. Values greater - # than five are most likely in a different region, with non-trivial network - # latency. - # - # Clients should use the following algorithm: - # * If the request is using a directed read, eliminate any tablets that - # do not match the directed read's target zone and/or replica type. - # * (Read-write transactions only) Choose leader tablet if it has an - # distance <=5. - # * Group and sort tablets by distance. Choose a random - # tablet with the lowest distance. If the request - # is not a directed read, only consider replicas with distances <=5. - # * Send the request to the fallback endpoint. - # - # The tablet picked by this algorithm may be skipped, either because it is - # marked as `skip` by the server or because the corresponding server is - # unreachable, flow controlled, etc. Skipped tablets should be added to the - # `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should - # then be re-run without including the skipped tablet(s) to pick the next - # best tablet. - # @!attribute [rw] skip - # @return [::Boolean] - # If true, the tablet should not be chosen by the client. Typically, this - # signals that the tablet is unhealthy in some way. Tablets with `skip` - # set to true should be reported back to the server in - # `RoutingHint.skipped_tablet_uid`; this cues the server to send updated - # information for this tablet should it become usable again. - class Tablet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the role of the tablet. - module Role - # Not specified. - ROLE_UNSPECIFIED = 0 - - # The tablet can perform reads and (if elected leader) writes. - READ_WRITE = 1 - - # The tablet can only perform reads. - READ_ONLY = 2 - end - end - - # A `Group` represents a paxos group in a database. A group is a set of - # tablets that are replicated across multiple servers. Groups may have a leader - # tablet. Groups store one (or sometimes more) ranges of keys. - # @!attribute [rw] group_uid - # @return [::Integer] - # The UID of the paxos group, unique within the database. Matches the - # `group_uid` field in `Range`. - # @!attribute [rw] tablets - # @return [::Array<::Google::Cloud::Spanner::V1::Tablet>] - # A list of tablets that are part of the group. Note that this list may not - # be exhaustive; it will only include tablets the server considers useful - # to the client. The returned list is ordered ascending by distance. - # - # Tablet UIDs reference `Tablet.tablet_uid`. - # @!attribute [rw] leader_index - # @return [::Integer] - # The last known leader tablet of the group as an index into `tablets`. May - # be negative if the group has no known leader. - # @!attribute [rw] generation - # @return [::String] - # `generation` indicates the freshness of the group information (including - # leader information) contained in this proto. Generations can be compared - # lexicographically; if generation A is greater than generation B, then the - # `Group` corresponding to A is newer than the `Group` corresponding to B, - # and should be used preferentially. - class Group - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `KeyRecipe` provides the metadata required to translate reads, mutations, - # and queries into a byte array in "sortable string format" (ssformat)that can - # be used with `Range`s to route requests. Note that the client *must* tolerate - # `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may - # change over time. Requests with invalid `KeyRecipe`s should be routed to a - # default server. - # @!attribute [rw] table_name - # @return [::String] - # A table name, matching the name from the database schema. - # - # Note: The following fields are mutually exclusive: `table_name`, `index_name`, `operation_uid`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] index_name - # @return [::String] - # An index name, matching the name from the database schema. - # - # Note: The following fields are mutually exclusive: `index_name`, `table_name`, `operation_uid`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] operation_uid - # @return [::Integer] - # The UID of a query, matching the UID from `RoutingHint`. - # - # Note: The following fields are mutually exclusive: `operation_uid`, `table_name`, `index_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] part - # @return [::Array<::Google::Cloud::Spanner::V1::KeyRecipe::Part>] - # Parts are in the order they should appear in the encoded key. - class KeyRecipe - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An ssformat key is composed of a sequence of tag numbers and key column - # values. `Part` represents a single tag or key column value. - # @!attribute [rw] tag - # @return [::Integer] - # If non-zero, `tag` is the only field present in this `Part`. The part - # is encoded by appending `tag` to the ssformat key. - # @!attribute [rw] order - # @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::Order] - # Whether the key column is sorted ascending or descending. Only present - # if `tag` is zero. - # @!attribute [rw] null_order - # @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::NullOrder] - # How NULLs are represented in the encoded key part. Only present if `tag` - # is zero. - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::V1::Type] - # The type of the key part. Only present if `tag` is zero. - # @!attribute [rw] identifier - # @return [::String] - # `identifier` is the name of the column or query parameter. - # - # Note: The following fields are mutually exclusive: `identifier`, `value`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - # The constant value of the key part. - # It is present when query uses a constant as a part of the key. - # - # Note: The following fields are mutually exclusive: `value`, `identifier`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] random - # @return [::Boolean] - # If true, the client is responsible to fill in the value randomly. - # It's relevant only for the INT64 type. - # - # Note: The following fields are mutually exclusive: `random`, `identifier`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_identifiers - # @return [::Array<::Integer>] - # It is a repeated field to support fetching key columns from nested - # structs, such as `STRUCT` query parameters. - class Part - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The remaining fields encode column values. - module Order - # Default value, equivalent to `ASCENDING`. - ORDER_UNSPECIFIED = 0 - - # The key is ascending - corresponds to `ASC` in the schema definition. - ASCENDING = 1 - - # The key is descending - corresponds to `DESC` in the schema definition. - DESCENDING = 2 - end - - # The null order of the key column. This dictates where NULL values sort - # in the sorted order. Note that columns which are `NOT NULL` can have a - # special encoding. - module NullOrder - # Default value. This value is unused. - NULL_ORDER_UNSPECIFIED = 0 - - # NULL values sort before any non-NULL values. - NULLS_FIRST = 1 - - # NULL values sort after any non-NULL values. - NULLS_LAST = 2 - - # The column does not support NULL values. - NOT_NULL = 3 - end - end - end - - # A `RecipeList` contains a list of `KeyRecipe`s, which share the same - # schema generation. - # @!attribute [rw] schema_generation - # @return [::String] - # The schema generation of the recipes. To be sent to the server in - # `RoutingHint.schema_generation` whenever one of the recipes is used. - # `schema_generation` values are comparable with each other; if generation A - # compares greater than generation B, then A is a more recent schema than B. - # Clients should in general aim to cache only the latest schema generation, - # and discard more stale recipes. - # @!attribute [rw] recipe - # @return [::Array<::Google::Cloud::Spanner::V1::KeyRecipe>] - # A list of recipes to be cached. - class RecipeList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `CacheUpdate` expresses a set of changes the client should incorporate into - # its location cache. These changes may or may not be newer than what the - # client has in its cache, and should be discarded if necessary. `CacheUpdate`s - # can be obtained in response to requests that included a `RoutingHint` - # field, but may also be obtained by explicit location-fetching RPCs which may - # be added in the future. - # @!attribute [rw] database_id - # @return [::Integer] - # An internal ID for the database. Database names can be reused if a database - # is deleted and re-created. Each time the database is re-created, it will - # get a new database ID, which will never be re-used for any other database. - # @!attribute [rw] range - # @return [::Array<::Google::Cloud::Spanner::V1::Range>] - # A list of ranges to be cached. - # @!attribute [rw] group - # @return [::Array<::Google::Cloud::Spanner::V1::Group>] - # A list of groups to be cached. - # @!attribute [rw] key_recipes - # @return [::Google::Cloud::Spanner::V1::RecipeList] - # A list of recipes to be cached. - class CacheUpdate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `RoutingHint` can be optionally added to location-aware Spanner - # requests. It gives the server hints that can be used to route the request to - # an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - # - # The presence of a valid `RoutingHint` tells the server that the client - # is location-aware. - # - # `RoutingHint` does not change the semantics of the request; it is - # purely a performance hint; the request will perform the same actions on the - # database's data as if `RoutingHint` were not present. However, if - # the `RoutingHint` is incomplete or incorrect, the response may include - # a `CacheUpdate` the client can use to correct its location cache. - # @!attribute [rw] operation_uid - # @return [::Integer] - # A session-scoped unique ID for the operation, computed client-side. - # Requests with the same `operation_uid` should have a shared 'shape', - # meaning that some fields are expected to be the same, such as the SQL - # query, the target table/columns (for reads) etc. Requests with the same - # `operation_uid` are meant to differ only in fields like keys/key - # ranges/query parameters, transaction IDs, etc. - # - # `operation_uid` must be non-zero for `RoutingHint` to be valid. - # @!attribute [rw] database_id - # @return [::Integer] - # The database ID of the database being accessed, see - # `CacheUpdate.database_id`. Should match the cache entries that were used - # to generate the rest of the fields in this `RoutingHint`. - # @!attribute [rw] schema_generation - # @return [::String] - # The schema generation of the recipe that was used to generate `key` and - # `limit_key`. See also `RecipeList.schema_generation`. - # @!attribute [rw] key - # @return [::String] - # The key / key range that this request accesses. For operations that - # access a single key, `key` should be set and `limit_key` should be empty. - # For operations that access a key range, `key` and `limit_key` should both - # be set, to the inclusive start and exclusive end of the range respectively. - # - # The keys are encoded in "sortable string format" (ssformat), using a - # `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more - # details. - # @!attribute [rw] limit_key - # @return [::String] - # If this request targets a key range, this is the exclusive end of the - # range. See `key` for more details. - # @!attribute [rw] group_uid - # @return [::Integer] - # The group UID of the group that the client believes serves the range - # defined by `key` and `limit_key`. See `Range.group_uid` for more details. - # @!attribute [rw] split_id - # @return [::Integer] - # The split ID of the split that the client believes contains the range - # defined by `key` and `limit_key`. See `Range.split_id` for more details. - # @!attribute [rw] tablet_uid - # @return [::Integer] - # The tablet UID of the tablet from group `group_uid` that the client - # believes is best to serve this request. See `Group.local_tablet_uids` and - # `Group.leader_tablet_uid`. - # @!attribute [rw] skipped_tablet_uid - # @return [::Array<::Google::Cloud::Spanner::V1::RoutingHint::SkippedTablet>] - # If the client had multiple options for tablet selection, and some of its - # first choices were unhealthy (e.g., the server is unreachable, or - # `Tablet.skip` is true), this field will contain the tablet UIDs of those - # tablets, with their incarnations. The server may include a `CacheUpdate` - # with new locations for those tablets. - # @!attribute [rw] client_location - # @return [::String] - # If present, the client's current location. This should be the name of a - # Google Cloud zone or region, such as "us-central1". - # - # If absent, the client's location will be assumed to be the same as the - # location of the server the client ends up connected to. - # - # Locations are primarily valuable for clients that connect from regions - # other than the ones that contain the Spanner database. - class RoutingHint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A tablet that was skipped by the client. See `Tablet.tablet_uid` and - # `Tablet.incarnation`. - # @!attribute [rw] tablet_uid - # @return [::Integer] - # The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`. - # @!attribute [rw] incarnation - # @return [::String] - # The incarnation of the tablet that was skipped. See `Tablet.incarnation`. - class SkippedTablet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb deleted file mode 100644 index 5c0d3caa5bb8..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/mutation.rb +++ /dev/null @@ -1,178 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # A modification to one or more Cloud Spanner rows. Mutations can be - # applied to a Cloud Spanner database by sending them in a - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} call. - # @!attribute [rw] insert - # @return [::Google::Cloud::Spanner::V1::Mutation::Write] - # Insert new rows in a table. If any of the rows already exist, - # the write or transaction fails with error `ALREADY_EXISTS`. - # - # Note: The following fields are mutually exclusive: `insert`, `update`, `insert_or_update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update - # @return [::Google::Cloud::Spanner::V1::Mutation::Write] - # Update existing rows in a table. If any of the rows does not - # already exist, the transaction fails with error `NOT_FOUND`. - # - # Note: The following fields are mutually exclusive: `update`, `insert`, `insert_or_update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] insert_or_update - # @return [::Google::Cloud::Spanner::V1::Mutation::Write] - # Like {::Google::Cloud::Spanner::V1::Mutation#insert insert}, except that if the row - # already exists, then its column values are overwritten with the ones - # provided. Any column values not explicitly written are preserved. - # - # When using - # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, just as - # when using {::Google::Cloud::Spanner::V1::Mutation#insert insert}, all `NOT NULL` - # columns in the table must be given a value. This holds true even when the - # row already exists and will therefore actually be updated. - # - # Note: The following fields are mutually exclusive: `insert_or_update`, `insert`, `update`, `replace`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] replace - # @return [::Google::Cloud::Spanner::V1::Mutation::Write] - # Like {::Google::Cloud::Spanner::V1::Mutation#insert insert}, except that if the row - # already exists, it is deleted, and the column values provided are - # inserted instead. Unlike - # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, this - # means any values not explicitly written become `NULL`. - # - # In an interleaved table, if you create the child table with the - # `ON DELETE CASCADE` annotation, then replacing a parent row - # also deletes the child rows. Otherwise, you must delete the - # child rows before you replace the parent row. - # - # Note: The following fields are mutually exclusive: `replace`, `insert`, `update`, `insert_or_update`, `delete`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete - # @return [::Google::Cloud::Spanner::V1::Mutation::Delete] - # Delete rows from a table. Succeeds whether or not the named - # rows were present. - # - # Note: The following fields are mutually exclusive: `delete`, `insert`, `update`, `insert_or_update`, `replace`, `send`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] send - # @return [::Google::Cloud::Spanner::V1::Mutation::Send] - # Send a message to a queue. - # - # Note: The following fields are mutually exclusive: `send`, `insert`, `update`, `insert_or_update`, `replace`, `delete`, `ack`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ack - # @return [::Google::Cloud::Spanner::V1::Mutation::Ack] - # Ack a message from a queue. - # - # Note: The following fields are mutually exclusive: `ack`, `insert`, `update`, `insert_or_update`, `replace`, `delete`, `send`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Mutation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Arguments to {::Google::Cloud::Spanner::V1::Mutation#insert insert}, - # {::Google::Cloud::Spanner::V1::Mutation#update update}, - # {::Google::Cloud::Spanner::V1::Mutation#insert_or_update insert_or_update}, and - # {::Google::Cloud::Spanner::V1::Mutation#replace replace} operations. - # @!attribute [rw] table - # @return [::String] - # Required. The table whose rows will be written. - # @!attribute [rw] columns - # @return [::Array<::String>] - # The names of the columns in - # {::Google::Cloud::Spanner::V1::Mutation::Write#table table} to be written. - # - # The list of columns must contain enough columns to allow - # Cloud Spanner to derive values for all primary key columns in the - # row(s) to be modified. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::ListValue>] - # The values to be written. `values` can contain more than one - # list of values. If it does, then multiple rows are written, one - # for each entry in `values`. Each list in `values` must have - # exactly as many entries as there are entries in - # {::Google::Cloud::Spanner::V1::Mutation::Write#columns columns} above. Sending - # multiple lists is equivalent to sending multiple `Mutation`s, each - # containing one `values` entry and repeating - # {::Google::Cloud::Spanner::V1::Mutation::Write#table table} and - # {::Google::Cloud::Spanner::V1::Mutation::Write#columns columns}. Individual values in - # each list are encoded as described {::Google::Cloud::Spanner::V1::TypeCode here}. - class Write - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Arguments to {::Google::Cloud::Spanner::V1::Mutation#delete delete} operations. - # @!attribute [rw] table - # @return [::String] - # Required. The table whose rows will be deleted. - # @!attribute [rw] key_set - # @return [::Google::Cloud::Spanner::V1::KeySet] - # Required. The primary keys of the rows within - # {::Google::Cloud::Spanner::V1::Mutation::Delete#table table} to delete. The primary - # keys must be specified in the order in which they appear in the `PRIMARY - # KEY()` clause of the table's equivalent DDL statement (the DDL statement - # used to create the table). Delete is idempotent. The transaction will - # succeed even if some or all rows do not exist. - class Delete - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Arguments to {::Google::Cloud::Spanner::V1::Mutation#send send} operations. - # @!attribute [rw] queue - # @return [::String] - # Required. The queue to which the message will be sent. - # @!attribute [rw] key - # @return [::Google::Protobuf::ListValue] - # Required. The primary key of the message to be sent. - # @!attribute [rw] deliver_time - # @return [::Google::Protobuf::Timestamp] - # The time at which Spanner will begin attempting to deliver the message. - # If `deliver_time` is not set, Spanner will deliver the message - # immediately. If `deliver_time` is in the past, Spanner will replace it - # with a value closer to the current time. - # @!attribute [rw] payload - # @return [::Google::Protobuf::Value] - # The payload of the message. - class Send - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Arguments to {::Google::Cloud::Spanner::V1::Mutation#ack ack} operations. - # @!attribute [rw] queue - # @return [::String] - # Required. The queue where the message to be acked is stored. - # @!attribute [rw] key - # @return [::Google::Protobuf::ListValue] - # Required. The primary key of the message to be acked. - # @!attribute [rw] ignore_not_found - # @return [::Boolean] - # By default, an attempt to ack a message that does not exist will fail - # with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack - # will succeed even if the message does not exist. This is useful for - # unconditionally acking a message, even if it is missing or has already - # been acked. - class Ack - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb deleted file mode 100644 index a213c6fbe1d4..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/query_plan.rb +++ /dev/null @@ -1,180 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # Node information for nodes appearing in a - # {::Google::Cloud::Spanner::V1::QueryPlan#plan_nodes QueryPlan.plan_nodes}. - # @!attribute [rw] index - # @return [::Integer] - # The `PlanNode`'s index in [node - # list][google.spanner.v1.QueryPlan.plan_nodes]. - # @!attribute [rw] kind - # @return [::Google::Cloud::Spanner::V1::PlanNode::Kind] - # Used to determine the type of node. May be needed for visualizing - # different kinds of nodes differently. For example, If the node is a - # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} node, it will have a - # condensed representation which can be used to directly embed a description - # of the node in its parent. - # @!attribute [rw] display_name - # @return [::String] - # The display name for the node. - # @!attribute [rw] child_links - # @return [::Array<::Google::Cloud::Spanner::V1::PlanNode::ChildLink>] - # List of child node `index`es and their relationship to this parent. - # @!attribute [rw] short_representation - # @return [::Google::Cloud::Spanner::V1::PlanNode::ShortRepresentation] - # Condensed representation for - # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} nodes. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Struct] - # Attributes relevant to the node contained in a group of key-value pairs. - # For example, a Parameter Reference node could have the following - # information in its metadata: - # - # { - # "parameter_reference": "param1", - # "parameter_type": "array" - # } - # @!attribute [rw] execution_stats - # @return [::Google::Protobuf::Struct] - # The execution statistics associated with the node, contained in a group of - # key-value pairs. Only present if the plan was returned as a result of a - # profile query. For example, number of executions, number of rows/time per - # execution etc. - class PlanNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metadata associated with a parent-child relationship appearing in a - # {::Google::Cloud::Spanner::V1::PlanNode PlanNode}. - # @!attribute [rw] child_index - # @return [::Integer] - # The node to which the link points. - # @!attribute [rw] type - # @return [::String] - # The type of the link. For example, in Hash Joins this could be used to - # distinguish between the build child and the probe child, or in the case - # of the child being an output variable, to represent the tag associated - # with the output variable. - # @!attribute [rw] variable - # @return [::String] - # Only present if the child node is - # {::Google::Cloud::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} and corresponds to an - # output variable of the parent node. The field carries the name of the - # output variable. For example, a `TableScan` operator that reads rows from - # a table will have child links to the `SCALAR` nodes representing the - # output variables created for each column that is read by the operator. - # The corresponding `variable` fields will be set to the variable names - # assigned to the columns. - class ChildLink - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Condensed representation of a node and its subtree. Only present for - # `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode]. - # @!attribute [rw] description - # @return [::String] - # A string representation of the expression subtree rooted at this node. - # @!attribute [rw] subqueries - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # A mapping of (subquery variable name) -> (subquery node id) for cases - # where the `description` string of this node references a `SCALAR` - # subquery contained in the expression subtree rooted at this node. The - # referenced `SCALAR` subquery may not necessarily be a direct child of - # this node. - class ShortRepresentation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class SubqueriesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The kind of {::Google::Cloud::Spanner::V1::PlanNode PlanNode}. Distinguishes between - # the two different kinds of nodes that can appear in a query plan. - module Kind - # Not specified. - KIND_UNSPECIFIED = 0 - - # Denotes a Relational operator node in the expression tree. Relational - # operators represent iterative processing of rows during query execution. - # For example, a `TableScan` operation that reads rows from a table. - RELATIONAL = 1 - - # Denotes a Scalar node in the expression tree. Scalar nodes represent - # non-iterable entities in the query plan. For example, constants or - # arithmetic operators appearing inside predicate expressions or references - # to column names. - SCALAR = 2 - end - end - - # Output of query advisor analysis. - # @!attribute [rw] index_advice - # @return [::Array<::Google::Cloud::Spanner::V1::QueryAdvisorResult::IndexAdvice>] - # Optional. Index Recommendation for a query. This is an optional field and - # the recommendation will only be available when the recommendation - # guarantees significant improvement in query performance. - class QueryAdvisorResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Recommendation to add new indexes to run queries more efficiently. - # @!attribute [rw] ddl - # @return [::Array<::String>] - # Optional. DDL statements to add new indexes that will improve the query. - # @!attribute [rw] improvement_factor - # @return [::Float] - # Optional. Estimated latency improvement factor. For example if the query - # currently takes 500 ms to run and the estimated latency with new indexes - # is 100 ms this field will be 5. - class IndexAdvice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Contains an ordered list of nodes appearing in the query plan. - # @!attribute [rw] plan_nodes - # @return [::Array<::Google::Cloud::Spanner::V1::PlanNode>] - # The nodes in the query plan. Plan nodes are returned in pre-order starting - # with the plan root. Each {::Google::Cloud::Spanner::V1::PlanNode PlanNode}'s `id` - # corresponds to its index in `plan_nodes`. - # @!attribute [rw] query_advice - # @return [::Google::Cloud::Spanner::V1::QueryAdvisorResult] - # Optional. The advise/recommendations for a query. Currently this field will - # be serving index recommendations for a query. - class QueryPlan - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.rb deleted file mode 100644 index 965cab4685b9..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/result_set.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! - - -module Google - module Cloud - module Spanner - module V1 - # Results from {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Spanner::V1::ResultSetMetadata] - # Metadata about the result set, such as row type information. - # @!attribute [rw] rows - # @return [::Array<::Google::Protobuf::ListValue>] - # Each element in `rows` is a row whose format is defined by - # {::Google::Cloud::Spanner::V1::ResultSetMetadata#row_type metadata.row_type}. The ith - # element in each row matches the ith field in - # {::Google::Cloud::Spanner::V1::ResultSetMetadata#row_type metadata.row_type}. Elements - # are encoded based on type as described {::Google::Cloud::Spanner::V1::TypeCode here}. - # @!attribute [rw] stats - # @return [::Google::Cloud::Spanner::V1::ResultSetStats] - # Query plan and execution statistics for the SQL statement that - # produced this result set. These can be requested by setting - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. - # DML statements always produce stats containing the number of rows - # modified, unless executed using the - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::PLAN ExecuteSqlRequest.QueryMode.PLAN} - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. - # Other fields might or might not be populated, based on the - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode}. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # Optional. A precommit token is included if the read-write transaction is on - # a multiplexed session. Pass the precommit token with the highest sequence - # number from this transaction attempt to the - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. - # @!attribute [rw] cache_update - # @return [::Google::Cloud::Spanner::V1::CacheUpdate] - # Optional. A cache update expresses a set of changes the client should - # incorporate into its location cache. The client should discard the changes - # if they are older than the data it already has. This data can be obtained - # in response to requests that included a `RoutingHint` field, but may also - # be obtained by explicit location-fetching RPCs which may be added in the - # future. - class ResultSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Partial results from a streaming read or SQL query. Streaming reads and - # SQL queries better tolerate large result sets, large rows, and large - # values, but are a little trickier to consume. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Spanner::V1::ResultSetMetadata] - # Metadata about the result set, such as row type information. - # Only present in the first response. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # A streamed result set consists of a stream of values, which might - # be split into many `PartialResultSet` messages to accommodate - # large rows and/or large values. Every N complete values defines a - # row, where N is equal to the number of entries in - # {::Google::Cloud::Spanner::V1::StructType#fields metadata.row_type.fields}. - # - # Most values are encoded based on type as described - # {::Google::Cloud::Spanner::V1::TypeCode here}. - # - # It's possible that the last value in values is "chunked", - # meaning that the rest of the value is sent in subsequent - # `PartialResultSet`(s). This is denoted by the - # {::Google::Cloud::Spanner::V1::PartialResultSet#chunked_value chunked_value} field. - # Two or more chunked values can be merged to form a complete value as - # follows: - # - # * `bool/number/null`: can't be chunked - # * `string`: concatenate the strings - # * `list`: concatenate the lists. If the last element in a list is a - # `string`, `list`, or `object`, merge it with the first element in - # the next list by applying these rules recursively. - # * `object`: concatenate the (field name, field value) pairs. If a - # field name is duplicated, then apply these rules recursively - # to merge the field values. - # - # Some examples of merging: - # - # Strings are concatenated. - # "foo", "bar" => "foobar" - # - # Lists of non-strings are concatenated. - # [2, 3], [4] => [2, 3, 4] - # - # Lists are concatenated, but the last and first elements are merged - # because they are strings. - # ["a", "b"], ["c", "d"] => ["a", "bc", "d"] - # - # Lists are concatenated, but the last and first elements are merged - # because they are lists. Recursively, the last and first elements - # of the inner lists are merged because they are strings. - # ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"] - # - # Non-overlapping object fields are combined. - # {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"} - # - # Overlapping object fields are merged. - # {"a": "1"}, {"a": "2"} => {"a": "12"} - # - # Examples of merging objects containing lists of strings. - # {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]} - # - # For a more complete example, suppose a streaming SQL query is - # yielding a result set whose rows contain a single string - # field. The following `PartialResultSet`s might be yielded: - # - # { - # "metadata": { ... } - # "values": ["Hello", "W"] - # "chunked_value": true - # "resume_token": "Af65..." - # } - # { - # "values": ["orl"] - # "chunked_value": true - # } - # { - # "values": ["d"] - # "resume_token": "Zx1B..." - # } - # - # This sequence of `PartialResultSet`s encodes two rows, one - # containing the field value `"Hello"`, and a second containing the - # field value `"World" = "W" + "orl" + "d"`. - # - # Not all `PartialResultSet`s contain a `resume_token`. Execution can only be - # resumed from a previously yielded `resume_token`. For the above sequence of - # `PartialResultSet`s, resuming the query with `"resume_token": "Af65..."` - # yields results from the `PartialResultSet` with value "orl". - # @!attribute [rw] chunked_value - # @return [::Boolean] - # If true, then the final value in - # {::Google::Cloud::Spanner::V1::PartialResultSet#values values} is chunked, and must be - # combined with more values from subsequent `PartialResultSet`s to obtain a - # complete field value. - # @!attribute [rw] resume_token - # @return [::String] - # Streaming calls might be interrupted for a variety of reasons, such - # as TCP connection loss. If this occurs, the stream of results can - # be resumed by re-sending the original request and including - # `resume_token`. Note that executing any other transaction in the - # same session invalidates the token. - # @!attribute [rw] stats - # @return [::Google::Cloud::Spanner::V1::ResultSetStats] - # Query plan and execution statistics for the statement that produced this - # streaming result set. These can be requested by setting - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode ExecuteSqlRequest.query_mode} - # and are sent only once with the last response in the stream. This field is - # also present in the last response for DML statements. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # Optional. A precommit token is included if the read-write transaction - # has multiplexed sessions enabled. Pass the precommit token with the highest - # sequence number from this transaction attempt to the - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. - # @!attribute [rw] last - # @return [::Boolean] - # Optional. Indicates whether this is the last `PartialResultSet` in the - # stream. The server might optionally set this field. Clients shouldn't rely - # on this field being set in all cases. - # @!attribute [rw] cache_update - # @return [::Google::Cloud::Spanner::V1::CacheUpdate] - # Optional. A cache update expresses a set of changes the client should - # incorporate into its location cache. The client should discard the changes - # if they are older than the data it already has. This data can be obtained - # in response to requests that included a `RoutingHint` field, but may also - # be obtained by explicit location-fetching RPCs which may be added in the - # future. - class PartialResultSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about a {::Google::Cloud::Spanner::V1::ResultSet ResultSet} or - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet}. - # @!attribute [rw] row_type - # @return [::Google::Cloud::Spanner::V1::StructType] - # Indicates the field names and types for the rows in the result - # set. For example, a SQL query like `"SELECT UserId, UserName FROM - # Users"` could return a `row_type` value like: - # - # "fields": [ - # { "name": "UserId", "type": { "code": "INT64" } }, - # { "name": "UserName", "type": { "code": "STRING" } }, - # ] - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::Transaction] - # If the read or SQL query began a transaction as a side-effect, the - # information about the new transaction is yielded here. - # @!attribute [rw] undeclared_parameters - # @return [::Google::Cloud::Spanner::V1::StructType] - # A SQL query can be parameterized. In PLAN mode, these parameters can be - # undeclared. This indicates the field names and types for those undeclared - # parameters in the SQL query. For example, a SQL query like `"SELECT * FROM - # Users where UserId = @userId and UserName = @userName "` could return a - # `undeclared_parameters` value like: - # - # "fields": [ - # { "name": "UserId", "type": { "code": "INT64" } }, - # { "name": "UserName", "type": { "code": "STRING" } }, - # ] - class ResultSetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional statistics about a {::Google::Cloud::Spanner::V1::ResultSet ResultSet} or - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet}. - # @!attribute [rw] query_plan - # @return [::Google::Cloud::Spanner::V1::QueryPlan] - # {::Google::Cloud::Spanner::V1::QueryPlan QueryPlan} for the query associated with this - # result. - # @!attribute [rw] query_stats - # @return [::Google::Protobuf::Struct] - # Aggregated statistics from the execution of the query. Only present when - # the query is profiled. For example, a query could return the statistics as - # follows: - # - # { - # "rows_returned": "3", - # "elapsed_time": "1.22 secs", - # "cpu_time": "1.19 secs" - # } - # @!attribute [rw] row_count_exact - # @return [::Integer] - # Standard DML returns an exact count of rows that were modified. - # - # Note: The following fields are mutually exclusive: `row_count_exact`, `row_count_lower_bound`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] row_count_lower_bound - # @return [::Integer] - # Partitioned DML doesn't offer exactly-once semantics, so it - # returns a lower bound of the rows modified. - # - # Note: The following fields are mutually exclusive: `row_count_lower_bound`, `row_count_exact`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ResultSetStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb deleted file mode 100644 index 68f02ed42f40..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/spanner.rb +++ /dev/null @@ -1,1203 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#create_session CreateSession}. - # @!attribute [rw] database - # @return [::String] - # Required. The database in which the new session is created. - # @!attribute [rw] session - # @return [::Google::Cloud::Spanner::V1::Session] - # Required. The session to create. - class CreateSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions}. - # @!attribute [rw] database - # @return [::String] - # Required. The database in which the new sessions are created. - # @!attribute [rw] session_template - # @return [::Google::Cloud::Spanner::V1::Session] - # Parameters to apply to each created session. - # @!attribute [rw] session_count - # @return [::Integer] - # Required. The number of sessions to be created in this batch call. At least - # one session is created. The API can return fewer than the requested number - # of sessions. If a specific number of sessions are desired, the client can - # make additional calls to `BatchCreateSessions` (adjusting - # {::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest#session_count session_count} - # as necessary). - class BatchCreateSessionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions}. - # @!attribute [rw] session - # @return [::Array<::Google::Cloud::Spanner::V1::Session>] - # The freshly created sessions. - class BatchCreateSessionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A session in the Cloud Spanner API. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the session. This is always system-assigned. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels for the session. - # - # * Label keys must be between 1 and 63 characters long and must conform to - # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - # * Label values must be between 0 and 63 characters long and must conform - # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - # * No more than 64 labels can be associated with a given session. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the session is created. - # @!attribute [r] approximate_last_use_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The approximate timestamp when the session is last used. It's - # typically earlier than the actual last use time. - # @!attribute [rw] creator_role - # @return [::String] - # The database role which created this session. - # @!attribute [rw] multiplexed - # @return [::Boolean] - # Optional. If `true`, specifies a multiplexed session. Use a multiplexed - # session for multiple, concurrent operations including any combination of - # read-only and read-write transactions. Use - # {::Google::Cloud::Spanner::V1::Spanner::Client#create_session `sessions.create`} to create - # multiplexed sessions. Don't use - # {::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions BatchCreateSessions} to - # create a multiplexed session. You can't delete or list multiplexed - # sessions. - class Session - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#get_session GetSession}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session to retrieve. - class GetSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions}. - # @!attribute [rw] database - # @return [::String] - # Required. The database in which to list sessions. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of sessions to be returned in the response. If 0 or less, defaults - # to the server's maximum allowed page size. - # @!attribute [rw] page_token - # @return [::String] - # If non-empty, `page_token` should contain a - # {::Google::Cloud::Spanner::V1::ListSessionsResponse#next_page_token next_page_token} - # from a previous - # {::Google::Cloud::Spanner::V1::ListSessionsResponse ListSessionsResponse}. - # @!attribute [rw] filter - # @return [::String] - # An expression for filtering the results of the request. Filter rules are - # case insensitive. The fields eligible for filtering are: - # - # * `labels.key` where key is the name of a label - # - # Some examples of using filters are: - # - # * `labels.env:*` --> The session has the label "env". - # * `labels.env:dev` --> The session has the label "env" and the value of - # the label contains the string "dev". - class ListSessionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions}. - # @!attribute [rw] sessions - # @return [::Array<::Google::Cloud::Spanner::V1::Session>] - # The list of requested sessions. - # @!attribute [rw] next_page_token - # @return [::String] - # `next_page_token` can be sent in a subsequent - # {::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions ListSessions} call to fetch more - # of the matching sessions. - class ListSessionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#delete_session DeleteSession}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session to delete. - class DeleteSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Common request options for various APIs. - # @!attribute [rw] priority - # @return [::Google::Cloud::Spanner::V1::RequestOptions::Priority] - # Priority for the request. - # @!attribute [rw] request_tag - # @return [::String] - # A per-request tag which can be applied to queries or reads, used for - # statistics collection. - # Both `request_tag` and `transaction_tag` can be specified for a read or - # query that belongs to a transaction. - # This field is ignored for requests where it's not applicable (for example, - # `CommitRequest`). - # Legal characters for `request_tag` values are all printable characters - # (ASCII 32 - 126) and the length of a request_tag is limited to 50 - # characters. Values that exceed this limit are truncated. - # Any leading underscore (_) characters are removed from the string. - # @!attribute [rw] transaction_tag - # @return [::String] - # A tag used for statistics collection about this transaction. - # Both `request_tag` and `transaction_tag` can be specified for a read or - # query that belongs to a transaction. - # To enable tagging on a transaction, `transaction_tag` must be set to the - # same value for all requests belonging to the same transaction, including - # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. - # If this request doesn't belong to any transaction, `transaction_tag` is - # ignored. - # Legal characters for `transaction_tag` values are all printable characters - # (ASCII 32 - 126) and the length of a `transaction_tag` is limited to 50 - # characters. Values that exceed this limit are truncated. - # Any leading underscore (_) characters are removed from the string. - # @!attribute [rw] client_context - # @return [::Google::Cloud::Spanner::V1::RequestOptions::ClientContext] - # Optional. Optional context that may be needed for some requests. - class RequestOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Container for various pieces of client-owned context attached to a request. - # @!attribute [rw] secure_context - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Optional. Map of parameter name to value for this request. These values - # will be returned by any SECURE_CONTEXT() calls invoked by this request - # (e.g., by queries against Parameterized Secure Views). - class ClientContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class SecureContextEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The relative priority for requests. Note that priority isn't applicable - # for {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. - # - # The priority acts as a hint to the Cloud Spanner scheduler and doesn't - # guarantee priority or order of execution. For example: - # - # * Some parts of a write operation always execute at `PRIORITY_HIGH`, - # regardless of the specified priority. This can cause you to see an - # increase in high priority workload even when executing a low priority - # request. This can also potentially cause a priority inversion where a - # lower priority request is fulfilled ahead of a higher priority - # request. - # * If a transaction contains multiple operations with different priorities, - # Cloud Spanner doesn't guarantee to process the higher priority - # operations first. There might be other constraints to satisfy, such as - # the order of operations. - module Priority - # `PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`. - PRIORITY_UNSPECIFIED = 0 - - # This specifies that the request is low priority. - PRIORITY_LOW = 1 - - # This specifies that the request is medium priority. - PRIORITY_MEDIUM = 2 - - # This specifies that the request is high priority. - PRIORITY_HIGH = 3 - end - end - - # The `DirectedReadOptions` can be used to indicate which replicas or regions - # should be used for non-transactional reads or queries. - # - # `DirectedReadOptions` can only be specified for a read-only transaction, - # otherwise the API returns an `INVALID_ARGUMENT` error. - # @!attribute [rw] include_replicas - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::IncludeReplicas] - # `Include_replicas` indicates the order of replicas (as they appear in - # this list) to process the request. If `auto_failover_disabled` is set to - # `true` and all replicas are exhausted without finding a healthy replica, - # Spanner waits for a replica in the list to become available, requests - # might fail due to `DEADLINE_EXCEEDED` errors. - # - # Note: The following fields are mutually exclusive: `include_replicas`, `exclude_replicas`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclude_replicas - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::ExcludeReplicas] - # `Exclude_replicas` indicates that specified replicas should be excluded - # from serving requests. Spanner doesn't route requests to the replicas - # in this list. - # - # Note: The following fields are mutually exclusive: `exclude_replicas`, `include_replicas`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class DirectedReadOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The directed read replica selector. - # Callers must provide one or more of the following fields for replica - # selection: - # - # * `location` - The location must be one of the regions within the - # multi-region configuration of your database. - # * `type` - The type of the replica. - # - # Some examples of using replica_selectors are: - # - # * `location:us-east1` --> The "us-east1" replica(s) of any available type - # is used to process the request. - # * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in the nearest - # available location are used to process the - # request. - # * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s) - # in location "us-east1" is used to process - # the request. - # @!attribute [rw] location - # @return [::String] - # The location or region of the serving requests, for example, "us-east1". - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection::Type] - # The type of replica. - class ReplicaSelection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the type of replica. - module Type - # Not specified. - TYPE_UNSPECIFIED = 0 - - # Read-write replicas support both reads and writes. - READ_WRITE = 1 - - # Read-only replicas only support reads (not writes). - READ_ONLY = 2 - end - end - - # An `IncludeReplicas` contains a repeated set of `ReplicaSelection` which - # indicates the order in which replicas should be considered. - # @!attribute [rw] replica_selections - # @return [::Array<::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection>] - # The directed read replica selector. - # @!attribute [rw] auto_failover_disabled - # @return [::Boolean] - # If `true`, Spanner doesn't route requests to a replica outside the - # <`include_replicas` list when all of the specified replicas are - # unavailable or unhealthy. Default value is `false`. - class IncludeReplicas - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An ExcludeReplicas contains a repeated set of ReplicaSelection that should - # be excluded from serving requests. - # @!attribute [rw] replica_selections - # @return [::Array<::Google::Cloud::Spanner::V1::DirectedReadOptions::ReplicaSelection>] - # The directed read replica selector. - class ExcludeReplicas - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql ExecuteStreamingSql}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the SQL query should be performed. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # The transaction to use. - # - # For queries, if none is provided, the default is a temporary read-only - # transaction with strong concurrency. - # - # Standard DML statements require a read-write transaction. To protect - # against replays, single-use transactions are not supported. The caller - # must either supply an existing transaction ID or begin a new transaction. - # - # Partitioned DML requires an existing Partitioned DML transaction ID. - # @!attribute [rw] sql - # @return [::String] - # Required. The SQL string. - # @!attribute [rw] params - # @return [::Google::Protobuf::Struct] - # Parameter names and values that bind to placeholders in the SQL string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names must conform - # to the naming requirements of identifiers as specified at - # https://cloud.google.com/spanner/docs/lexical#identifiers. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @!attribute [rw] param_types - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#params params} as JSON strings. - # - # In these cases, you can use `param_types` to specify the exact - # SQL type for some or all of the SQL statement parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @!attribute [rw] resume_token - # @return [::String] - # If this request is resuming a previously interrupted SQL statement - # execution, `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new SQL statement execution to resume - # where the last one left off. The rest of the request parameters must - # exactly match the request that yielded this token. - # @!attribute [rw] query_mode - # @return [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode] - # Used to control the amount of debugging information returned in - # {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats}. If - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#partition_token partition_token} is - # set, {::Google::Cloud::Spanner::V1::ExecuteSqlRequest#query_mode query_mode} can only - # be set to - # {::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryMode::NORMAL QueryMode.NORMAL}. - # @!attribute [rw] partition_token - # @return [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionQuery`. There must be an exact - # match for the values of fields common to this message and the - # `PartitionQueryRequest` message used to create this `partition_token`. - # @!attribute [rw] seqno - # @return [::Integer] - # A per-transaction sequence number used to identify this request. This field - # makes each request idempotent such that if the request is received multiple - # times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction can be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # - # Required for DML statements. Ignored for queries. - # @!attribute [rw] query_options - # @return [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions] - # Query optimizer configuration to use for the given query. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] directed_read_options - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions] - # Directed read options for this request. - # @!attribute [rw] data_boost_enabled - # @return [::Boolean] - # If this is for a partitioned query and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @!attribute [rw] last_statement - # @return [::Boolean] - # Optional. If set to `true`, this statement marks the end of the - # transaction. After this statement executes, you must commit or abort the - # transaction. Attempts to execute any other requests against this - # transaction (including reads and queries) are rejected. - # - # For DML statements, setting this option might cause some error reporting to - # be deferred until commit time (for example, validation of unique - # constraints). Given this, successful execution of a DML statement shouldn't - # be assumed until a subsequent `Commit` call completes successfully. - # @!attribute [rw] routing_hint - # @return [::Google::Cloud::Spanner::V1::RoutingHint] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - class ExecuteSqlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Query optimizer configuration. - # @!attribute [rw] optimizer_version - # @return [::String] - # An option to control the selection of optimizer version. - # - # This parameter allows individual queries to pick different query - # optimizer versions. - # - # Specifying `latest` as a value instructs Cloud Spanner to use the - # latest supported query optimizer version. If not specified, Cloud Spanner - # uses the optimizer version set at the database level options. Any other - # positive integer (from the list of supported optimizer versions) - # overrides the default optimizer version for query execution. - # - # The list of supported optimizer versions can be queried from - # `SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS`. - # - # Executing a SQL statement with an invalid optimizer version fails with - # an `INVALID_ARGUMENT` error. - # - # See - # https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer - # for more information on managing the query optimizer. - # - # The `optimizer_version` statement hint has precedence over this setting. - # @!attribute [rw] optimizer_statistics_package - # @return [::String] - # An option to control the selection of optimizer statistics package. - # - # This parameter allows individual queries to use a different query - # optimizer statistics package. - # - # Specifying `latest` as a value instructs Cloud Spanner to use the latest - # generated statistics package. If not specified, Cloud Spanner uses - # the statistics package set at the database level options, or the latest - # package if the database option isn't set. - # - # The statistics package requested by the query has to be exempt from - # garbage collection. This can be achieved with the following DDL - # statement: - # - # ```sql - # ALTER STATISTICS SET OPTIONS (allow_gc=false) - # ``` - # - # The list of available statistics packages can be queried from - # `INFORMATION_SCHEMA.SPANNER_STATISTICS`. - # - # Executing a SQL statement with an invalid optimizer statistics package - # or with a statistics package that allows garbage collection fails with - # an `INVALID_ARGUMENT` error. - class QueryOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Spanner::V1::Type] - class ParamTypesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Mode in which the statement must be processed. - module QueryMode - # The default mode. Only the statement results are returned. - NORMAL = 0 - - # This mode returns only the query plan, without any results or - # execution statistics information. - PLAN = 1 - - # This mode returns the query plan, overall execution statistics, - # operator level execution statistics along with the results. This has a - # performance overhead compared to the other modes. It isn't recommended - # to use this mode for production traffic. - PROFILE = 2 - - # This mode returns the overall (but not operator-level) execution - # statistics along with the results. - WITH_STATS = 3 - - # This mode returns the query plan, overall (but not operator-level) - # execution statistics along with the results. - WITH_PLAN_AND_STATS = 4 - end - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml ExecuteBatchDml}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the DML statements should be performed. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # Required. The transaction to use. Must be a read-write transaction. - # - # To protect against replays, single-use transactions are not supported. The - # caller must either supply an existing transaction ID or begin a new - # transaction. - # @!attribute [rw] statements - # @return [::Array<::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement>] - # Required. The list of statements to execute in this batch. Statements are - # executed serially, such that the effects of statement `i` are visible to - # statement `i+1`. Each statement must be a DML statement. Execution stops at - # the first failed statement; the remaining statements are not executed. - # - # Callers must provide at least one statement. - # @!attribute [rw] seqno - # @return [::Integer] - # Required. A per-transaction sequence number used to identify this request. - # This field makes each request idempotent such that if the request is - # received multiple times, at most one succeeds. - # - # The sequence number must be monotonically increasing within the - # transaction. If a request arrives for the first time with an out-of-order - # sequence number, the transaction might be aborted. Replays of previously - # handled requests yield the same response as the first execution. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] last_statements - # @return [::Boolean] - # Optional. If set to `true`, this request marks the end of the transaction. - # After these statements execute, you must commit or abort the transaction. - # Attempts to execute any other requests against this transaction - # (including reads and queries) are rejected. - # - # Setting this option might cause some error reporting to be deferred until - # commit time (for example, validation of unique constraints). Given this, - # successful execution of statements shouldn't be assumed until a subsequent - # `Commit` call completes successfully. - class ExecuteBatchDmlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single DML statement. - # @!attribute [rw] sql - # @return [::String] - # Required. The DML string. - # @!attribute [rw] params - # @return [::Google::Protobuf::Struct] - # Parameter names and values that bind to placeholders in the DML string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names can contain - # letters, numbers, and underscores. - # - # Parameters can appear anywhere that a literal value is expected. The - # same parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @!attribute [rw] param_types - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] - # It isn't always possible for Cloud Spanner to infer the right SQL type - # from a JSON value. For example, values of type `BYTES` and values - # of type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement#params params} as - # JSON strings. - # - # In these cases, `param_types` can be used to specify the exact - # SQL type for some or all of the SQL statement parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - class Statement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Spanner::V1::Type] - class ParamTypesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # The response for - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml ExecuteBatchDml}. Contains a list - # of {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, one for each DML - # statement that has successfully executed, in the same order as the statements - # in the request. If a statement fails, the status in the response body - # identifies the cause of the failure. - # - # To check for DML statements that failed, use the following approach: - # - # 1. Check the status in the response message. The - # [google.rpc.Code][google.rpc.Code] enum - # value `OK` indicates that all statements were executed successfully. - # 2. If the status was not `OK`, check the number of result sets in the - # response. If the response contains `N` - # {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, then statement `N+1` in - # the request failed. - # - # Example 1: - # - # * Request: 5 DML statements, all executed successfully. - # * Response: 5 {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, with the - # status `OK`. - # - # Example 2: - # - # * Request: 5 DML statements. The third statement has a syntax error. - # * Response: 2 {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages, and a syntax - # error (`INVALID_ARGUMENT`) - # status. The number of {::Google::Cloud::Spanner::V1::ResultSet ResultSet} messages - # indicates that the third statement failed, and the fourth and fifth - # statements were not executed. - # @!attribute [rw] result_sets - # @return [::Array<::Google::Cloud::Spanner::V1::ResultSet>] - # One {::Google::Cloud::Spanner::V1::ResultSet ResultSet} for each statement in the - # request that ran successfully, in the same order as the statements in the - # request. Each {::Google::Cloud::Spanner::V1::ResultSet ResultSet} does not contain any - # rows. The {::Google::Cloud::Spanner::V1::ResultSetStats ResultSetStats} in each - # {::Google::Cloud::Spanner::V1::ResultSet ResultSet} contain the number of rows - # modified by the statement. - # - # Only the first {::Google::Cloud::Spanner::V1::ResultSet ResultSet} in the response - # contains valid {::Google::Cloud::Spanner::V1::ResultSetMetadata ResultSetMetadata}. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # If all DML statements are executed successfully, the status is `OK`. - # Otherwise, the error status of the first failed statement. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # Optional. A precommit token is included if the read-write transaction - # is on a multiplexed session. Pass the precommit token with the highest - # sequence number from this transaction attempt should be passed to the - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} request for this transaction. - class ExecuteBatchDmlResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options for a `PartitionQueryRequest` and `PartitionReadRequest`. - # @!attribute [rw] partition_size_bytes - # @return [::Integer] - # **Note:** This hint is currently ignored by `PartitionQuery` and - # `PartitionRead` requests. - # - # The desired data size for each partition generated. The default for this - # option is currently 1 GiB. This is only a hint. The actual size of each - # partition can be smaller or larger than this size request. - # @!attribute [rw] max_partitions - # @return [::Integer] - # **Note:** This hint is currently ignored by `PartitionQuery` and - # `PartitionRead` requests. - # - # The desired maximum number of partitions to return. For example, this - # might be set to the number of workers available. The default for this - # option is currently 10,000. The maximum value is currently 200,000. This - # is only a hint. The actual number of partitions returned can be smaller or - # larger than this maximum count request. - class PartitionOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_query PartitionQuery} - # @!attribute [rw] session - # @return [::String] - # Required. The session used to create the partitions. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # Read-only snapshot transactions are supported, read and write and - # single-use transactions are not. - # @!attribute [rw] sql - # @return [::String] - # Required. The query request to generate partitions for. The request fails - # if the query isn't root partitionable. For a query to be root - # partitionable, it needs to satisfy a few conditions. For example, if the - # query execution plan contains a distributed union operator, then it must be - # the first operator in the plan. For more information about other - # conditions, see [Read data in - # parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel). - # - # The query request must not contain DML commands, such as `INSERT`, - # `UPDATE`, or `DELETE`. Use - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql `ExecuteStreamingSql`} with - # a `PartitionedDml` transaction for large, partition-friendly DML - # operations. - # @!attribute [rw] params - # @return [::Google::Protobuf::Struct] - # Optional. Parameter names and values that bind to placeholders in the SQL - # string. - # - # A parameter placeholder consists of the `@` character followed by the - # parameter name (for example, `@firstName`). Parameter names can contain - # letters, numbers, and underscores. - # - # Parameters can appear anywhere that a literal value is expected. The same - # parameter name can be used more than once, for example: - # - # `"WHERE id > @msg_id AND id < @msg_id + 100"` - # - # It's an error to execute a SQL statement with unbound parameters. - # @!attribute [rw] param_types - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Spanner::V1::Type}] - # Optional. It isn't always possible for Cloud Spanner to infer the right SQL - # type from a JSON value. For example, values of type `BYTES` and values of - # type `STRING` both appear in - # {::Google::Cloud::Spanner::V1::PartitionQueryRequest#params params} as JSON strings. - # - # In these cases, `param_types` can be used to specify the exact - # SQL type for some or all of the SQL query parameters. See the - # definition of {::Google::Cloud::Spanner::V1::Type Type} for more information - # about SQL types. - # @!attribute [rw] partition_options - # @return [::Google::Cloud::Spanner::V1::PartitionOptions] - # Additional options that affect how many partitions are created. - class PartitionQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Spanner::V1::Type] - class ParamTypesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_read PartitionRead} - # @!attribute [rw] session - # @return [::String] - # Required. The session used to create the partitions. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # Read only snapshot transactions are supported, read/write and single use - # transactions are not. - # @!attribute [rw] table - # @return [::String] - # Required. The name of the table in the database to be read. - # @!attribute [rw] index - # @return [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table}. This index is used - # instead of the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} and sorting - # result rows. See {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} - # for further information. - # @!attribute [rw] columns - # @return [::Array<::String>] - # The columns of {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be - # returned for each row matching this request. - # @!attribute [rw] key_set - # @return [::Google::Cloud::Spanner::V1::KeySet] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#table table} to be yielded, unless - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present. If - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::PartitionReadRequest#key_set key_set} instead names - # index keys in {::Google::Cloud::Spanner::V1::PartitionReadRequest#index index}. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @!attribute [rw] partition_options - # @return [::Google::Cloud::Spanner::V1::PartitionOptions] - # Additional options that affect how many partitions are created. - class PartitionReadRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information returned for each partition returned in a - # PartitionResponse. - # @!attribute [rw] partition_token - # @return [::String] - # This token can be passed to `Read`, `StreamingRead`, `ExecuteSql`, or - # `ExecuteStreamingSql` requests to restrict the results to those identified - # by this partition token. - class Partition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for {::Google::Cloud::Spanner::V1::Spanner::Client#partition_query PartitionQuery} - # or {::Google::Cloud::Spanner::V1::Spanner::Client#partition_read PartitionRead} - # @!attribute [rw] partitions - # @return [::Array<::Google::Cloud::Spanner::V1::Partition>] - # Partitions created by this request. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::Transaction] - # Transaction created by this request. - class PartitionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read StreamingRead}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the read should be performed. - # @!attribute [rw] transaction - # @return [::Google::Cloud::Spanner::V1::TransactionSelector] - # The transaction to use. If none is provided, the default is a - # temporary read-only transaction with strong concurrency. - # @!attribute [rw] table - # @return [::String] - # Required. The name of the table in the database to be read. - # @!attribute [rw] index - # @return [::String] - # If non-empty, the name of an index on - # {::Google::Cloud::Spanner::V1::ReadRequest#table table}. This index is used instead of - # the table primary key when interpreting - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} and sorting result rows. - # See {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} for further - # information. - # @!attribute [rw] columns - # @return [::Array<::String>] - # Required. The columns of {::Google::Cloud::Spanner::V1::ReadRequest#table table} to be - # returned for each row matching this request. - # @!attribute [rw] key_set - # @return [::Google::Cloud::Spanner::V1::KeySet] - # Required. `key_set` identifies the rows to be yielded. `key_set` names the - # primary keys of the rows in {::Google::Cloud::Spanner::V1::ReadRequest#table table} to - # be yielded, unless {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present. - # If {::Google::Cloud::Spanner::V1::ReadRequest#index index} is present, then - # {::Google::Cloud::Spanner::V1::ReadRequest#key_set key_set} instead names index keys - # in {::Google::Cloud::Spanner::V1::ReadRequest#index index}. - # - # If the {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} - # field is empty, rows are yielded in table primary key order (if - # {::Google::Cloud::Spanner::V1::ReadRequest#index index} is empty) or index key order - # (if {::Google::Cloud::Spanner::V1::ReadRequest#index index} is non-empty). If the - # {::Google::Cloud::Spanner::V1::ReadRequest#partition_token partition_token} field - # isn't empty, rows are yielded in an unspecified order. - # - # It isn't an error for the `key_set` to name rows that don't - # exist in the database. Read yields nothing for nonexistent rows. - # @!attribute [rw] limit - # @return [::Integer] - # If greater than zero, only the first `limit` rows are yielded. If `limit` - # is zero, the default is no limit. A limit can't be specified if - # `partition_token` is set. - # @!attribute [rw] resume_token - # @return [::String] - # If this request is resuming a previously interrupted read, - # `resume_token` should be copied from the last - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} yielded before the - # interruption. Doing this enables the new read to resume where the last read - # left off. The rest of the request parameters must exactly match the request - # that yielded this token. - # @!attribute [rw] partition_token - # @return [::String] - # If present, results are restricted to the specified partition - # previously created using `PartitionRead`. There must be an exact - # match for the values of fields common to this message and the - # PartitionReadRequest message used to create this partition_token. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] directed_read_options - # @return [::Google::Cloud::Spanner::V1::DirectedReadOptions] - # Directed read options for this request. - # @!attribute [rw] data_boost_enabled - # @return [::Boolean] - # If this is for a partitioned read and this field is set to `true`, the - # request is executed with Spanner Data Boost independent compute resources. - # - # If the field is set to `true` but the request doesn't set - # `partition_token`, the API returns an `INVALID_ARGUMENT` error. - # @!attribute [rw] order_by - # @return [::Google::Cloud::Spanner::V1::ReadRequest::OrderBy] - # Optional. Order for the returned rows. - # - # By default, Spanner returns result rows in primary key order except for - # PartitionRead requests. For applications that don't require rows to be - # returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting - # `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, - # resulting in lower latencies in certain cases (for example, bulk point - # lookups). - # @!attribute [rw] lock_hint - # @return [::Google::Cloud::Spanner::V1::ReadRequest::LockHint] - # Optional. Lock Hint for the request, it can only be used with read-write - # transactions. - # @!attribute [rw] routing_hint - # @return [::Google::Cloud::Spanner::V1::RoutingHint] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - class ReadRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An option to control the order in which rows are returned from a read. - module OrderBy - # Default value. - # - # `ORDER_BY_UNSPECIFIED` is equivalent to `ORDER_BY_PRIMARY_KEY`. - ORDER_BY_UNSPECIFIED = 0 - - # Read rows are returned in primary key order. - # - # In the event that this option is used in conjunction with the - # `partition_token` field, the API returns an `INVALID_ARGUMENT` error. - ORDER_BY_PRIMARY_KEY = 1 - - # Read rows are returned in any order. - ORDER_BY_NO_ORDER = 2 - end - - # A lock hint mechanism for reads done within a transaction. - module LockHint - # Default value. - # - # `LOCK_HINT_UNSPECIFIED` is equivalent to `LOCK_HINT_SHARED`. - LOCK_HINT_UNSPECIFIED = 0 - - # Acquire shared locks. - # - # By default when you perform a read as part of a read-write transaction, - # Spanner acquires shared read locks, which allows other reads to still - # access the data until your transaction is ready to commit. When your - # transaction is committing and writes are being applied, the transaction - # attempts to upgrade to an exclusive lock for any data you are writing. - # For more information about locks, see [Lock - # modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes). - LOCK_HINT_SHARED = 1 - - # Acquire exclusive locks. - # - # Requesting exclusive locks is beneficial if you observe high write - # contention, which means you notice that multiple transactions are - # concurrently trying to read and write to the same data, resulting in a - # large number of aborts. This problem occurs when two transactions - # initially acquire shared locks and then both try to upgrade to exclusive - # locks at the same time. In this situation both transactions are waiting - # for the other to give up their lock, resulting in a deadlocked situation. - # Spanner is able to detect this occurring and force one of the - # transactions to abort. However, this is a slow and expensive operation - # and results in lower performance. In this case it makes sense to acquire - # exclusive locks at the start of the transaction because then when - # multiple transactions try to act on the same data, they automatically get - # serialized. Each transaction waits its turn to acquire the lock and - # avoids getting into deadlock situations. - # - # Because the exclusive lock hint is just a hint, it shouldn't be - # considered equivalent to a mutex. In other words, you shouldn't use - # Spanner exclusive locks as a mutual exclusion mechanism for the execution - # of code outside of Spanner. - # - # **Note:** Request exclusive locks judiciously because they block others - # from reading that data for the entire transaction, rather than just when - # the writes are being performed. Unless you observe high write contention, - # you should use the default of shared read locks so you don't prematurely - # block other clients from reading the data that you're writing to. - LOCK_HINT_EXCLUSIVE = 2 - end - end - - # The request for - # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the transaction runs. - # @!attribute [rw] options - # @return [::Google::Cloud::Spanner::V1::TransactionOptions] - # Required. Options for the new transaction. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # Priority is ignored for this request. Setting the priority in this - # `request_options` struct doesn't do anything. To set the priority for a - # transaction, set it on the reads and writes that are part of this - # transaction instead. - # @!attribute [rw] mutation_key - # @return [::Google::Cloud::Spanner::V1::Mutation] - # Optional. Required for read-write transactions on a multiplexed session - # that commit mutations but don't perform any reads or queries. You must - # randomly select one of the mutations from the mutation set and send it as a - # part of this request. - # @!attribute [rw] routing_hint - # @return [::Google::Cloud::Spanner::V1::RoutingHint] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - class BeginTransactionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the transaction to be committed is running. - # @!attribute [rw] transaction_id - # @return [::String] - # Commit a previously-started transaction. - # - # Note: The following fields are mutually exclusive: `transaction_id`, `single_use_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] single_use_transaction - # @return [::Google::Cloud::Spanner::V1::TransactionOptions] - # Execute mutations in a temporary transaction. Note that unlike - # commit of a previously-started transaction, commit with a - # temporary transaction is non-idempotent. That is, if the - # `CommitRequest` is sent to Cloud Spanner more than once (for - # instance, due to retries in the application, or in the - # transport library), it's possible that the mutations are - # executed more than once. If this is undesirable, use - # {::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction BeginTransaction} and - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} instead. - # - # Note: The following fields are mutually exclusive: `single_use_transaction`, `transaction_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] mutations - # @return [::Array<::Google::Cloud::Spanner::V1::Mutation>] - # The mutations to be executed when this transaction commits. All - # mutations are applied atomically, in the order they appear in - # this list. - # @!attribute [rw] return_commit_stats - # @return [::Boolean] - # If `true`, then statistics related to the transaction is included in - # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. - # Default value is `false`. - # @!attribute [rw] max_commit_delay - # @return [::Google::Protobuf::Duration] - # Optional. The amount of latency this request is configured to incur in - # order to improve throughput. If this field isn't set, Spanner assumes - # requests are relatively latency sensitive and automatically determines an - # appropriate delay time. You can specify a commit delay value between 0 and - # 500 ms. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # Optional. If the read-write transaction was executed on a multiplexed - # session, then you must include the precommit token with the highest - # sequence number received in this transaction attempt. Failing to do so - # results in a `FailedPrecondition` error. - # @!attribute [rw] routing_hint - # @return [::Google::Cloud::Spanner::V1::RoutingHint] - # Optional. Makes the Spanner requests location-aware if present. - # - # It gives the server hints that can be used to route the request - # to an appropriate server, potentially significantly decreasing latency and - # improving throughput. To achieve improved performance, most fields must be - # filled in with accurate values. - class CommitRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the transaction to roll back is running. - # @!attribute [rw] transaction_id - # @return [::String] - # Required. The transaction to roll back. - class RollbackRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Spanner::V1::Spanner::Client#batch_write BatchWrite}. - # @!attribute [rw] session - # @return [::String] - # Required. The session in which the batch request is to be run. - # @!attribute [rw] request_options - # @return [::Google::Cloud::Spanner::V1::RequestOptions] - # Common options for this request. - # @!attribute [rw] mutation_groups - # @return [::Array<::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup>] - # Required. The groups of mutations to be applied. - # @!attribute [rw] exclude_txn_from_change_streams - # @return [::Boolean] - # Optional. If you don't set the `exclude_txn_from_change_streams` option or - # if it's set to `false`, then any change streams monitoring columns modified - # by transactions will capture the updates made within that transaction. - class BatchWriteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A group of mutations to be committed together. Related mutations should be - # placed in a group. For example, two mutations inserting rows with the same - # primary key prefix in both parent and child tables are related. - # @!attribute [rw] mutations - # @return [::Array<::Google::Cloud::Spanner::V1::Mutation>] - # Required. The mutations in this group. - class MutationGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The result of applying a batch of mutations. - # @!attribute [rw] indexes - # @return [::Array<::Integer>] - # The mutation groups applied in this batch. The values index into the - # `mutation_groups` field in the corresponding `BatchWriteRequest`. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # An `OK` status indicates success. Any other status indicates a failure. - # @!attribute [rw] commit_timestamp - # @return [::Google::Protobuf::Timestamp] - # The commit timestamp of the transaction that applied this batch. - # Present if status is OK and the mutation groups were applied, absent - # otherwise. - # - # For mutation groups with conditions, a status=OK and missing - # commit_timestamp means that the mutation groups were not applied due to the - # condition not being satisfied after evaluation. - class BatchWriteResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb deleted file mode 100644 index 53ec83e49080..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/transaction.rb +++ /dev/null @@ -1,357 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # Options to use for transactions. - # @!attribute [rw] read_write - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite] - # Transaction may write. - # - # Authorization to begin a read-write transaction requires - # `spanner.databases.beginOrRollbackReadWriteTransaction` permission - # on the `session` resource. - # - # Note: The following fields are mutually exclusive: `read_write`, `partitioned_dml`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] partitioned_dml - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::PartitionedDml] - # Partitioned DML transaction. - # - # Authorization to begin a Partitioned DML transaction requires - # `spanner.databases.beginPartitionedDmlTransaction` permission - # on the `session` resource. - # - # Note: The following fields are mutually exclusive: `partitioned_dml`, `read_write`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_only - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly] - # Transaction does not write. - # - # Authorization to begin a read-only transaction requires - # `spanner.databases.beginReadOnlyTransaction` permission - # on the `session` resource. - # - # Note: The following fields are mutually exclusive: `read_only`, `read_write`, `partitioned_dml`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclude_txn_from_change_streams - # @return [::Boolean] - # When `exclude_txn_from_change_streams` is set to `true`, it prevents read - # or write transactions from being tracked in change streams. - # - # * If the DDL option `allow_txn_exclusion` is set to `true`, then the - # updates - # made within this transaction aren't recorded in the change stream. - # - # * If you don't set the DDL option `allow_txn_exclusion` or if it's - # set to `false`, then the updates made within this transaction are - # recorded in the change stream. - # - # When `exclude_txn_from_change_streams` is set to `false` or not set, - # modifications from this transaction are recorded in all change streams - # that are tracking columns modified by these transactions. - # - # The `exclude_txn_from_change_streams` option can only be specified - # for read-write or partitioned DML transactions, otherwise the API returns - # an `INVALID_ARGUMENT` error. - # @!attribute [rw] isolation_level - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] - # Isolation level for the transaction. - class TransactionOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message type to initiate a read-write transaction. Currently this - # transaction type has no options. - # @!attribute [rw] read_lock_mode - # @return [::Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite::ReadLockMode] - # Read lock mode for the transaction. - # @!attribute [rw] multiplexed_session_previous_transaction_id - # @return [::String] - # Optional. Clients should pass the transaction ID of the previous - # transaction attempt that was aborted if this transaction is being - # executed on a multiplexed session. - class ReadWrite - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # `ReadLockMode` is used to set the read lock mode for read-write - # transactions. - module ReadLockMode - # Default value. - # - # * If isolation level is - # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE}, - # locking semantics default to `PESSIMISTIC`. - # * If isolation level is - # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ}, - # locking semantics default to `OPTIMISTIC`. - # * See - # [Concurrency - # control](https://cloud.google.com/spanner/docs/concurrency-control) - # for more details. - READ_LOCK_MODE_UNSPECIFIED = 0 - - # Pessimistic lock mode. - # - # Lock acquisition behavior depends on the isolation level in use. In - # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} - # isolation, reads and writes acquire necessary locks during transaction - # statement execution. In - # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ} - # isolation, reads that explicitly request to be locked and writes - # acquire locks. - # See - # [Concurrency - # control](https://cloud.google.com/spanner/docs/concurrency-control) for - # details on the types of locks acquired at each transaction step. - PESSIMISTIC = 1 - - # Optimistic lock mode. - # - # Lock acquisition behavior depends on the isolation level in use. In - # both - # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::SERIALIZABLE SERIALIZABLE} - # and - # {::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel::REPEATABLE_READ REPEATABLE_READ} - # isolation, reads and writes do not acquire locks during transaction - # statement execution. - # See - # [Concurrency - # control](https://cloud.google.com/spanner/docs/concurrency-control) for - # details on how the guarantees of each isolation level are provided at - # commit time. - OPTIMISTIC = 2 - end - end - - # Message type to initiate a Partitioned DML transaction. - class PartitionedDml - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message type to initiate a read-only transaction. - # @!attribute [rw] strong - # @return [::Boolean] - # Read at a timestamp where all previously committed transactions - # are visible. - # - # Note: The following fields are mutually exclusive: `strong`, `min_read_timestamp`, `max_staleness`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] min_read_timestamp - # @return [::Google::Protobuf::Timestamp] - # Executes all reads at a timestamp >= `min_read_timestamp`. - # - # This is useful for requesting fresher data than some previous - # read, or data that is fresh enough to observe the effects of some - # previously committed transaction whose timestamp is known. - # - # Note that this option can only be used in single-use transactions. - # - # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - # Example: `"2014-10-02T15:01:23.045123456Z"`. - # - # Note: The following fields are mutually exclusive: `min_read_timestamp`, `strong`, `max_staleness`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] max_staleness - # @return [::Google::Protobuf::Duration] - # Read data at a timestamp >= `NOW - max_staleness` - # seconds. Guarantees that all writes that have committed more - # than the specified number of seconds ago are visible. Because - # Cloud Spanner chooses the exact timestamp, this mode works even if - # the client's local clock is substantially skewed from Cloud Spanner - # commit timestamps. - # - # Useful for reading the freshest data available at a nearby - # replica, while bounding the possible staleness if the local - # replica has fallen behind. - # - # Note that this option can only be used in single-use - # transactions. - # - # Note: The following fields are mutually exclusive: `max_staleness`, `strong`, `min_read_timestamp`, `read_timestamp`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_timestamp - # @return [::Google::Protobuf::Timestamp] - # Executes all reads at the given timestamp. Unlike other modes, - # reads at a specific timestamp are repeatable; the same read at - # the same timestamp always returns the same data. If the - # timestamp is in the future, the read is blocked until the - # specified timestamp, modulo the read's deadline. - # - # Useful for large scale consistent reads such as mapreduces, or - # for coordinating many reads against a consistent snapshot of the - # data. - # - # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - # Example: `"2014-10-02T15:01:23.045123456Z"`. - # - # Note: The following fields are mutually exclusive: `read_timestamp`, `strong`, `min_read_timestamp`, `max_staleness`, `exact_staleness`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exact_staleness - # @return [::Google::Protobuf::Duration] - # Executes all reads at a timestamp that is `exact_staleness` - # old. The timestamp is chosen soon after the read is started. - # - # Guarantees that all writes that have committed more than the - # specified number of seconds ago are visible. Because Cloud Spanner - # chooses the exact timestamp, this mode works even if the client's - # local clock is substantially skewed from Cloud Spanner commit - # timestamps. - # - # Useful for reading at nearby replicas without the distributed - # timestamp negotiation overhead of `max_staleness`. - # - # Note: The following fields are mutually exclusive: `exact_staleness`, `strong`, `min_read_timestamp`, `max_staleness`, `read_timestamp`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] return_read_timestamp - # @return [::Boolean] - # If true, the Cloud Spanner-selected read timestamp is included in - # the {::Google::Cloud::Spanner::V1::Transaction Transaction} message that describes - # the transaction. - class ReadOnly - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `IsolationLevel` is used when setting the [isolation - # level](https://cloud.google.com/spanner/docs/isolation-levels) for a - # transaction. - module IsolationLevel - # Default value. - # - # If the value is not specified, the `SERIALIZABLE` isolation level is - # used. - ISOLATION_LEVEL_UNSPECIFIED = 0 - - # All transactions appear as if they executed in a serial order, even if - # some of the reads, writes, and other operations of distinct transactions - # actually occurred in parallel. Spanner assigns commit timestamps that - # reflect the order of committed transactions to implement this property. - # Spanner offers a stronger guarantee than serializability called external - # consistency. For more information, see - # [TrueTime and external - # consistency](https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability). - SERIALIZABLE = 1 - - # All reads performed during the transaction observe a consistent snapshot - # of the database, and the transaction is only successfully committed in - # the absence of conflicts between its updates and any concurrent updates - # that have occurred since that snapshot. Consequently, in contrast to - # `SERIALIZABLE` transactions, only write-write conflicts are detected in - # snapshot transactions. - # - # This isolation level does not support read-only and partitioned DML - # transactions. - # - # When `REPEATABLE_READ` is specified on a read-write transaction, the - # locking semantics default to `OPTIMISTIC`. - REPEATABLE_READ = 2 - end - end - - # A transaction. - # @!attribute [rw] id - # @return [::String] - # `id` may be used to identify the transaction in subsequent - # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read}, - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql}, - # {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit}, or - # {::Google::Cloud::Spanner::V1::Spanner::Client#rollback Rollback} calls. - # - # Single-use read-only transactions do not have IDs, because - # single-use transactions do not support multiple requests. - # @!attribute [rw] read_timestamp - # @return [::Google::Protobuf::Timestamp] - # For snapshot read-only transactions, the read timestamp chosen - # for the transaction. Not returned by default: see - # {::Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly#return_read_timestamp TransactionOptions.ReadOnly.return_read_timestamp}. - # - # A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - # Example: `"2014-10-02T15:01:23.045123456Z"`. - # @!attribute [rw] precommit_token - # @return [::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken] - # A precommit token is included in the response of a BeginTransaction - # request if the read-write transaction is on a multiplexed session and - # a mutation_key was specified in the - # {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction}. - # The precommit token with the highest sequence number from this transaction - # attempt should be passed to the {::Google::Cloud::Spanner::V1::Spanner::Client#commit Commit} - # request for this transaction. - # @!attribute [rw] cache_update - # @return [::Google::Cloud::Spanner::V1::CacheUpdate] - # Optional. A cache update expresses a set of changes the client should - # incorporate into its location cache. The client should discard the changes - # if they are older than the data it already has. This data can be obtained - # in response to requests that included a `RoutingHint` field, but may also - # be obtained by explicit location-fetching RPCs which may be added in the - # future. - class Transaction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message is used to select the transaction in which a - # {::Google::Cloud::Spanner::V1::Spanner::Client#read Read} or - # {::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql ExecuteSql} call runs. - # - # See {::Google::Cloud::Spanner::V1::TransactionOptions TransactionOptions} for more - # information about transactions. - # @!attribute [rw] single_use - # @return [::Google::Cloud::Spanner::V1::TransactionOptions] - # Execute the read or SQL query in a temporary transaction. - # This is the most efficient way to execute a transaction that - # consists of a single SQL query. - # - # Note: The following fields are mutually exclusive: `single_use`, `id`, `begin`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] id - # @return [::String] - # Execute the read or SQL query in a previously-started transaction. - # - # Note: The following fields are mutually exclusive: `id`, `single_use`, `begin`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] begin - # @return [::Google::Cloud::Spanner::V1::TransactionOptions] - # Begin a new transaction and execute this read or SQL query in - # it. The transaction ID of the new transaction is returned in - # {::Google::Cloud::Spanner::V1::ResultSetMetadata#transaction ResultSetMetadata.transaction}, - # which is a {::Google::Cloud::Spanner::V1::Transaction Transaction}. - # - # Note: The following fields are mutually exclusive: `begin`, `single_use`, `id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class TransactionSelector - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # When a read-write transaction is executed on a multiplexed session, - # this precommit token is sent back to the client - # as a part of the {::Google::Cloud::Spanner::V1::Transaction Transaction} message in the - # {::Google::Cloud::Spanner::V1::BeginTransactionRequest BeginTransaction} response and - # also as a part of the {::Google::Cloud::Spanner::V1::ResultSet ResultSet} and - # {::Google::Cloud::Spanner::V1::PartialResultSet PartialResultSet} responses. - # @!attribute [rw] precommit_token - # @return [::String] - # Opaque precommit token. - # @!attribute [rw] seq_num - # @return [::Integer] - # An incrementing seq number is generated on every precommit token - # that is returned. Clients should remember the precommit token with the - # highest sequence number from the current transaction attempt. - class MultiplexedSessionPrecommitToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb b/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb deleted file mode 100644 index 693060eddddf..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/proto_docs/google/spanner/v1/type.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Spanner - module V1 - # `Type` indicates the type of a Cloud Spanner value, as might be stored in a - # table cell or returned from an SQL query. - # @!attribute [rw] code - # @return [::Google::Cloud::Spanner::V1::TypeCode] - # Required. The {::Google::Cloud::Spanner::V1::TypeCode TypeCode} for this type. - # @!attribute [rw] array_element_type - # @return [::Google::Cloud::Spanner::V1::Type] - # If {::Google::Cloud::Spanner::V1::Type#code code} == - # {::Google::Cloud::Spanner::V1::TypeCode::ARRAY ARRAY}, then `array_element_type` is the - # type of the array elements. - # @!attribute [rw] struct_type - # @return [::Google::Cloud::Spanner::V1::StructType] - # If {::Google::Cloud::Spanner::V1::Type#code code} == - # {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT}, then `struct_type` provides - # type information for the struct's fields. - # @!attribute [rw] type_annotation - # @return [::Google::Cloud::Spanner::V1::TypeAnnotationCode] - # The {::Google::Cloud::Spanner::V1::TypeAnnotationCode TypeAnnotationCode} that - # disambiguates SQL type that Spanner will use to represent values of this - # type during query processing. This is necessary for some type codes because - # a single {::Google::Cloud::Spanner::V1::TypeCode TypeCode} can be mapped to different - # SQL types depending on the SQL dialect. - # {::Google::Cloud::Spanner::V1::Type#type_annotation type_annotation} typically is not - # needed to process the content of a value (it doesn't affect serialization) - # and clients can ignore it on the read path. - # @!attribute [rw] proto_type_fqn - # @return [::String] - # If {::Google::Cloud::Spanner::V1::Type#code code} == - # {::Google::Cloud::Spanner::V1::TypeCode::PROTO PROTO} or - # {::Google::Cloud::Spanner::V1::Type#code code} == - # {::Google::Cloud::Spanner::V1::TypeCode::ENUM ENUM}, then `proto_type_fqn` is the fully - # qualified name of the proto type representing the proto/enum definition. - class Type - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `StructType` defines the fields of a - # {::Google::Cloud::Spanner::V1::TypeCode::STRUCT STRUCT} type. - # @!attribute [rw] fields - # @return [::Array<::Google::Cloud::Spanner::V1::StructType::Field>] - # The list of fields that make up this struct. Order is - # significant, because values of this struct type are represented as - # lists, where the order of field values matches the order of - # fields in the {::Google::Cloud::Spanner::V1::StructType StructType}. In turn, the - # order of fields matches the order of columns in a read request, or the - # order of fields in the `SELECT` clause of a query. - class StructType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message representing a single field of a struct. - # @!attribute [rw] name - # @return [::String] - # The name of the field. For reads, this is the column name. For - # SQL queries, it is the column alias (e.g., `"Word"` in the - # query `"SELECT 'hello' AS Word"`), or the column name (e.g., - # `"ColName"` in the query `"SELECT ColName FROM Table"`). Some - # columns might have an empty name (e.g., `"SELECT - # UPPER(ColName)"`). Note that a query result can contain - # multiple fields with the same name. - # @!attribute [rw] type - # @return [::Google::Cloud::Spanner::V1::Type] - # The type of the field. - class Field - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `TypeCode` is used as part of {::Google::Cloud::Spanner::V1::Type Type} to - # indicate the type of a Cloud Spanner value. - # - # Each legal value of a type can be encoded to or decoded from a JSON - # value, using the encodings described below. All Cloud Spanner values can - # be `null`, regardless of type; `null`s are always encoded as a JSON - # `null`. - module TypeCode - # Not specified. - TYPE_CODE_UNSPECIFIED = 0 - - # Encoded as JSON `true` or `false`. - BOOL = 1 - - # Encoded as `string`, in decimal format. - INT64 = 2 - - # Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or - # `"-Infinity"`. - FLOAT64 = 3 - - # Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or - # `"-Infinity"`. - FLOAT32 = 15 - - # Encoded as `string` in RFC 3339 timestamp format. The time zone - # must be present, and must be `"Z"`. - # - # If the schema has the column option - # `allow_commit_timestamp=true`, the placeholder string - # `"spanner.commit_timestamp()"` can be used to instruct the system - # to insert the commit timestamp associated with the transaction - # commit. - TIMESTAMP = 4 - - # Encoded as `string` in RFC 3339 date format. - DATE = 5 - - # Encoded as `string`. - STRING = 6 - - # Encoded as a base64-encoded `string`, as described in RFC 4648, - # section 4. - BYTES = 7 - - # Encoded as `list`, where the list elements are represented - # according to - # {::Google::Cloud::Spanner::V1::Type#array_element_type array_element_type}. - ARRAY = 8 - - # Encoded as `list`, where list element `i` is represented according - # to [struct_type.fields[i]][google.spanner.v1.StructType.fields]. - STRUCT = 9 - - # Encoded as `string`, in decimal format or scientific notation format. - # Decimal format: - # `[+-]Digits[.[Digits]]` or - # `[+-][Digits].Digits` - # - # Scientific notation: - # `[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or - # `[+-][Digits].Digits[ExponentIndicator[+-]Digits]` - # (ExponentIndicator is `"e"` or `"E"`) - NUMERIC = 10 - - # Encoded as a JSON-formatted `string` as described in RFC 7159. The - # following rules are applied when parsing JSON input: - # - # - Whitespace characters are not preserved. - # - If a JSON object has duplicate keys, only the first key is preserved. - # - Members of a JSON object are not guaranteed to have their order - # preserved. - # - JSON array elements will have their order preserved. - JSON = 11 - - # Encoded as a base64-encoded `string`, as described in RFC 4648, - # section 4. - PROTO = 13 - - # Encoded as `string`, in decimal format. - ENUM = 14 - - # Encoded as `string`, in `ISO8601` duration format - - # `P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S` - # where `n` is an integer. - # For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 - # months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. - INTERVAL = 16 - - # Encoded as `string`, in lower-case hexa-decimal format, as described - # in RFC 9562, section 4. - UUID = 17 - end - - # `TypeAnnotationCode` is used as a part of {::Google::Cloud::Spanner::V1::Type Type} to - # disambiguate SQL types that should be used for a given Cloud Spanner value. - # Disambiguation is needed because the same Cloud Spanner type can be mapped to - # different SQL types depending on SQL dialect. TypeAnnotationCode doesn't - # affect the way value is serialized. - module TypeAnnotationCode - # Not specified. - TYPE_ANNOTATION_CODE_UNSPECIFIED = 0 - - # PostgreSQL compatible NUMERIC type. This annotation needs to be applied to - # {::Google::Cloud::Spanner::V1::Type Type} instances having - # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} type code to specify that - # values of this type should be treated as PostgreSQL NUMERIC values. - # Currently this annotation is always needed for - # {::Google::Cloud::Spanner::V1::TypeCode::NUMERIC NUMERIC} when a client interacts with - # PostgreSQL-enabled Spanner databases. - PG_NUMERIC = 2 - - # PostgreSQL compatible JSONB type. This annotation needs to be applied to - # {::Google::Cloud::Spanner::V1::Type Type} instances having - # {::Google::Cloud::Spanner::V1::TypeCode::JSON JSON} type code to specify that values of - # this type should be treated as PostgreSQL JSONB values. Currently this - # annotation is always needed for {::Google::Cloud::Spanner::V1::TypeCode::JSON JSON} - # when a client interacts with PostgreSQL-enabled Spanner databases. - PG_JSONB = 3 - - # PostgreSQL compatible OID type. This annotation can be used by a client - # interacting with PostgreSQL-enabled Spanner database to specify that a - # value should be treated using the semantics of the OID type. - PG_OID = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-spanner-v1/snippets/Gemfile deleted file mode 100644 index 77b0e1097706..000000000000 --- a/owl-bot-staging/google-cloud-spanner-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-spanner-v1", path: "../" -else - gem "google-cloud-spanner-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-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json b/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json deleted file mode 100644 index 7aed2197752d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json +++ /dev/null @@ -1,655 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-spanner-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.spanner.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "spanner_v1_generated_Spanner_CreateSession_sync", - "title": "Snippet for the create_session call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#create_session.", - "file": "spanner/create_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_session", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#create_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::CreateSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::Session", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "CreateSession", - "full_name": "google.spanner.v1.Spanner.CreateSession", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_BatchCreateSessions_sync", - "title": "Snippet for the batch_create_sessions call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions.", - "file": "spanner/batch_create_sessions.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_sessions", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "BatchCreateSessions", - "full_name": "google.spanner.v1.Spanner.BatchCreateSessions", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_GetSession_sync", - "title": "Snippet for the get_session call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#get_session.", - "file": "spanner/get_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_session", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#get_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::GetSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::Session", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "GetSession", - "full_name": "google.spanner.v1.Spanner.GetSession", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_ListSessions_sync", - "title": "Snippet for the list_sessions call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#list_sessions.", - "file": "spanner/list_sessions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sessions", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#list_sessions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ListSessionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::ListSessionsResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "ListSessions", - "full_name": "google.spanner.v1.Spanner.ListSessions", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_DeleteSession_sync", - "title": "Snippet for the delete_session call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#delete_session.", - "file": "spanner/delete_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_session", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#delete_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::DeleteSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "DeleteSession", - "full_name": "google.spanner.v1.Spanner.DeleteSession", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_ExecuteSql_sync", - "title": "Snippet for the execute_sql call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_sql.", - "file": "spanner/execute_sql.rb", - "language": "RUBY", - "client_method": { - "short_name": "execute_sql", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_sql", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ExecuteSqlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::ResultSet", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "ExecuteSql", - "full_name": "google.spanner.v1.Spanner.ExecuteSql", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_ExecuteStreamingSql_sync", - "title": "Snippet for the execute_streaming_sql call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql.", - "file": "spanner/execute_streaming_sql.rb", - "language": "RUBY", - "client_method": { - "short_name": "execute_streaming_sql", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ExecuteSqlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::PartialResultSet", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "ExecuteStreamingSql", - "full_name": "google.spanner.v1.Spanner.ExecuteStreamingSql", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_ExecuteBatchDml_sync", - "title": "Snippet for the execute_batch_dml call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml.", - "file": "spanner/execute_batch_dml.rb", - "language": "RUBY", - "client_method": { - "short_name": "execute_batch_dml", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "ExecuteBatchDml", - "full_name": "google.spanner.v1.Spanner.ExecuteBatchDml", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_Read_sync", - "title": "Snippet for the read call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#read.", - "file": "spanner/read.rb", - "language": "RUBY", - "client_method": { - "short_name": "read", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#read", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ReadRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::ResultSet", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "Read", - "full_name": "google.spanner.v1.Spanner.Read", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_StreamingRead_sync", - "title": "Snippet for the streaming_read call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#streaming_read.", - "file": "spanner/streaming_read.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_read", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#streaming_read", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::ReadRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::PartialResultSet", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "StreamingRead", - "full_name": "google.spanner.v1.Spanner.StreamingRead", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_BeginTransaction_sync", - "title": "Snippet for the begin_transaction call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction.", - "file": "spanner/begin_transaction.rb", - "language": "RUBY", - "client_method": { - "short_name": "begin_transaction", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::BeginTransactionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::Transaction", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "BeginTransaction", - "full_name": "google.spanner.v1.Spanner.BeginTransaction", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_Commit_sync", - "title": "Snippet for the commit call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#commit.", - "file": "spanner/commit.rb", - "language": "RUBY", - "client_method": { - "short_name": "commit", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#commit", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::CommitRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::CommitResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "Commit", - "full_name": "google.spanner.v1.Spanner.Commit", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_Rollback_sync", - "title": "Snippet for the rollback call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#rollback.", - "file": "spanner/rollback.rb", - "language": "RUBY", - "client_method": { - "short_name": "rollback", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#rollback", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::RollbackRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "Rollback", - "full_name": "google.spanner.v1.Spanner.Rollback", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_PartitionQuery_sync", - "title": "Snippet for the partition_query call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#partition_query.", - "file": "spanner/partition_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "partition_query", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#partition_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::PartitionQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::PartitionResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "PartitionQuery", - "full_name": "google.spanner.v1.Spanner.PartitionQuery", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_PartitionRead_sync", - "title": "Snippet for the partition_read call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#partition_read.", - "file": "spanner/partition_read.rb", - "language": "RUBY", - "client_method": { - "short_name": "partition_read", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#partition_read", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::PartitionReadRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::PartitionResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "PartitionRead", - "full_name": "google.spanner.v1.Spanner.PartitionRead", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "spanner_v1_generated_Spanner_BatchWrite_sync", - "title": "Snippet for the batch_write call in the Spanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Spanner::V1::Spanner::Client#batch_write.", - "file": "spanner/batch_write.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_write", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client#batch_write", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Spanner::V1::BatchWriteRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Spanner::V1::BatchWriteResponse", - "client": { - "short_name": "Spanner::Client", - "full_name": "::Google::Cloud::Spanner::V1::Spanner::Client" - }, - "method": { - "short_name": "BatchWrite", - "full_name": "google.spanner.v1.Spanner.BatchWrite", - "service": { - "short_name": "Spanner", - "full_name": "google.spanner.v1.Spanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb deleted file mode 100644 index 0586ea617219..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_BatchCreateSessions_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the batch_create_sessions call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions. -# -def batch_create_sessions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new - - # Call the batch_create_sessions method. - result = client.batch_create_sessions request - - # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. - p result -end -# [END spanner_v1_generated_Spanner_BatchCreateSessions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb deleted file mode 100644 index b95914412706..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/batch_write.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_BatchWrite_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the batch_write call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#batch_write. -# -def batch_write - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::BatchWriteRequest.new - - # Call the batch_write method to start streaming. - output = client.batch_write request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Spanner::V1::BatchWriteResponse - output.each do |current_response| - p current_response - end -end -# [END spanner_v1_generated_Spanner_BatchWrite_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb deleted file mode 100644 index 491b1932c86d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_BeginTransaction_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the begin_transaction call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction. -# -def begin_transaction - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new - - # Call the begin_transaction method. - result = client.begin_transaction request - - # The returned object is of type Google::Cloud::Spanner::V1::Transaction. - p result -end -# [END spanner_v1_generated_Spanner_BeginTransaction_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb deleted file mode 100644 index bdef590c536b..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/commit.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_Commit_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the commit call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#commit. -# -def commit - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::CommitRequest.new - - # Call the commit method. - result = client.commit request - - # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. - p result -end -# [END spanner_v1_generated_Spanner_Commit_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb deleted file mode 100644 index 2978e20b708d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/create_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_CreateSession_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the create_session call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#create_session. -# -def create_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::CreateSessionRequest.new - - # Call the create_session method. - result = client.create_session request - - # The returned object is of type Google::Cloud::Spanner::V1::Session. - p result -end -# [END spanner_v1_generated_Spanner_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb deleted file mode 100644 index 0fe6714eefc1..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/delete_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_DeleteSession_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the delete_session call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#delete_session. -# -def delete_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new - - # Call the delete_session method. - result = client.delete_session request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_Spanner_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb deleted file mode 100644 index 0dfff556a81d..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_ExecuteBatchDml_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the execute_batch_dml call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml. -# -def execute_batch_dml - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new - - # Call the execute_batch_dml method. - result = client.execute_batch_dml request - - # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. - p result -end -# [END spanner_v1_generated_Spanner_ExecuteBatchDml_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb deleted file mode 100644 index 25fda1b8ff3f..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_ExecuteSql_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the execute_sql call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#execute_sql. -# -def execute_sql - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new - - # Call the execute_sql method. - result = client.execute_sql request - - # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. - p result -end -# [END spanner_v1_generated_Spanner_ExecuteSql_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb deleted file mode 100644 index e96077064cca..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the execute_streaming_sql call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql. -# -def execute_streaming_sql - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new - - # Call the execute_streaming_sql method to start streaming. - output = client.execute_streaming_sql request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Spanner::V1::PartialResultSet - output.each do |current_response| - p current_response - end -end -# [END spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb deleted file mode 100644 index 57e3f09069af..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/get_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_GetSession_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the get_session call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#get_session. -# -def get_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::GetSessionRequest.new - - # Call the get_session method. - result = client.get_session request - - # The returned object is of type Google::Cloud::Spanner::V1::Session. - p result -end -# [END spanner_v1_generated_Spanner_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb deleted file mode 100644 index ad2e46e5db36..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/list_sessions.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 spanner_v1_generated_Spanner_ListSessions_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the list_sessions call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#list_sessions. -# -def list_sessions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ListSessionsRequest.new - - # Call the list_sessions method. - result = client.list_sessions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Spanner::V1::Session. - p item - end -end -# [END spanner_v1_generated_Spanner_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb deleted file mode 100644 index fe7511916bee..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_query.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_PartitionQuery_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the partition_query call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#partition_query. -# -def partition_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new - - # Call the partition_query method. - result = client.partition_query request - - # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. - p result -end -# [END spanner_v1_generated_Spanner_PartitionQuery_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb deleted file mode 100644 index 548247d9a655..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/partition_read.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_PartitionRead_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the partition_read call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#partition_read. -# -def partition_read - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::PartitionReadRequest.new - - # Call the partition_read method. - result = client.partition_read request - - # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. - p result -end -# [END spanner_v1_generated_Spanner_PartitionRead_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb deleted file mode 100644 index e0ae8f6a89bd..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/read.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_Read_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the read call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#read. -# -def read - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ReadRequest.new - - # Call the read method. - result = client.read request - - # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. - p result -end -# [END spanner_v1_generated_Spanner_Read_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb deleted file mode 100644 index aa46e63322b9..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/rollback.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_Rollback_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the rollback call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#rollback. -# -def rollback - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::RollbackRequest.new - - # Call the rollback method. - result = client.rollback request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END spanner_v1_generated_Spanner_Rollback_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb b/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb deleted file mode 100644 index 858dafcebeb7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START spanner_v1_generated_Spanner_StreamingRead_sync] -require "google/cloud/spanner/v1" - -## -# Snippet for the streaming_read call in the Spanner service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Spanner::V1::Spanner::Client#streaming_read. -# -def streaming_read - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Spanner::V1::Spanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Spanner::V1::ReadRequest.new - - # Call the streaming_read method to start streaming. - output = client.streaming_read request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Spanner::V1::PartialResultSet - output.each do |current_response| - p current_response - end -end -# [END spanner_v1_generated_Spanner_StreamingRead_sync] diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb deleted file mode 100644 index f1898edbaf00..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_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/spanner/v1/spanner" - -class ::Google::Cloud::Spanner::V1::Spanner::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_database_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.database_path project: "value0", instance: "value1", database: "value2" - assert_equal "projects/value0/instances/value1/databases/value2", path - end - end - - def test_session_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", instance: "value1", database: "value2", session: "value3" - assert_equal "projects/value0/instances/value1/databases/value2/sessions/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb b/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb deleted file mode 100644 index 62239e5f3ad2..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb +++ /dev/null @@ -1,1269 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/spanner/v1/spanner_pb" -require "google/cloud/spanner/v1/spanner" - -class ::Google::Cloud::Spanner::V1::Spanner::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_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - session = {} - - create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_session, name - assert_kind_of ::Google::Cloud::Spanner::V1::CreateSessionRequest, request - assert_equal "hello world", request["database"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Session), request["session"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_session_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_session({ database: database, session: session }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_session database: database, session: session do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_session ::Google::Cloud::Spanner::V1::CreateSessionRequest.new(database: database, session: session) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_session({ database: database, session: session }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_session(::Google::Cloud::Spanner::V1::CreateSessionRequest.new(database: database, session: session), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_session_client_stub.call_rpc_count - end - end - - def test_batch_create_sessions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - session_template = {} - session_count = 42 - - batch_create_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_sessions, name - assert_kind_of ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest, request - assert_equal "hello world", request["database"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Session), request["session_template"] - assert_equal 42, request["session_count"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_sessions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_sessions({ database: database, session_template: session_template, session_count: session_count }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_create_sessions database: database, session_template: session_template, session_count: session_count do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_create_sessions ::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new(database: database, session_template: session_template, session_count: session_count) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_create_sessions({ database: database, session_template: session_template, session_count: session_count }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_create_sessions(::Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new(database: database, session_template: session_template, session_count: session_count), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_create_sessions_client_stub.call_rpc_count - end - end - - def test_get_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_session, name - assert_kind_of ::Google::Cloud::Spanner::V1::GetSessionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_session_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_session({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_session name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_session ::Google::Cloud::Spanner::V1::GetSessionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_session({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_session(::Google::Cloud::Spanner::V1::GetSessionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_session_client_stub.call_rpc_count - end - end - - def test_list_sessions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::ListSessionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sessions, name - assert_kind_of ::Google::Cloud::Spanner::V1::ListSessionsRequest, request - assert_equal "hello world", request["database"] - 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_sessions_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_sessions({ database: database, 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_sessions database: database, 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_sessions ::Google::Cloud::Spanner::V1::ListSessionsRequest.new(database: database, 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_sessions({ database: database, 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_sessions(::Google::Cloud::Spanner::V1::ListSessionsRequest.new(database: database, 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_sessions_client_stub.call_rpc_count - end - end - - def test_delete_session - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_session, name - assert_kind_of ::Google::Cloud::Spanner::V1::DeleteSessionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_session_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_session({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_session name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_session ::Google::Cloud::Spanner::V1::DeleteSessionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_session({ 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_session(::Google::Cloud::Spanner::V1::DeleteSessionRequest.new(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_session_client_stub.call_rpc_count - end - end - - def test_execute_sql - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::ResultSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - sql = "hello world" - params = {} - param_types = {} - resume_token = "hello world" - query_mode = :NORMAL - partition_token = "hello world" - seqno = 42 - query_options = {} - request_options = {} - directed_read_options = {} - data_boost_enabled = true - last_statement = true - routing_hint = {} - - execute_sql_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :execute_sql, name - assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteSqlRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["sql"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] - assert_equal({}, request["param_types"].to_h) - assert_equal "hello world", request["resume_token"] - assert_equal :NORMAL, request["query_mode"] - assert_equal "hello world", request["partition_token"] - assert_equal 42, request["seqno"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions), request["query_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] - assert_equal true, request["data_boost_enabled"] - assert_equal true, request["last_statement"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, execute_sql_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.execute_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.execute_sql session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.execute_sql ::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.execute_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.execute_sql(::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, execute_sql_client_stub.call_rpc_count - end - end - - def test_execute_streaming_sql - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::PartialResultSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - session = "hello world" - transaction = {} - sql = "hello world" - params = {} - param_types = {} - resume_token = "hello world" - query_mode = :NORMAL - partition_token = "hello world" - seqno = 42 - query_options = {} - request_options = {} - directed_read_options = {} - data_boost_enabled = true - last_statement = true - routing_hint = {} - - execute_streaming_sql_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :execute_streaming_sql, name - assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteSqlRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["sql"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] - assert_equal({}, request["param_types"].to_h) - assert_equal "hello world", request["resume_token"] - assert_equal :NORMAL, request["query_mode"] - assert_equal "hello world", request["partition_token"] - assert_equal 42, request["seqno"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions), request["query_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] - assert_equal true, request["data_boost_enabled"] - assert_equal true, request["last_statement"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, execute_streaming_sql_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.execute_streaming_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.execute_streaming_sql session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.execute_streaming_sql ::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.execute_streaming_sql({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.execute_streaming_sql(::Google::Cloud::Spanner::V1::ExecuteSqlRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, resume_token: resume_token, query_mode: query_mode, partition_token: partition_token, seqno: seqno, query_options: query_options, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, last_statement: last_statement, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, execute_streaming_sql_client_stub.call_rpc_count - end - end - - def test_execute_batch_dml - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - statements = [{}] - seqno = 42 - request_options = {} - last_statements = true - - execute_batch_dml_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :execute_batch_dml, name - assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_kind_of ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement, request["statements"].first - assert_equal 42, request["seqno"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal true, request["last_statements"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, execute_batch_dml_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.execute_batch_dml({ session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.execute_batch_dml session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.execute_batch_dml ::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new(session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.execute_batch_dml({ session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.execute_batch_dml(::Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new(session: session, transaction: transaction, statements: statements, seqno: seqno, request_options: request_options, last_statements: last_statements), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, execute_batch_dml_client_stub.call_rpc_count - end - end - - def test_read - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::ResultSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - table = "hello world" - index = "hello world" - columns = ["hello world"] - key_set = {} - limit = 42 - resume_token = "hello world" - partition_token = "hello world" - request_options = {} - directed_read_options = {} - data_boost_enabled = true - order_by = :ORDER_BY_UNSPECIFIED - lock_hint = :LOCK_HINT_UNSPECIFIED - routing_hint = {} - - read_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :read, name - assert_kind_of ::Google::Cloud::Spanner::V1::ReadRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["table"] - assert_equal "hello world", request["index"] - assert_equal ["hello world"], request["columns"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] - assert_equal 42, request["limit"] - assert_equal "hello world", request["resume_token"] - assert_equal "hello world", request["partition_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] - assert_equal true, request["data_boost_enabled"] - assert_equal :ORDER_BY_UNSPECIFIED, request["order_by"] - assert_equal :LOCK_HINT_UNSPECIFIED, request["lock_hint"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, read_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.read ::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.read(::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, read_client_stub.call_rpc_count - end - end - - def test_streaming_read - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::PartialResultSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - session = "hello world" - transaction = {} - table = "hello world" - index = "hello world" - columns = ["hello world"] - key_set = {} - limit = 42 - resume_token = "hello world" - partition_token = "hello world" - request_options = {} - directed_read_options = {} - data_boost_enabled = true - order_by = :ORDER_BY_UNSPECIFIED - lock_hint = :LOCK_HINT_UNSPECIFIED - routing_hint = {} - - streaming_read_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_read, name - assert_kind_of ::Google::Cloud::Spanner::V1::ReadRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["table"] - assert_equal "hello world", request["index"] - assert_equal ["hello world"], request["columns"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] - assert_equal 42, request["limit"] - assert_equal "hello world", request["resume_token"] - assert_equal "hello world", request["partition_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::DirectedReadOptions), request["directed_read_options"] - assert_equal true, request["data_boost_enabled"] - assert_equal :ORDER_BY_UNSPECIFIED, request["order_by"] - assert_equal :LOCK_HINT_UNSPECIFIED, request["lock_hint"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, streaming_read_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.streaming_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.streaming_read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.streaming_read ::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.streaming_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.streaming_read(::Google::Cloud::Spanner::V1::ReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, limit: limit, resume_token: resume_token, partition_token: partition_token, request_options: request_options, directed_read_options: directed_read_options, data_boost_enabled: data_boost_enabled, order_by: order_by, lock_hint: lock_hint, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::PartialResultSet, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, streaming_read_client_stub.call_rpc_count - end - end - - def test_begin_transaction - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::Transaction.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - options = {} - request_options = {} - mutation_key = {} - routing_hint = {} - - begin_transaction_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :begin_transaction, name - assert_kind_of ::Google::Cloud::Spanner::V1::BeginTransactionRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionOptions), request["options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::Mutation), request["mutation_key"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, begin_transaction_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.begin_transaction({ session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.begin_transaction session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.begin_transaction ::Google::Cloud::Spanner::V1::BeginTransactionRequest.new(session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.begin_transaction({ session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.begin_transaction(::Google::Cloud::Spanner::V1::BeginTransactionRequest.new(session: session, options: options, request_options: request_options, mutation_key: mutation_key, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, begin_transaction_client_stub.call_rpc_count - end - end - - def test_commit - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::CommitResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction_id = "hello world" - mutations = [{}] - return_commit_stats = true - max_commit_delay = {} - request_options = {} - precommit_token = {} - routing_hint = {} - - commit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :commit, name - assert_kind_of ::Google::Cloud::Spanner::V1::CommitRequest, request - assert_equal "hello world", request["session"] - assert_equal "hello world", request["transaction_id"] - assert_equal :transaction_id, request.transaction - assert_kind_of ::Google::Cloud::Spanner::V1::Mutation, request["mutations"].first - assert_equal true, request["return_commit_stats"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["max_commit_delay"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::MultiplexedSessionPrecommitToken), request["precommit_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RoutingHint), request["routing_hint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, commit_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.commit({ session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.commit session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.commit ::Google::Cloud::Spanner::V1::CommitRequest.new(session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.commit({ session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.commit(::Google::Cloud::Spanner::V1::CommitRequest.new(session: session, transaction_id: transaction_id, mutations: mutations, return_commit_stats: return_commit_stats, max_commit_delay: max_commit_delay, request_options: request_options, precommit_token: precommit_token, routing_hint: routing_hint), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, commit_client_stub.call_rpc_count - end - end - - def test_rollback - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction_id = "hello world" - - rollback_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rollback, name - assert_kind_of ::Google::Cloud::Spanner::V1::RollbackRequest, request - assert_equal "hello world", request["session"] - assert_equal "hello world", request["transaction_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rollback_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rollback({ session: session, transaction_id: transaction_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.rollback session: session, transaction_id: transaction_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.rollback ::Google::Cloud::Spanner::V1::RollbackRequest.new(session: session, transaction_id: transaction_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.rollback({ session: session, transaction_id: transaction_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.rollback(::Google::Cloud::Spanner::V1::RollbackRequest.new(session: session, transaction_id: transaction_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, rollback_client_stub.call_rpc_count - end - end - - def test_partition_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::PartitionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - sql = "hello world" - params = {} - param_types = {} - partition_options = {} - - partition_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :partition_query, name - assert_kind_of ::Google::Cloud::Spanner::V1::PartitionQueryRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["sql"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["params"] - assert_equal({}, request["param_types"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::PartitionOptions), request["partition_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, partition_query_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.partition_query({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.partition_query session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.partition_query ::Google::Cloud::Spanner::V1::PartitionQueryRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.partition_query({ session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.partition_query(::Google::Cloud::Spanner::V1::PartitionQueryRequest.new(session: session, transaction: transaction, sql: sql, params: params, param_types: param_types, partition_options: partition_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, partition_query_client_stub.call_rpc_count - end - end - - def test_partition_read - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::PartitionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = "hello world" - transaction = {} - table = "hello world" - index = "hello world" - columns = ["hello world"] - key_set = {} - partition_options = {} - - partition_read_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :partition_read, name - assert_kind_of ::Google::Cloud::Spanner::V1::PartitionReadRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::TransactionSelector), request["transaction"] - assert_equal "hello world", request["table"] - assert_equal "hello world", request["index"] - assert_equal ["hello world"], request["columns"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::KeySet), request["key_set"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::PartitionOptions), request["partition_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, partition_read_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.partition_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.partition_read session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.partition_read ::Google::Cloud::Spanner::V1::PartitionReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.partition_read({ session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.partition_read(::Google::Cloud::Spanner::V1::PartitionReadRequest.new(session: session, transaction: transaction, table: table, index: index, columns: columns, key_set: key_set, partition_options: partition_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, partition_read_client_stub.call_rpc_count - end - end - - def test_batch_write - # Create GRPC objects. - grpc_response = ::Google::Cloud::Spanner::V1::BatchWriteResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - session = "hello world" - request_options = {} - mutation_groups = [{}] - exclude_txn_from_change_streams = true - - batch_write_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :batch_write, name - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Spanner::V1::RequestOptions), request["request_options"] - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteRequest::MutationGroup, request["mutation_groups"].first - assert_equal true, request["exclude_txn_from_change_streams"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_write_client_stub do - # Create client - client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_write({ session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_write session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_write ::Google::Cloud::Spanner::V1::BatchWriteRequest.new(session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_write({ session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_write(::Google::Cloud::Spanner::V1::BatchWriteRequest.new(session: session, request_options: request_options, mutation_groups: mutation_groups, exclude_txn_from_change_streams: exclude_txn_from_change_streams), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Spanner::V1::BatchWriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_write_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Spanner::V1::Spanner::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::Spanner::V1::Spanner::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::Spanner::V1::Spanner::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Spanner::V1::Spanner::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb b/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-spanner-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-speech-v1/.gitignore b/owl-bot-staging/google-cloud-speech-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-speech-v1/.repo-metadata.json deleted file mode 100644 index 2c94c817be63..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "speech.googleapis.com", - "api_shortname": "speech", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1/latest", - "distribution_name": "google-cloud-speech-v1", - "is_cloud": true, - "language": "ruby", - "name": "speech", - "name_pretty": "Cloud Speech-to-Text V1 API", - "product_documentation": "https://cloud.google.com/speech-to-text", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SPEECH", - "ruby-cloud-product-url": "https://cloud.google.com/speech-to-text", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-speech-v1/.rubocop.yml b/owl-bot-staging/google-cloud-speech-v1/.rubocop.yml deleted file mode 100644 index 3c22305c5efd..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-speech-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-speech-v1.rb" diff --git a/owl-bot-staging/google-cloud-speech-v1/.toys.rb b/owl-bot-staging/google-cloud-speech-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/.yardopts b/owl-bot-staging/google-cloud-speech-v1/.yardopts deleted file mode 100644 index a7bd0f2eaed7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Speech-to-Text 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-speech-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-speech-v1/AUTHENTICATION.md deleted file mode 100644 index 3c4dc7e2d2ce..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-speech-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-speech-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/speech/v1" - -client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/speech/v1" - -::Google::Cloud::Speech::V1::Speech::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Speech::V1::Speech::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-speech-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/speech/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Speech::V1::Speech::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-speech-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-speech-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-speech-v1/Gemfile b/owl-bot-staging/google-cloud-speech-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-speech-v1/LICENSE.md b/owl-bot-staging/google-cloud-speech-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/README.md b/owl-bot-staging/google-cloud-speech-v1/README.md deleted file mode 100644 index a7fe405d0c89..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Speech-to-Text V1 API - -Converts audio to text by applying powerful neural network models. - -Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. - -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 Speech-to-Text V1 API. Most users should consider using -the main client gem, -[google-cloud-speech](https://rubygems.org/gems/google-cloud-speech). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-speech-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/speech.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/speech/v1" - -client = ::Google::Cloud::Speech::V1::Speech::Client.new -request = ::Google::Cloud::Speech::V1::RecognizeRequest.new # (request fields as keyword arguments...) -response = client.recognize request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/speech-to-text) -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/speech/v1" -require "logger" - -client = ::Google::Cloud::Speech::V1::Speech::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-speech`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-speech-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-speech`. -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-speech-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-speech-v1/Rakefile b/owl-bot-staging/google-cloud-speech-v1/Rakefile deleted file mode 100644 index 4e0a18b9fab2..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SPEECH_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SPEECH_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SPEECH_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 SPEECH_TEST_PROJECT=test123 SPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/speech/v1/speech/credentials" - ::Google::Cloud::Speech::V1::Speech::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SPEECH_PROJECT"] = project - ENV["SPEECH_TEST_PROJECT"] = project - ENV["SPEECH_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-speech-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-speech-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-speech-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-speech-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-speech-v1" - header "google-cloud-speech-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-speech-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-speech-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-speech-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-speech-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-speech-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-speech-v1/gapic_metadata.json deleted file mode 100644 index b8215cef6ab6..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/gapic_metadata.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.speech.v1", - "libraryPackage": "::Google::Cloud::Speech::V1", - "services": { - "Speech": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Speech::V1::Speech::Client", - "rpcs": { - "Recognize": { - "methods": [ - "recognize" - ] - }, - "LongRunningRecognize": { - "methods": [ - "long_running_recognize" - ] - }, - "StreamingRecognize": { - "methods": [ - "streaming_recognize" - ] - } - } - } - } - }, - "Adaptation": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Speech::V1::Adaptation::Client", - "rpcs": { - "CreatePhraseSet": { - "methods": [ - "create_phrase_set" - ] - }, - "GetPhraseSet": { - "methods": [ - "get_phrase_set" - ] - }, - "ListPhraseSet": { - "methods": [ - "list_phrase_set" - ] - }, - "UpdatePhraseSet": { - "methods": [ - "update_phrase_set" - ] - }, - "DeletePhraseSet": { - "methods": [ - "delete_phrase_set" - ] - }, - "CreateCustomClass": { - "methods": [ - "create_custom_class" - ] - }, - "GetCustomClass": { - "methods": [ - "get_custom_class" - ] - }, - "ListCustomClasses": { - "methods": [ - "list_custom_classes" - ] - }, - "UpdateCustomClass": { - "methods": [ - "update_custom_class" - ] - }, - "DeleteCustomClass": { - "methods": [ - "delete_custom_class" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-speech-v1/google-cloud-speech-v1.gemspec b/owl-bot-staging/google-cloud-speech-v1/google-cloud-speech-v1.gemspec deleted file mode 100644 index 992ca305023c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/google-cloud-speech-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/speech/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-speech-v1" - gem.version = Google::Cloud::Speech::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details." - gem.summary = "Converts audio to text by applying powerful neural network models." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google-cloud-speech-v1.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google-cloud-speech-v1.rb deleted file mode 100644 index 203644080a2e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google-cloud-speech-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/speech/v1" diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1.rb deleted file mode 100644 index 3a78a0bfcd8b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1.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/speech/v1/speech" -require "google/cloud/speech/v1/adaptation" -require "google/cloud/speech/v1/version" - -module Google - module Cloud - module Speech - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/speech/v1" - # client = ::Google::Cloud::Speech::V1::Speech::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/speech/v1" - # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/speech/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation.rb deleted file mode 100644 index 13699cd76973..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation.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/speech/v1/version" - -require "google/cloud/speech/v1/adaptation/credentials" -require "google/cloud/speech/v1/adaptation/paths" -require "google/cloud/speech/v1/adaptation/client" -require "google/cloud/speech/v1/adaptation/rest" - -module Google - module Cloud - module Speech - module V1 - ## - # Service that implements Google Cloud Speech Adaptation API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/speech/v1/adaptation" - # client = ::Google::Cloud::Speech::V1::Adaptation::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/speech/v1/adaptation/rest" - # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - module Adaptation - end - end - end - end -end - -helper_path = ::File.join __dir__, "adaptation", "helpers.rb" -require "google/cloud/speech/v1/adaptation/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/client.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/client.rb deleted file mode 100644 index a04df217bffc..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/client.rb +++ /dev/null @@ -1,1434 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v1/cloud_speech_adaptation_pb" - -module Google - module Cloud - module Speech - module V1 - module Adaptation - ## - # Client for the Adaptation service. - # - # Service that implements Google Cloud Speech Adaptation API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :adaptation_stub - - ## - # Configure the Adaptation Client class. - # - # See {::Google::Cloud::Speech::V1::Adaptation::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Adaptation clients - # ::Google::Cloud::Speech::V1::Adaptation::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Speech", "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 Adaptation Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V1::Adaptation::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @adaptation_stub.universe_domain - end - - ## - # Create a new Adaptation client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Adaptation 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/speech/v1/cloud_speech_adaptation_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 - - @adaptation_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Speech::V1::Adaptation::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 - ) - - @adaptation_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 - @adaptation_stub.logger - end - - # Service calls - - ## - # Create a set of phrase hints. Each item in the set can be a single word or - # a multi-word phrase. The items in the PhraseSet are favored by the - # recognition model when you send a call that includes the PhraseSet. - # - # @overload create_phrase_set(request, options = nil) - # Pass arguments to `create_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::CreatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::CreatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) - # Pass arguments to `create_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this phrase set will be created. - # Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param phrase_set_id [::String] - # Required. The ID to use for the phrase set, which will become the final - # component of the phrase set's resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @param phrase_set [::Google::Cloud::Speech::V1::PhraseSet, ::Hash] - # Required. The phrase set to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1::PhraseSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::CreatePhraseSetRequest.new - # - # # Call the create_phrase_set method. - # result = client.create_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. - # p result - # - def create_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::CreatePhraseSetRequest - - # Converts hash and nil to 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :create_phrase_set, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a phrase set. - # - # @overload get_phrase_set(request, options = nil) - # Pass arguments to `get_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::GetPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::GetPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_phrase_set(name: nil) - # Pass arguments to `get_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 phrase set to retrieve. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1::PhraseSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::GetPhraseSetRequest.new - # - # # Call the get_phrase_set method. - # result = client.get_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. - # p result - # - def get_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::GetPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :get_phrase_set, request, 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 phrase sets. - # - # @overload list_phrase_set(request, options = nil) - # Pass arguments to `list_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::ListPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::ListPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_phrase_set(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, 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 phrase set. Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param page_size [::Integer] - # The maximum number of phrase sets to return. The service may return - # fewer than this value. If unspecified, at most 50 phrase sets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # A page token, received from a previous `ListPhraseSet` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPhraseSet` 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::Speech::V1::PhraseSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::ListPhraseSetRequest.new - # - # # Call the list_phrase_set method. - # result = client.list_phrase_set request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V1::PhraseSet. - # p item - # end - # - def list_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::ListPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :list_phrase_set, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_phrase_set, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a phrase set. - # - # @overload update_phrase_set(request, options = nil) - # Pass arguments to `update_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::UpdatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::UpdatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_phrase_set(phrase_set: nil, update_mask: nil) - # Pass arguments to `update_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V1::PhraseSet, ::Hash] - # Required. The phrase set to update. - # - # The phrase set's `name` field is used to identify the set to be - # updated. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1::PhraseSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new - # - # # Call the update_phrase_set method. - # result = client.update_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. - # p result - # - def update_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest - - # Converts hash and nil to 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.phrase_set&.name - header_params["phrase_set.name"] = request.phrase_set.name - end - - request_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_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :update_phrase_set, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a phrase set. - # - # @overload delete_phrase_set(request, options = nil) - # Pass arguments to `delete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::DeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::DeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_phrase_set(name: nil) - # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 phrase set to delete. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::DeletePhraseSetRequest.new - # - # # Call the delete_phrase_set method. - # result = client.delete_phrase_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::DeletePhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :delete_phrase_set, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a custom class. - # - # @overload create_custom_class(request, options = nil) - # Pass arguments to `create_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1::CreateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::CreateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) - # Pass arguments to `create_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this custom class will be created. - # Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param custom_class_id [::String] - # Required. The ID to use for the custom class, which will become the final - # component of the custom class' resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @param custom_class [::Google::Cloud::Speech::V1::CustomClass, ::Hash] - # Required. The custom class to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1::CustomClass] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::CreateCustomClassRequest.new - # - # # Call the create_custom_class method. - # result = client.create_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. - # p result - # - def create_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::CreateCustomClassRequest - - # Converts hash and nil to 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :create_custom_class, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a custom class. - # - # @overload get_custom_class(request, options = nil) - # Pass arguments to `get_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1::GetCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::GetCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_custom_class(name: nil) - # Pass arguments to `get_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 custom class to retrieve. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1::CustomClass] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::GetCustomClassRequest.new - # - # # Call the get_custom_class method. - # result = client.get_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. - # p result - # - def get_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::GetCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :get_custom_class, request, 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 custom classes. - # - # @overload list_custom_classes(request, options = nil) - # Pass arguments to `list_custom_classes` via a request object, either of type - # {::Google::Cloud::Speech::V1::ListCustomClassesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::ListCustomClassesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_custom_classes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, 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 custom classes. Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param page_size [::Integer] - # The maximum number of custom classes to return. The service may return - # fewer than this value. If unspecified, at most 50 custom classes will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # A page token, received from a previous `ListCustomClass` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCustomClass` 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::Speech::V1::CustomClass>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::CustomClass>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::ListCustomClassesRequest.new - # - # # Call the list_custom_classes method. - # result = client.list_custom_classes request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V1::CustomClass. - # p item - # end - # - def list_custom_classes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::ListCustomClassesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_custom_classes.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_custom_classes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :list_custom_classes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_custom_classes, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a custom class. - # - # @overload update_custom_class(request, options = nil) - # Pass arguments to `update_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1::UpdateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::UpdateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_custom_class(custom_class: nil, update_mask: nil) - # Pass arguments to `update_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V1::CustomClass, ::Hash] - # Required. The custom class to update. - # - # The custom class's `name` field is used to identify the custom class to be - # updated. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1::CustomClass] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::UpdateCustomClassRequest.new - # - # # Call the update_custom_class method. - # result = client.update_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. - # p result - # - def update_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::UpdateCustomClassRequest - - # Converts hash and nil to 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.custom_class&.name - header_params["custom_class.name"] = request.custom_class.name - end - - request_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_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :update_custom_class, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a custom class. - # - # @overload delete_custom_class(request, options = nil) - # Pass arguments to `delete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1::DeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::DeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_custom_class(name: nil) - # Pass arguments to `delete_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 custom class to delete. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::DeleteCustomClassRequest.new - # - # # Call the delete_custom_class method. - # result = client.delete_custom_class request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::DeleteCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :delete_custom_class, request, 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 Adaptation API. - # - # This class represents the configuration for Adaptation, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V1::Adaptation::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_phrase_set to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V1::Adaptation::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_phrase_set.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_phrase_set.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Speech::V1::Adaptation::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Adaptation API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_phrase_set - ## - # RPC-specific configuration for `get_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_phrase_set - ## - # RPC-specific configuration for `list_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :list_phrase_set - ## - # RPC-specific configuration for `update_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_phrase_set - ## - # RPC-specific configuration for `delete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_phrase_set - ## - # RPC-specific configuration for `create_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_class - ## - # RPC-specific configuration for `get_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_class - ## - # RPC-specific configuration for `list_custom_classes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_classes - ## - # RPC-specific configuration for `update_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :update_custom_class - ## - # RPC-specific configuration for `delete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_class - - # @private - def initialize parent_rpcs = nil - create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set - @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config - get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set - @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config - list_phrase_set_config = parent_rpcs.list_phrase_set if parent_rpcs.respond_to? :list_phrase_set - @list_phrase_set = ::Gapic::Config::Method.new list_phrase_set_config - update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set - @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config - delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set - @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config - create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class - @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config - get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class - @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config - list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes - @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config - update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class - @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config - delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class - @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/credentials.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/credentials.rb deleted file mode 100644 index 3d08fc44b076..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/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 Speech - module V1 - module Adaptation - # Credentials for the Adaptation API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SPEECH_CREDENTIALS", - "SPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPEECH_CREDENTIALS_JSON", - "SPEECH_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-speech-v1/lib/google/cloud/speech/v1/adaptation/paths.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/paths.rb deleted file mode 100644 index 57c97718dd9d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/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 Speech - module V1 - module Adaptation - # Path helper methods for the Adaptation API. - module Paths - ## - # Create a fully-qualified CustomClass resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # @param project [String] - # @param location [String] - # @param custom_class [String] - # - # @return [::String] - def custom_class_path project:, location:, custom_class: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" - 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 PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest.rb deleted file mode 100644 index 3b9be5472f5a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/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/speech/v1/version" - -require "google/cloud/speech/v1/adaptation/credentials" -require "google/cloud/speech/v1/adaptation/paths" -require "google/cloud/speech/v1/adaptation/rest/client" - -module Google - module Cloud - module Speech - module V1 - ## - # Service that implements Google Cloud Speech Adaptation API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/speech/v1/adaptation/rest" - # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - module Adaptation - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/speech/v1/adaptation/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/client.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/client.rb deleted file mode 100644 index 4f61cb6d2536..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/client.rb +++ /dev/null @@ -1,1321 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v1/cloud_speech_adaptation_pb" -require "google/cloud/speech/v1/adaptation/rest/service_stub" - -module Google - module Cloud - module Speech - module V1 - module Adaptation - module Rest - ## - # REST client for the Adaptation service. - # - # Service that implements Google Cloud Speech Adaptation API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :adaptation_stub - - ## - # Configure the Adaptation Client class. - # - # See {::Google::Cloud::Speech::V1::Adaptation::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Adaptation clients - # ::Google::Cloud::Speech::V1::Adaptation::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", "Speech", "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 Adaptation Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V1::Adaptation::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 - @adaptation_stub.universe_domain - end - - ## - # Create a new Adaptation REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Adaptation 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 - - @adaptation_stub = ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @adaptation_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 - @adaptation_stub.logger - end - - # Service calls - - ## - # Create a set of phrase hints. Each item in the set can be a single word or - # a multi-word phrase. The items in the PhraseSet are favored by the - # recognition model when you send a call that includes the PhraseSet. - # - # @overload create_phrase_set(request, options = nil) - # Pass arguments to `create_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::CreatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::CreatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) - # Pass arguments to `create_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this phrase set will be created. - # Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param phrase_set_id [::String] - # Required. The ID to use for the phrase set, which will become the final - # component of the phrase set's resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @param phrase_set [::Google::Cloud::Speech::V1::PhraseSet, ::Hash] - # Required. The phrase set to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::CreatePhraseSetRequest.new - # - # # Call the create_phrase_set method. - # result = client.create_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. - # p result - # - def create_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::CreatePhraseSetRequest - - # Converts hash and nil to an 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.create_phrase_set request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a phrase set. - # - # @overload get_phrase_set(request, options = nil) - # Pass arguments to `get_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::GetPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::GetPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_phrase_set(name: nil) - # Pass arguments to `get_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 phrase set to retrieve. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::GetPhraseSetRequest.new - # - # # Call the get_phrase_set method. - # result = client.get_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. - # p result - # - def get_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::GetPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.get_phrase_set request, 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 phrase sets. - # - # @overload list_phrase_set(request, options = nil) - # Pass arguments to `list_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::ListPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::ListPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_phrase_set(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, 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 phrase set. Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param page_size [::Integer] - # The maximum number of phrase sets to return. The service may return - # fewer than this value. If unspecified, at most 50 phrase sets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # A page token, received from a previous `ListPhraseSet` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPhraseSet` 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::Speech::V1::PhraseSet>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::ListPhraseSetRequest.new - # - # # Call the list_phrase_set method. - # result = client.list_phrase_set request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V1::PhraseSet. - # p item - # end - # - def list_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::ListPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.list_phrase_set request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_phrase_set, "phrase_sets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a phrase set. - # - # @overload update_phrase_set(request, options = nil) - # Pass arguments to `update_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::UpdatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::UpdatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_phrase_set(phrase_set: nil, update_mask: nil) - # Pass arguments to `update_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V1::PhraseSet, ::Hash] - # Required. The phrase set to update. - # - # The phrase set's `name` field is used to identify the set to be - # updated. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new - # - # # Call the update_phrase_set method. - # result = client.update_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. - # p result - # - def update_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest - - # Converts hash and nil to an 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.update_phrase_set request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a phrase set. - # - # @overload delete_phrase_set(request, options = nil) - # Pass arguments to `delete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1::DeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::DeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_phrase_set(name: nil) - # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 phrase set to delete. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::DeletePhraseSetRequest.new - # - # # Call the delete_phrase_set method. - # result = client.delete_phrase_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::DeletePhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.delete_phrase_set request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a custom class. - # - # @overload create_custom_class(request, options = nil) - # Pass arguments to `create_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1::CreateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::CreateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) - # Pass arguments to `create_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this custom class will be created. - # Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param custom_class_id [::String] - # Required. The ID to use for the custom class, which will become the final - # component of the custom class' resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @param custom_class [::Google::Cloud::Speech::V1::CustomClass, ::Hash] - # Required. The custom class to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::CreateCustomClassRequest.new - # - # # Call the create_custom_class method. - # result = client.create_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. - # p result - # - def create_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::CreateCustomClassRequest - - # Converts hash and nil to an 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.create_custom_class request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a custom class. - # - # @overload get_custom_class(request, options = nil) - # Pass arguments to `get_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1::GetCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::GetCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_custom_class(name: nil) - # Pass arguments to `get_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 custom class to retrieve. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::GetCustomClassRequest.new - # - # # Call the get_custom_class method. - # result = client.get_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. - # p result - # - def get_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::GetCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.get_custom_class request, 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 custom classes. - # - # @overload list_custom_classes(request, options = nil) - # Pass arguments to `list_custom_classes` via a request object, either of type - # {::Google::Cloud::Speech::V1::ListCustomClassesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::ListCustomClassesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_custom_classes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, 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 custom classes. Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param page_size [::Integer] - # The maximum number of custom classes to return. The service may return - # fewer than this value. If unspecified, at most 50 custom classes will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # A page token, received from a previous `ListCustomClass` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCustomClass` 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::Speech::V1::CustomClass>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1::CustomClass>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::ListCustomClassesRequest.new - # - # # Call the list_custom_classes method. - # result = client.list_custom_classes request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V1::CustomClass. - # p item - # end - # - def list_custom_classes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::ListCustomClassesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_custom_classes.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_custom_classes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.list_custom_classes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_custom_classes, "custom_classes", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a custom class. - # - # @overload update_custom_class(request, options = nil) - # Pass arguments to `update_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1::UpdateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::UpdateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_custom_class(custom_class: nil, update_mask: nil) - # Pass arguments to `update_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V1::CustomClass, ::Hash] - # Required. The custom class to update. - # - # The custom class's `name` field is used to identify the custom class to be - # updated. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::UpdateCustomClassRequest.new - # - # # Call the update_custom_class method. - # result = client.update_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1::CustomClass. - # p result - # - def update_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::UpdateCustomClassRequest - - # Converts hash and nil to an 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.update_custom_class request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a custom class. - # - # @overload delete_custom_class(request, options = nil) - # Pass arguments to `delete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1::DeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::DeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_custom_class(name: nil) - # Pass arguments to `delete_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 custom class to delete. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::DeleteCustomClassRequest.new - # - # # Call the delete_custom_class method. - # result = client.delete_custom_class request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::DeleteCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.delete_custom_class request, 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 Adaptation REST API. - # - # This class represents the configuration for Adaptation REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V1::Adaptation::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_phrase_set to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_phrase_set.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_phrase_set.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Adaptation API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_phrase_set - ## - # RPC-specific configuration for `get_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_phrase_set - ## - # RPC-specific configuration for `list_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :list_phrase_set - ## - # RPC-specific configuration for `update_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_phrase_set - ## - # RPC-specific configuration for `delete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_phrase_set - ## - # RPC-specific configuration for `create_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_class - ## - # RPC-specific configuration for `get_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_class - ## - # RPC-specific configuration for `list_custom_classes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_classes - ## - # RPC-specific configuration for `update_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :update_custom_class - ## - # RPC-specific configuration for `delete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_class - - # @private - def initialize parent_rpcs = nil - create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set - @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config - get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set - @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config - list_phrase_set_config = parent_rpcs.list_phrase_set if parent_rpcs.respond_to? :list_phrase_set - @list_phrase_set = ::Gapic::Config::Method.new list_phrase_set_config - update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set - @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config - delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set - @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config - create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class - @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config - get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class - @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config - list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes - @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config - update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class - @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config - delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class - @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb deleted file mode 100644 index 3eb09c2b9827..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb +++ /dev/null @@ -1,695 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/speech/v1/cloud_speech_adaptation_pb" - -module Google - module Cloud - module Speech - module V1 - module Adaptation - module Rest - ## - # REST service stub for the Adaptation 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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::CreatePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # A result object deserialized from the server's reply - def create_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1::PhraseSet.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::GetPhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # A result object deserialized from the server's reply - def get_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1::PhraseSet.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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::ListPhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::ListPhraseSetResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::ListPhraseSetResponse] - # A result object deserialized from the server's reply - def list_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1::ListPhraseSetResponse.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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::UpdatePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # A result object deserialized from the server's reply - def update_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1::PhraseSet.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::DeletePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 create_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::CreateCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::CustomClass] - # A result object deserialized from the server's reply - def create_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1::CustomClass.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::GetCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::CustomClass] - # A result object deserialized from the server's reply - def get_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1::CustomClass.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_custom_classes REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::ListCustomClassesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::ListCustomClassesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::ListCustomClassesResponse] - # A result object deserialized from the server's reply - def list_custom_classes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_classes_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_custom_classes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1::ListCustomClassesResponse.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_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::UpdateCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::CustomClass] - # A result object deserialized from the server's reply - def update_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1::CustomClass.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::DeleteCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::CreatePhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/phraseSets", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::GetPhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::ListPhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/phraseSets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::UpdatePhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{phrase_set.name}", - body: "phrase_set", - matches: [ - ["phrase_set.name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::DeletePhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::CreateCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/customClasses", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::GetCustomClassRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_custom_classes REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::ListCustomClassesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_custom_classes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/customClasses", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::UpdateCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{custom_class.name}", - body: "custom_class", - matches: [ - ["custom_class.name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::DeleteCustomClassRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_pb.rb deleted file mode 100644 index 602e53dc90e7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_pb.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v1/cloud_speech_adaptation.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/speech/v1/resource_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n4google/cloud/speech/v1/cloud_speech_adaptation.proto\x12\x16google.cloud.speech.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/speech/v1/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa9\x01\n\x16\x43reatePhraseSetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\x12\x1a\n\rphrase_set_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\nphrase_set\x18\x03 \x01(\x0b\x32!.google.cloud.speech.v1.PhraseSetB\x03\xe0\x41\x02\"\x85\x01\n\x16UpdatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v1.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"v\n\x14ListPhraseSetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"h\n\x15ListPhraseSetResponse\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v1.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\xb3\x01\n\x18\x43reateCustomClassRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\x12\x1c\n\x0f\x63ustom_class_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12>\n\x0c\x63ustom_class\x18\x03 \x01(\x0b\x32#.google.cloud.speech.v1.CustomClassB\x03\xe0\x41\x02\"\x8b\x01\n\x18UpdateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v1.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"|\n\x18ListCustomClassesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"q\n\x19ListCustomClassesResponse\x12;\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32#.google.cloud.speech.v1.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass2\x8e\x0f\n\nAdaptation\x12\xc1\x01\n\x0f\x43reatePhraseSet\x12..google.cloud.speech.v1.CreatePhraseSetRequest\x1a!.google.cloud.speech.v1.PhraseSet\"[\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02\x33\"./v1/{parent=projects/*/locations/*}/phraseSets:\x01*\x12\x9d\x01\n\x0cGetPhraseSet\x12+.google.cloud.speech.v1.GetPhraseSetRequest\x1a!.google.cloud.speech.v1.PhraseSet\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/phraseSets/*}\x12\xad\x01\n\rListPhraseSet\x12,.google.cloud.speech.v1.ListPhraseSetRequest\x1a-.google.cloud.speech.v1.ListPhraseSetResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/phraseSets\x12\xcc\x01\n\x0fUpdatePhraseSet\x12..google.cloud.speech.v1.UpdatePhraseSetRequest\x1a!.google.cloud.speech.v1.PhraseSet\"f\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02G29/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\x98\x01\n\x0f\x44\x65letePhraseSet\x12..google.cloud.speech.v1.DeletePhraseSetRequest\x1a\x16.google.protobuf.Empty\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/phraseSets/*}\x12\xce\x01\n\x11\x43reateCustomClass\x12\x30.google.cloud.speech.v1.CreateCustomClassRequest\x1a#.google.cloud.speech.v1.CustomClass\"b\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02\x36\"1/v1/{parent=projects/*/locations/*}/customClasses:\x01*\x12\xa6\x01\n\x0eGetCustomClass\x12-.google.cloud.speech.v1.GetCustomClassRequest\x1a#.google.cloud.speech.v1.CustomClass\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=projects/*/locations/*/customClasses/*}\x12\xbc\x01\n\x11ListCustomClasses\x12\x30.google.cloud.speech.v1.ListCustomClassesRequest\x1a\x31.google.cloud.speech.v1.ListCustomClassesResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=projects/*/locations/*}/customClasses\x12\xdb\x01\n\x11UpdateCustomClass\x12\x30.google.cloud.speech.v1.UpdateCustomClassRequest\x1a#.google.cloud.speech.v1.CustomClass\"o\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02N2>/v1/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\x9f\x01\n\x11\x44\x65leteCustomClass\x12\x30.google.cloud.speech.v1.DeleteCustomClassRequest\x1a\x16.google.protobuf.Empty\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1/{name=projects/*/locations/*/customClasses/*}\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBr\n\x1a\x63om.google.cloud.speech.v1B\x15SpeechAdaptationProtoP\x01Z2cloud.google.com/go/speech/apiv1/speechpb;speechpb\xf8\x01\x01\xa2\x02\x03GCSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Speech - module V1 - CreatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CreatePhraseSetRequest").msgclass - UpdatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.UpdatePhraseSetRequest").msgclass - GetPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.GetPhraseSetRequest").msgclass - ListPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.ListPhraseSetRequest").msgclass - ListPhraseSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.ListPhraseSetResponse").msgclass - DeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.DeletePhraseSetRequest").msgclass - CreateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CreateCustomClassRequest").msgclass - UpdateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.UpdateCustomClassRequest").msgclass - GetCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.GetCustomClassRequest").msgclass - ListCustomClassesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.ListCustomClassesRequest").msgclass - ListCustomClassesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.ListCustomClassesResponse").msgclass - DeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.DeleteCustomClassRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_services_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_services_pb.rb deleted file mode 100644 index 9cc7add34e77..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_adaptation_services_pb.rb +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/speech/v1/cloud_speech_adaptation.proto for package 'google.cloud.speech.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/speech/v1/cloud_speech_adaptation_pb' - -module Google - module Cloud - module Speech - module V1 - module Adaptation - # Service that implements Google Cloud Speech Adaptation API. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.speech.v1.Adaptation' - - # Create a set of phrase hints. Each item in the set can be a single word or - # a multi-word phrase. The items in the PhraseSet are favored by the - # recognition model when you send a call that includes the PhraseSet. - rpc :CreatePhraseSet, ::Google::Cloud::Speech::V1::CreatePhraseSetRequest, ::Google::Cloud::Speech::V1::PhraseSet - # Get a phrase set. - rpc :GetPhraseSet, ::Google::Cloud::Speech::V1::GetPhraseSetRequest, ::Google::Cloud::Speech::V1::PhraseSet - # List phrase sets. - rpc :ListPhraseSet, ::Google::Cloud::Speech::V1::ListPhraseSetRequest, ::Google::Cloud::Speech::V1::ListPhraseSetResponse - # Update a phrase set. - rpc :UpdatePhraseSet, ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest, ::Google::Cloud::Speech::V1::PhraseSet - # Delete a phrase set. - rpc :DeletePhraseSet, ::Google::Cloud::Speech::V1::DeletePhraseSetRequest, ::Google::Protobuf::Empty - # Create a custom class. - rpc :CreateCustomClass, ::Google::Cloud::Speech::V1::CreateCustomClassRequest, ::Google::Cloud::Speech::V1::CustomClass - # Get a custom class. - rpc :GetCustomClass, ::Google::Cloud::Speech::V1::GetCustomClassRequest, ::Google::Cloud::Speech::V1::CustomClass - # List custom classes. - rpc :ListCustomClasses, ::Google::Cloud::Speech::V1::ListCustomClassesRequest, ::Google::Cloud::Speech::V1::ListCustomClassesResponse - # Update a custom class. - rpc :UpdateCustomClass, ::Google::Cloud::Speech::V1::UpdateCustomClassRequest, ::Google::Cloud::Speech::V1::CustomClass - # Delete a custom class. - rpc :DeleteCustomClass, ::Google::Cloud::Speech::V1::DeleteCustomClassRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_pb.rb deleted file mode 100644 index 1870ee42f8a3..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v1/cloud_speech.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/cloud/speech/v1/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n)google/cloud/speech/v1/cloud_speech.proto\x12\x16google.cloud.speech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a%google/cloud/speech/v1/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\"\x90\x01\n\x10RecognizeRequest\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfigB\x03\xe0\x41\x02\x12<\n\x05\x61udio\x18\x02 \x01(\x0b\x32(.google.cloud.speech.v1.RecognitionAudioB\x03\xe0\x41\x02\"\xe7\x01\n\x1bLongRunningRecognizeRequest\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfigB\x03\xe0\x41\x02\x12<\n\x05\x61udio\x18\x02 \x01(\x0b\x32(.google.cloud.speech.v1.RecognitionAudioB\x03\xe0\x41\x02\x12J\n\routput_config\x18\x04 \x01(\x0b\x32..google.cloud.speech.v1.TranscriptOutputConfigB\x03\xe0\x41\x01\":\n\x16TranscriptOutputConfig\x12\x11\n\x07gcs_uri\x18\x01 \x01(\tH\x00\x42\r\n\x0boutput_type\"\x99\x01\n\x19StreamingRecognizeRequest\x12N\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x32.google.cloud.speech.v1.StreamingRecognitionConfigH\x00\x12\x17\n\raudio_content\x18\x02 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\xa7\x03\n\x1aStreamingRecognitionConfig\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfigB\x03\xe0\x41\x02\x12\x18\n\x10single_utterance\x18\x02 \x01(\x08\x12\x17\n\x0finterim_results\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_voice_activity_events\x18\x05 \x01(\x08\x12g\n\x16voice_activity_timeout\x18\x06 \x01(\x0b\x32G.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xca\x08\n\x11RecognitionConfig\x12I\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32\x37.google.cloud.speech.v1.RecognitionConfig.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x1b\n\x13\x61udio_channel_count\x18\x07 \x01(\x05\x12/\n\'enable_separate_recognition_per_channel\x18\x0c \x01(\x08\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x1a\x61lternative_language_codes\x18\x12 \x03(\t\x12\x18\n\x10max_alternatives\x18\x04 \x01(\x05\x12\x18\n\x10profanity_filter\x18\x05 \x01(\x08\x12<\n\nadaptation\x18\x14 \x01(\x0b\x32(.google.cloud.speech.v1.SpeechAdaptation\x12V\n\x18transcript_normalization\x18\x18 \x01(\x0b\x32/.google.cloud.speech.v1.TranscriptNormalizationB\x03\xe0\x41\x01\x12>\n\x0fspeech_contexts\x18\x06 \x03(\x0b\x32%.google.cloud.speech.v1.SpeechContext\x12 \n\x18\x65nable_word_time_offsets\x18\x08 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x0f \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x0b \x01(\x08\x12=\n\x19\x65nable_spoken_punctuation\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x38\n\x14\x65nable_spoken_emojis\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12L\n\x12\x64iarization_config\x18\x13 \x01(\x0b\x32\x30.google.cloud.speech.v1.SpeakerDiarizationConfig\x12=\n\x08metadata\x18\t \x01(\x0b\x32+.google.cloud.speech.v1.RecognitionMetadata\x12\r\n\x05model\x18\r \x01(\t\x12\x14\n\x0cuse_enhanced\x18\x0e \x01(\x08\"\xa3\x01\n\rAudioEncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x08\n\x04\x46LAC\x10\x02\x12\t\n\x05MULAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x0c\n\x08OGG_OPUS\x10\x06\x12\x1a\n\x16SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x07\n\x03MP3\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\"\x90\x01\n\x18SpeakerDiarizationConfig\x12\"\n\x1a\x65nable_speaker_diarization\x18\x01 \x01(\x08\x12\x19\n\x11min_speaker_count\x18\x02 \x01(\x05\x12\x19\n\x11max_speaker_count\x18\x03 \x01(\x05\x12\x1a\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x05\x18\x01\xe0\x41\x03\"\xa4\x08\n\x13RecognitionMetadata\x12U\n\x10interaction_type\x18\x01 \x01(\x0e\x32;.google.cloud.speech.v1.RecognitionMetadata.InteractionType\x12$\n\x1cindustry_naics_code_of_audio\x18\x03 \x01(\r\x12[\n\x13microphone_distance\x18\x04 \x01(\x0e\x32>.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance\x12Z\n\x13original_media_type\x18\x05 \x01(\x0e\x32=.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType\x12^\n\x15recording_device_type\x18\x06 \x01(\x0e\x32?.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType\x12\x1d\n\x15recording_device_name\x18\x07 \x01(\t\x12\x1a\n\x12original_mime_type\x18\x08 \x01(\t\x12\x13\n\x0b\x61udio_topic\x18\n \x01(\t\"\xc5\x01\n\x0fInteractionType\x12 \n\x1cINTERACTION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nDISCUSSION\x10\x01\x12\x10\n\x0cPRESENTATION\x10\x02\x12\x0e\n\nPHONE_CALL\x10\x03\x12\r\n\tVOICEMAIL\x10\x04\x12\x1b\n\x17PROFESSIONALLY_PRODUCED\x10\x05\x12\x10\n\x0cVOICE_SEARCH\x10\x06\x12\x11\n\rVOICE_COMMAND\x10\x07\x12\r\n\tDICTATION\x10\x08\"d\n\x12MicrophoneDistance\x12#\n\x1fMICROPHONE_DISTANCE_UNSPECIFIED\x10\x00\x12\r\n\tNEARFIELD\x10\x01\x12\x0c\n\x08MIDFIELD\x10\x02\x12\x0c\n\x08\x46\x41RFIELD\x10\x03\"N\n\x11OriginalMediaType\x12#\n\x1fORIGINAL_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\t\n\x05VIDEO\x10\x02\"\xa4\x01\n\x13RecordingDeviceType\x12%\n!RECORDING_DEVICE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nSMARTPHONE\x10\x01\x12\x06\n\x02PC\x10\x02\x12\x0e\n\nPHONE_LINE\x10\x03\x12\x0b\n\x07VEHICLE\x10\x04\x12\x18\n\x14OTHER_OUTDOOR_DEVICE\x10\x05\x12\x17\n\x13OTHER_INDOOR_DEVICE\x10\x06:\x02\x18\x01\"/\n\rSpeechContext\x12\x0f\n\x07phrases\x18\x01 \x03(\t\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\"D\n\x10RecognitionAudio\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\xed\x01\n\x11RecognizeResponse\x12@\n\x07results\x18\x02 \x03(\x0b\x32/.google.cloud.speech.v1.SpeechRecognitionResult\x12\x34\n\x11total_billed_time\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12L\n\x16speech_adaptation_info\x18\x07 \x01(\x0b\x32,.google.cloud.speech.v1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\x08 \x01(\x03\"\xe9\x02\n\x1cLongRunningRecognizeResponse\x12@\n\x07results\x18\x02 \x03(\x0b\x32/.google.cloud.speech.v1.SpeechRecognitionResult\x12\x34\n\x11total_billed_time\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x45\n\routput_config\x18\x06 \x01(\x0b\x32..google.cloud.speech.v1.TranscriptOutputConfig\x12(\n\x0coutput_error\x18\x07 \x01(\x0b\x32\x12.google.rpc.Status\x12L\n\x16speech_adaptation_info\x18\x08 \x01(\x0b\x32,.google.cloud.speech.v1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\t \x01(\x03\"\xb0\x01\n\x1cLongRunningRecognizeMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10last_update_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x03uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\"\xd1\x04\n\x1aStreamingRecognizeResponse\x12!\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12\x43\n\x07results\x18\x02 \x03(\x0b\x32\x32.google.cloud.speech.v1.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x04 \x01(\x0e\x32\x42.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType\x12\x34\n\x11speech_event_time\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x11total_billed_time\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12L\n\x16speech_adaptation_info\x18\t \x01(\x0b\x32,.google.cloud.speech.v1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\n \x01(\x03\"\x9d\x01\n\x0fSpeechEventType\x12\x1c\n\x18SPEECH_EVENT_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\x12\x1b\n\x17SPEECH_ACTIVITY_TIMEOUT\x10\x04\"\xf2\x01\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v1.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xca\x01\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v1.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v1.WordInfo\"\xc0\x01\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x1a\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x05\x18\x01\xe0\x41\x03\x12\x1a\n\rspeaker_label\x18\x06 \x01(\tB\x03\xe0\x41\x03\"K\n\x14SpeechAdaptationInfo\x12\x1a\n\x12\x61\x64\x61ptation_timeout\x18\x01 \x01(\x08\x12\x17\n\x0ftimeout_message\x18\x04 \x01(\t2\xd1\x04\n\x06Speech\x12\x90\x01\n\tRecognize\x12(.google.cloud.speech.v1.RecognizeRequest\x1a).google.cloud.speech.v1.RecognizeResponse\".\xda\x41\x0c\x63onfig,audio\x82\xd3\xe4\x93\x02\x19\"\x14/v1/speech:recognize:\x01*\x12\xe4\x01\n\x14LongRunningRecognize\x12\x33.google.cloud.speech.v1.LongRunningRecognizeRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41<\n\x1cLongRunningRecognizeResponse\x12\x1cLongRunningRecognizeMetadata\xda\x41\x0c\x63onfig,audio\x82\xd3\xe4\x93\x02$\"\x1f/v1/speech:longrunningrecognize:\x01*\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v1.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v1.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBh\n\x1a\x63om.google.cloud.speech.v1B\x0bSpeechProtoP\x01Z2cloud.google.com/go/speech/apiv1/speechpb;speechpb\xf8\x01\x01\xa2\x02\x03GCSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Speech - module V1 - RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognizeRequest").msgclass - LongRunningRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.LongRunningRecognizeRequest").msgclass - TranscriptOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.TranscriptOutputConfig").msgclass - StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognizeRequest").msgclass - StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognitionConfig").msgclass - StreamingRecognitionConfig::VoiceActivityTimeout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout").msgclass - RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionConfig").msgclass - RecognitionConfig::AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionConfig.AudioEncoding").enummodule - SpeakerDiarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeakerDiarizationConfig").msgclass - RecognitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata").msgclass - RecognitionMetadata::InteractionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata.InteractionType").enummodule - RecognitionMetadata::MicrophoneDistance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance").enummodule - RecognitionMetadata::OriginalMediaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType").enummodule - RecognitionMetadata::RecordingDeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType").enummodule - SpeechContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechContext").msgclass - RecognitionAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionAudio").msgclass - RecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognizeResponse").msgclass - LongRunningRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.LongRunningRecognizeResponse").msgclass - LongRunningRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.LongRunningRecognizeMetadata").msgclass - StreamingRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognizeResponse").msgclass - StreamingRecognizeResponse::SpeechEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType").enummodule - StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognitionResult").msgclass - SpeechRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechRecognitionResult").msgclass - SpeechRecognitionAlternative = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechRecognitionAlternative").msgclass - WordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.WordInfo").msgclass - SpeechAdaptationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechAdaptationInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb deleted file mode 100644 index 872e6df62f83..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/speech/v1/cloud_speech.proto for package 'google.cloud.speech.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/speech/v1/cloud_speech_pb' - -module Google - module Cloud - module Speech - module V1 - module Speech - # Service that implements Google Cloud Speech API. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.speech.v1.Speech' - - # Performs synchronous speech recognition: receive results after all audio - # has been sent and processed. - rpc :Recognize, ::Google::Cloud::Speech::V1::RecognizeRequest, ::Google::Cloud::Speech::V1::RecognizeResponse - # Performs asynchronous speech recognition: receive results via the - # google.longrunning.Operations interface. Returns either an - # `Operation.error` or an `Operation.response` which contains - # a `LongRunningRecognizeResponse` message. - # For more information on asynchronous speech recognition, see the - # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - rpc :LongRunningRecognize, ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest, ::Google::Longrunning::Operation - # Performs bidirectional streaming speech recognition: receive results while - # sending audio. This method is only available via the gRPC API (not REST). - rpc :StreamingRecognize, stream(::Google::Cloud::Speech::V1::StreamingRecognizeRequest), stream(::Google::Cloud::Speech::V1::StreamingRecognizeResponse) - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/resource_pb.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/resource_pb.rb deleted file mode 100644 index 2b910a6cea8b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/resource_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v1/resource.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n%google/cloud/speech/v1/resource.proto\x12\x16google.cloud.speech.v1\x1a\x19google/api/resource.proto\"\xfc\x01\n\x0b\x43ustomClass\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0f\x63ustom_class_id\x18\x02 \x01(\t\x12<\n\x05items\x18\x03 \x03(\x0b\x32-.google.cloud.speech.v1.CustomClass.ClassItem\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \x01(\t:l\xea\x41i\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}\"\xf2\x01\n\tPhraseSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x07phrases\x18\x02 \x03(\x0b\x32(.google.cloud.speech.v1.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02:e\xea\x41\x62\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}\"\xbd\x02\n\x10SpeechAdaptation\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v1.PhraseSet\x12\x43\n\x15phrase_set_references\x18\x02 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12;\n\x0e\x63ustom_classes\x18\x03 \x03(\x0b\x32#.google.cloud.speech.v1.CustomClass\x12J\n\x0c\x61\x62nf_grammar\x18\x04 \x01(\x0b\x32\x34.google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar\x1a#\n\x0b\x41\x42NFGrammar\x12\x14\n\x0c\x61\x62nf_strings\x18\x01 \x03(\t\"\xa3\x01\n\x17TranscriptNormalization\x12\x46\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x35.google.cloud.speech.v1.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\x42p\n\x1a\x63om.google.cloud.speech.v1B\x13SpeechResourceProtoP\x01Z2cloud.google.com/go/speech/apiv1/speechpb;speechpb\xf8\x01\x01\xa2\x02\x03GCSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Speech - module V1 - CustomClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CustomClass").msgclass - CustomClass::ClassItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.CustomClass.ClassItem").msgclass - PhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.PhraseSet").msgclass - PhraseSet::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.PhraseSet.Phrase").msgclass - SpeechAdaptation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechAdaptation").msgclass - SpeechAdaptation::ABNFGrammar = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.SpeechAdaptation.ABNFGrammar").msgclass - TranscriptNormalization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.TranscriptNormalization").msgclass - TranscriptNormalization::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.TranscriptNormalization.Entry").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/rest.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/rest.rb deleted file mode 100644 index b039262b9bb0..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/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/speech/v1/speech/rest" -require "google/cloud/speech/v1/adaptation/rest" -require "google/cloud/speech/v1/version" - -module Google - module Cloud - module Speech - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/speech/v1/rest" - # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech.rb deleted file mode 100644 index b88111d1fa2f..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech.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/speech/v1/version" - -require "google/cloud/speech/v1/speech/credentials" -require "google/cloud/speech/v1/speech/paths" -require "google/cloud/speech/v1/speech/operations" -require "google/cloud/speech/v1/speech/client" -require "google/cloud/speech/v1/speech/rest" - -module Google - module Cloud - module Speech - module V1 - ## - # Service that implements Google Cloud Speech API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/speech/v1/speech" - # client = ::Google::Cloud::Speech::V1::Speech::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/speech/v1/speech/rest" - # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new - # - module Speech - end - end - end - end -end - -helper_path = ::File.join __dir__, "speech", "helpers.rb" -require "google/cloud/speech/v1/speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/client.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/client.rb deleted file mode 100644 index aa61e8e18391..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/client.rb +++ /dev/null @@ -1,685 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v1/cloud_speech_pb" - -module Google - module Cloud - module Speech - module V1 - module Speech - ## - # Client for the Speech service. - # - # Service that implements Google Cloud Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :speech_stub - - ## - # Configure the Speech Client class. - # - # See {::Google::Cloud::Speech::V1::Speech::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Speech clients - # ::Google::Cloud::Speech::V1::Speech::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Speech", "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.recognize.timeout = 5000.0 - default_config.rpcs.recognize.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.long_running_recognize.timeout = 5000.0 - - default_config.rpcs.streaming_recognize.timeout = 5000.0 - default_config.rpcs.streaming_recognize.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 Speech Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V1::Speech::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @speech_stub.universe_domain - end - - ## - # Create a new Speech client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V1::Speech::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Speech 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/speech/v1/cloud_speech_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 - - @speech_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Speech::V1::Speech::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 - ) - - @speech_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::Speech::V1::Speech::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @speech_stub.logger - end - - # Service calls - - ## - # Performs synchronous speech recognition: receive results after all audio - # has been sent and processed. - # - # @overload recognize(request, options = nil) - # Pass arguments to `recognize` via a request object, either of type - # {::Google::Cloud::Speech::V1::RecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::RecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload recognize(config: nil, audio: nil) - # Pass arguments to `recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash] - # Required. The audio data to be recognized. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1::RecognizeResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1::RecognizeResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::RecognizeRequest.new - # - # # Call the recognize method. - # result = client.recognize request - # - # # The returned object is of type Google::Cloud::Speech::V1::RecognizeResponse. - # p result - # - def recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::RecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::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.recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :recognize, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs asynchronous speech recognition: receive results via the - # google.longrunning.Operations interface. Returns either an - # `Operation.error` or an `Operation.response` which contains - # a `LongRunningRecognizeResponse` message. - # For more information on asynchronous speech recognition, see the - # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - # - # @overload long_running_recognize(request, options = nil) - # Pass arguments to `long_running_recognize` via a request object, either of type - # {::Google::Cloud::Speech::V1::LongRunningRecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::LongRunningRecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload long_running_recognize(config: nil, audio: nil, output_config: nil) - # Pass arguments to `long_running_recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash] - # Required. The audio data to be recognized. - # @param output_config [::Google::Cloud::Speech::V1::TranscriptOutputConfig, ::Hash] - # Optional. Specifies an optional destination for the recognition results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new - # - # # Call the long_running_recognize method. - # result = client.long_running_recognize request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def long_running_recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.long_running_recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::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.long_running_recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.long_running_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :long_running_recognize, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs bidirectional streaming speech recognition: receive results while - # sending audio. This method is only available via the gRPC API (not REST). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeRequest, ::Hash>] - # An enumerable of {::Google::Cloud::Speech::V1::StreamingRecognizeRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Speech::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the streaming_recognize method to start streaming. - # output = client.streaming_recognize input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new - # input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Speech::V1::StreamingRecognizeResponse - # output.each do |current_response| - # p current_response - # end - # - def streaming_recognize request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V1::StreamingRecognizeRequest - end - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.streaming_recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::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.streaming_recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :streaming_recognize, request, 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 Speech API. - # - # This class represents the configuration for Speech, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V1::Speech::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # recognize to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V1::Speech::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.recognize.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.recognize.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Speech::V1::Speech::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Speech API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :recognize - ## - # RPC-specific configuration for `long_running_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :long_running_recognize - ## - # RPC-specific configuration for `streaming_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_recognize - - # @private - def initialize parent_rpcs = nil - recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize - @recognize = ::Gapic::Config::Method.new recognize_config - long_running_recognize_config = parent_rpcs.long_running_recognize if parent_rpcs.respond_to? :long_running_recognize - @long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config - streaming_recognize_config = parent_rpcs.streaming_recognize if parent_rpcs.respond_to? :streaming_recognize - @streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/credentials.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/credentials.rb deleted file mode 100644 index b98a12db51ab..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/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 Speech - module V1 - module Speech - # Credentials for the Speech API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SPEECH_CREDENTIALS", - "SPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPEECH_CREDENTIALS_JSON", - "SPEECH_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-speech-v1/lib/google/cloud/speech/v1/speech/operations.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/operations.rb deleted file mode 100644 index 430b79286138..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/operations.rb +++ /dev/null @@ -1,833 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 Speech - module V1 - module Speech - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Speech 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 Speech 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::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_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::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Speech::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::Speech::V1::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 = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-speech-v1/lib/google/cloud/speech/v1/speech/paths.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/paths.rb deleted file mode 100644 index ae06954b3904..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/paths.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Speech - module V1 - module Speech - # Path helper methods for the Speech API. - module Paths - ## - # Create a fully-qualified CustomClass resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # @param project [String] - # @param location [String] - # @param custom_class [String] - # - # @return [::String] - def custom_class_path project:, location:, custom_class: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" - end - - ## - # Create a fully-qualified PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest.rb deleted file mode 100644 index bf0e8c48b909..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/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/speech/v1/version" - -require "google/cloud/speech/v1/speech/credentials" -require "google/cloud/speech/v1/speech/paths" -require "google/cloud/speech/v1/speech/rest/operations" -require "google/cloud/speech/v1/speech/rest/client" - -module Google - module Cloud - module Speech - module V1 - ## - # Service that implements Google Cloud Speech API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/speech/v1/speech/rest" - # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new - # - module Speech - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/speech/v1/speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/client.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/client.rb deleted file mode 100644 index f60b595eeb4b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/client.rb +++ /dev/null @@ -1,553 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v1/cloud_speech_pb" -require "google/cloud/speech/v1/speech/rest/service_stub" - -module Google - module Cloud - module Speech - module V1 - module Speech - module Rest - ## - # REST client for the Speech service. - # - # Service that implements Google Cloud Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :speech_stub - - ## - # Configure the Speech Client class. - # - # See {::Google::Cloud::Speech::V1::Speech::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Speech clients - # ::Google::Cloud::Speech::V1::Speech::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", "Speech", "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.recognize.timeout = 5000.0 - default_config.rpcs.recognize.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.long_running_recognize.timeout = 5000.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Speech Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V1::Speech::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 - @speech_stub.universe_domain - end - - ## - # Create a new Speech REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Speech 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::Speech::V1::Speech::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 - - @speech_stub = ::Google::Cloud::Speech::V1::Speech::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @speech_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::Speech::V1::Speech::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @speech_stub.logger - end - - # Service calls - - ## - # Performs synchronous speech recognition: receive results after all audio - # has been sent and processed. - # - # @overload recognize(request, options = nil) - # Pass arguments to `recognize` via a request object, either of type - # {::Google::Cloud::Speech::V1::RecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::RecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload recognize(config: nil, audio: nil) - # Pass arguments to `recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash] - # Required. The audio data to be recognized. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::RecognizeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::RecognizeResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::RecognizeRequest.new - # - # # Call the recognize method. - # result = client.recognize request - # - # # The returned object is of type Google::Cloud::Speech::V1::RecognizeResponse. - # p result - # - def recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::RecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.recognize.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.recognize request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs asynchronous speech recognition: receive results via the - # google.longrunning.Operations interface. Returns either an - # `Operation.error` or an `Operation.response` which contains - # a `LongRunningRecognizeResponse` message. - # For more information on asynchronous speech recognition, see the - # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - # - # @overload long_running_recognize(request, options = nil) - # Pass arguments to `long_running_recognize` via a request object, either of type - # {::Google::Cloud::Speech::V1::LongRunningRecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1::LongRunningRecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload long_running_recognize(config: nil, audio: nil, output_config: nil) - # Pass arguments to `long_running_recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V1::RecognitionConfig, ::Hash] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash] - # Required. The audio data to be recognized. - # @param output_config [::Google::Cloud::Speech::V1::TranscriptOutputConfig, ::Hash] - # Optional. Specifies an optional destination for the recognition results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new - # - # # Call the long_running_recognize method. - # result = client.long_running_recognize request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def long_running_recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.long_running_recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.long_running_recognize.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.long_running_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.long_running_recognize request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 Speech REST API. - # - # This class represents the configuration for Speech REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V1::Speech::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # recognize to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V1::Speech::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.recognize.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.recognize.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Speech API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :recognize - ## - # RPC-specific configuration for `long_running_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :long_running_recognize - - # @private - def initialize parent_rpcs = nil - recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize - @recognize = ::Gapic::Config::Method.new recognize_config - long_running_recognize_config = parent_rpcs.long_running_recognize if parent_rpcs.respond_to? :long_running_recognize - @long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/operations.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/operations.rb deleted file mode 100644 index 24ff8022221f..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/operations.rb +++ /dev/null @@ -1,923 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Speech - module V1 - module Speech - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Speech 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 Speech 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::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_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/operations", - matches: [] - ) - 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/operations/{name}", - matches: [ - ["name", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb deleted file mode 100644 index 6394ec823985..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/speech/v1/cloud_speech_pb" - -module Google - module Cloud - module Speech - module V1 - module Speech - module Rest - ## - # REST service stub for the Speech 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 recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::RecognizeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1::RecognizeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1::RecognizeResponse] - # A result object deserialized from the server's reply - def recognize request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_recognize_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "recognize", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1::RecognizeResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the long_running_recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::LongRunningRecognizeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def long_running_recognize request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_long_running_recognize_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "long_running_recognize", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::RecognizeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_recognize_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/speech:recognize", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the long_running_recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V1::LongRunningRecognizeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_long_running_recognize_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/speech:longrunningrecognize", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/version.rb b/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/v1/version.rb deleted file mode 100644 index 1a5ee1f9dace..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/lib/google/cloud/speech/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 Speech - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-speech-v1/proto_docs/README.md deleted file mode 100644 index 9ab7063008bf..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Speech-to-Text 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-speech-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech.rb deleted file mode 100644 index c7a315d42f57..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech.rb +++ /dev/null @@ -1,1003 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Speech - module V1 - # The top-level message sent by the client for the `Recognize` method. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V1::RecognitionConfig] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @!attribute [rw] audio - # @return [::Google::Cloud::Speech::V1::RecognitionAudio] - # Required. The audio data to be recognized. - class RecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message sent by the client for the `LongRunningRecognize` - # method. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V1::RecognitionConfig] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @!attribute [rw] audio - # @return [::Google::Cloud::Speech::V1::RecognitionAudio] - # Required. The audio data to be recognized. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Speech::V1::TranscriptOutputConfig] - # Optional. Specifies an optional destination for the recognition results. - class LongRunningRecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies an optional destination for the recognition results. - # @!attribute [rw] gcs_uri - # @return [::String] - # Specifies a Cloud Storage URI for the recognition results. Must be - # specified in the format: `gs://bucket_name/object_name`, and the bucket - # must already exist. - class TranscriptOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message sent by the client for the `StreamingRecognize` method. - # Multiple `StreamingRecognizeRequest` messages are sent. The first message - # must contain a `streaming_config` message and must not contain - # `audio_content`. All subsequent messages must contain `audio_content` and - # must not contain a `streaming_config` message. - # @!attribute [rw] streaming_config - # @return [::Google::Cloud::Speech::V1::StreamingRecognitionConfig] - # Provides information to the recognizer that specifies how to process the - # request. The first `StreamingRecognizeRequest` message must contain a - # `streaming_config` message. - # - # Note: The following fields are mutually exclusive: `streaming_config`, `audio_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] audio_content - # @return [::String] - # The audio data to be recognized. Sequential chunks of audio data are sent - # in sequential `StreamingRecognizeRequest` messages. The first - # `StreamingRecognizeRequest` message must not contain `audio_content` data - # and all subsequent `StreamingRecognizeRequest` messages must contain - # `audio_content` data. The audio bytes must be encoded as specified in - # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - # pure binary representation (not base64). See - # [content limits](https://cloud.google.com/speech-to-text/quotas#content). - # - # Note: The following fields are mutually exclusive: `audio_content`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class StreamingRecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides information to the recognizer that specifies how to process the - # request. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V1::RecognitionConfig] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @!attribute [rw] single_utterance - # @return [::Boolean] - # If `false` or omitted, the recognizer will perform continuous - # recognition (continuing to wait for and process audio even if the user - # pauses speaking) until the client closes the input stream (gRPC API) or - # until the maximum time limit has been reached. May return multiple - # `StreamingRecognitionResult`s with the `is_final` flag set to `true`. - # - # If `true`, the recognizer will detect a single spoken utterance. When it - # detects that the user has paused or stopped speaking, it will return an - # `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no - # more than one `StreamingRecognitionResult` with the `is_final` flag set to - # `true`. - # - # The `single_utterance` field can only be used with specified models, - # otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] - # must be set to: - # - # * `command_and_search` - # * `phone_call` AND additional field `useEnhanced`=`true` - # * The `model` field is left undefined. In this case the API auto-selects - # a model based on any other parameters that you set in - # `RecognitionConfig`. - # @!attribute [rw] interim_results - # @return [::Boolean] - # If `true`, interim results (tentative hypotheses) may be - # returned as they become available (these interim results are indicated with - # the `is_final=false` flag). - # If `false` or omitted, only `is_final=true` result(s) are returned. - # @!attribute [rw] enable_voice_activity_events - # @return [::Boolean] - # If `true`, responses with voice activity speech events will be returned as - # they are detected. - # @!attribute [rw] voice_activity_timeout - # @return [::Google::Cloud::Speech::V1::StreamingRecognitionConfig::VoiceActivityTimeout] - # If set, the server will automatically close the stream after the specified - # duration has elapsed after the last VOICE_ACTIVITY speech event has been - # sent. The field `voice_activity_events` must also be set to true. - class StreamingRecognitionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Events that a timeout can be set on for voice activity. - # @!attribute [rw] speech_start_timeout - # @return [::Google::Protobuf::Duration] - # Duration to timeout the stream if no speech begins. - # @!attribute [rw] speech_end_timeout - # @return [::Google::Protobuf::Duration] - # Duration to timeout the stream after speech ends. - class VoiceActivityTimeout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Provides information to the recognizer that specifies how to process the - # request. - # @!attribute [rw] encoding - # @return [::Google::Cloud::Speech::V1::RecognitionConfig::AudioEncoding] - # Encoding of audio data sent in all `RecognitionAudio` messages. - # This field is optional for `FLAC` and `WAV` audio files and required - # for all other audio formats. For details, see - # {::Google::Cloud::Speech::V1::RecognitionConfig::AudioEncoding AudioEncoding}. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Sample rate in Hertz of the audio data sent in all - # `RecognitionAudio` messages. Valid values are: 8000-48000. - # 16000 is optimal. For best results, set the sampling rate of the audio - # source to 16000 Hz. If that's not possible, use the native sample rate of - # the audio source (instead of re-sampling). - # This field is optional for FLAC and WAV audio files, but is - # required for all other audio formats. For details, see - # {::Google::Cloud::Speech::V1::RecognitionConfig::AudioEncoding AudioEncoding}. - # @!attribute [rw] audio_channel_count - # @return [::Integer] - # The number of channels in the input audio data. - # ONLY set this for MULTI-CHANNEL recognition. - # Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. - # Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. - # If `0` or omitted, defaults to one channel (mono). - # Note: We only recognize the first channel by default. - # To perform independent recognition on each channel set - # `enable_separate_recognition_per_channel` to 'true'. - # @!attribute [rw] enable_separate_recognition_per_channel - # @return [::Boolean] - # This needs to be set to `true` explicitly and `audio_channel_count` > 1 - # to get each channel recognized separately. The recognition result will - # contain a `channel_tag` field to state which channel that result belongs - # to. If this is not true, we will only recognize the first channel. The - # request is billed cumulatively for all channels recognized: - # `audio_channel_count` multiplied by the length of the audio. - # @!attribute [rw] language_code - # @return [::String] - # Required. The language of the supplied audio as a - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # Example: "en-US". - # See [Language - # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - # of the currently supported language codes. - # @!attribute [rw] alternative_language_codes - # @return [::Array<::String>] - # A list of up to 3 additional - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, - # listing possible alternative languages of the supplied audio. - # See [Language - # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - # of the currently supported language codes. If alternative languages are - # listed, recognition result will contain recognition in the most likely - # language detected including the main language_code. The recognition result - # will include the language tag of the language detected in the audio. Note: - # This feature is only supported for Voice Command and Voice Search use cases - # and performance may vary for other use cases (e.g., phone call - # transcription). - # @!attribute [rw] max_alternatives - # @return [::Integer] - # Maximum number of recognition hypotheses to be returned. - # Specifically, the maximum number of `SpeechRecognitionAlternative` messages - # within each `SpeechRecognitionResult`. - # The server may return fewer than `max_alternatives`. - # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - # one. If omitted, will return a maximum of one. - # @!attribute [rw] profanity_filter - # @return [::Boolean] - # If set to `true`, the server will attempt to filter out - # profanities, replacing all but the initial character in each filtered word - # with asterisks, e.g. "f***". If set to `false` or omitted, profanities - # won't be filtered out. - # @!attribute [rw] adaptation - # @return [::Google::Cloud::Speech::V1::SpeechAdaptation] - # Speech adaptation configuration improves the accuracy of speech - # recognition. For more information, see the [speech - # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) - # documentation. - # When speech adaptation is set it supersedes the `speech_contexts` field. - # @!attribute [rw] transcript_normalization - # @return [::Google::Cloud::Speech::V1::TranscriptNormalization] - # Optional. Use transcription normalization to automatically replace parts of - # the transcript with phrases of your choosing. For StreamingRecognize, this - # normalization only applies to stable partial transcripts (stability > 0.8) - # and final transcripts. - # @!attribute [rw] speech_contexts - # @return [::Array<::Google::Cloud::Speech::V1::SpeechContext>] - # Array of {::Google::Cloud::Speech::V1::SpeechContext SpeechContext}. - # A means to provide context to assist the speech recognition. For more - # information, see - # [speech - # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). - # @!attribute [rw] enable_word_time_offsets - # @return [::Boolean] - # If `true`, the top result includes a list of words and - # the start and end time offsets (timestamps) for those words. If - # `false`, no word-level time offset information is returned. The default is - # `false`. - # @!attribute [rw] enable_word_confidence - # @return [::Boolean] - # If `true`, the top result includes a list of words and the - # confidence for those words. If `false`, no word-level confidence - # information is returned. The default is `false`. - # @!attribute [rw] enable_automatic_punctuation - # @return [::Boolean] - # If 'true', adds punctuation to recognition result hypotheses. - # This feature is only available in select languages. Setting this for - # requests in other languages has no effect at all. - # The default 'false' value does not add punctuation to result hypotheses. - # @!attribute [rw] enable_spoken_punctuation - # @return [::Google::Protobuf::BoolValue] - # The spoken punctuation behavior for the call - # If not set, uses default behavior based on model of choice - # e.g. command_and_search will enable spoken punctuation by default - # If 'true', replaces spoken punctuation with the corresponding symbols in - # the request. For example, "how are you question mark" becomes "how are - # you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation - # for support. If 'false', spoken punctuation is not replaced. - # @!attribute [rw] enable_spoken_emojis - # @return [::Google::Protobuf::BoolValue] - # The spoken emoji behavior for the call - # If not set, uses default behavior based on model of choice - # If 'true', adds spoken emoji formatting for the request. This will replace - # spoken emojis with the corresponding Unicode symbols in the final - # transcript. If 'false', spoken emojis are not replaced. - # @!attribute [rw] diarization_config - # @return [::Google::Cloud::Speech::V1::SpeakerDiarizationConfig] - # Config to enable speaker diarization and set additional - # parameters to make diarization better suited for your application. - # Note: When this is enabled, we send all the words from the beginning of the - # audio for the top alternative in every consecutive STREAMING responses. - # This is done in order to improve our speaker tags as our models learn to - # identify the speakers in the conversation over time. - # For non-streaming requests, the diarization results will be provided only - # in the top alternative of the FINAL SpeechRecognitionResult. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V1::RecognitionMetadata] - # Metadata regarding this request. - # @!attribute [rw] model - # @return [::String] - # Which model to select for the given request. Select the model - # best suited to your domain to get best results. If a model is not - # explicitly specified, then we auto-select a model based on the parameters - # in the RecognitionConfig. - #
- # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed - # speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically - # recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple - # speakers. Ideally the audio is recorded at a 16khz or greater - # sampling rate. This is a premium model that costs more than the - # standard rate.
defaultBest for audio that is not one of the specific audio models. - # For example, long-form audio. Ideally the audio is high-fidelity, - # recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a - # medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical - # provider.
- # @!attribute [rw] use_enhanced - # @return [::Boolean] - # Set to true to use an enhanced model for speech recognition. - # If `use_enhanced` is set to true and the `model` field is not set, then - # an appropriate enhanced model is chosen if an enhanced model exists for - # the audio. - # - # If `use_enhanced` is true and an enhanced version of the specified model - # does not exist, then the speech is recognized using the standard version - # of the specified model. - class RecognitionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The encoding of the audio data sent in the request. - # - # All encodings support only 1 channel (mono) audio, unless the - # `audio_channel_count` and `enable_separate_recognition_per_channel` fields - # are set. - # - # For best results, the audio source should be captured and transmitted using - # a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech - # recognition can be reduced if lossy codecs are used to capture or transmit - # audio, particularly if background noise is present. Lossy codecs include - # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, - # and `WEBM_OPUS`. - # - # The `FLAC` and `WAV` audio file formats include a header that describes the - # included audio content. You can request recognition for `WAV` files that - # contain either `LINEAR16` or `MULAW` encoded audio. - # If you send `FLAC` or `WAV` audio file format in - # your request, you do not need to specify an `AudioEncoding`; the audio - # encoding format is determined from the file header. If you specify - # an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the - # encoding configuration must match the encoding described in the audio - # header; otherwise the request returns an - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error - # code. - module AudioEncoding - # Not specified. - ENCODING_UNSPECIFIED = 0 - - # Uncompressed 16-bit signed little-endian samples (Linear PCM). - LINEAR16 = 1 - - # `FLAC` (Free Lossless Audio - # Codec) is the recommended encoding because it is - # lossless--therefore recognition is not compromised--and - # requires only about half the bandwidth of `LINEAR16`. `FLAC` stream - # encoding supports 16-bit and 24-bit samples, however, not all fields in - # `STREAMINFO` are supported. - FLAC = 2 - - # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 3 - - # Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. - AMR = 4 - - # Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. - AMR_WB = 5 - - # Opus encoded audio frames in Ogg container - # ([OggOpus](https://wiki.xiph.org/OggOpus)). - # `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. - OGG_OPUS = 6 - - # Although the use of lossy encodings is not recommended, if a very low - # bitrate encoding is required, `OGG_OPUS` is highly preferred over - # Speex encoding. The [Speex](https://speex.org/) encoding supported by - # Cloud Speech API has a header byte in each block, as in MIME type - # `audio/x-speex-with-header-byte`. - # It is a variant of the RTP Speex encoding defined in - # [RFC 5574](https://tools.ietf.org/html/rfc5574). - # The stream is a sequence of blocks, one block per RTP packet. Each block - # starts with a byte containing the length of the block, in bytes, followed - # by one or more frames of Speex data, padded to an integral number of - # bytes (octets) as specified in RFC 5574. In other words, each RTP header - # is replaced with a single byte containing the block length. Only Speex - # wideband is supported. `sample_rate_hertz` must be 16000. - SPEEX_WITH_HEADER_BYTE = 7 - - # MP3 audio. MP3 encoding is a Beta feature and only available in - # v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 - # kbps). When using this encoding, `sample_rate_hertz` has to match the - # sample rate of the file being used. - MP3 = 8 - - # Opus encoded audio frames in WebM container - # ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be - # one of 8000, 12000, 16000, 24000, or 48000. - WEBM_OPUS = 9 - end - end - - # Config to enable speaker diarization. - # @!attribute [rw] enable_speaker_diarization - # @return [::Boolean] - # If 'true', enables speaker detection for each recognized word in - # the top alternative of the recognition result using a speaker_label - # provided in the WordInfo. - # @!attribute [rw] min_speaker_count - # @return [::Integer] - # Minimum number of speakers in the conversation. This range gives you more - # flexibility by allowing the system to automatically determine the correct - # number of speakers. If not set, the default value is 2. - # @!attribute [rw] max_speaker_count - # @return [::Integer] - # Maximum number of speakers in the conversation. This range gives you more - # flexibility by allowing the system to automatically determine the correct - # number of speakers. If not set, the default value is 6. - # @!attribute [r] speaker_tag - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Output only. Unused. - class SpeakerDiarizationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of audio data to be recognized. - # @deprecated This message is deprecated and may be removed in the next major version update. - # @!attribute [rw] interaction_type - # @return [::Google::Cloud::Speech::V1::RecognitionMetadata::InteractionType] - # The use case most closely describing the audio content to be recognized. - # @!attribute [rw] industry_naics_code_of_audio - # @return [::Integer] - # The industry vertical to which this speech recognition request most - # closely applies. This is most indicative of the topics contained - # in the audio. Use the 6-digit NAICS code to identify the industry - # vertical - see https://www.naics.com/search/. - # @!attribute [rw] microphone_distance - # @return [::Google::Cloud::Speech::V1::RecognitionMetadata::MicrophoneDistance] - # The audio type that most closely describes the audio being recognized. - # @!attribute [rw] original_media_type - # @return [::Google::Cloud::Speech::V1::RecognitionMetadata::OriginalMediaType] - # The original media the speech was recorded on. - # @!attribute [rw] recording_device_type - # @return [::Google::Cloud::Speech::V1::RecognitionMetadata::RecordingDeviceType] - # The type of device the speech was recorded with. - # @!attribute [rw] recording_device_name - # @return [::String] - # The device used to make the recording. Examples 'Nexus 5X' or - # 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - # 'Cardioid Microphone'. - # @!attribute [rw] original_mime_type - # @return [::String] - # Mime type of the original audio file. For example `audio/m4a`, - # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. - # A list of possible audio mime types is maintained at - # http://www.iana.org/assignments/media-types/media-types.xhtml#audio - # @!attribute [rw] audio_topic - # @return [::String] - # Description of the content. Eg. "Recordings of federal supreme court - # hearings from 2012". - class RecognitionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Use case categories that the audio recognition request can be described - # by. - module InteractionType - # Use case is either unknown or is something other than one of the other - # values below. - INTERACTION_TYPE_UNSPECIFIED = 0 - - # Multiple people in a conversation or discussion. For example in a - # meeting with two or more people actively participating. Typically - # all the primary people speaking would be in the same room (if not, - # see PHONE_CALL) - DISCUSSION = 1 - - # One or more persons lecturing or presenting to others, mostly - # uninterrupted. - PRESENTATION = 2 - - # A phone-call or video-conference in which two or more people, who are - # not in the same room, are actively participating. - PHONE_CALL = 3 - - # A recorded message intended for another person to listen to. - VOICEMAIL = 4 - - # Professionally produced audio (eg. TV Show, Podcast). - PROFESSIONALLY_PRODUCED = 5 - - # Transcribe spoken questions and queries into text. - VOICE_SEARCH = 6 - - # Transcribe voice commands, such as for controlling a device. - VOICE_COMMAND = 7 - - # Transcribe speech to text to create a written document, such as a - # text-message, email or report. - DICTATION = 8 - end - - # Enumerates the types of capture settings describing an audio file. - module MicrophoneDistance - # Audio type is not known. - MICROPHONE_DISTANCE_UNSPECIFIED = 0 - - # The audio was captured from a closely placed microphone. Eg. phone, - # dictaphone, or handheld microphone. Generally if there speaker is within - # 1 meter of the microphone. - NEARFIELD = 1 - - # The speaker if within 3 meters of the microphone. - MIDFIELD = 2 - - # The speaker is more than 3 meters away from the microphone. - FARFIELD = 3 - end - - # The original media the speech was recorded on. - module OriginalMediaType - # Unknown original media type. - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0 - - # The speech data is an audio recording. - AUDIO = 1 - - # The speech data originally recorded on a video. - VIDEO = 2 - end - - # The type of device the speech was recorded with. - module RecordingDeviceType - # The recording device is unknown. - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0 - - # Speech was recorded on a smartphone. - SMARTPHONE = 1 - - # Speech was recorded using a personal computer or tablet. - PC = 2 - - # Speech was recorded over a phone line. - PHONE_LINE = 3 - - # Speech was recorded in a vehicle. - VEHICLE = 4 - - # Speech was recorded outdoors. - OTHER_OUTDOOR_DEVICE = 5 - - # Speech was recorded indoors. - OTHER_INDOOR_DEVICE = 6 - end - end - - # Provides "hints" to the speech recognizer to favor specific words and phrases - # in the results. - # @!attribute [rw] phrases - # @return [::Array<::String>] - # A list of strings containing words and phrases "hints" so that - # the speech recognition is more likely to recognize them. This can be used - # to improve the accuracy for specific words and phrases, for example, if - # specific commands are typically spoken by the user. This can also be used - # to add additional words to the vocabulary of the recognizer. See - # [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - # - # List items can also be set to classes for groups of words that represent - # common concepts that occur in natural language. For example, rather than - # providing phrase hints for every month of the year, using the $MONTH class - # improves the likelihood of correctly transcribing audio that includes - # months. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Positive value will increase the probability that a specific - # phrase will be recognized over other similar sounding phrases. The higher - # the boost, the higher the chance of false positive recognition as well. - # Negative boost values would correspond to anti-biasing. Anti-biasing is not - # enabled, so negative boost will simply be ignored. Though `boost` can - # accept a wide range of positive values, most use cases are best served with - # values between 0 and 20. We recommend using a binary search approach to - # finding the optimal value for your use case. - class SpeechContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains audio data in the encoding specified in the `RecognitionConfig`. - # Either `content` or `uri` must be supplied. Supplying both or neither - # returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - # See [content limits](https://cloud.google.com/speech-to-text/quotas#content). - # @!attribute [rw] content - # @return [::String] - # The audio data bytes encoded as specified in - # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - # pure binary representation, whereas JSON representations use base64. - # - # Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] uri - # @return [::String] - # URI that points to a file that contains audio data bytes as specified in - # `RecognitionConfig`. The file must not be compressed (for example, gzip). - # Currently, only Google Cloud Storage URIs are - # supported, which must be specified in the following format: - # `gs://bucket_name/object_name` (other URI formats return - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). - # For more information, see [Request - # URIs](https://cloud.google.com/storage/docs/reference-uris). - # - # Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class RecognitionAudio - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The only message returned to the client by the `Recognize` method. It - # contains the result as zero or more sequential `SpeechRecognitionResult` - # messages. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionResult>] - # Sequential list of transcription results corresponding to - # sequential portions of audio. - # @!attribute [rw] total_billed_time - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the corresponding request. - # @!attribute [rw] speech_adaptation_info - # @return [::Google::Cloud::Speech::V1::SpeechAdaptationInfo] - # Provides information on adaptation behavior in response - # @!attribute [rw] request_id - # @return [::Integer] - # The ID associated with the request. This is a unique ID specific only to - # the given request. - class RecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The only message returned to the client by the `LongRunningRecognize` method. - # It contains the result as zero or more sequential `SpeechRecognitionResult` - # messages. It is included in the `result.response` field of the `Operation` - # returned by the `GetOperation` call of the `google::longrunning::Operations` - # service. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionResult>] - # Sequential list of transcription results corresponding to - # sequential portions of audio. - # @!attribute [rw] total_billed_time - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the corresponding request. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Speech::V1::TranscriptOutputConfig] - # Original output config if present in the request. - # @!attribute [rw] output_error - # @return [::Google::Rpc::Status] - # If the transcript output fails this field contains the relevant error. - # @!attribute [rw] speech_adaptation_info - # @return [::Google::Cloud::Speech::V1::SpeechAdaptationInfo] - # Provides information on speech adaptation behavior in response - # @!attribute [rw] request_id - # @return [::Integer] - # The ID associated with the request. This is a unique ID specific only to - # the given request. - class LongRunningRecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the progress of a long-running `LongRunningRecognize` call. It is - # included in the `metadata` field of the `Operation` returned by the - # `GetOperation` call of the `google::longrunning::Operations` service. - # @!attribute [rw] progress_percent - # @return [::Integer] - # Approximate percentage of audio processed thus far. Guaranteed to be 100 - # when the audio is fully processed and the results are available. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Time when the request was received. - # @!attribute [rw] last_update_time - # @return [::Google::Protobuf::Timestamp] - # Time of the most recent processing update. - # @!attribute [r] uri - # @return [::String] - # Output only. The URI of the audio file being transcribed. Empty if the - # audio was sent as byte content. - class LongRunningRecognizeMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `StreamingRecognizeResponse` is the only message returned to the client by - # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` - # messages are streamed back to the client. If there is no recognizable - # audio, and `single_utterance` is set to false, then no messages are streamed - # back to the client. - # - # Here's an example of a series of `StreamingRecognizeResponse`s that might be - # returned while processing audio: - # - # 1. results { alternatives { transcript: "tube" } stability: 0.01 } - # - # 2. results { alternatives { transcript: "to be a" } stability: 0.01 } - # - # 3. results { alternatives { transcript: "to be" } stability: 0.9 } - # results { alternatives { transcript: " or not to be" } stability: 0.01 } - # - # 4. results { alternatives { transcript: "to be or not to be" - # confidence: 0.92 } - # alternatives { transcript: "to bee or not to bee" } - # is_final: true } - # - # 5. results { alternatives { transcript: " that's" } stability: 0.01 } - # - # 6. results { alternatives { transcript: " that is" } stability: 0.9 } - # results { alternatives { transcript: " the question" } stability: 0.01 } - # - # 7. results { alternatives { transcript: " that is the question" - # confidence: 0.98 } - # alternatives { transcript: " that was the question" } - # is_final: true } - # - # Notes: - # - # - Only two of the above responses #4 and #7 contain final results; they are - # indicated by `is_final: true`. Concatenating these together generates the - # full transcript: "to be or not to be that is the question". - # - # - The others contain interim `results`. #3 and #6 contain two interim - # `results`: the first portion has a high stability and is less likely to - # change; the second portion has a low stability and is very likely to - # change. A UI designer might choose to show only high stability `results`. - # - # - The specific `stability` and `confidence` values shown above are only for - # illustrative purposes. Actual values may vary. - # - # - In each response, only one of these fields will be set: - # `error`, - # `speech_event_type`, or - # one or more (repeated) `results`. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # If set, returns a {::Google::Rpc::Status google.rpc.Status} message that - # specifies the error for the operation. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V1::StreamingRecognitionResult>] - # This repeated list contains zero or more results that - # correspond to consecutive portions of the audio currently being processed. - # It contains zero or one `is_final=true` result (the newly settled portion), - # followed by zero or more `is_final=false` results (the interim results). - # @!attribute [rw] speech_event_type - # @return [::Google::Cloud::Speech::V1::StreamingRecognizeResponse::SpeechEventType] - # Indicates the type of speech event. - # @!attribute [rw] speech_event_time - # @return [::Google::Protobuf::Duration] - # Time offset between the beginning of the audio and event emission. - # @!attribute [rw] total_billed_time - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the stream. - # Set only if this is the last response in the stream. - # @!attribute [rw] speech_adaptation_info - # @return [::Google::Cloud::Speech::V1::SpeechAdaptationInfo] - # Provides information on adaptation behavior in response - # @!attribute [rw] request_id - # @return [::Integer] - # The ID associated with the request. This is a unique ID specific only to - # the given request. - class StreamingRecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the type of speech event. - module SpeechEventType - # No speech event specified. - SPEECH_EVENT_UNSPECIFIED = 0 - - # This event indicates that the server has detected the end of the user's - # speech utterance and expects no additional speech. Therefore, the server - # will not process additional audio (although it may subsequently return - # additional results). The client should stop sending additional audio - # data, half-close the gRPC connection, and wait for any additional results - # until the server closes the gRPC connection. This event is only sent if - # `single_utterance` was set to `true`, and is not used otherwise. - END_OF_SINGLE_UTTERANCE = 1 - - # This event indicates that the server has detected the beginning of human - # voice activity in the stream. This event can be returned multiple times - # if speech starts and stops repeatedly throughout the stream. This event - # is only sent if `voice_activity_events` is set to true. - SPEECH_ACTIVITY_BEGIN = 2 - - # This event indicates that the server has detected the end of human voice - # activity in the stream. This event can be returned multiple times if - # speech starts and stops repeatedly throughout the stream. This event is - # only sent if `voice_activity_events` is set to true. - SPEECH_ACTIVITY_END = 3 - - # This event indicates that the user-set timeout for speech activity begin - # or end has exceeded. Upon receiving this event, the client is expected to - # send a half close. Further audio will not be processed. - SPEECH_ACTIVITY_TIMEOUT = 4 - end - end - - # A streaming speech recognition result corresponding to a portion of the audio - # that is currently being processed. - # @!attribute [rw] alternatives - # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionAlternative>] - # May contain one or more recognition hypotheses (up to the - # maximum specified in `max_alternatives`). - # These alternatives are ordered in terms of accuracy, with the top (first) - # alternative being the most probable, as ranked by the recognizer. - # @!attribute [rw] is_final - # @return [::Boolean] - # If `false`, this `StreamingRecognitionResult` represents an - # interim result that may change. If `true`, this is the final time the - # speech service will return this particular `StreamingRecognitionResult`, - # the recognizer will not return any further hypotheses for this portion of - # the transcript and corresponding audio. - # @!attribute [rw] stability - # @return [::Float] - # An estimate of the likelihood that the recognizer will not - # change its guess about this interim result. Values range from 0.0 - # (completely unstable) to 1.0 (completely stable). - # This field is only provided for interim results (`is_final=false`). - # The default of 0.0 is a sentinel value indicating `stability` was not set. - # @!attribute [rw] result_end_time - # @return [::Google::Protobuf::Duration] - # Time offset of the end of this result relative to the - # beginning of the audio. - # @!attribute [rw] channel_tag - # @return [::Integer] - # For multi-channel audio, this is the channel number corresponding to the - # recognized result for the audio from that channel. - # For audio_channel_count = N, its output values can range from '1' to 'N'. - # @!attribute [r] language_code - # @return [::String] - # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag of the language in this result. This language code was - # detected to have the most likelihood of being spoken in the audio. - class StreamingRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A speech recognition result corresponding to a portion of the audio. - # @!attribute [rw] alternatives - # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionAlternative>] - # May contain one or more recognition hypotheses (up to the - # maximum specified in `max_alternatives`). - # These alternatives are ordered in terms of accuracy, with the top (first) - # alternative being the most probable, as ranked by the recognizer. - # @!attribute [rw] channel_tag - # @return [::Integer] - # For multi-channel audio, this is the channel number corresponding to the - # recognized result for the audio from that channel. - # For audio_channel_count = N, its output values can range from '1' to 'N'. - # @!attribute [rw] result_end_time - # @return [::Google::Protobuf::Duration] - # Time offset of the end of this result relative to the - # beginning of the audio. - # @!attribute [r] language_code - # @return [::String] - # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag of the language in this result. This language code was - # detected to have the most likelihood of being spoken in the audio. - class SpeechRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Alternative hypotheses (a.k.a. n-best list). - # @!attribute [rw] transcript - # @return [::String] - # Transcript text representing the words that the user spoke. - # In languages that use spaces to separate words, the transcript might have a - # leading space if it isn't the first result. You can concatenate each result - # to obtain the full transcript without using a separator. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence estimate between 0.0 and 1.0. A higher number - # indicates an estimated greater likelihood that the recognized words are - # correct. This field is set only for the top alternative of a non-streaming - # result or, of a streaming result where `is_final=true`. - # This field is not guaranteed to be accurate and users should not rely on it - # to be always provided. - # The default of 0.0 is a sentinel value indicating `confidence` was not set. - # @!attribute [rw] words - # @return [::Array<::Google::Cloud::Speech::V1::WordInfo>] - # A list of word-specific information for each recognized word. - # Note: When `enable_speaker_diarization` is true, you will see all the words - # from the beginning of the audio. - class SpeechRecognitionAlternative - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Word-specific information for recognized words. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio, - # and corresponding to the start of the spoken word. - # This field is only set if `enable_word_time_offsets=true` and only - # in the top hypothesis. - # This is an experimental feature and the accuracy of the time offset can - # vary. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio, - # and corresponding to the end of the spoken word. - # This field is only set if `enable_word_time_offsets=true` and only - # in the top hypothesis. - # This is an experimental feature and the accuracy of the time offset can - # vary. - # @!attribute [rw] word - # @return [::String] - # The word corresponding to this set of information. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence estimate between 0.0 and 1.0. A higher number - # indicates an estimated greater likelihood that the recognized words are - # correct. This field is set only for the top alternative of a non-streaming - # result or, of a streaming result where `is_final=true`. - # This field is not guaranteed to be accurate and users should not rely on it - # to be always provided. - # The default of 0.0 is a sentinel value indicating `confidence` was not set. - # @!attribute [r] speaker_tag - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Output only. A distinct integer value is assigned for every speaker within - # the audio. This field specifies which one of those speakers was detected to - # have spoken this word. Value ranges from '1' to diarization_speaker_count. - # speaker_tag is set if enable_speaker_diarization = 'true' and only for the - # top alternative. - # Note: Use speaker_label instead. - # @!attribute [r] speaker_label - # @return [::String] - # Output only. A label value assigned for every unique speaker within the - # audio. This field specifies which speaker was detected to have spoken this - # word. For some models, like medical_conversation this can be actual speaker - # role, for example "patient" or "provider", but generally this would be a - # number identifying a speaker. This field is only set if - # enable_speaker_diarization = 'true' and only for the top alternative. - class WordInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information on speech adaptation use in results - # @!attribute [rw] adaptation_timeout - # @return [::Boolean] - # Whether there was a timeout when applying speech adaptation. If true, - # adaptation had no effect in the response transcript. - # @!attribute [rw] timeout_message - # @return [::String] - # If set, returns a message specifying which part of the speech adaptation - # request timed out. - class SpeechAdaptationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech_adaptation.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech_adaptation.rb deleted file mode 100644 index 73416b556c1c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/cloud_speech_adaptation.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! - - -module Google - module Cloud - module Speech - module V1 - # Message sent by the client for the `CreatePhraseSet` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this phrase set will be created. - # Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] phrase_set_id - # @return [::String] - # Required. The ID to use for the phrase set, which will become the final - # component of the phrase set's resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @!attribute [rw] phrase_set - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # Required. The phrase set to create. - class CreatePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `UpdatePhraseSet` method. - # @!attribute [rw] phrase_set - # @return [::Google::Cloud::Speech::V1::PhraseSet] - # Required. The phrase set to update. - # - # The phrase set's `name` field is used to identify the set to be - # updated. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdatePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `GetPhraseSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the phrase set to retrieve. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - class GetPhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `ListPhraseSet` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of phrase set. Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of phrase sets to return. The service may return - # fewer than this value. If unspecified, at most 50 phrase sets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListPhraseSet` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPhraseSet` must - # match the call that provided the page token. - class ListPhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned to the client by the `ListPhraseSet` method. - # @!attribute [rw] phrase_sets - # @return [::Array<::Google::Cloud::Speech::V1::PhraseSet>] - # The phrase set. - # @!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 ListPhraseSetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `DeletePhraseSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the phrase set to delete. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - class DeletePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `CreateCustomClass` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this custom class will be created. - # Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] custom_class_id - # @return [::String] - # Required. The ID to use for the custom class, which will become the final - # component of the custom class' resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @!attribute [rw] custom_class - # @return [::Google::Cloud::Speech::V1::CustomClass] - # Required. The custom class to create. - class CreateCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `UpdateCustomClass` method. - # @!attribute [rw] custom_class - # @return [::Google::Cloud::Speech::V1::CustomClass] - # Required. The custom class to update. - # - # The custom class's `name` field is used to identify the custom class to be - # updated. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `GetCustomClass` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the custom class to retrieve. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - class GetCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `ListCustomClasses` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of custom classes. Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of custom classes to return. The service may return - # fewer than this value. If unspecified, at most 50 custom classes will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListCustomClass` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCustomClass` must - # match the call that provided the page token. - class ListCustomClassesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned to the client by the `ListCustomClasses` method. - # @!attribute [rw] custom_classes - # @return [::Array<::Google::Cloud::Speech::V1::CustomClass>] - # The custom classes. - # @!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 ListCustomClassesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `DeleteCustomClass` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the custom class to delete. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - class DeleteCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/resource.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/resource.rb deleted file mode 100644 index 91ddc97572db..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/cloud/speech/v1/resource.rb +++ /dev/null @@ -1,185 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Speech - module V1 - # A set of words or phrases that represents a common concept likely to appear - # in your audio, for example a list of passenger ship names. CustomClass items - # can be substituted into placeholders that you set in PhraseSet phrases. - # @!attribute [rw] name - # @return [::String] - # The resource name of the custom class. - # @!attribute [rw] custom_class_id - # @return [::String] - # If this custom class is a resource, the custom_class_id is the resource id - # of the CustomClass. Case sensitive. - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::Speech::V1::CustomClass::ClassItem>] - # A collection of class items. - class CustomClass - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An item of the class. - # @!attribute [rw] value - # @return [::String] - # The class item's value. - class ClassItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Provides "hints" to the speech recognizer to favor specific words and phrases - # in the results. - # @!attribute [rw] name - # @return [::String] - # The resource name of the phrase set. - # @!attribute [rw] phrases - # @return [::Array<::Google::Cloud::Speech::V1::PhraseSet::Phrase>] - # A list of word and phrases. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Positive value will increase the probability that a specific - # phrase will be recognized over other similar sounding phrases. The higher - # the boost, the higher the chance of false positive recognition as well. - # Negative boost values would correspond to anti-biasing. Anti-biasing is not - # enabled, so negative boost will simply be ignored. Though `boost` can - # accept a wide range of positive values, most use cases are best served with - # values between 0 (exclusive) and 20. We recommend using a binary search - # approach to finding the optimal value for your use case as well as adding - # phrases both with and without boost to your requests. - class PhraseSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A phrases containing words and phrase "hints" so that - # the speech recognition is more likely to recognize them. This can be used - # to improve the accuracy for specific words and phrases, for example, if - # specific commands are typically spoken by the user. This can also be used - # to add additional words to the vocabulary of the recognizer. See - # [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - # - # List items can also include pre-built or custom classes containing groups - # of words that represent common concepts that occur in natural language. For - # example, rather than providing a phrase hint for every month of the - # year (e.g. "i was born in january", "i was born in febuary", ...), use the - # pre-built `$MONTH` class improves the likelihood of correctly transcribing - # audio that includes months (e.g. "i was born in $month"). - # To refer to pre-built classes, use the class' symbol prepended with `$` - # e.g. `$MONTH`. To refer to custom classes that were defined inline in the - # request, set the class's `custom_class_id` to a string unique to all class - # resources and inline classes. Then use the class' id wrapped in $`{...}` - # e.g. "$\\{my-months}". To refer to custom classes resources, use the class' - # id wrapped in `${}` (e.g. `${my-months}`). - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] value - # @return [::String] - # The phrase itself. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Overrides the boost set at the phrase set level. - # Positive value will increase the probability that a specific phrase will - # be recognized over other similar sounding phrases. The higher the boost, - # the higher the chance of false positive recognition as well. Negative - # boost will simply be ignored. Though `boost` can accept a wide range of - # positive values, most use cases are best served - # with values between 0 and 20. We recommend using a binary search approach - # to finding the optimal value for your use case as well as adding - # phrases both with and without boost to your requests. - class Phrase - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Speech adaptation configuration. - # @!attribute [rw] phrase_sets - # @return [::Array<::Google::Cloud::Speech::V1::PhraseSet>] - # A collection of phrase sets. To specify the hints inline, leave the - # phrase set's `name` blank and fill in the rest of its fields. Any - # phrase set can use any custom class. - # @!attribute [rw] phrase_set_references - # @return [::Array<::String>] - # A collection of phrase set resource names to use. - # @!attribute [rw] custom_classes - # @return [::Array<::Google::Cloud::Speech::V1::CustomClass>] - # A collection of custom classes. To specify the classes inline, leave the - # class' `name` blank and fill in the rest of its fields, giving it a unique - # `custom_class_id`. Refer to the inline defined class in phrase hints by its - # `custom_class_id`. - # @!attribute [rw] abnf_grammar - # @return [::Google::Cloud::Speech::V1::SpeechAdaptation::ABNFGrammar] - # Augmented Backus-Naur form (ABNF) is a standardized grammar notation - # comprised by a set of derivation rules. - # See specifications: https://www.w3.org/TR/speech-grammar - class SpeechAdaptation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] abnf_strings - # @return [::Array<::String>] - # All declarations and rules of an ABNF grammar broken up into multiple - # strings that will end up concatenated. - class ABNFGrammar - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Transcription normalization configuration. Use transcription normalization - # to automatically replace parts of the transcript with phrases of your - # choosing. For StreamingRecognize, this normalization only applies to stable - # partial transcripts (stability > 0.8) and final transcripts. - # @!attribute [rw] entries - # @return [::Array<::Google::Cloud::Speech::V1::TranscriptNormalization::Entry>] - # A list of replacement entries. We will perform replacement with one entry - # at a time. For example, the second entry in ["cat" => "dog", "mountain cat" - # => "mountain dog"] will never be applied because we will always process the - # first entry before it. At most 100 entries. - class TranscriptNormalization - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single replacement configuration. - # @!attribute [rw] search - # @return [::String] - # What to replace. Max length is 100 characters. - # @!attribute [rw] replace - # @return [::String] - # What to replace with. Max length is 100 characters. - # @!attribute [rw] case_sensitive - # @return [::Boolean] - # Whether the search is case sensitive. - class Entry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 9a7c0269fa42..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-speech-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-speech-v1/snippets/Gemfile deleted file mode 100644 index cbcc9d84c51b..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v1", path: "../" -else - gem "google-cloud-speech-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-speech-v1/snippets/adaptation/create_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb deleted file mode 100644 index fc51d3e2daca..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Adaptation_CreateCustomClass_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the create_custom_class call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#create_custom_class. -# -def create_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::CreateCustomClassRequest.new - - # Call the create_custom_class method. - result = client.create_custom_class request - - # The returned object is of type Google::Cloud::Speech::V1::CustomClass. - p result -end -# [END speech_v1_generated_Adaptation_CreateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb deleted file mode 100644 index 7240501837bc..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Adaptation_CreatePhraseSet_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the create_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#create_phrase_set. -# -def create_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::CreatePhraseSetRequest.new - - # Call the create_phrase_set method. - result = client.create_phrase_set request - - # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. - p result -end -# [END speech_v1_generated_Adaptation_CreatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb deleted file mode 100644 index 29e6c8d7cfb2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Adaptation_DeleteCustomClass_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the delete_custom_class call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#delete_custom_class. -# -def delete_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::DeleteCustomClassRequest.new - - # Call the delete_custom_class method. - result = client.delete_custom_class request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END speech_v1_generated_Adaptation_DeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb deleted file mode 100644 index b2c8ad998b0b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Adaptation_DeletePhraseSet_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the delete_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#delete_phrase_set. -# -def delete_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::DeletePhraseSetRequest.new - - # Call the delete_phrase_set method. - result = client.delete_phrase_set request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END speech_v1_generated_Adaptation_DeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb deleted file mode 100644 index 087735c5f1c5..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Adaptation_GetCustomClass_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the get_custom_class call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#get_custom_class. -# -def get_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::GetCustomClassRequest.new - - # Call the get_custom_class method. - result = client.get_custom_class request - - # The returned object is of type Google::Cloud::Speech::V1::CustomClass. - p result -end -# [END speech_v1_generated_Adaptation_GetCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb deleted file mode 100644 index 25a23e7f955f..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Adaptation_GetPhraseSet_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the get_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#get_phrase_set. -# -def get_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::GetPhraseSetRequest.new - - # Call the get_phrase_set method. - result = client.get_phrase_set request - - # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. - p result -end -# [END speech_v1_generated_Adaptation_GetPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb deleted file mode 100644 index dacfa57bd4ff..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.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 speech_v1_generated_Adaptation_ListCustomClasses_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the list_custom_classes call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#list_custom_classes. -# -def list_custom_classes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::ListCustomClassesRequest.new - - # Call the list_custom_classes method. - result = client.list_custom_classes request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Speech::V1::CustomClass. - p item - end -end -# [END speech_v1_generated_Adaptation_ListCustomClasses_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb deleted file mode 100644 index 44d69fb6efab..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.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 speech_v1_generated_Adaptation_ListPhraseSet_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the list_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#list_phrase_set. -# -def list_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::ListPhraseSetRequest.new - - # Call the list_phrase_set method. - result = client.list_phrase_set request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Speech::V1::PhraseSet. - p item - end -end -# [END speech_v1_generated_Adaptation_ListPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb deleted file mode 100644 index 2d1b25dcb582..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Adaptation_UpdateCustomClass_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the update_custom_class call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#update_custom_class. -# -def update_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::UpdateCustomClassRequest.new - - # Call the update_custom_class method. - result = client.update_custom_class request - - # The returned object is of type Google::Cloud::Speech::V1::CustomClass. - p result -end -# [END speech_v1_generated_Adaptation_UpdateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb deleted file mode 100644 index ff2decbbb48a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Adaptation_UpdatePhraseSet_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the update_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Adaptation::Client#update_phrase_set. -# -def update_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new - - # Call the update_phrase_set method. - result = client.update_phrase_set request - - # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. - p result -end -# [END speech_v1_generated_Adaptation_UpdatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json b/owl-bot-staging/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json deleted file mode 100644 index 356aec9f11f2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json +++ /dev/null @@ -1,535 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-speech-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.speech.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "speech_v1_generated_Speech_Recognize_sync", - "title": "Snippet for the recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Speech::Client#recognize.", - "file": "speech/recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "recognize", - "full_name": "::Google::Cloud::Speech::V1::Speech::Client#recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::RecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::RecognizeResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V1::Speech::Client" - }, - "method": { - "short_name": "Recognize", - "full_name": "google.cloud.speech.v1.Speech.Recognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v1.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Speech_LongRunningRecognize_sync", - "title": "Snippet for the long_running_recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Speech::Client#long_running_recognize.", - "file": "speech/long_running_recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "long_running_recognize", - "full_name": "::Google::Cloud::Speech::V1::Speech::Client#long_running_recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::LongRunningRecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V1::Speech::Client" - }, - "method": { - "short_name": "LongRunningRecognize", - "full_name": "google.cloud.speech.v1.Speech.LongRunningRecognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v1.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Speech_StreamingRecognize_sync", - "title": "Snippet for the streaming_recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Speech::Client#streaming_recognize.", - "file": "speech/streaming_recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_recognize", - "full_name": "::Google::Cloud::Speech::V1::Speech::Client#streaming_recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::StreamingRecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::StreamingRecognizeResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V1::Speech::Client" - }, - "method": { - "short_name": "StreamingRecognize", - "full_name": "google.cloud.speech.v1.Speech.StreamingRecognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v1.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_CreatePhraseSet_sync", - "title": "Snippet for the create_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#create_phrase_set.", - "file": "adaptation/create_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_phrase_set", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#create_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::CreatePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::PhraseSet", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "CreatePhraseSet", - "full_name": "google.cloud.speech.v1.Adaptation.CreatePhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_GetPhraseSet_sync", - "title": "Snippet for the get_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#get_phrase_set.", - "file": "adaptation/get_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_phrase_set", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#get_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::GetPhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::PhraseSet", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "GetPhraseSet", - "full_name": "google.cloud.speech.v1.Adaptation.GetPhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_ListPhraseSet_sync", - "title": "Snippet for the list_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#list_phrase_set.", - "file": "adaptation/list_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_phrase_set", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#list_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::ListPhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::ListPhraseSetResponse", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "ListPhraseSet", - "full_name": "google.cloud.speech.v1.Adaptation.ListPhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_UpdatePhraseSet_sync", - "title": "Snippet for the update_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#update_phrase_set.", - "file": "adaptation/update_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_phrase_set", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#update_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::UpdatePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::PhraseSet", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "UpdatePhraseSet", - "full_name": "google.cloud.speech.v1.Adaptation.UpdatePhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_DeletePhraseSet_sync", - "title": "Snippet for the delete_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#delete_phrase_set.", - "file": "adaptation/delete_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_phrase_set", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#delete_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::DeletePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "DeletePhraseSet", - "full_name": "google.cloud.speech.v1.Adaptation.DeletePhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_CreateCustomClass_sync", - "title": "Snippet for the create_custom_class call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#create_custom_class.", - "file": "adaptation/create_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_custom_class", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#create_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::CreateCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::CustomClass", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "CreateCustomClass", - "full_name": "google.cloud.speech.v1.Adaptation.CreateCustomClass", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_GetCustomClass_sync", - "title": "Snippet for the get_custom_class call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#get_custom_class.", - "file": "adaptation/get_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_custom_class", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#get_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::GetCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::CustomClass", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "GetCustomClass", - "full_name": "google.cloud.speech.v1.Adaptation.GetCustomClass", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_ListCustomClasses_sync", - "title": "Snippet for the list_custom_classes call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#list_custom_classes.", - "file": "adaptation/list_custom_classes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_custom_classes", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#list_custom_classes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::ListCustomClassesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::ListCustomClassesResponse", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "ListCustomClasses", - "full_name": "google.cloud.speech.v1.Adaptation.ListCustomClasses", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_UpdateCustomClass_sync", - "title": "Snippet for the update_custom_class call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#update_custom_class.", - "file": "adaptation/update_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_custom_class", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#update_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::UpdateCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1::CustomClass", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "UpdateCustomClass", - "full_name": "google.cloud.speech.v1.Adaptation.UpdateCustomClass", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1_generated_Adaptation_DeleteCustomClass_sync", - "title": "Snippet for the delete_custom_class call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1::Adaptation::Client#delete_custom_class.", - "file": "adaptation/delete_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_custom_class", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client#delete_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1::DeleteCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1::Adaptation::Client" - }, - "method": { - "short_name": "DeleteCustomClass", - "full_name": "google.cloud.speech.v1.Adaptation.DeleteCustomClass", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1.Adaptation" - } - } - }, - "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-speech-v1/snippets/speech/long_running_recognize.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb deleted file mode 100644 index 5b94dc5d192e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Speech_LongRunningRecognize_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the long_running_recognize call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Speech::Client#long_running_recognize. -# -def long_running_recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new - - # Call the long_running_recognize method. - result = client.long_running_recognize request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v1_generated_Speech_LongRunningRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/speech/recognize.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/speech/recognize.rb deleted file mode 100644 index 20864502c3ca..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/speech/recognize.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1_generated_Speech_Recognize_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the recognize call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Speech::Client#recognize. -# -def recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1::RecognizeRequest.new - - # Call the recognize method. - result = client.recognize request - - # The returned object is of type Google::Cloud::Speech::V1::RecognizeResponse. - p result -end -# [END speech_v1_generated_Speech_Recognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb b/owl-bot-staging/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb deleted file mode 100644 index fa73922ac483..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/snippets/speech/streaming_recognize.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! - -# [START speech_v1_generated_Speech_StreamingRecognize_sync] -require "google/cloud/speech/v1" - -## -# Snippet for the streaming_recognize call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1::Speech::Client#streaming_recognize. -# -def streaming_recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1::Speech::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the streaming_recognize method to start streaming. - output = client.streaming_recognize input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new - input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Speech::V1::StreamingRecognizeResponse - output.each do |current_response| - p current_response - end -end -# [END speech_v1_generated_Speech_StreamingRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb deleted file mode 100644 index 952b7e04e59a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_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/speech/v1/adaptation" - -class ::Google::Cloud::Speech::V1::Adaptation::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_custom_class_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" - assert_equal "projects/value0/locations/value1/customClasses/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::Speech::V1::Adaptation::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_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb deleted file mode 100644 index 5e53064c446b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb +++ /dev/null @@ -1,649 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/speech/v1/cloud_speech_adaptation_pb" -require "google/cloud/speech/v1/adaptation/rest" - - -class ::Google::Cloud::Speech::V1::Adaptation::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_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V1::PhraseSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - phrase_set_id = "hello world" - phrase_set = {} - - create_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_create_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_phrase_set parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_phrase_set ::Google::Cloud::Speech::V1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_phrase_set(::Google::Cloud::Speech::V1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_phrase_set_client_stub.call_count - end - end - end - - def test_get_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V1::PhraseSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_get_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_phrase_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_phrase_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_phrase_set ::Google::Cloud::Speech::V1::GetPhraseSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_phrase_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_phrase_set(::Google::Cloud::Speech::V1::GetPhraseSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_phrase_set_client_stub.call_count - end - end - end - - def test_list_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V1::ListPhraseSetResponse.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_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_list_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_phrase_set({ 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_phrase_set 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_phrase_set ::Google::Cloud::Speech::V1::ListPhraseSetRequest.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_phrase_set({ 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_phrase_set(::Google::Cloud::Speech::V1::ListPhraseSetRequest.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_phrase_set_client_stub.call_count - end - end - end - - def test_update_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V1::PhraseSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - phrase_set = {} - update_mask = {} - - update_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_update_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_phrase_set ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_phrase_set(::Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_phrase_set_client_stub.call_count - end - end - end - - def test_delete_phrase_set - # 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_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_delete_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_phrase_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_phrase_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_phrase_set ::Google::Cloud::Speech::V1::DeletePhraseSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_phrase_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_phrase_set(::Google::Cloud::Speech::V1::DeletePhraseSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_phrase_set_client_stub.call_count - end - end - end - - def test_create_custom_class - # Create test objects. - client_result = ::Google::Cloud::Speech::V1::CustomClass.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - custom_class_id = "hello world" - custom_class = {} - - create_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_create_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_custom_class parent: parent, custom_class_id: custom_class_id, custom_class: custom_class do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_custom_class ::Google::Cloud::Speech::V1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_custom_class(::Google::Cloud::Speech::V1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_custom_class_client_stub.call_count - end - end - end - - def test_get_custom_class - # Create test objects. - client_result = ::Google::Cloud::Speech::V1::CustomClass.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_get_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_custom_class({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_custom_class name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_custom_class ::Google::Cloud::Speech::V1::GetCustomClassRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_custom_class({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_custom_class(::Google::Cloud::Speech::V1::GetCustomClassRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_custom_class_client_stub.call_count - end - end - end - - def test_list_custom_classes - # Create test objects. - client_result = ::Google::Cloud::Speech::V1::ListCustomClassesResponse.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_custom_classes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_list_custom_classes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_custom_classes_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_custom_classes({ 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_custom_classes 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_custom_classes ::Google::Cloud::Speech::V1::ListCustomClassesRequest.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_custom_classes({ 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_custom_classes(::Google::Cloud::Speech::V1::ListCustomClassesRequest.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_custom_classes_client_stub.call_count - end - end - end - - def test_update_custom_class - # Create test objects. - client_result = ::Google::Cloud::Speech::V1::CustomClass.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - custom_class = {} - update_mask = {} - - update_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_update_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_custom_class custom_class: custom_class, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_custom_class ::Google::Cloud::Speech::V1::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_custom_class(::Google::Cloud::Speech::V1::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_custom_class_client_stub.call_count - end - end - end - - def test_delete_custom_class - # 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_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Adaptation::Rest::ServiceStub.stub :transcode_delete_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_custom_class({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_custom_class name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_custom_class ::Google::Cloud::Speech::V1::DeleteCustomClassRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_custom_class({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_custom_class(::Google::Cloud::Speech::V1::DeleteCustomClassRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_custom_class_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::Speech::V1::Adaptation::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::Speech::V1::Adaptation::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb deleted file mode 100644 index a5b12ab7a6d9..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb +++ /dev/null @@ -1,714 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/speech/v1/cloud_speech_adaptation_pb" -require "google/cloud/speech/v1/adaptation" - -class ::Google::Cloud::Speech::V1::Adaptation::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_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::PhraseSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - phrase_set_id = "hello world" - phrase_set = {} - - create_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1::CreatePhraseSetRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["phrase_set_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::PhraseSet), request["phrase_set"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_phrase_set parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_phrase_set ::Google::Cloud::Speech::V1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_phrase_set(::Google::Cloud::Speech::V1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_phrase_set_client_stub.call_rpc_count - end - end - - def test_get_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::PhraseSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1::GetPhraseSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_phrase_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_phrase_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_phrase_set ::Google::Cloud::Speech::V1::GetPhraseSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_phrase_set({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_phrase_set(::Google::Cloud::Speech::V1::GetPhraseSetRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_phrase_set_client_stub.call_rpc_count - end - end - - def test_list_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::ListPhraseSetResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1::ListPhraseSetRequest, 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_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_phrase_set({ parent: parent, page_size: page_size, page_token: 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_phrase_set parent: parent, page_size: page_size, page_token: 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_phrase_set ::Google::Cloud::Speech::V1::ListPhraseSetRequest.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_phrase_set({ parent: parent, page_size: page_size, page_token: page_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_phrase_set(::Google::Cloud::Speech::V1::ListPhraseSetRequest.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_phrase_set_client_stub.call_rpc_count - end - end - - def test_update_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::PhraseSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - phrase_set = {} - update_mask = {} - - update_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::PhraseSet), request["phrase_set"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_phrase_set ::Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set({ phrase_set: phrase_set, 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_phrase_set(::Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set_client_stub.call_rpc_count - end - end - - def test_delete_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1::DeletePhraseSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_phrase_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_phrase_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_phrase_set ::Google::Cloud::Speech::V1::DeletePhraseSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_phrase_set({ 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_phrase_set(::Google::Cloud::Speech::V1::DeletePhraseSetRequest.new(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_phrase_set_client_stub.call_rpc_count - end - end - - def test_create_custom_class - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::CustomClass.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - custom_class_id = "hello world" - custom_class = {} - - create_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V1::CreateCustomClassRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["custom_class_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::CustomClass), request["custom_class"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_custom_class parent: parent, custom_class_id: custom_class_id, custom_class: custom_class do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_custom_class ::Google::Cloud::Speech::V1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_custom_class(::Google::Cloud::Speech::V1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_custom_class_client_stub.call_rpc_count - end - end - - def test_get_custom_class - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::CustomClass.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V1::GetCustomClassRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_custom_class({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_custom_class name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_custom_class ::Google::Cloud::Speech::V1::GetCustomClassRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_custom_class({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_custom_class(::Google::Cloud::Speech::V1::GetCustomClassRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_custom_class_client_stub.call_rpc_count - end - end - - def test_list_custom_classes - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::ListCustomClassesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_custom_classes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_custom_classes, name - assert_kind_of ::Google::Cloud::Speech::V1::ListCustomClassesRequest, 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_custom_classes_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: 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_custom_classes parent: parent, page_size: page_size, page_token: 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_custom_classes ::Google::Cloud::Speech::V1::ListCustomClassesRequest.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_custom_classes({ parent: parent, page_size: page_size, page_token: page_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_custom_classes(::Google::Cloud::Speech::V1::ListCustomClassesRequest.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_custom_classes_client_stub.call_rpc_count - end - end - - def test_update_custom_class - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::CustomClass.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - custom_class = {} - update_mask = {} - - update_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V1::UpdateCustomClassRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::CustomClass), request["custom_class"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_custom_class custom_class: custom_class, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_custom_class ::Google::Cloud::Speech::V1::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class({ custom_class: custom_class, 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_custom_class(::Google::Cloud::Speech::V1::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class_client_stub.call_rpc_count - end - end - - def test_delete_custom_class - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V1::DeleteCustomClassRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_custom_class({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_custom_class name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_custom_class ::Google::Cloud::Speech::V1::DeleteCustomClassRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_custom_class({ 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_custom_class(::Google::Cloud::Speech::V1::DeleteCustomClassRequest.new(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_custom_class_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V1::Adaptation::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::Speech::V1::Adaptation::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::Speech::V1::Adaptation::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Speech::V1::Adaptation::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb deleted file mode 100644 index dd3639fdf7b9..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_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/speech/v1/cloud_speech_pb" -require "google/cloud/speech/v1/cloud_speech_services_pb" -require "google/cloud/speech/v1/speech" - -class ::Google::Cloud::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb deleted file mode 100644 index f90ecd2284cc..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_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/speech/v1/speech" - -class ::Google::Cloud::Speech::V1::Speech::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_custom_class_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" - assert_equal "projects/value0/locations/value1/customClasses/value2", path - end - end - - def test_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb deleted file mode 100644 index f6fc60db3501..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb +++ /dev/null @@ -1,210 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/speech/v1/cloud_speech_pb" -require "google/cloud/speech/v1/speech/rest" - - -class ::Google::Cloud::Speech::V1::Speech::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_recognize - # Create test objects. - client_result = ::Google::Cloud::Speech::V1::RecognizeResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - config = {} - audio = {} - - recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Speech::Rest::ServiceStub.stub :transcode_recognize_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.recognize({ config: config, audio: audio }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.recognize config: config, audio: audio do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.recognize ::Google::Cloud::Speech::V1::RecognizeRequest.new(config: config, audio: audio) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.recognize({ config: config, audio: audio }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.recognize(::Google::Cloud::Speech::V1::RecognizeRequest.new(config: config, audio: audio), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, recognize_client_stub.call_count - end - end - end - - def test_long_running_recognize - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - config = {} - audio = {} - output_config = {} - - long_running_recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1::Speech::Rest::ServiceStub.stub :transcode_long_running_recognize_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, long_running_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.long_running_recognize({ config: config, audio: audio, output_config: output_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.long_running_recognize config: config, audio: audio, output_config: output_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.long_running_recognize ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.long_running_recognize({ config: config, audio: audio, output_config: output_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.long_running_recognize(::Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, long_running_recognize_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::Speech::V1::Speech::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::Speech::V1::Speech::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb b/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb deleted file mode 100644 index 31036f772d1f..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb +++ /dev/null @@ -1,334 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/speech/v1/cloud_speech_pb" -require "google/cloud/speech/v1/speech" - -class ::Google::Cloud::Speech::V1::Speech::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_recognize - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::RecognizeResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - config = {} - audio = {} - - recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :recognize, name - assert_kind_of ::Google::Cloud::Speech::V1::RecognizeRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::RecognitionConfig), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::RecognitionAudio), request["audio"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.recognize({ config: config, audio: audio }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.recognize config: config, audio: audio do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.recognize ::Google::Cloud::Speech::V1::RecognizeRequest.new(config: config, audio: audio) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.recognize({ config: config, audio: audio }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.recognize(::Google::Cloud::Speech::V1::RecognizeRequest.new(config: config, audio: audio), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, recognize_client_stub.call_rpc_count - end - end - - def test_long_running_recognize - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - config = {} - audio = {} - output_config = {} - - long_running_recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :long_running_recognize, name - assert_kind_of ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::RecognitionConfig), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::RecognitionAudio), request["audio"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::TranscriptOutputConfig), request["output_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, long_running_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.long_running_recognize({ config: config, audio: audio, output_config: output_config }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.long_running_recognize config: config, audio: audio, output_config: output_config do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.long_running_recognize ::Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.long_running_recognize({ config: config, audio: audio, output_config: output_config }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.long_running_recognize(::Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, long_running_recognize_client_stub.call_rpc_count - end - end - - def test_streaming_recognize - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1::StreamingRecognizeResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a bidi streaming method. - streaming_config = {} - - streaming_recognize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_recognize, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, streaming_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V1::StreamingRecognizeRequest.new streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_recognize enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V1::StreamingRecognizeRequest.new streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_recognize stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V1::StreamingRecognizeRequest.new streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_recognize enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V1::StreamingRecognizeRequest.new streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_recognize stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, streaming_recognize_client_stub.call_rpc_count - streaming_recognize_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1::StreamingRecognizeRequest, r - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1::StreamingRecognitionConfig), r["streaming_config"] - assert_equal :streaming_config, r.streaming_request - end - end - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V1::Speech::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::Speech::V1::Speech::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::Speech::V1::Speech::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Speech::V1::Speech::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::Speech::V1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Speech::V1::Speech::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1/test/helper.rb b/owl-bot-staging/google-cloud-speech-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.gitignore b/owl-bot-staging/google-cloud-speech-v1p1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-speech-v1p1beta1/.repo-metadata.json deleted file mode 100644 index 0f33931b5a91..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "speech.googleapis.com", - "api_shortname": "speech", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1p1beta1/latest", - "distribution_name": "google-cloud-speech-v1p1beta1", - "is_cloud": true, - "language": "ruby", - "name": "speech", - "name_pretty": "Cloud Speech-to-Text V1p1beta1 API", - "product_documentation": "https://cloud.google.com/speech-to-text", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v1p1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SPEECH", - "ruby-cloud-product-url": "https://cloud.google.com/speech-to-text", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-speech-v1p1beta1/.rubocop.yml deleted file mode 100644 index 6e64dd5a1ded..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-speech-v1p1beta1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-speech-v1p1beta1.rb" diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.toys.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/.yardopts b/owl-bot-staging/google-cloud-speech-v1p1beta1/.yardopts deleted file mode 100644 index 5265c1e63603..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Speech-to-Text V1p1beta1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/AUTHENTICATION.md deleted file mode 100644 index 234cd17b2900..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-speech-v1p1beta1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-speech-v1p1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/speech/v1p1beta1" - -client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/speech/v1p1beta1" - -::Google::Cloud::Speech::V1p1beta1::Speech::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Speech::V1p1beta1::Speech::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-speech-v1p1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/speech/v1p1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Speech::V1p1beta1::Speech::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-speech-v1p1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/Gemfile b/owl-bot-staging/google-cloud-speech-v1p1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/LICENSE.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/README.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/README.md deleted file mode 100644 index fb487dc9164c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Speech-to-Text V1p1beta1 API - -Converts audio to text by applying powerful neural network models. - -Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. - -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 Speech-to-Text V1p1beta1 API. Most users should consider using -the main client gem, -[google-cloud-speech](https://rubygems.org/gems/google-cloud-speech). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-speech-v1p1beta1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/speech.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/speech/v1p1beta1" - -client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new -request = ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new # (request fields as keyword arguments...) -response = client.recognize request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v1p1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/speech-to-text) -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/speech/v1p1beta1" -require "logger" - -client = ::Google::Cloud::Speech::V1p1beta1::Speech::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-speech`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-speech-v1p1beta1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-speech`. -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-speech-v1p1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/Rakefile b/owl-bot-staging/google-cloud-speech-v1p1beta1/Rakefile deleted file mode 100644 index 0e12b1140bcd..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-speech-v1p1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SPEECH_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SPEECH_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SPEECH_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 SPEECH_TEST_PROJECT=test123 SPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/speech/v1p1beta1/speech/credentials" - ::Google::Cloud::Speech::V1p1beta1::Speech::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SPEECH_PROJECT"] = project - ENV["SPEECH_TEST_PROJECT"] = project - ENV["SPEECH_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-speech-v1p1beta1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-speech-v1p1beta1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-speech-v1p1beta1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-speech-v1p1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-speech-v1p1beta1" - header "google-cloud-speech-v1p1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-speech-v1p1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-speech-v1p1beta1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-speech-v1p1beta1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-speech-v1p1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-speech-v1p1beta1/gapic_metadata.json deleted file mode 100644 index 763b43de9241..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/gapic_metadata.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.speech.v1p1beta1", - "libraryPackage": "::Google::Cloud::Speech::V1p1beta1", - "services": { - "Speech": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Speech::V1p1beta1::Speech::Client", - "rpcs": { - "Recognize": { - "methods": [ - "recognize" - ] - }, - "LongRunningRecognize": { - "methods": [ - "long_running_recognize" - ] - }, - "StreamingRecognize": { - "methods": [ - "streaming_recognize" - ] - } - } - } - } - }, - "Adaptation": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client", - "rpcs": { - "CreatePhraseSet": { - "methods": [ - "create_phrase_set" - ] - }, - "GetPhraseSet": { - "methods": [ - "get_phrase_set" - ] - }, - "ListPhraseSet": { - "methods": [ - "list_phrase_set" - ] - }, - "UpdatePhraseSet": { - "methods": [ - "update_phrase_set" - ] - }, - "DeletePhraseSet": { - "methods": [ - "delete_phrase_set" - ] - }, - "CreateCustomClass": { - "methods": [ - "create_custom_class" - ] - }, - "GetCustomClass": { - "methods": [ - "get_custom_class" - ] - }, - "ListCustomClasses": { - "methods": [ - "list_custom_classes" - ] - }, - "UpdateCustomClass": { - "methods": [ - "update_custom_class" - ] - }, - "DeleteCustomClass": { - "methods": [ - "delete_custom_class" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/google-cloud-speech-v1p1beta1.gemspec b/owl-bot-staging/google-cloud-speech-v1p1beta1/google-cloud-speech-v1p1beta1.gemspec deleted file mode 100644 index c7097081b744..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/google-cloud-speech-v1p1beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/speech/v1p1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-speech-v1p1beta1" - gem.version = Google::Cloud::Speech::V1p1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v1p1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details." - gem.summary = "Converts audio to text by applying powerful neural network models." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google-cloud-speech-v1p1beta1.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google-cloud-speech-v1p1beta1.rb deleted file mode 100644 index f30b25947a2c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google-cloud-speech-v1p1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/speech/v1p1beta1" diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1.rb deleted file mode 100644 index 29aac12bfb2a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1.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/speech/v1p1beta1/speech" -require "google/cloud/speech/v1p1beta1/adaptation" -require "google/cloud/speech/v1p1beta1/version" - -module Google - module Cloud - module Speech - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/speech/v1p1beta1" - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/speech/v1p1beta1" - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new - # - module V1p1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1p1beta1", "_helpers.rb" -require "google/cloud/speech/v1p1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation.rb deleted file mode 100644 index 304cdacc9735..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation.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/speech/v1p1beta1/version" - -require "google/cloud/speech/v1p1beta1/adaptation/credentials" -require "google/cloud/speech/v1p1beta1/adaptation/paths" -require "google/cloud/speech/v1p1beta1/adaptation/client" -require "google/cloud/speech/v1p1beta1/adaptation/rest" - -module Google - module Cloud - module Speech - module V1p1beta1 - ## - # Service that implements Google Cloud Speech Adaptation API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/speech/v1p1beta1/adaptation" - # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/speech/v1p1beta1/adaptation/rest" - # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - module Adaptation - end - end - end - end -end - -helper_path = ::File.join __dir__, "adaptation", "helpers.rb" -require "google/cloud/speech/v1p1beta1/adaptation/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb deleted file mode 100644 index 63a6c18a54d5..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb +++ /dev/null @@ -1,1434 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb" - -module Google - module Cloud - module Speech - module V1p1beta1 - module Adaptation - ## - # Client for the Adaptation service. - # - # Service that implements Google Cloud Speech Adaptation API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :adaptation_stub - - ## - # Configure the Adaptation Client class. - # - # See {::Google::Cloud::Speech::V1p1beta1::Adaptation::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Adaptation clients - # ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Speech", "V1p1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Adaptation Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V1p1beta1::Adaptation::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @adaptation_stub.universe_domain - end - - ## - # Create a new Adaptation client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Adaptation 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/speech/v1p1beta1/cloud_speech_adaptation_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 - - @adaptation_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Speech::V1p1beta1::Adaptation::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 - ) - - @adaptation_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 - @adaptation_stub.logger - end - - # Service calls - - ## - # Create a set of phrase hints. Each item in the set can be a single word or - # a multi-word phrase. The items in the PhraseSet are favored by the - # recognition model when you send a call that includes the PhraseSet. - # - # @overload create_phrase_set(request, options = nil) - # Pass arguments to `create_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) - # Pass arguments to `create_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this phrase set will be created. - # Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param phrase_set_id [::String] - # Required. The ID to use for the phrase set, which will become the final - # component of the phrase set's resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @param phrase_set [::Google::Cloud::Speech::V1p1beta1::PhraseSet, ::Hash] - # Required. The phrase set to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new - # - # # Call the create_phrase_set method. - # result = client.create_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. - # p result - # - def create_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest - - # Converts hash and nil to 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :create_phrase_set, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a phrase set. - # - # @overload get_phrase_set(request, options = nil) - # Pass arguments to `get_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_phrase_set(name: nil) - # Pass arguments to `get_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 phrase set to retrieve. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new - # - # # Call the get_phrase_set method. - # result = client.get_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. - # p result - # - def get_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :get_phrase_set, request, 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 phrase sets. - # - # @overload list_phrase_set(request, options = nil) - # Pass arguments to `list_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_phrase_set(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, 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 phrase set. Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param page_size [::Integer] - # The maximum number of phrase sets to return. The service may return - # fewer than this value. If unspecified, at most 50 phrase sets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # A page token, received from a previous `ListPhraseSet` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPhraseSet` 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::Speech::V1p1beta1::PhraseSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::PhraseSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new - # - # # Call the list_phrase_set method. - # result = client.list_phrase_set request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet. - # p item - # end - # - def list_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :list_phrase_set, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_phrase_set, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a phrase set. - # - # @overload update_phrase_set(request, options = nil) - # Pass arguments to `update_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_phrase_set(phrase_set: nil, update_mask: nil) - # Pass arguments to `update_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V1p1beta1::PhraseSet, ::Hash] - # Required. The phrase set to update. - # - # The phrase set's `name` field is used to identify the set to be - # updated. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new - # - # # Call the update_phrase_set method. - # result = client.update_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. - # p result - # - def update_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest - - # Converts hash and nil to 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.phrase_set&.name - header_params["phrase_set.name"] = request.phrase_set.name - end - - request_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_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :update_phrase_set, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a phrase set. - # - # @overload delete_phrase_set(request, options = nil) - # Pass arguments to `delete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_phrase_set(name: nil) - # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 phrase set to delete. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new - # - # # Call the delete_phrase_set method. - # result = client.delete_phrase_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :delete_phrase_set, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a custom class. - # - # @overload create_custom_class(request, options = nil) - # Pass arguments to `create_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) - # Pass arguments to `create_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this custom class will be created. - # Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param custom_class_id [::String] - # Required. The ID to use for the custom class, which will become the final - # component of the custom class' resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @param custom_class [::Google::Cloud::Speech::V1p1beta1::CustomClass, ::Hash] - # Required. The custom class to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new - # - # # Call the create_custom_class method. - # result = client.create_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. - # p result - # - def create_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest - - # Converts hash and nil to 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :create_custom_class, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a custom class. - # - # @overload get_custom_class(request, options = nil) - # Pass arguments to `get_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_custom_class(name: nil) - # Pass arguments to `get_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 custom class to retrieve. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new - # - # # Call the get_custom_class method. - # result = client.get_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. - # p result - # - def get_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :get_custom_class, request, 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 custom classes. - # - # @overload list_custom_classes(request, options = nil) - # Pass arguments to `list_custom_classes` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_custom_classes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, 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 custom classes. Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param page_size [::Integer] - # The maximum number of custom classes to return. The service may return - # fewer than this value. If unspecified, at most 50 custom classes will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # A page token, received from a previous `ListCustomClass` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCustomClass` 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::Speech::V1p1beta1::CustomClass>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::CustomClass>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new - # - # # Call the list_custom_classes method. - # result = client.list_custom_classes request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass. - # p item - # end - # - def list_custom_classes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_custom_classes.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_custom_classes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :list_custom_classes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_custom_classes, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a custom class. - # - # @overload update_custom_class(request, options = nil) - # Pass arguments to `update_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_custom_class(custom_class: nil, update_mask: nil) - # Pass arguments to `update_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V1p1beta1::CustomClass, ::Hash] - # Required. The custom class to update. - # - # The custom class's `name` field is used to identify the custom class to be - # updated. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new - # - # # Call the update_custom_class method. - # result = client.update_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. - # p result - # - def update_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest - - # Converts hash and nil to 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.custom_class&.name - header_params["custom_class.name"] = request.custom_class.name - end - - request_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_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :update_custom_class, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a custom class. - # - # @overload delete_custom_class(request, options = nil) - # Pass arguments to `delete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_custom_class(name: nil) - # Pass arguments to `delete_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 custom class to delete. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new - # - # # Call the delete_custom_class method. - # result = client.delete_custom_class request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.call_rpc :delete_custom_class, request, 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 Adaptation API. - # - # This class represents the configuration for Adaptation, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V1p1beta1::Adaptation::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_phrase_set to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_phrase_set.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_phrase_set.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Speech::V1p1beta1::Adaptation::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Adaptation API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_phrase_set - ## - # RPC-specific configuration for `get_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_phrase_set - ## - # RPC-specific configuration for `list_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :list_phrase_set - ## - # RPC-specific configuration for `update_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_phrase_set - ## - # RPC-specific configuration for `delete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_phrase_set - ## - # RPC-specific configuration for `create_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_class - ## - # RPC-specific configuration for `get_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_class - ## - # RPC-specific configuration for `list_custom_classes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_classes - ## - # RPC-specific configuration for `update_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :update_custom_class - ## - # RPC-specific configuration for `delete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_class - - # @private - def initialize parent_rpcs = nil - create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set - @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config - get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set - @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config - list_phrase_set_config = parent_rpcs.list_phrase_set if parent_rpcs.respond_to? :list_phrase_set - @list_phrase_set = ::Gapic::Config::Method.new list_phrase_set_config - update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set - @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config - delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set - @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config - create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class - @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config - get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class - @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config - list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes - @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config - update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class - @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config - delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class - @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/credentials.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/credentials.rb deleted file mode 100644 index 0752ca8a8cf1..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/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 Speech - module V1p1beta1 - module Adaptation - # Credentials for the Adaptation API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SPEECH_CREDENTIALS", - "SPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPEECH_CREDENTIALS_JSON", - "SPEECH_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-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb deleted file mode 100644 index e5086c847d19..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/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 Speech - module V1p1beta1 - module Adaptation - # Path helper methods for the Adaptation API. - module Paths - ## - # 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 CustomClass resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # @param project [String] - # @param location [String] - # @param custom_class [String] - # - # @return [::String] - def custom_class_path project:, location:, custom_class: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" - 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 PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest.rb deleted file mode 100644 index 06d9364c931d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/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/speech/v1p1beta1/version" - -require "google/cloud/speech/v1p1beta1/adaptation/credentials" -require "google/cloud/speech/v1p1beta1/adaptation/paths" -require "google/cloud/speech/v1p1beta1/adaptation/rest/client" - -module Google - module Cloud - module Speech - module V1p1beta1 - ## - # Service that implements Google Cloud Speech Adaptation API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/speech/v1p1beta1/adaptation/rest" - # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - module Adaptation - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/speech/v1p1beta1/adaptation/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/client.rb deleted file mode 100644 index 25cfba7fdb20..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/client.rb +++ /dev/null @@ -1,1321 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb" -require "google/cloud/speech/v1p1beta1/adaptation/rest/service_stub" - -module Google - module Cloud - module Speech - module V1p1beta1 - module Adaptation - module Rest - ## - # REST client for the Adaptation service. - # - # Service that implements Google Cloud Speech Adaptation API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :adaptation_stub - - ## - # Configure the Adaptation Client class. - # - # See {::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Adaptation clients - # ::Google::Cloud::Speech::V1p1beta1::Adaptation::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", "Speech", "V1p1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Adaptation Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V1p1beta1::Adaptation::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 - @adaptation_stub.universe_domain - end - - ## - # Create a new Adaptation REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Adaptation 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 - - @adaptation_stub = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @adaptation_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 - @adaptation_stub.logger - end - - # Service calls - - ## - # Create a set of phrase hints. Each item in the set can be a single word or - # a multi-word phrase. The items in the PhraseSet are favored by the - # recognition model when you send a call that includes the PhraseSet. - # - # @overload create_phrase_set(request, options = nil) - # Pass arguments to `create_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) - # Pass arguments to `create_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this phrase set will be created. - # Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param phrase_set_id [::String] - # Required. The ID to use for the phrase set, which will become the final - # component of the phrase set's resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @param phrase_set [::Google::Cloud::Speech::V1p1beta1::PhraseSet, ::Hash] - # Required. The phrase set to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new - # - # # Call the create_phrase_set method. - # result = client.create_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. - # p result - # - def create_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest - - # Converts hash and nil to an 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.create_phrase_set request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a phrase set. - # - # @overload get_phrase_set(request, options = nil) - # Pass arguments to `get_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_phrase_set(name: nil) - # Pass arguments to `get_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 phrase set to retrieve. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new - # - # # Call the get_phrase_set method. - # result = client.get_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. - # p result - # - def get_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.get_phrase_set request, 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 phrase sets. - # - # @overload list_phrase_set(request, options = nil) - # Pass arguments to `list_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_phrase_set(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, 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 phrase set. Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param page_size [::Integer] - # The maximum number of phrase sets to return. The service may return - # fewer than this value. If unspecified, at most 50 phrase sets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # A page token, received from a previous `ListPhraseSet` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPhraseSet` 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::Speech::V1p1beta1::PhraseSet>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::PhraseSet>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new - # - # # Call the list_phrase_set method. - # result = client.list_phrase_set request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet. - # p item - # end - # - def list_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.list_phrase_set request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_phrase_set, "phrase_sets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a phrase set. - # - # @overload update_phrase_set(request, options = nil) - # Pass arguments to `update_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_phrase_set(phrase_set: nil, update_mask: nil) - # Pass arguments to `update_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V1p1beta1::PhraseSet, ::Hash] - # Required. The phrase set to update. - # - # The phrase set's `name` field is used to identify the set to be - # updated. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new - # - # # Call the update_phrase_set method. - # result = client.update_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. - # p result - # - def update_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest - - # Converts hash and nil to an 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.update_phrase_set request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a phrase set. - # - # @overload delete_phrase_set(request, options = nil) - # Pass arguments to `delete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_phrase_set(name: nil) - # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 phrase set to delete. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new - # - # # Call the delete_phrase_set method. - # result = client.delete_phrase_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.delete_phrase_set request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a custom class. - # - # @overload create_custom_class(request, options = nil) - # Pass arguments to `create_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) - # Pass arguments to `create_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this custom class will be created. - # Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param custom_class_id [::String] - # Required. The ID to use for the custom class, which will become the final - # component of the custom class' resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @param custom_class [::Google::Cloud::Speech::V1p1beta1::CustomClass, ::Hash] - # Required. The custom class to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new - # - # # Call the create_custom_class method. - # result = client.create_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. - # p result - # - def create_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest - - # Converts hash and nil to an 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.create_custom_class request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a custom class. - # - # @overload get_custom_class(request, options = nil) - # Pass arguments to `get_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_custom_class(name: nil) - # Pass arguments to `get_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 custom class to retrieve. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new - # - # # Call the get_custom_class method. - # result = client.get_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. - # p result - # - def get_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.get_custom_class request, 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 custom classes. - # - # @overload list_custom_classes(request, options = nil) - # Pass arguments to `list_custom_classes` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_custom_classes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, 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 custom classes. Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param page_size [::Integer] - # The maximum number of custom classes to return. The service may return - # fewer than this value. If unspecified, at most 50 custom classes will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # A page token, received from a previous `ListCustomClass` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCustomClass` 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::Speech::V1p1beta1::CustomClass>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::CustomClass>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new - # - # # Call the list_custom_classes method. - # result = client.list_custom_classes request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass. - # p item - # end - # - def list_custom_classes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_custom_classes.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_custom_classes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.list_custom_classes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_custom_classes, "custom_classes", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a custom class. - # - # @overload update_custom_class(request, options = nil) - # Pass arguments to `update_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_custom_class(custom_class: nil, update_mask: nil) - # Pass arguments to `update_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V1p1beta1::CustomClass, ::Hash] - # Required. The custom class to update. - # - # The custom class's `name` field is used to identify the custom class to be - # updated. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new - # - # # Call the update_custom_class method. - # result = client.update_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. - # p result - # - def update_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest - - # Converts hash and nil to an 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.update_custom_class request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a custom class. - # - # @overload delete_custom_class(request, options = nil) - # Pass arguments to `delete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_custom_class(name: nil) - # Pass arguments to `delete_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 custom class to delete. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new - # - # # Call the delete_custom_class method. - # result = client.delete_custom_class request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @adaptation_stub.delete_custom_class request, 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 Adaptation REST API. - # - # This class represents the configuration for Adaptation REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_phrase_set to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_phrase_set.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_phrase_set.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Adaptation API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_phrase_set - ## - # RPC-specific configuration for `get_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_phrase_set - ## - # RPC-specific configuration for `list_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :list_phrase_set - ## - # RPC-specific configuration for `update_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_phrase_set - ## - # RPC-specific configuration for `delete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_phrase_set - ## - # RPC-specific configuration for `create_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_class - ## - # RPC-specific configuration for `get_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_class - ## - # RPC-specific configuration for `list_custom_classes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_classes - ## - # RPC-specific configuration for `update_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :update_custom_class - ## - # RPC-specific configuration for `delete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_class - - # @private - def initialize parent_rpcs = nil - create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set - @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config - get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set - @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config - list_phrase_set_config = parent_rpcs.list_phrase_set if parent_rpcs.respond_to? :list_phrase_set - @list_phrase_set = ::Gapic::Config::Method.new list_phrase_set_config - update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set - @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config - delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set - @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config - create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class - @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config - get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class - @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config - list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes - @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config - update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class - @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config - delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class - @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb deleted file mode 100644 index bd467300f761..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb +++ /dev/null @@ -1,695 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb" - -module Google - module Cloud - module Speech - module V1p1beta1 - module Adaptation - module Rest - ## - # REST service stub for the Adaptation 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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # A result object deserialized from the server's reply - def create_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # A result object deserialized from the server's reply - def get_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse] - # A result object deserialized from the server's reply - def list_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse.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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # A result object deserialized from the server's reply - def update_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 create_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # A result object deserialized from the server's reply - def create_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # A result object deserialized from the server's reply - def get_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.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_custom_classes REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse] - # A result object deserialized from the server's reply - def list_custom_classes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_classes_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_custom_classes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse.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_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # A result object deserialized from the server's reply - def update_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/phraseSets", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/phraseSets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{phrase_set.name}", - body: "phrase_set", - matches: [ - ["phrase_set.name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/{parent}/customClasses", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_custom_classes REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_custom_classes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/{parent}/customClasses", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p1beta1/{custom_class.name}", - body: "custom_class", - matches: [ - ["custom_class.name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1p1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb deleted file mode 100644 index 5b0bc2fff55e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.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/speech/v1p1beta1/resource_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n;google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto\x12\x1dgoogle.cloud.speech.v1p1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/speech/v1p1beta1/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb0\x01\n\x16\x43reatePhraseSetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\x12\x1a\n\rphrase_set_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\nphrase_set\x18\x03 \x01(\x0b\x32(.google.cloud.speech.v1p1beta1.PhraseSetB\x03\xe0\x41\x02\"\x8c\x01\n\x16UpdatePhraseSetRequest\x12\x41\n\nphrase_set\x18\x01 \x01(\x0b\x32(.google.cloud.speech.v1p1beta1.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"v\n\x14ListPhraseSetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"o\n\x15ListPhraseSetResponse\x12=\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32(.google.cloud.speech.v1p1beta1.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\xba\x01\n\x18\x43reateCustomClassRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\x12\x1c\n\x0f\x63ustom_class_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\x0c\x63ustom_class\x18\x03 \x01(\x0b\x32*.google.cloud.speech.v1p1beta1.CustomClassB\x03\xe0\x41\x02\"\x92\x01\n\x18UpdateCustomClassRequest\x12\x45\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32*.google.cloud.speech.v1p1beta1.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"|\n\x18ListCustomClassesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"x\n\x19ListCustomClassesResponse\x12\x42\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32*.google.cloud.speech.v1p1beta1.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass2\xd2\x10\n\nAdaptation\x12\xd6\x01\n\x0f\x43reatePhraseSet\x12\x35.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest\x1a(.google.cloud.speech.v1p1beta1.PhraseSet\"b\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02:\"5/v1p1beta1/{parent=projects/*/locations/*}/phraseSets:\x01*\x12\xb2\x01\n\x0cGetPhraseSet\x12\x32.google.cloud.speech.v1p1beta1.GetPhraseSetRequest\x1a(.google.cloud.speech.v1p1beta1.PhraseSet\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}\x12\xc2\x01\n\rListPhraseSet\x12\x33.google.cloud.speech.v1p1beta1.ListPhraseSetRequest\x1a\x34.google.cloud.speech.v1p1beta1.ListPhraseSetResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1p1beta1/{parent=projects/*/locations/*}/phraseSets\x12\xe1\x01\n\x0fUpdatePhraseSet\x12\x35.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest\x1a(.google.cloud.speech.v1p1beta1.PhraseSet\"m\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02N2@/v1p1beta1/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\xa6\x01\n\x0f\x44\x65letePhraseSet\x12\x35.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}\x12\xe3\x01\n\x11\x43reateCustomClass\x12\x37.google.cloud.speech.v1p1beta1.CreateCustomClassRequest\x1a*.google.cloud.speech.v1p1beta1.CustomClass\"i\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02=\"8/v1p1beta1/{parent=projects/*/locations/*}/customClasses:\x01*\x12\xbb\x01\n\x0eGetCustomClass\x12\x34.google.cloud.speech.v1p1beta1.GetCustomClassRequest\x1a*.google.cloud.speech.v1p1beta1.CustomClass\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1p1beta1/{name=projects/*/locations/*/customClasses/*}\x12\xd1\x01\n\x11ListCustomClasses\x12\x37.google.cloud.speech.v1p1beta1.ListCustomClassesRequest\x1a\x38.google.cloud.speech.v1p1beta1.ListCustomClassesResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1p1beta1/{parent=projects/*/locations/*}/customClasses\x12\xf0\x01\n\x11UpdateCustomClass\x12\x37.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest\x1a*.google.cloud.speech.v1p1beta1.CustomClass\"v\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02U2E/v1p1beta1/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\xad\x01\n\x11\x44\x65leteCustomClass\x12\x37.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1p1beta1/{name=projects/*/locations/*/customClasses/*}\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB}\n!com.google.cloud.speech.v1p1beta1B\x15SpeechAdaptationProtoP\x01Z9cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb\xa2\x02\x03GCSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Speech - module V1p1beta1 - CreatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CreatePhraseSetRequest").msgclass - UpdatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest").msgclass - GetPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.GetPhraseSetRequest").msgclass - ListPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListPhraseSetRequest").msgclass - ListPhraseSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListPhraseSetResponse").msgclass - DeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.DeletePhraseSetRequest").msgclass - CreateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CreateCustomClassRequest").msgclass - UpdateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.UpdateCustomClassRequest").msgclass - GetCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.GetCustomClassRequest").msgclass - ListCustomClassesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListCustomClassesRequest").msgclass - ListCustomClassesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListCustomClassesResponse").msgclass - DeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.DeleteCustomClassRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb deleted file mode 100644 index e7fe2aa9bbdf..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto for package 'google.cloud.speech.v1p1beta1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb' - -module Google - module Cloud - module Speech - module V1p1beta1 - module Adaptation - # Service that implements Google Cloud Speech Adaptation API. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.speech.v1p1beta1.Adaptation' - - # Create a set of phrase hints. Each item in the set can be a single word or - # a multi-word phrase. The items in the PhraseSet are favored by the - # recognition model when you send a call that includes the PhraseSet. - rpc :CreatePhraseSet, ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::PhraseSet - # Get a phrase set. - rpc :GetPhraseSet, ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::PhraseSet - # List phrase sets. - rpc :ListPhraseSet, ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse - # Update a phrase set. - rpc :UpdatePhraseSet, ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::PhraseSet - # Delete a phrase set. - rpc :DeletePhraseSet, ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest, ::Google::Protobuf::Empty - # Create a custom class. - rpc :CreateCustomClass, ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest, ::Google::Cloud::Speech::V1p1beta1::CustomClass - # Get a custom class. - rpc :GetCustomClass, ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest, ::Google::Cloud::Speech::V1p1beta1::CustomClass - # List custom classes. - rpc :ListCustomClasses, ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest, ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse - # Update a custom class. - rpc :UpdateCustomClass, ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest, ::Google::Cloud::Speech::V1p1beta1::CustomClass - # Delete a custom class. - rpc :DeleteCustomClass, ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb deleted file mode 100644 index b33181f5fa56..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/cloud/speech/v1p1beta1/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n0google/cloud/speech/v1p1beta1/cloud_speech.proto\x12\x1dgoogle.cloud.speech.v1p1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/speech/v1p1beta1/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\"\x9e\x01\n\x10RecognizeRequest\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x30.google.cloud.speech.v1p1beta1.RecognitionConfigB\x03\xe0\x41\x02\x12\x43\n\x05\x61udio\x18\x02 \x01(\x0b\x32/.google.cloud.speech.v1p1beta1.RecognitionAudioB\x03\xe0\x41\x02\"\xfc\x01\n\x1bLongRunningRecognizeRequest\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x30.google.cloud.speech.v1p1beta1.RecognitionConfigB\x03\xe0\x41\x02\x12\x43\n\x05\x61udio\x18\x02 \x01(\x0b\x32/.google.cloud.speech.v1p1beta1.RecognitionAudioB\x03\xe0\x41\x02\x12Q\n\routput_config\x18\x04 \x01(\x0b\x32\x35.google.cloud.speech.v1p1beta1.TranscriptOutputConfigB\x03\xe0\x41\x01\":\n\x16TranscriptOutputConfig\x12\x11\n\x07gcs_uri\x18\x01 \x01(\tH\x00\x42\r\n\x0boutput_type\"\xa0\x01\n\x19StreamingRecognizeRequest\x12U\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x39.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigH\x00\x12\x17\n\raudio_content\x18\x02 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\xb5\x03\n\x1aStreamingRecognitionConfig\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x30.google.cloud.speech.v1p1beta1.RecognitionConfigB\x03\xe0\x41\x02\x12\x18\n\x10single_utterance\x18\x02 \x01(\x08\x12\x17\n\x0finterim_results\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_voice_activity_events\x18\x05 \x01(\x08\x12n\n\x16voice_activity_timeout\x18\x06 \x01(\x0b\x32N.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xcd\t\n\x11RecognitionConfig\x12P\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32>.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x1b\n\x13\x61udio_channel_count\x18\x07 \x01(\x05\x12/\n\'enable_separate_recognition_per_channel\x18\x0c \x01(\x08\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x1a\x61lternative_language_codes\x18\x12 \x03(\t\x12\x18\n\x10max_alternatives\x18\x04 \x01(\x05\x12\x18\n\x10profanity_filter\x18\x05 \x01(\x08\x12\x43\n\nadaptation\x18\x14 \x01(\x0b\x32/.google.cloud.speech.v1p1beta1.SpeechAdaptation\x12]\n\x18transcript_normalization\x18\x18 \x01(\x0b\x32\x36.google.cloud.speech.v1p1beta1.TranscriptNormalizationB\x03\xe0\x41\x01\x12\x45\n\x0fspeech_contexts\x18\x06 \x03(\x0b\x32,.google.cloud.speech.v1p1beta1.SpeechContext\x12 \n\x18\x65nable_word_time_offsets\x18\x08 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x0f \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x0b \x01(\x08\x12=\n\x19\x65nable_spoken_punctuation\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x38\n\x14\x65nable_spoken_emojis\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12&\n\x1a\x65nable_speaker_diarization\x18\x10 \x01(\x08\x42\x02\x18\x01\x12%\n\x19\x64iarization_speaker_count\x18\x11 \x01(\x05\x42\x02\x18\x01\x12S\n\x12\x64iarization_config\x18\x13 \x01(\x0b\x32\x37.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig\x12\x44\n\x08metadata\x18\t \x01(\x0b\x32\x32.google.cloud.speech.v1p1beta1.RecognitionMetadata\x12\r\n\x05model\x18\r \x01(\t\x12\x14\n\x0cuse_enhanced\x18\x0e \x01(\x08\"\xad\x01\n\rAudioEncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x08\n\x04\x46LAC\x10\x02\x12\t\n\x05MULAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x0c\n\x08OGG_OPUS\x10\x06\x12\x1a\n\x16SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x07\n\x03MP3\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\x12\x08\n\x04\x41LAW\x10\n\"\x90\x01\n\x18SpeakerDiarizationConfig\x12\"\n\x1a\x65nable_speaker_diarization\x18\x01 \x01(\x08\x12\x19\n\x11min_speaker_count\x18\x02 \x01(\x05\x12\x19\n\x11max_speaker_count\x18\x03 \x01(\x05\x12\x1a\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x05\x18\x01\xe0\x41\x03\"\xdb\x08\n\x13RecognitionMetadata\x12\\\n\x10interaction_type\x18\x01 \x01(\x0e\x32\x42.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType\x12$\n\x1cindustry_naics_code_of_audio\x18\x03 \x01(\r\x12\x62\n\x13microphone_distance\x18\x04 \x01(\x0e\x32\x45.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance\x12\x61\n\x13original_media_type\x18\x05 \x01(\x0e\x32\x44.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType\x12\x65\n\x15recording_device_type\x18\x06 \x01(\x0e\x32\x46.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType\x12\x1d\n\x15recording_device_name\x18\x07 \x01(\t\x12\x1a\n\x12original_mime_type\x18\x08 \x01(\t\x12\x19\n\robfuscated_id\x18\t \x01(\x03\x42\x02\x18\x01\x12\x13\n\x0b\x61udio_topic\x18\n \x01(\t\"\xc5\x01\n\x0fInteractionType\x12 \n\x1cINTERACTION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nDISCUSSION\x10\x01\x12\x10\n\x0cPRESENTATION\x10\x02\x12\x0e\n\nPHONE_CALL\x10\x03\x12\r\n\tVOICEMAIL\x10\x04\x12\x1b\n\x17PROFESSIONALLY_PRODUCED\x10\x05\x12\x10\n\x0cVOICE_SEARCH\x10\x06\x12\x11\n\rVOICE_COMMAND\x10\x07\x12\r\n\tDICTATION\x10\x08\"d\n\x12MicrophoneDistance\x12#\n\x1fMICROPHONE_DISTANCE_UNSPECIFIED\x10\x00\x12\r\n\tNEARFIELD\x10\x01\x12\x0c\n\x08MIDFIELD\x10\x02\x12\x0c\n\x08\x46\x41RFIELD\x10\x03\"N\n\x11OriginalMediaType\x12#\n\x1fORIGINAL_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\t\n\x05VIDEO\x10\x02\"\xa4\x01\n\x13RecordingDeviceType\x12%\n!RECORDING_DEVICE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nSMARTPHONE\x10\x01\x12\x06\n\x02PC\x10\x02\x12\x0e\n\nPHONE_LINE\x10\x03\x12\x0b\n\x07VEHICLE\x10\x04\x12\x18\n\x14OTHER_OUTDOOR_DEVICE\x10\x05\x12\x17\n\x13OTHER_INDOOR_DEVICE\x10\x06:\x02\x18\x01\"/\n\rSpeechContext\x12\x0f\n\x07phrases\x18\x01 \x03(\t\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\"D\n\x10RecognitionAudio\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\x98\x02\n\x11RecognizeResponse\x12G\n\x07results\x18\x02 \x03(\x0b\x32\x36.google.cloud.speech.v1p1beta1.SpeechRecognitionResult\x12\x34\n\x11total_billed_time\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12S\n\x16speech_adaptation_info\x18\x07 \x01(\x0b\x32\x33.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\x08 \x01(\x03\x12\x1b\n\x13using_legacy_models\x18\t \x01(\x08\"\xfe\x02\n\x1cLongRunningRecognizeResponse\x12G\n\x07results\x18\x02 \x03(\x0b\x32\x36.google.cloud.speech.v1p1beta1.SpeechRecognitionResult\x12\x34\n\x11total_billed_time\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12L\n\routput_config\x18\x06 \x01(\x0b\x32\x35.google.cloud.speech.v1p1beta1.TranscriptOutputConfig\x12(\n\x0coutput_error\x18\x07 \x01(\x0b\x32\x12.google.rpc.Status\x12S\n\x16speech_adaptation_info\x18\x08 \x01(\x0b\x32\x33.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\t \x01(\x03\"\x83\x02\n\x1cLongRunningRecognizeMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10last_update_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x03uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12Q\n\routput_config\x18\x05 \x01(\x0b\x32\x35.google.cloud.speech.v1p1beta1.TranscriptOutputConfigB\x03\xe0\x41\x03\"\xe6\x04\n\x1aStreamingRecognizeResponse\x12!\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12J\n\x07results\x18\x02 \x03(\x0b\x32\x39.google.cloud.speech.v1p1beta1.StreamingRecognitionResult\x12\x64\n\x11speech_event_type\x18\x04 \x01(\x0e\x32I.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType\x12\x34\n\x11speech_event_time\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x11total_billed_time\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12S\n\x16speech_adaptation_info\x18\t \x01(\x0b\x32\x33.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo\x12\x12\n\nrequest_id\x18\n \x01(\x03\"\x9d\x01\n\x0fSpeechEventType\x12\x1c\n\x18SPEECH_EVENT_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\x12\x1b\n\x17SPEECH_ACTIVITY_TIMEOUT\x10\x04\"\xf9\x01\n\x1aStreamingRecognitionResult\x12Q\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xd1\x01\n\x17SpeechRecognitionResult\x12Q\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"~\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x36\n\x05words\x18\x03 \x03(\x0b\x32\'.google.cloud.speech.v1p1beta1.WordInfo\"\xc0\x01\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x1a\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x05\x18\x01\xe0\x41\x03\x12\x1a\n\rspeaker_label\x18\x06 \x01(\tB\x03\xe0\x41\x03\"K\n\x14SpeechAdaptationInfo\x12\x1a\n\x12\x61\x64\x61ptation_timeout\x18\x01 \x01(\x08\x12\x17\n\x0ftimeout_message\x18\x04 \x01(\t2\x82\x05\n\x06Speech\x12\xa5\x01\n\tRecognize\x12/.google.cloud.speech.v1p1beta1.RecognizeRequest\x1a\x30.google.cloud.speech.v1p1beta1.RecognizeResponse\"5\xda\x41\x0c\x63onfig,audio\x82\xd3\xe4\x93\x02 \"\x1b/v1p1beta1/speech:recognize:\x01*\x12\xf2\x01\n\x14LongRunningRecognize\x12:.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41<\n\x1cLongRunningRecognizeResponse\x12\x1cLongRunningRecognizeMetadata\xda\x41\x0c\x63onfig,audio\x82\xd3\xe4\x93\x02+\"&/v1p1beta1/speech:longrunningrecognize:\x01*\x12\x8f\x01\n\x12StreamingRecognize\x12\x38.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest\x1a\x39.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBs\n!com.google.cloud.speech.v1p1beta1B\x0bSpeechProtoP\x01Z9cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb\xa2\x02\x03GCSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Speech - module V1p1beta1 - RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognizeRequest").msgclass - LongRunningRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest").msgclass - TranscriptOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.TranscriptOutputConfig").msgclass - StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeRequest").msgclass - StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionConfig").msgclass - StreamingRecognitionConfig::VoiceActivityTimeout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.VoiceActivityTimeout").msgclass - RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionConfig").msgclass - RecognitionConfig::AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding").enummodule - SpeakerDiarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig").msgclass - RecognitionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata").msgclass - RecognitionMetadata::InteractionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType").enummodule - RecognitionMetadata::MicrophoneDistance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance").enummodule - RecognitionMetadata::OriginalMediaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType").enummodule - RecognitionMetadata::RecordingDeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType").enummodule - SpeechContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechContext").msgclass - RecognitionAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionAudio").msgclass - RecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognizeResponse").msgclass - LongRunningRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse").msgclass - LongRunningRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata").msgclass - StreamingRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeResponse").msgclass - StreamingRecognizeResponse::SpeechEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType").enummodule - StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionResult").msgclass - SpeechRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechRecognitionResult").msgclass - SpeechRecognitionAlternative = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative").msgclass - WordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.WordInfo").msgclass - SpeechAdaptationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechAdaptationInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb deleted file mode 100644 index 7a757ba1b34b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/speech/v1p1beta1/cloud_speech.proto for package 'google.cloud.speech.v1p1beta1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/speech/v1p1beta1/cloud_speech_pb' - -module Google - module Cloud - module Speech - module V1p1beta1 - module Speech - # Service that implements Google Cloud Speech API. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.speech.v1p1beta1.Speech' - - # Performs synchronous speech recognition: receive results after all audio - # has been sent and processed. - rpc :Recognize, ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest, ::Google::Cloud::Speech::V1p1beta1::RecognizeResponse - # Performs asynchronous speech recognition: receive results via the - # google.longrunning.Operations interface. Returns either an - # `Operation.error` or an `Operation.response` which contains - # a `LongRunningRecognizeResponse` message. - # For more information on asynchronous speech recognition, see the - # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - rpc :LongRunningRecognize, ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest, ::Google::Longrunning::Operation - # Performs bidirectional streaming speech recognition: receive results while - # sending audio. This method is only available via the gRPC API (not REST). - rpc :StreamingRecognize, stream(::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest), stream(::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse) - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/resource_pb.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/resource_pb.rb deleted file mode 100644 index debdb5df1fa0..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/resource_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v1p1beta1/resource.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/speech/v1p1beta1/resource.proto\x12\x1dgoogle.cloud.speech.v1p1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe4\x06\n\x0b\x43ustomClass\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0f\x63ustom_class_id\x18\x02 \x01(\t\x12\x43\n\x05items\x18\x03 \x03(\x0b\x32\x34.google.cloud.speech.v1p1beta1.CustomClass.ClassItem\x12?\n\x0ckms_key_name\x18\x06 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x07 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x10\n\x03uid\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\n \x01(\x0e\x32\x30.google.cloud.speech.v1p1beta1.CustomClass.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x0b\x61nnotations\x18\r \x03(\x0b\x32;.google.cloud.speech.v1p1beta1.CustomClass.AnnotationsEntryB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:l\xea\x41i\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}\"\xd6\x06\n\tPhraseSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12@\n\x07phrases\x18\x02 \x03(\x0b\x32/.google.cloud.speech.v1p1beta1.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x12?\n\x0ckms_key_name\x18\x07 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x08 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x05state\x18\x0b \x01(\x0e\x32..google.cloud.speech.v1p1beta1.PhraseSet.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12S\n\x0b\x61nnotations\x18\x0e \x03(\x0b\x32\x39.google.cloud.speech.v1p1beta1.PhraseSet.AnnotationsEntryB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:e\xea\x41\x62\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}\"\xd2\x02\n\x10SpeechAdaptation\x12=\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32(.google.cloud.speech.v1p1beta1.PhraseSet\x12\x43\n\x15phrase_set_references\x18\x02 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x42\n\x0e\x63ustom_classes\x18\x03 \x03(\x0b\x32*.google.cloud.speech.v1p1beta1.CustomClass\x12Q\n\x0c\x61\x62nf_grammar\x18\x04 \x01(\x0b\x32;.google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar\x1a#\n\x0b\x41\x42NFGrammar\x12\x14\n\x0c\x61\x62nf_strings\x18\x01 \x03(\t\"\xaa\x01\n\x17TranscriptNormalization\x12M\n\x07\x65ntries\x18\x01 \x03(\x0b\x32<.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\x42\xa0\x03\n!com.google.cloud.speech.v1p1beta1B\x13SpeechResourceProtoP\x01Z9cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb\xa2\x02\x03GCS\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Speech - module V1p1beta1 - CustomClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CustomClass").msgclass - CustomClass::ClassItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CustomClass.ClassItem").msgclass - CustomClass::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CustomClass.State").enummodule - PhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.PhraseSet").msgclass - PhraseSet::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.PhraseSet.Phrase").msgclass - PhraseSet::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.PhraseSet.State").enummodule - SpeechAdaptation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechAdaptation").msgclass - SpeechAdaptation::ABNFGrammar = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechAdaptation.ABNFGrammar").msgclass - TranscriptNormalization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.TranscriptNormalization").msgclass - TranscriptNormalization::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/rest.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/rest.rb deleted file mode 100644 index 6c94920321b1..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/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/speech/v1p1beta1/speech/rest" -require "google/cloud/speech/v1p1beta1/adaptation/rest" -require "google/cloud/speech/v1p1beta1/version" - -module Google - module Cloud - module Speech - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/speech/v1p1beta1/rest" - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new - # - module V1p1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech.rb deleted file mode 100644 index bd0aec88faf2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech.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/speech/v1p1beta1/version" - -require "google/cloud/speech/v1p1beta1/speech/credentials" -require "google/cloud/speech/v1p1beta1/speech/paths" -require "google/cloud/speech/v1p1beta1/speech/operations" -require "google/cloud/speech/v1p1beta1/speech/client" -require "google/cloud/speech/v1p1beta1/speech/rest" - -module Google - module Cloud - module Speech - module V1p1beta1 - ## - # Service that implements Google Cloud Speech API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/speech/v1p1beta1/speech" - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/speech/v1p1beta1/speech/rest" - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new - # - module Speech - end - end - end - end -end - -helper_path = ::File.join __dir__, "speech", "helpers.rb" -require "google/cloud/speech/v1p1beta1/speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/client.rb deleted file mode 100644 index 4f672a626f58..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/client.rb +++ /dev/null @@ -1,685 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v1p1beta1/cloud_speech_pb" - -module Google - module Cloud - module Speech - module V1p1beta1 - module Speech - ## - # Client for the Speech service. - # - # Service that implements Google Cloud Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :speech_stub - - ## - # Configure the Speech Client class. - # - # See {::Google::Cloud::Speech::V1p1beta1::Speech::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Speech clients - # ::Google::Cloud::Speech::V1p1beta1::Speech::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Speech", "V1p1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.recognize.timeout = 5000.0 - default_config.rpcs.recognize.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.long_running_recognize.timeout = 5000.0 - - default_config.rpcs.streaming_recognize.timeout = 5000.0 - default_config.rpcs.streaming_recognize.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Speech Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V1p1beta1::Speech::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @speech_stub.universe_domain - end - - ## - # Create a new Speech client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Speech 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/speech/v1p1beta1/cloud_speech_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 - - @speech_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Speech::V1p1beta1::Speech::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 - ) - - @speech_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::Speech::V1p1beta1::Speech::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @speech_stub.logger - end - - # Service calls - - ## - # Performs synchronous speech recognition: receive results after all audio - # has been sent and processed. - # - # @overload recognize(request, options = nil) - # Pass arguments to `recognize` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::RecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::RecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload recognize(config: nil, audio: nil) - # Pass arguments to `recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig, ::Hash] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @param audio [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio, ::Hash] - # Required. The audio data to be recognized. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new - # - # # Call the recognize method. - # result = client.recognize request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::RecognizeResponse. - # p result - # - def recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :recognize, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs asynchronous speech recognition: receive results via the - # google.longrunning.Operations interface. Returns either an - # `Operation.error` or an `Operation.response` which contains - # a `LongRunningRecognizeResponse` message. - # For more information on asynchronous speech recognition, see the - # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - # - # @overload long_running_recognize(request, options = nil) - # Pass arguments to `long_running_recognize` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload long_running_recognize(config: nil, audio: nil, output_config: nil) - # Pass arguments to `long_running_recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig, ::Hash] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @param audio [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio, ::Hash] - # Required. The audio data to be recognized. - # @param output_config [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig, ::Hash] - # Optional. Specifies an optional destination for the recognition results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new - # - # # Call the long_running_recognize method. - # result = client.long_running_recognize request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def long_running_recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.long_running_recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.long_running_recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.long_running_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :long_running_recognize, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs bidirectional streaming speech recognition: receive results while - # sending audio. This method is only available via the gRPC API (not REST). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest, ::Hash>] - # An enumerable of {::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the streaming_recognize method to start streaming. - # output = client.streaming_recognize input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new - # input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse - # output.each do |current_response| - # p current_response - # end - # - def streaming_recognize request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest - end - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.streaming_recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.streaming_recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :streaming_recognize, request, 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 Speech API. - # - # This class represents the configuration for Speech, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V1p1beta1::Speech::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # recognize to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V1p1beta1::Speech::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.recognize.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.recognize.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Speech::V1p1beta1::Speech::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Speech API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :recognize - ## - # RPC-specific configuration for `long_running_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :long_running_recognize - ## - # RPC-specific configuration for `streaming_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_recognize - - # @private - def initialize parent_rpcs = nil - recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize - @recognize = ::Gapic::Config::Method.new recognize_config - long_running_recognize_config = parent_rpcs.long_running_recognize if parent_rpcs.respond_to? :long_running_recognize - @long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config - streaming_recognize_config = parent_rpcs.streaming_recognize if parent_rpcs.respond_to? :streaming_recognize - @streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/credentials.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/credentials.rb deleted file mode 100644 index f83c21f0ed37..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/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 Speech - module V1p1beta1 - module Speech - # Credentials for the Speech API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SPEECH_CREDENTIALS", - "SPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPEECH_CREDENTIALS_JSON", - "SPEECH_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-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/operations.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/operations.rb deleted file mode 100644 index 6a9b3255798d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/operations.rb +++ /dev/null @@ -1,833 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 Speech - module V1p1beta1 - module Speech - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Speech 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 Speech 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::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.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::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/paths.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/paths.rb deleted file mode 100644 index 9e690dc1410d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/paths.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! - - -module Google - module Cloud - module Speech - module V1p1beta1 - module Speech - # Path helper methods for the Speech API. - module Paths - ## - # 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 CustomClass resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # @param project [String] - # @param location [String] - # @param custom_class [String] - # - # @return [::String] - def custom_class_path project:, location:, custom_class: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" - end - - ## - # Create a fully-qualified PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest.rb deleted file mode 100644 index cd4e47947364..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/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/speech/v1p1beta1/version" - -require "google/cloud/speech/v1p1beta1/speech/credentials" -require "google/cloud/speech/v1p1beta1/speech/paths" -require "google/cloud/speech/v1p1beta1/speech/rest/operations" -require "google/cloud/speech/v1p1beta1/speech/rest/client" - -module Google - module Cloud - module Speech - module V1p1beta1 - ## - # Service that implements Google Cloud Speech API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/speech/v1p1beta1/speech/rest" - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new - # - module Speech - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/speech/v1p1beta1/speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb deleted file mode 100644 index cf9a596bd24d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb +++ /dev/null @@ -1,553 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v1p1beta1/cloud_speech_pb" -require "google/cloud/speech/v1p1beta1/speech/rest/service_stub" - -module Google - module Cloud - module Speech - module V1p1beta1 - module Speech - module Rest - ## - # REST client for the Speech service. - # - # Service that implements Google Cloud Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :speech_stub - - ## - # Configure the Speech Client class. - # - # See {::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Speech clients - # ::Google::Cloud::Speech::V1p1beta1::Speech::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", "Speech", "V1p1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.recognize.timeout = 5000.0 - default_config.rpcs.recognize.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.long_running_recognize.timeout = 5000.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Speech Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V1p1beta1::Speech::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 - @speech_stub.universe_domain - end - - ## - # Create a new Speech REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Speech 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::Speech::V1p1beta1::Speech::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 - - @speech_stub = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @speech_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::Speech::V1p1beta1::Speech::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @speech_stub.logger - end - - # Service calls - - ## - # Performs synchronous speech recognition: receive results after all audio - # has been sent and processed. - # - # @overload recognize(request, options = nil) - # Pass arguments to `recognize` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::RecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::RecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload recognize(config: nil, audio: nil) - # Pass arguments to `recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig, ::Hash] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @param audio [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio, ::Hash] - # Required. The audio data to be recognized. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new - # - # # Call the recognize method. - # result = client.recognize request - # - # # The returned object is of type Google::Cloud::Speech::V1p1beta1::RecognizeResponse. - # p result - # - def recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.recognize.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.recognize request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs asynchronous speech recognition: receive results via the - # google.longrunning.Operations interface. Returns either an - # `Operation.error` or an `Operation.response` which contains - # a `LongRunningRecognizeResponse` message. - # For more information on asynchronous speech recognition, see the - # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - # - # @overload long_running_recognize(request, options = nil) - # Pass arguments to `long_running_recognize` via a request object, either of type - # {::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload long_running_recognize(config: nil, audio: nil, output_config: nil) - # Pass arguments to `long_running_recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig, ::Hash] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @param audio [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio, ::Hash] - # Required. The audio data to be recognized. - # @param output_config [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig, ::Hash] - # Optional. Specifies an optional destination for the recognition results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v1p1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new - # - # # Call the long_running_recognize method. - # result = client.long_running_recognize request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def long_running_recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.long_running_recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.long_running_recognize.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.long_running_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.long_running_recognize request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 Speech REST API. - # - # This class represents the configuration for Speech REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # recognize to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.recognize.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.recognize.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Speech API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :recognize - ## - # RPC-specific configuration for `long_running_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :long_running_recognize - - # @private - def initialize parent_rpcs = nil - recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize - @recognize = ::Gapic::Config::Method.new recognize_config - long_running_recognize_config = parent_rpcs.long_running_recognize if parent_rpcs.respond_to? :long_running_recognize - @long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/operations.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/operations.rb deleted file mode 100644 index 6334c916e3b1..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/operations.rb +++ /dev/null @@ -1,923 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Speech - module V1p1beta1 - module Speech - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Speech 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 Speech 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::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/operations", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p1beta1/operations/{name}", - matches: [ - ["name", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb deleted file mode 100644 index 5822dffd5c1b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/speech/v1p1beta1/cloud_speech_pb" - -module Google - module Cloud - module Speech - module V1p1beta1 - module Speech - module Rest - ## - # REST service stub for the Speech 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 recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::RecognizeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V1p1beta1::RecognizeResponse] - # A result object deserialized from the server's reply - def recognize request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_recognize_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "recognize", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V1p1beta1::RecognizeResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the long_running_recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def long_running_recognize request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_long_running_recognize_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "long_running_recognize", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::RecognizeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_recognize_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/speech:recognize", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the long_running_recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_long_running_recognize_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p1beta1/speech:longrunningrecognize", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/version.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/version.rb deleted file mode 100644 index 44ab865d9484..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Speech - module V1p1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/README.md deleted file mode 100644 index 61d72528ac28..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Speech-to-Text V1p1beta1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb deleted file mode 100644 index 00d8a38fa769..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb +++ /dev/null @@ -1,1033 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Speech - module V1p1beta1 - # The top-level message sent by the client for the `Recognize` method. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @!attribute [rw] audio - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio] - # Required. The audio data to be recognized. - class RecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message sent by the client for the `LongRunningRecognize` - # method. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @!attribute [rw] audio - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio] - # Required. The audio data to be recognized. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig] - # Optional. Specifies an optional destination for the recognition results. - class LongRunningRecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies an optional destination for the recognition results. - # @!attribute [rw] gcs_uri - # @return [::String] - # Specifies a Cloud Storage URI for the recognition results. Must be - # specified in the format: `gs://bucket_name/object_name`, and the bucket - # must already exist. - class TranscriptOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message sent by the client for the `StreamingRecognize` method. - # Multiple `StreamingRecognizeRequest` messages are sent. The first message - # must contain a `streaming_config` message and must not contain - # `audio_content`. All subsequent messages must contain `audio_content` and - # must not contain a `streaming_config` message. - # @!attribute [rw] streaming_config - # @return [::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionConfig] - # Provides information to the recognizer that specifies how to process the - # request. The first `StreamingRecognizeRequest` message must contain a - # `streaming_config` message. - # - # Note: The following fields are mutually exclusive: `streaming_config`, `audio_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] audio_content - # @return [::String] - # The audio data to be recognized. Sequential chunks of audio data are sent - # in sequential `StreamingRecognizeRequest` messages. The first - # `StreamingRecognizeRequest` message must not contain `audio_content` data - # and all subsequent `StreamingRecognizeRequest` messages must contain - # `audio_content` data. The audio bytes must be encoded as specified in - # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - # pure binary representation (not base64). See - # [content limits](https://cloud.google.com/speech-to-text/quotas#content). - # - # Note: The following fields are mutually exclusive: `audio_content`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class StreamingRecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides information to the recognizer that specifies how to process the - # request. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig] - # Required. Provides information to the recognizer that specifies how to - # process the request. - # @!attribute [rw] single_utterance - # @return [::Boolean] - # If `false` or omitted, the recognizer will perform continuous - # recognition (continuing to wait for and process audio even if the user - # pauses speaking) until the client closes the input stream (gRPC API) or - # until the maximum time limit has been reached. May return multiple - # `StreamingRecognitionResult`s with the `is_final` flag set to `true`. - # - # If `true`, the recognizer will detect a single spoken utterance. When it - # detects that the user has paused or stopped speaking, it will return an - # `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no - # more than one `StreamingRecognitionResult` with the `is_final` flag set to - # `true`. - # - # The `single_utterance` field can only be used with specified models, - # otherwise an error is thrown. The `model` field in - # {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig RecognitionConfig} must - # be set to: - # - # * `command_and_search` - # * `phone_call` AND additional field `useEnhanced`=`true` - # * The `model` field is left undefined. In this case the API auto-selects - # a model based on any other parameters that you set in - # `RecognitionConfig`. - # @!attribute [rw] interim_results - # @return [::Boolean] - # If `true`, interim results (tentative hypotheses) may be - # returned as they become available (these interim results are indicated with - # the `is_final=false` flag). - # If `false` or omitted, only `is_final=true` result(s) are returned. - # @!attribute [rw] enable_voice_activity_events - # @return [::Boolean] - # If `true`, responses with voice activity speech events will be returned as - # they are detected. - # @!attribute [rw] voice_activity_timeout - # @return [::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionConfig::VoiceActivityTimeout] - # If set, the server will automatically close the stream after the specified - # duration has elapsed after the last VOICE_ACTIVITY speech event has been - # sent. The field `voice_activity_events` must also be set to true. - class StreamingRecognitionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Events that a timeout can be set on for voice activity. - # @!attribute [rw] speech_start_timeout - # @return [::Google::Protobuf::Duration] - # Duration to timeout the stream if no speech begins. - # @!attribute [rw] speech_end_timeout - # @return [::Google::Protobuf::Duration] - # Duration to timeout the stream after speech ends. - class VoiceActivityTimeout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Provides information to the recognizer that specifies how to process the - # request. - # @!attribute [rw] encoding - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding] - # Encoding of audio data sent in all `RecognitionAudio` messages. - # This field is optional for `FLAC` and `WAV` audio files and required - # for all other audio formats. For details, see - # {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Sample rate in Hertz of the audio data sent in all - # `RecognitionAudio` messages. Valid values are: 8000-48000. - # 16000 is optimal. For best results, set the sampling rate of the audio - # source to 16000 Hz. If that's not possible, use the native sample rate of - # the audio source (instead of re-sampling). - # This field is optional for FLAC and WAV audio files, but is - # required for all other audio formats. For details, see - # {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}. - # @!attribute [rw] audio_channel_count - # @return [::Integer] - # The number of channels in the input audio data. - # ONLY set this for MULTI-CHANNEL recognition. - # Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`. - # Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. - # If `0` or omitted, defaults to one channel (mono). - # Note: We only recognize the first channel by default. - # To perform independent recognition on each channel set - # `enable_separate_recognition_per_channel` to 'true'. - # @!attribute [rw] enable_separate_recognition_per_channel - # @return [::Boolean] - # This needs to be set to `true` explicitly and `audio_channel_count` > 1 - # to get each channel recognized separately. The recognition result will - # contain a `channel_tag` field to state which channel that result belongs - # to. If this is not true, we will only recognize the first channel. The - # request is billed cumulatively for all channels recognized: - # `audio_channel_count` multiplied by the length of the audio. - # @!attribute [rw] language_code - # @return [::String] - # Required. The language of the supplied audio as a - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # Example: "en-US". - # See [Language - # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - # of the currently supported language codes. - # @!attribute [rw] alternative_language_codes - # @return [::Array<::String>] - # A list of up to 3 additional - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, - # listing possible alternative languages of the supplied audio. - # See [Language - # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - # of the currently supported language codes. If alternative languages are - # listed, recognition result will contain recognition in the most likely - # language detected including the main language_code. The recognition result - # will include the language tag of the language detected in the audio. Note: - # This feature is only supported for Voice Command and Voice Search use cases - # and performance may vary for other use cases (e.g., phone call - # transcription). - # @!attribute [rw] max_alternatives - # @return [::Integer] - # Maximum number of recognition hypotheses to be returned. - # Specifically, the maximum number of `SpeechRecognitionAlternative` messages - # within each `SpeechRecognitionResult`. - # The server may return fewer than `max_alternatives`. - # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - # one. If omitted, will return a maximum of one. - # @!attribute [rw] profanity_filter - # @return [::Boolean] - # If set to `true`, the server will attempt to filter out - # profanities, replacing all but the initial character in each filtered word - # with asterisks, e.g. "f***". If set to `false` or omitted, profanities - # won't be filtered out. - # @!attribute [rw] adaptation - # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptation] - # Speech adaptation configuration improves the accuracy of speech - # recognition. For more information, see the [speech - # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) - # documentation. - # When speech adaptation is set it supersedes the `speech_contexts` field. - # @!attribute [rw] transcript_normalization - # @return [::Google::Cloud::Speech::V1p1beta1::TranscriptNormalization] - # Optional. Use transcription normalization to automatically replace parts of - # the transcript with phrases of your choosing. For StreamingRecognize, this - # normalization only applies to stable partial transcripts (stability > 0.8) - # and final transcripts. - # @!attribute [rw] speech_contexts - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechContext>] - # Array of {::Google::Cloud::Speech::V1p1beta1::SpeechContext SpeechContext}. - # A means to provide context to assist the speech recognition. For more - # information, see - # [speech - # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). - # @!attribute [rw] enable_word_time_offsets - # @return [::Boolean] - # If `true`, the top result includes a list of words and - # the start and end time offsets (timestamps) for those words. If - # `false`, no word-level time offset information is returned. The default is - # `false`. - # @!attribute [rw] enable_word_confidence - # @return [::Boolean] - # If `true`, the top result includes a list of words and the - # confidence for those words. If `false`, no word-level confidence - # information is returned. The default is `false`. - # @!attribute [rw] enable_automatic_punctuation - # @return [::Boolean] - # If 'true', adds punctuation to recognition result hypotheses. - # This feature is only available in select languages. Setting this for - # requests in other languages has no effect at all. - # The default 'false' value does not add punctuation to result hypotheses. - # @!attribute [rw] enable_spoken_punctuation - # @return [::Google::Protobuf::BoolValue] - # The spoken punctuation behavior for the call - # If not set, uses default behavior based on model of choice - # e.g. command_and_search will enable spoken punctuation by default - # If 'true', replaces spoken punctuation with the corresponding symbols in - # the request. For example, "how are you question mark" becomes "how are - # you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation - # for support. If 'false', spoken punctuation is not replaced. - # @!attribute [rw] enable_spoken_emojis - # @return [::Google::Protobuf::BoolValue] - # The spoken emoji behavior for the call - # If not set, uses default behavior based on model of choice - # If 'true', adds spoken emoji formatting for the request. This will replace - # spoken emojis with the corresponding Unicode symbols in the final - # transcript. If 'false', spoken emojis are not replaced. - # @!attribute [rw] enable_speaker_diarization - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # If 'true', enables speaker detection for each recognized word in - # the top alternative of the recognition result using a speaker_label - # provided in the WordInfo. - # Note: Use diarization_config instead. - # @!attribute [rw] diarization_speaker_count - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # If set, specifies the estimated number of speakers in the conversation. - # Defaults to '2'. Ignored unless enable_speaker_diarization is set to true. - # Note: Use diarization_config instead. - # @!attribute [rw] diarization_config - # @return [::Google::Cloud::Speech::V1p1beta1::SpeakerDiarizationConfig] - # Config to enable speaker diarization and set additional - # parameters to make diarization better suited for your application. - # Note: When this is enabled, we send all the words from the beginning of the - # audio for the top alternative in every consecutive STREAMING responses. - # This is done in order to improve our speaker tags as our models learn to - # identify the speakers in the conversation over time. - # For non-streaming requests, the diarization results will be provided only - # in the top alternative of the FINAL SpeechRecognitionResult. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata] - # Metadata regarding this request. - # @!attribute [rw] model - # @return [::String] - # Which model to select for the given request. Select the model - # best suited to your domain to get best results. If a model is not - # explicitly specified, then we auto-select a model based on the parameters - # in the RecognitionConfig. - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed - # speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically - # recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple - # speakers. Ideally the audio is recorded at a 16khz or greater - # sampling rate. This is a premium model that costs more than the - # standard rate.
defaultBest for audio that is not one of the specific audio models. - # For example, long-form audio. Ideally the audio is high-fidelity, - # recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a - # medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical - # provider.
- # @!attribute [rw] use_enhanced - # @return [::Boolean] - # Set to true to use an enhanced model for speech recognition. - # If `use_enhanced` is set to true and the `model` field is not set, then - # an appropriate enhanced model is chosen if an enhanced model exists for - # the audio. - # - # If `use_enhanced` is true and an enhanced version of the specified model - # does not exist, then the speech is recognized using the standard version - # of the specified model. - class RecognitionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The encoding of the audio data sent in the request. - # - # All encodings support only 1 channel (mono) audio, unless the - # `audio_channel_count` and `enable_separate_recognition_per_channel` fields - # are set. - # - # For best results, the audio source should be captured and transmitted using - # a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech - # recognition can be reduced if lossy codecs are used to capture or transmit - # audio, particularly if background noise is present. Lossy codecs include - # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, - # and `WEBM_OPUS`. - # - # The `FLAC` and `WAV` audio file formats include a header that describes the - # included audio content. You can request recognition for `WAV` files that - # contain either `LINEAR16` or `MULAW` encoded audio. - # If you send `FLAC` or `WAV` audio file format in - # your request, you do not need to specify an `AudioEncoding`; the audio - # encoding format is determined from the file header. If you specify - # an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the - # encoding configuration must match the encoding described in the audio - # header; otherwise the request returns an - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error - # code. - module AudioEncoding - # Not specified. - ENCODING_UNSPECIFIED = 0 - - # Uncompressed 16-bit signed little-endian samples (Linear PCM). - LINEAR16 = 1 - - # `FLAC` (Free Lossless Audio - # Codec) is the recommended encoding because it is - # lossless--therefore recognition is not compromised--and - # requires only about half the bandwidth of `LINEAR16`. `FLAC` stream - # encoding supports 16-bit and 24-bit samples, however, not all fields in - # `STREAMINFO` are supported. - FLAC = 2 - - # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 3 - - # Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. - AMR = 4 - - # Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. - AMR_WB = 5 - - # Opus encoded audio frames in Ogg container - # ([OggOpus](https://wiki.xiph.org/OggOpus)). - # `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. - OGG_OPUS = 6 - - # Although the use of lossy encodings is not recommended, if a very low - # bitrate encoding is required, `OGG_OPUS` is highly preferred over - # Speex encoding. The [Speex](https://speex.org/) encoding supported by - # Cloud Speech API has a header byte in each block, as in MIME type - # `audio/x-speex-with-header-byte`. - # It is a variant of the RTP Speex encoding defined in - # [RFC 5574](https://tools.ietf.org/html/rfc5574). - # The stream is a sequence of blocks, one block per RTP packet. Each block - # starts with a byte containing the length of the block, in bytes, followed - # by one or more frames of Speex data, padded to an integral number of - # bytes (octets) as specified in RFC 5574. In other words, each RTP header - # is replaced with a single byte containing the block length. Only Speex - # wideband is supported. `sample_rate_hertz` must be 16000. - SPEEX_WITH_HEADER_BYTE = 7 - - # MP3 audio. MP3 encoding is a Beta feature and only available in - # v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 - # kbps). When using this encoding, `sample_rate_hertz` has to match the - # sample rate of the file being used. - MP3 = 8 - - # Opus encoded audio frames in WebM container - # ([WebM](https://www.webmproject.org/docs/container/)). - # `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. - WEBM_OPUS = 9 - - # 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. - ALAW = 10 - end - end - - # Config to enable speaker diarization. - # @!attribute [rw] enable_speaker_diarization - # @return [::Boolean] - # If 'true', enables speaker detection for each recognized word in - # the top alternative of the recognition result using a speaker_label - # provided in the WordInfo. - # @!attribute [rw] min_speaker_count - # @return [::Integer] - # Minimum number of speakers in the conversation. This range gives you more - # flexibility by allowing the system to automatically determine the correct - # number of speakers. If not set, the default value is 2. - # @!attribute [rw] max_speaker_count - # @return [::Integer] - # Maximum number of speakers in the conversation. This range gives you more - # flexibility by allowing the system to automatically determine the correct - # number of speakers. If not set, the default value is 6. - # @!attribute [r] speaker_tag - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Output only. Unused. - class SpeakerDiarizationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of audio data to be recognized. - # @deprecated This message is deprecated and may be removed in the next major version update. - # @!attribute [rw] interaction_type - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::InteractionType] - # The use case most closely describing the audio content to be recognized. - # @!attribute [rw] industry_naics_code_of_audio - # @return [::Integer] - # The industry vertical to which this speech recognition request most - # closely applies. This is most indicative of the topics contained - # in the audio. Use the 6-digit NAICS code to identify the industry - # vertical - see https://www.naics.com/search/. - # @!attribute [rw] microphone_distance - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::MicrophoneDistance] - # The audio type that most closely describes the audio being recognized. - # @!attribute [rw] original_media_type - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::OriginalMediaType] - # The original media the speech was recorded on. - # @!attribute [rw] recording_device_type - # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::RecordingDeviceType] - # The type of device the speech was recorded with. - # @!attribute [rw] recording_device_name - # @return [::String] - # The device used to make the recording. Examples 'Nexus 5X' or - # 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - # 'Cardioid Microphone'. - # @!attribute [rw] original_mime_type - # @return [::String] - # Mime type of the original audio file. For example `audio/m4a`, - # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. - # A list of possible audio mime types is maintained at - # http://www.iana.org/assignments/media-types/media-types.xhtml#audio - # @!attribute [rw] obfuscated_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Obfuscated (privacy-protected) ID of the user, to identify number of - # unique users using the service. - # @!attribute [rw] audio_topic - # @return [::String] - # Description of the content. Eg. "Recordings of federal supreme court - # hearings from 2012". - class RecognitionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Use case categories that the audio recognition request can be described - # by. - module InteractionType - # Use case is either unknown or is something other than one of the other - # values below. - INTERACTION_TYPE_UNSPECIFIED = 0 - - # Multiple people in a conversation or discussion. For example in a - # meeting with two or more people actively participating. Typically - # all the primary people speaking would be in the same room (if not, - # see PHONE_CALL) - DISCUSSION = 1 - - # One or more persons lecturing or presenting to others, mostly - # uninterrupted. - PRESENTATION = 2 - - # A phone-call or video-conference in which two or more people, who are - # not in the same room, are actively participating. - PHONE_CALL = 3 - - # A recorded message intended for another person to listen to. - VOICEMAIL = 4 - - # Professionally produced audio (eg. TV Show, Podcast). - PROFESSIONALLY_PRODUCED = 5 - - # Transcribe spoken questions and queries into text. - VOICE_SEARCH = 6 - - # Transcribe voice commands, such as for controlling a device. - VOICE_COMMAND = 7 - - # Transcribe speech to text to create a written document, such as a - # text-message, email or report. - DICTATION = 8 - end - - # Enumerates the types of capture settings describing an audio file. - module MicrophoneDistance - # Audio type is not known. - MICROPHONE_DISTANCE_UNSPECIFIED = 0 - - # The audio was captured from a closely placed microphone. Eg. phone, - # dictaphone, or handheld microphone. Generally if there speaker is within - # 1 meter of the microphone. - NEARFIELD = 1 - - # The speaker if within 3 meters of the microphone. - MIDFIELD = 2 - - # The speaker is more than 3 meters away from the microphone. - FARFIELD = 3 - end - - # The original media the speech was recorded on. - module OriginalMediaType - # Unknown original media type. - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0 - - # The speech data is an audio recording. - AUDIO = 1 - - # The speech data originally recorded on a video. - VIDEO = 2 - end - - # The type of device the speech was recorded with. - module RecordingDeviceType - # The recording device is unknown. - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0 - - # Speech was recorded on a smartphone. - SMARTPHONE = 1 - - # Speech was recorded using a personal computer or tablet. - PC = 2 - - # Speech was recorded over a phone line. - PHONE_LINE = 3 - - # Speech was recorded in a vehicle. - VEHICLE = 4 - - # Speech was recorded outdoors. - OTHER_OUTDOOR_DEVICE = 5 - - # Speech was recorded indoors. - OTHER_INDOOR_DEVICE = 6 - end - end - - # Provides "hints" to the speech recognizer to favor specific words and phrases - # in the results. - # @!attribute [rw] phrases - # @return [::Array<::String>] - # A list of strings containing words and phrases "hints" so that - # the speech recognition is more likely to recognize them. This can be used - # to improve the accuracy for specific words and phrases, for example, if - # specific commands are typically spoken by the user. This can also be used - # to add additional words to the vocabulary of the recognizer. See - # [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - # - # List items can also be set to classes for groups of words that represent - # common concepts that occur in natural language. For example, rather than - # providing phrase hints for every month of the year, using the $MONTH class - # improves the likelihood of correctly transcribing audio that includes - # months. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Positive value will increase the probability that a specific - # phrase will be recognized over other similar sounding phrases. The higher - # the boost, the higher the chance of false positive recognition as well. - # Negative boost values would correspond to anti-biasing. Anti-biasing is not - # enabled, so negative boost will simply be ignored. Though `boost` can - # accept a wide range of positive values, most use cases are best served with - # values between 0 and 20. We recommend using a binary search approach to - # finding the optimal value for your use case. - class SpeechContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains audio data in the encoding specified in the `RecognitionConfig`. - # Either `content` or `uri` must be supplied. Supplying both or neither - # returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - # See [content limits](https://cloud.google.com/speech-to-text/quotas#content). - # @!attribute [rw] content - # @return [::String] - # The audio data bytes encoded as specified in - # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - # pure binary representation, whereas JSON representations use base64. - # - # Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] uri - # @return [::String] - # URI that points to a file that contains audio data bytes as specified in - # `RecognitionConfig`. The file must not be compressed (for example, gzip). - # Currently, only Google Cloud Storage URIs are - # supported, which must be specified in the following format: - # `gs://bucket_name/object_name` (other URI formats return - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). - # For more information, see [Request - # URIs](https://cloud.google.com/storage/docs/reference-uris). - # - # Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class RecognitionAudio - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The only message returned to the client by the `Recognize` method. It - # contains the result as zero or more sequential `SpeechRecognitionResult` - # messages. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>] - # Sequential list of transcription results corresponding to - # sequential portions of audio. - # @!attribute [rw] total_billed_time - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the corresponding request. - # @!attribute [rw] speech_adaptation_info - # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptationInfo] - # Provides information on adaptation behavior in response - # @!attribute [rw] request_id - # @return [::Integer] - # The ID associated with the request. This is a unique ID specific only to - # the given request. - # @!attribute [rw] using_legacy_models - # @return [::Boolean] - # Whether request used legacy asr models (was not automatically migrated to - # use conformer models). - class RecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The only message returned to the client by the `LongRunningRecognize` method. - # It contains the result as zero or more sequential `SpeechRecognitionResult` - # messages. It is included in the `result.response` field of the `Operation` - # returned by the `GetOperation` call of the `google::longrunning::Operations` - # service. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>] - # Sequential list of transcription results corresponding to - # sequential portions of audio. - # @!attribute [rw] total_billed_time - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the corresponding request. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig] - # Original output config if present in the request. - # @!attribute [rw] output_error - # @return [::Google::Rpc::Status] - # If the transcript output fails this field contains the relevant error. - # @!attribute [rw] speech_adaptation_info - # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptationInfo] - # Provides information on speech adaptation behavior in response - # @!attribute [rw] request_id - # @return [::Integer] - # The ID associated with the request. This is a unique ID specific only to - # the given request. - class LongRunningRecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the progress of a long-running `LongRunningRecognize` call. It is - # included in the `metadata` field of the `Operation` returned by the - # `GetOperation` call of the `google::longrunning::Operations` service. - # @!attribute [rw] progress_percent - # @return [::Integer] - # Approximate percentage of audio processed thus far. Guaranteed to be 100 - # when the audio is fully processed and the results are available. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Time when the request was received. - # @!attribute [rw] last_update_time - # @return [::Google::Protobuf::Timestamp] - # Time of the most recent processing update. - # @!attribute [r] uri - # @return [::String] - # Output only. The URI of the audio file being transcribed. Empty if the - # audio was sent as byte content. - # @!attribute [r] output_config - # @return [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig] - # Output only. A copy of the TranscriptOutputConfig if it was set in the - # request. - class LongRunningRecognizeMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `StreamingRecognizeResponse` is the only message returned to the client by - # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` - # messages are streamed back to the client. If there is no recognizable - # audio, and `single_utterance` is set to false, then no messages are streamed - # back to the client. - # - # Here's an example of a series of `StreamingRecognizeResponse`s that might be - # returned while processing audio: - # - # 1. results { alternatives { transcript: "tube" } stability: 0.01 } - # - # 2. results { alternatives { transcript: "to be a" } stability: 0.01 } - # - # 3. results { alternatives { transcript: "to be" } stability: 0.9 } - # results { alternatives { transcript: " or not to be" } stability: 0.01 } - # - # 4. results { alternatives { transcript: "to be or not to be" - # confidence: 0.92 } - # alternatives { transcript: "to bee or not to bee" } - # is_final: true } - # - # 5. results { alternatives { transcript: " that's" } stability: 0.01 } - # - # 6. results { alternatives { transcript: " that is" } stability: 0.9 } - # results { alternatives { transcript: " the question" } stability: 0.01 } - # - # 7. results { alternatives { transcript: " that is the question" - # confidence: 0.98 } - # alternatives { transcript: " that was the question" } - # is_final: true } - # - # Notes: - # - # - Only two of the above responses #4 and #7 contain final results; they are - # indicated by `is_final: true`. Concatenating these together generates the - # full transcript: "to be or not to be that is the question". - # - # - The others contain interim `results`. #3 and #6 contain two interim - # `results`: the first portion has a high stability and is less likely to - # change; the second portion has a low stability and is very likely to - # change. A UI designer might choose to show only high stability `results`. - # - # - The specific `stability` and `confidence` values shown above are only for - # illustrative purposes. Actual values may vary. - # - # - In each response, only one of these fields will be set: - # `error`, - # `speech_event_type`, or - # one or more (repeated) `results`. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # If set, returns a {::Google::Rpc::Status google.rpc.Status} message that - # specifies the error for the operation. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionResult>] - # This repeated list contains zero or more results that - # correspond to consecutive portions of the audio currently being processed. - # It contains zero or one `is_final=true` result (the newly settled portion), - # followed by zero or more `is_final=false` results (the interim results). - # @!attribute [rw] speech_event_type - # @return [::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse::SpeechEventType] - # Indicates the type of speech event. - # @!attribute [rw] speech_event_time - # @return [::Google::Protobuf::Duration] - # Time offset between the beginning of the audio and event emission. - # @!attribute [rw] total_billed_time - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the stream. - # Set only if this is the last response in the stream. - # @!attribute [rw] speech_adaptation_info - # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptationInfo] - # Provides information on adaptation behavior in response - # @!attribute [rw] request_id - # @return [::Integer] - # The ID associated with the request. This is a unique ID specific only to - # the given request. - class StreamingRecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the type of speech event. - module SpeechEventType - # No speech event specified. - SPEECH_EVENT_UNSPECIFIED = 0 - - # This event indicates that the server has detected the end of the user's - # speech utterance and expects no additional speech. Therefore, the server - # will not process additional audio (although it may subsequently return - # additional results). The client should stop sending additional audio - # data, half-close the gRPC connection, and wait for any additional results - # until the server closes the gRPC connection. This event is only sent if - # `single_utterance` was set to `true`, and is not used otherwise. - END_OF_SINGLE_UTTERANCE = 1 - - # This event indicates that the server has detected the beginning of human - # voice activity in the stream. This event can be returned multiple times - # if speech starts and stops repeatedly throughout the stream. This event - # is only sent if `voice_activity_events` is set to true. - SPEECH_ACTIVITY_BEGIN = 2 - - # This event indicates that the server has detected the end of human voice - # activity in the stream. This event can be returned multiple times if - # speech starts and stops repeatedly throughout the stream. This event is - # only sent if `voice_activity_events` is set to true. - SPEECH_ACTIVITY_END = 3 - - # This event indicates that the user-set timeout for speech activity begin - # or end has exceeded. Upon receiving this event, the client is expected to - # send a half close. Further audio will not be processed. - SPEECH_ACTIVITY_TIMEOUT = 4 - end - end - - # A streaming speech recognition result corresponding to a portion of the audio - # that is currently being processed. - # @!attribute [rw] alternatives - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>] - # May contain one or more recognition hypotheses (up to the - # maximum specified in `max_alternatives`). - # These alternatives are ordered in terms of accuracy, with the top (first) - # alternative being the most probable, as ranked by the recognizer. - # @!attribute [rw] is_final - # @return [::Boolean] - # If `false`, this `StreamingRecognitionResult` represents an - # interim result that may change. If `true`, this is the final time the - # speech service will return this particular `StreamingRecognitionResult`, - # the recognizer will not return any further hypotheses for this portion of - # the transcript and corresponding audio. - # @!attribute [rw] stability - # @return [::Float] - # An estimate of the likelihood that the recognizer will not - # change its guess about this interim result. Values range from 0.0 - # (completely unstable) to 1.0 (completely stable). - # This field is only provided for interim results (`is_final=false`). - # The default of 0.0 is a sentinel value indicating `stability` was not set. - # @!attribute [rw] result_end_time - # @return [::Google::Protobuf::Duration] - # Time offset of the end of this result relative to the - # beginning of the audio. - # @!attribute [rw] channel_tag - # @return [::Integer] - # For multi-channel audio, this is the channel number corresponding to the - # recognized result for the audio from that channel. - # For audio_channel_count = N, its output values can range from '1' to 'N'. - # @!attribute [r] language_code - # @return [::String] - # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag of the language in this result. This language code was - # detected to have the most likelihood of being spoken in the audio. - class StreamingRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A speech recognition result corresponding to a portion of the audio. - # @!attribute [rw] alternatives - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>] - # May contain one or more recognition hypotheses (up to the - # maximum specified in `max_alternatives`). - # These alternatives are ordered in terms of accuracy, with the top (first) - # alternative being the most probable, as ranked by the recognizer. - # @!attribute [rw] channel_tag - # @return [::Integer] - # For multi-channel audio, this is the channel number corresponding to the - # recognized result for the audio from that channel. - # For audio_channel_count = N, its output values can range from '1' to 'N'. - # @!attribute [rw] result_end_time - # @return [::Google::Protobuf::Duration] - # Time offset of the end of this result relative to the - # beginning of the audio. - # @!attribute [r] language_code - # @return [::String] - # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag of the language in this result. This language code was - # detected to have the most likelihood of being spoken in the audio. - class SpeechRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Alternative hypotheses (a.k.a. n-best list). - # @!attribute [rw] transcript - # @return [::String] - # Transcript text representing the words that the user spoke. - # In languages that use spaces to separate words, the transcript might have a - # leading space if it isn't the first result. You can concatenate each result - # to obtain the full transcript without using a separator. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence estimate between 0.0 and 1.0. A higher number - # indicates an estimated greater likelihood that the recognized words are - # correct. This field is set only for the top alternative of a non-streaming - # result or, of a streaming result where `is_final=true`. - # This field is not guaranteed to be accurate and users should not rely on it - # to be always provided. - # The default of 0.0 is a sentinel value indicating `confidence` was not set. - # @!attribute [rw] words - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::WordInfo>] - # A list of word-specific information for each recognized word. - # Note: When `enable_speaker_diarization` is true, you will see all the words - # from the beginning of the audio. - class SpeechRecognitionAlternative - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Word-specific information for recognized words. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio, - # and corresponding to the start of the spoken word. - # This field is only set if `enable_word_time_offsets=true` and only - # in the top hypothesis. - # This is an experimental feature and the accuracy of the time offset can - # vary. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio, - # and corresponding to the end of the spoken word. - # This field is only set if `enable_word_time_offsets=true` and only - # in the top hypothesis. - # This is an experimental feature and the accuracy of the time offset can - # vary. - # @!attribute [rw] word - # @return [::String] - # The word corresponding to this set of information. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence estimate between 0.0 and 1.0. A higher number - # indicates an estimated greater likelihood that the recognized words are - # correct. This field is set only for the top alternative of a non-streaming - # result or, of a streaming result where `is_final=true`. - # This field is not guaranteed to be accurate and users should not rely on it - # to be always provided. - # The default of 0.0 is a sentinel value indicating `confidence` was not set. - # @!attribute [r] speaker_tag - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Output only. A distinct integer value is assigned for every speaker within - # the audio. This field specifies which one of those speakers was detected to - # have spoken this word. Value ranges from '1' to diarization_speaker_count. - # speaker_tag is set if enable_speaker_diarization = 'true' and only for the - # top alternative. - # Note: Use speaker_label instead. - # @!attribute [r] speaker_label - # @return [::String] - # Output only. A label value assigned for every unique speaker within the - # audio. This field specifies which speaker was detected to have spoken this - # word. For some models, like medical_conversation this can be actual speaker - # role, for example "patient" or "provider", but generally this would be a - # number identifying a speaker. This field is only set if - # enable_speaker_diarization = 'true' and only for the top alternative. - class WordInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information on speech adaptation use in results - # @!attribute [rw] adaptation_timeout - # @return [::Boolean] - # Whether there was a timeout when applying speech adaptation. If true, - # adaptation had no effect in the response transcript. - # @!attribute [rw] timeout_message - # @return [::String] - # If set, returns a message specifying which part of the speech adaptation - # request timed out. - class SpeechAdaptationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb deleted file mode 100644 index 9d33bec8a1dd..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.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! - - -module Google - module Cloud - module Speech - module V1p1beta1 - # Message sent by the client for the `CreatePhraseSet` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this phrase set will be created. - # Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] phrase_set_id - # @return [::String] - # Required. The ID to use for the phrase set, which will become the final - # component of the phrase set's resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @!attribute [rw] phrase_set - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # Required. The phrase set to create. - class CreatePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `UpdatePhraseSet` method. - # @!attribute [rw] phrase_set - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet] - # Required. The phrase set to update. - # - # The phrase set's `name` field is used to identify the set to be - # updated. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdatePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `GetPhraseSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the phrase set to retrieve. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - class GetPhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `ListPhraseSet` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of phrase set. Format: - # - # `projects/{project}/locations/{location}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of phrase sets to return. The service may return - # fewer than this value. If unspecified, at most 50 phrase sets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListPhraseSet` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPhraseSet` must - # match the call that provided the page token. - class ListPhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned to the client by the `ListPhraseSet` method. - # @!attribute [rw] phrase_sets - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::PhraseSet>] - # The phrase set. - # @!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 ListPhraseSetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `DeletePhraseSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the phrase set to delete. Format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - class DeletePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `CreateCustomClass` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this custom class will be created. - # Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] custom_class_id - # @return [::String] - # Required. The ID to use for the custom class, which will become the final - # component of the custom class' resource name. - # - # This value should restrict to letters, numbers, and hyphens, with the first - # character a letter, the last a letter or a number, and be 4-63 characters. - # @!attribute [rw] custom_class - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # Required. The custom class to create. - class CreateCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `UpdateCustomClass` method. - # @!attribute [rw] custom_class - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass] - # Required. The custom class to update. - # - # The custom class's `name` field is used to identify the custom class to be - # updated. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `GetCustomClass` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the custom class to retrieve. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - class GetCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `ListCustomClasses` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of custom classes. Format: - # - # `projects/{project}/locations/{location}/customClasses` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of custom classes to return. The service may return - # fewer than this value. If unspecified, at most 50 custom classes will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListCustomClass` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCustomClass` must - # match the call that provided the page token. - class ListCustomClassesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned to the client by the `ListCustomClasses` method. - # @!attribute [rw] custom_classes - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::CustomClass>] - # The custom classes. - # @!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 ListCustomClassesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message sent by the client for the `DeleteCustomClass` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the custom class to delete. Format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - class DeleteCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/resource.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/resource.rb deleted file mode 100644 index 09887768ca8a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/cloud/speech/v1p1beta1/resource.rb +++ /dev/null @@ -1,325 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Speech - module V1p1beta1 - # A set of words or phrases that represents a common concept likely to appear - # in your audio, for example a list of passenger ship names. CustomClass items - # can be substituted into placeholders that you set in PhraseSet phrases. - # @!attribute [rw] name - # @return [::String] - # The resource name of the custom class. - # @!attribute [rw] custom_class_id - # @return [::String] - # If this custom class is a resource, the custom_class_id is the resource id - # of the CustomClass. Case sensitive. - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::CustomClass::ClassItem>] - # A collection of class items. - # @!attribute [r] kms_key_name - # @return [::String] - # Output only. The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the content of the ClassItem is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] kms_key_version_name - # @return [::String] - # Output only. The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which content of the ClassItem is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - # @!attribute [r] uid - # @return [::String] - # Output only. System-assigned unique identifier for the CustomClass. - # This field is not used. - # @!attribute [r] display_name - # @return [::String] - # Output only. User-settable, human-readable name for the CustomClass. Must - # be 63 characters or less. This field is not used. - # @!attribute [r] state - # @return [::Google::Cloud::Speech::V1p1beta1::CustomClass::State] - # Output only. The CustomClass lifecycle state. - # This field is not used. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource was requested for deletion. - # This field is not used. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource will be purged. - # This field is not used. - # @!attribute [r] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. Allows users to store small amounts of arbitrary data. - # Both the key and the value must be 63 characters or less each. - # At most 100 annotations. - # This field is not used. - # @!attribute [r] etag - # @return [::String] - # Output only. This checksum is computed by the server based on the value of - # other fields. This may be sent on update, undelete, and delete requests to - # ensure the client has an up-to-date value before proceeding. This field is - # not used. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Whether or not this CustomClass is in the process of being - # updated. This field is not used. - class CustomClass - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An item of the class. - # @!attribute [rw] value - # @return [::String] - # The class item's value. - class ClassItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of states that define the lifecycle of a CustomClass. - module State - # Unspecified state. This is only used/useful for distinguishing - # unset values. - STATE_UNSPECIFIED = 0 - - # The normal and active state. - ACTIVE = 2 - - # This CustomClass has been deleted. - DELETED = 4 - end - end - - # Provides "hints" to the speech recognizer to favor specific words and phrases - # in the results. - # @!attribute [rw] name - # @return [::String] - # The resource name of the phrase set. - # @!attribute [rw] phrases - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::PhraseSet::Phrase>] - # A list of word and phrases. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Positive value will increase the probability that a specific - # phrase will be recognized over other similar sounding phrases. The higher - # the boost, the higher the chance of false positive recognition as well. - # Negative boost values would correspond to anti-biasing. Anti-biasing is not - # enabled, so negative boost will simply be ignored. Though `boost` can - # accept a wide range of positive values, most use cases are best served with - # values between 0 (exclusive) and 20. We recommend using a binary search - # approach to finding the optimal value for your use case as well as adding - # phrases both with and without boost to your requests. - # @!attribute [r] kms_key_name - # @return [::String] - # Output only. The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the content of the PhraseSet is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] kms_key_version_name - # @return [::String] - # Output only. The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which content of the PhraseSet is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - # @!attribute [r] uid - # @return [::String] - # Output only. System-assigned unique identifier for the PhraseSet. - # This field is not used. - # @!attribute [r] display_name - # @return [::String] - # Output only. User-settable, human-readable name for the PhraseSet. Must be - # 63 characters or less. This field is not used. - # @!attribute [r] state - # @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet::State] - # Output only. The CustomClass lifecycle state. - # This field is not used. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource was requested for deletion. - # This field is not used. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource will be purged. - # This field is not used. - # @!attribute [r] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. Allows users to store small amounts of arbitrary data. - # Both the key and the value must be 63 characters or less each. - # At most 100 annotations. - # This field is not used. - # @!attribute [r] etag - # @return [::String] - # Output only. This checksum is computed by the server based on the value of - # other fields. This may be sent on update, undelete, and delete requests to - # ensure the client has an up-to-date value before proceeding. This field is - # not used. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Whether or not this PhraseSet is in the process of being - # updated. This field is not used. - class PhraseSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A phrases containing words and phrase "hints" so that - # the speech recognition is more likely to recognize them. This can be used - # to improve the accuracy for specific words and phrases, for example, if - # specific commands are typically spoken by the user. This can also be used - # to add additional words to the vocabulary of the recognizer. See - # [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - # - # List items can also include pre-built or custom classes containing groups - # of words that represent common concepts that occur in natural language. For - # example, rather than providing a phrase hint for every month of the - # year (e.g. "i was born in january", "i was born in febuary", ...), use the - # pre-built `$MONTH` class improves the likelihood of correctly transcribing - # audio that includes months (e.g. "i was born in $month"). - # To refer to pre-built classes, use the class' symbol prepended with `$` - # e.g. `$MONTH`. To refer to custom classes that were defined inline in the - # request, set the class's `custom_class_id` to a string unique to all class - # resources and inline classes. Then use the class' id wrapped in $`{...}` - # e.g. "$\\{my-months}". To refer to custom classes resources, use the class' - # id wrapped in `${}` (e.g. `${my-months}`). - # - # Speech-to-Text supports three locations: `global`, `us` (US North America), - # and `eu` (Europe). If you are calling the `speech.googleapis.com` - # endpoint, use the `global` location. To specify a region, use a - # [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - # with matching `us` or `eu` location value. - # @!attribute [rw] value - # @return [::String] - # The phrase itself. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Overrides the boost set at the phrase set level. - # Positive value will increase the probability that a specific phrase will - # be recognized over other similar sounding phrases. The higher the boost, - # the higher the chance of false positive recognition as well. Negative - # boost will simply be ignored. Though `boost` can accept a wide range of - # positive values, most use cases are best served - # with values between 0 and 20. We recommend using a binary search approach - # to finding the optimal value for your use case as well as adding - # phrases both with and without boost to your requests. - class Phrase - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of states that define the lifecycle of a CustomClass. - module State - # Unspecified state. This is only used/useful for distinguishing - # unset values. - STATE_UNSPECIFIED = 0 - - # The normal and active state. - ACTIVE = 2 - - # This CustomClass has been deleted. - DELETED = 4 - end - end - - # Speech adaptation configuration. - # @!attribute [rw] phrase_sets - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::PhraseSet>] - # A collection of phrase sets. To specify the hints inline, leave the - # phrase set's `name` blank and fill in the rest of its fields. Any - # phrase set can use any custom class. - # @!attribute [rw] phrase_set_references - # @return [::Array<::String>] - # A collection of phrase set resource names to use. - # @!attribute [rw] custom_classes - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::CustomClass>] - # A collection of custom classes. To specify the classes inline, leave the - # class' `name` blank and fill in the rest of its fields, giving it a unique - # `custom_class_id`. Refer to the inline defined class in phrase hints by its - # `custom_class_id`. - # @!attribute [rw] abnf_grammar - # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptation::ABNFGrammar] - # Augmented Backus-Naur form (ABNF) is a standardized grammar notation - # comprised by a set of derivation rules. - # See specifications: https://www.w3.org/TR/speech-grammar - class SpeechAdaptation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] abnf_strings - # @return [::Array<::String>] - # All declarations and rules of an ABNF grammar broken up into multiple - # strings that will end up concatenated. - class ABNFGrammar - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Transcription normalization configuration. Use transcription normalization - # to automatically replace parts of the transcript with phrases of your - # choosing. For StreamingRecognize, this normalization only applies to stable - # partial transcripts (stability > 0.8) and final transcripts. - # @!attribute [rw] entries - # @return [::Array<::Google::Cloud::Speech::V1p1beta1::TranscriptNormalization::Entry>] - # A list of replacement entries. We will perform replacement with one entry - # at a time. For example, the second entry in ["cat" => "dog", "mountain cat" - # => "mountain dog"] will never be applied because we will always process the - # first entry before it. At most 100 entries. - class TranscriptNormalization - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single replacement configuration. - # @!attribute [rw] search - # @return [::String] - # What to replace. Max length is 100 characters. - # @!attribute [rw] replace - # @return [::String] - # What to replace with. Max length is 100 characters. - # @!attribute [rw] case_sensitive - # @return [::Boolean] - # Whether the search is case sensitive. - class Entry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 9a7c0269fa42..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/Gemfile deleted file mode 100644 index 4acec445659b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-speech-v1p1beta1", path: "../" -else - gem "google-cloud-speech-v1p1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb deleted file mode 100644 index 5c73bb5dd521..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Adaptation_CreateCustomClass_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the create_custom_class call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_custom_class. -# -def create_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new - - # Call the create_custom_class method. - result = client.create_custom_class request - - # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. - p result -end -# [END speech_v1p1beta1_generated_Adaptation_CreateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb deleted file mode 100644 index 7d85b9d76fde..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the create_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_phrase_set. -# -def create_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new - - # Call the create_phrase_set method. - result = client.create_phrase_set request - - # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. - p result -end -# [END speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb deleted file mode 100644 index 4093e3e479b3..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the delete_custom_class call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_custom_class. -# -def delete_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new - - # Call the delete_custom_class method. - result = client.delete_custom_class request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb deleted file mode 100644 index 742847acd058..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the delete_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_phrase_set. -# -def delete_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new - - # Call the delete_phrase_set method. - result = client.delete_phrase_set request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb deleted file mode 100644 index 67374d53dcb0..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Adaptation_GetCustomClass_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the get_custom_class call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_custom_class. -# -def get_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new - - # Call the get_custom_class method. - result = client.get_custom_class request - - # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. - p result -end -# [END speech_v1p1beta1_generated_Adaptation_GetCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb deleted file mode 100644 index 292ba87e414c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Adaptation_GetPhraseSet_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the get_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_phrase_set. -# -def get_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new - - # Call the get_phrase_set method. - result = client.get_phrase_set request - - # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. - p result -end -# [END speech_v1p1beta1_generated_Adaptation_GetPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb deleted file mode 100644 index 0bc4f30f6be8..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.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 speech_v1p1beta1_generated_Adaptation_ListCustomClasses_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the list_custom_classes call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_custom_classes. -# -def list_custom_classes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new - - # Call the list_custom_classes method. - result = client.list_custom_classes request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass. - p item - end -end -# [END speech_v1p1beta1_generated_Adaptation_ListCustomClasses_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb deleted file mode 100644 index 6ad4f5cc6487..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.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 speech_v1p1beta1_generated_Adaptation_ListPhraseSet_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the list_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_phrase_set. -# -def list_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new - - # Call the list_phrase_set method. - result = client.list_phrase_set request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet. - p item - end -end -# [END speech_v1p1beta1_generated_Adaptation_ListPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb deleted file mode 100644 index 6cf5ff2deb0c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the update_custom_class call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_custom_class. -# -def update_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new - - # Call the update_custom_class method. - result = client.update_custom_class request - - # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. - p result -end -# [END speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb deleted file mode 100644 index 4b35a1ba1fff..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the update_phrase_set call in the Adaptation service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_phrase_set. -# -def update_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new - - # Call the update_phrase_set method. - result = client.update_phrase_set request - - # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. - p result -end -# [END speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json deleted file mode 100644 index ab7bf03ae9a7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json +++ /dev/null @@ -1,535 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-speech-v1p1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.speech.v1p1beta1", - "version": "v1p1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "speech_v1p1beta1_generated_Speech_Recognize_sync", - "title": "Snippet for the recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Speech::Client#recognize.", - "file": "speech/recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "recognize", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client#recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::RecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::RecognizeResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client" - }, - "method": { - "short_name": "Recognize", - "full_name": "google.cloud.speech.v1p1beta1.Speech.Recognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v1p1beta1.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Speech_LongRunningRecognize_sync", - "title": "Snippet for the long_running_recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Speech::Client#long_running_recognize.", - "file": "speech/long_running_recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "long_running_recognize", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client#long_running_recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client" - }, - "method": { - "short_name": "LongRunningRecognize", - "full_name": "google.cloud.speech.v1p1beta1.Speech.LongRunningRecognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v1p1beta1.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Speech_StreamingRecognize_sync", - "title": "Snippet for the streaming_recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Speech::Client#streaming_recognize.", - "file": "speech/streaming_recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_recognize", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client#streaming_recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Speech::Client" - }, - "method": { - "short_name": "StreamingRecognize", - "full_name": "google.cloud.speech.v1p1beta1.Speech.StreamingRecognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v1p1beta1.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_sync", - "title": "Snippet for the create_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_phrase_set.", - "file": "adaptation/create_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_phrase_set", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::PhraseSet", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "CreatePhraseSet", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_GetPhraseSet_sync", - "title": "Snippet for the get_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_phrase_set.", - "file": "adaptation/get_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_phrase_set", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::PhraseSet", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "GetPhraseSet", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_ListPhraseSet_sync", - "title": "Snippet for the list_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_phrase_set.", - "file": "adaptation/list_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_phrase_set", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "ListPhraseSet", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_sync", - "title": "Snippet for the update_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_phrase_set.", - "file": "adaptation/update_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_phrase_set", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::PhraseSet", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "UpdatePhraseSet", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_sync", - "title": "Snippet for the delete_phrase_set call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_phrase_set.", - "file": "adaptation/delete_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_phrase_set", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "DeletePhraseSet", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSet", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_CreateCustomClass_sync", - "title": "Snippet for the create_custom_class call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_custom_class.", - "file": "adaptation/create_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_custom_class", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::CustomClass", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "CreateCustomClass", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClass", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_GetCustomClass_sync", - "title": "Snippet for the get_custom_class call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_custom_class.", - "file": "adaptation/get_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_custom_class", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::CustomClass", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "GetCustomClass", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.GetCustomClass", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_ListCustomClasses_sync", - "title": "Snippet for the list_custom_classes call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_custom_classes.", - "file": "adaptation/list_custom_classes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_custom_classes", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_custom_classes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "ListCustomClasses", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.ListCustomClasses", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_sync", - "title": "Snippet for the update_custom_class call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_custom_class.", - "file": "adaptation/update_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_custom_class", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V1p1beta1::CustomClass", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "UpdateCustomClass", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClass", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_sync", - "title": "Snippet for the delete_custom_class call in the Adaptation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_custom_class.", - "file": "adaptation/delete_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_custom_class", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Adaptation::Client", - "full_name": "::Google::Cloud::Speech::V1p1beta1::Adaptation::Client" - }, - "method": { - "short_name": "DeleteCustomClass", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClass", - "service": { - "short_name": "Adaptation", - "full_name": "google.cloud.speech.v1p1beta1.Adaptation" - } - } - }, - "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-speech-v1p1beta1/snippets/speech/long_running_recognize.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb deleted file mode 100644 index eb1d313092dd..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Speech_LongRunningRecognize_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the long_running_recognize call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Speech::Client#long_running_recognize. -# -def long_running_recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new - - # Call the long_running_recognize method. - result = client.long_running_recognize request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v1p1beta1_generated_Speech_LongRunningRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb deleted file mode 100644 index cd26986de973..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v1p1beta1_generated_Speech_Recognize_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the recognize call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Speech::Client#recognize. -# -def recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new - - # Call the recognize method. - result = client.recognize request - - # The returned object is of type Google::Cloud::Speech::V1p1beta1::RecognizeResponse. - p result -end -# [END speech_v1p1beta1_generated_Speech_Recognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb deleted file mode 100644 index 719413e3c9a3..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.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! - -# [START speech_v1p1beta1_generated_Speech_StreamingRecognize_sync] -require "google/cloud/speech/v1p1beta1" - -## -# Snippet for the streaming_recognize call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V1p1beta1::Speech::Client#streaming_recognize. -# -def streaming_recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the streaming_recognize method to start streaming. - output = client.streaming_recognize input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new - input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse - output.each do |current_response| - p current_response - end -end -# [END speech_v1p1beta1_generated_Speech_StreamingRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb deleted file mode 100644 index 5b544b26135c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/speech/v1p1beta1/adaptation" - -class ::Google::Cloud::Speech::V1p1beta1::Adaptation::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_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::Speech::V1p1beta1::Adaptation::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::Speech::V1p1beta1::Adaptation::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_custom_class_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" - assert_equal "projects/value0/locations/value1/customClasses/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::Speech::V1p1beta1::Adaptation::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_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb deleted file mode 100644 index 306bcdc93477..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb +++ /dev/null @@ -1,649 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/speech/v1p1beta1/cloud_speech_adaptation_pb" -require "google/cloud/speech/v1p1beta1/adaptation/rest" - - -class ::Google::Cloud::Speech::V1p1beta1::Adaptation::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_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - phrase_set_id = "hello world" - phrase_set = {} - - create_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_create_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_phrase_set parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_phrase_set ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_phrase_set(::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_phrase_set_client_stub.call_count - end - end - end - - def test_get_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_get_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_phrase_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_phrase_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_phrase_set ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_phrase_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_phrase_set(::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_phrase_set_client_stub.call_count - end - end - end - - def test_list_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse.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_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_list_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_phrase_set({ 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_phrase_set 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_phrase_set ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.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_phrase_set({ 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_phrase_set(::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.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_phrase_set_client_stub.call_count - end - end - end - - def test_update_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - phrase_set = {} - update_mask = {} - - update_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_update_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_phrase_set ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_phrase_set(::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_phrase_set_client_stub.call_count - end - end - end - - def test_delete_phrase_set - # 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_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_delete_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_phrase_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_phrase_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_phrase_set ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_phrase_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_phrase_set(::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_phrase_set_client_stub.call_count - end - end - end - - def test_create_custom_class - # Create test objects. - client_result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - custom_class_id = "hello world" - custom_class = {} - - create_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_create_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_custom_class parent: parent, custom_class_id: custom_class_id, custom_class: custom_class do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_custom_class ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_custom_class(::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_custom_class_client_stub.call_count - end - end - end - - def test_get_custom_class - # Create test objects. - client_result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_get_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_custom_class({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_custom_class name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_custom_class ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_custom_class({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_custom_class(::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_custom_class_client_stub.call_count - end - end - end - - def test_list_custom_classes - # Create test objects. - client_result = ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse.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_custom_classes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_list_custom_classes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_custom_classes_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_custom_classes({ 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_custom_classes 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_custom_classes ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.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_custom_classes({ 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_custom_classes(::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.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_custom_classes_client_stub.call_count - end - end - end - - def test_update_custom_class - # Create test objects. - client_result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - custom_class = {} - update_mask = {} - - update_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_update_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_custom_class custom_class: custom_class, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_custom_class ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_custom_class(::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_custom_class_client_stub.call_count - end - end - end - - def test_delete_custom_class - # 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_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::ServiceStub.stub :transcode_delete_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_custom_class({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_custom_class name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_custom_class ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_custom_class({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_custom_class(::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_custom_class_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::Speech::V1p1beta1::Adaptation::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::Speech::V1p1beta1::Adaptation::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb deleted file mode 100644 index c47dd787a294..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb +++ /dev/null @@ -1,714 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb" -require "google/cloud/speech/v1p1beta1/adaptation" - -class ::Google::Cloud::Speech::V1p1beta1::Adaptation::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_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - phrase_set_id = "hello world" - phrase_set = {} - - create_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["phrase_set_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::PhraseSet), request["phrase_set"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_phrase_set parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_phrase_set ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_phrase_set({ parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_phrase_set(::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new(parent: parent, phrase_set_id: phrase_set_id, phrase_set: phrase_set), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_phrase_set_client_stub.call_rpc_count - end - end - - def test_get_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_phrase_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_phrase_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_phrase_set ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_phrase_set({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_phrase_set(::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_phrase_set_client_stub.call_rpc_count - end - end - - def test_list_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest, 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_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_phrase_set({ parent: parent, page_size: page_size, page_token: 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_phrase_set parent: parent, page_size: page_size, page_token: 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_phrase_set ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.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_phrase_set({ parent: parent, page_size: page_size, page_token: page_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_phrase_set(::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.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_phrase_set_client_stub.call_rpc_count - end - end - - def test_update_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - phrase_set = {} - update_mask = {} - - update_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::PhraseSet), request["phrase_set"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_phrase_set ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set({ phrase_set: phrase_set, 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_phrase_set(::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set_client_stub.call_rpc_count - end - end - - def test_delete_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_phrase_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_phrase_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_phrase_set ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_phrase_set({ 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_phrase_set(::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new(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_phrase_set_client_stub.call_rpc_count - end - end - - def test_create_custom_class - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - custom_class_id = "hello world" - custom_class = {} - - create_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["custom_class_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::CustomClass), request["custom_class"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_custom_class parent: parent, custom_class_id: custom_class_id, custom_class: custom_class do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_custom_class ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_custom_class({ parent: parent, custom_class_id: custom_class_id, custom_class: custom_class }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_custom_class(::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new(parent: parent, custom_class_id: custom_class_id, custom_class: custom_class), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_custom_class_client_stub.call_rpc_count - end - end - - def test_get_custom_class - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_custom_class({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_custom_class name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_custom_class ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_custom_class({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_custom_class(::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_custom_class_client_stub.call_rpc_count - end - end - - def test_list_custom_classes - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_custom_classes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_custom_classes, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest, 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_custom_classes_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: 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_custom_classes parent: parent, page_size: page_size, page_token: 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_custom_classes ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.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_custom_classes({ parent: parent, page_size: page_size, page_token: page_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_custom_classes(::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.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_custom_classes_client_stub.call_rpc_count - end - end - - def test_update_custom_class - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::CustomClass.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - custom_class = {} - update_mask = {} - - update_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::CustomClass), request["custom_class"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_custom_class custom_class: custom_class, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_custom_class ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class({ custom_class: custom_class, 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_custom_class(::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class_client_stub.call_rpc_count - end - end - - def test_delete_custom_class - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_custom_class({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_custom_class name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_custom_class ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_custom_class({ 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_custom_class(::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new(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_custom_class_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V1p1beta1::Adaptation::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::Speech::V1p1beta1::Adaptation::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::Speech::V1p1beta1::Adaptation::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb deleted file mode 100644 index d36047600a78..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_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/speech/v1p1beta1/cloud_speech_pb" -require "google/cloud/speech/v1p1beta1/cloud_speech_services_pb" -require "google/cloud/speech/v1p1beta1/speech" - -class ::Google::Cloud::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb deleted file mode 100644 index 9572a99afe91..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/speech/v1p1beta1/speech" - -class ::Google::Cloud::Speech::V1p1beta1::Speech::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_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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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_custom_class_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" - assert_equal "projects/value0/locations/value1/customClasses/value2", path - end - end - - def test_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb deleted file mode 100644 index 99ea6cbebd0d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb +++ /dev/null @@ -1,210 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/speech/v1p1beta1/cloud_speech_pb" -require "google/cloud/speech/v1p1beta1/speech/rest" - - -class ::Google::Cloud::Speech::V1p1beta1::Speech::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_recognize - # Create test objects. - client_result = ::Google::Cloud::Speech::V1p1beta1::RecognizeResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - config = {} - audio = {} - - recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::ServiceStub.stub :transcode_recognize_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.recognize({ config: config, audio: audio }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.recognize config: config, audio: audio do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.recognize ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new(config: config, audio: audio) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.recognize({ config: config, audio: audio }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.recognize(::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new(config: config, audio: audio), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, recognize_client_stub.call_count - end - end - end - - def test_long_running_recognize - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - config = {} - audio = {} - output_config = {} - - long_running_recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::ServiceStub.stub :transcode_long_running_recognize_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, long_running_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.long_running_recognize({ config: config, audio: audio, output_config: output_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.long_running_recognize config: config, audio: audio, output_config: output_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.long_running_recognize ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.long_running_recognize({ config: config, audio: audio, output_config: output_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.long_running_recognize(::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, long_running_recognize_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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb deleted file mode 100644 index 704771621ccf..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb +++ /dev/null @@ -1,334 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/speech/v1p1beta1/cloud_speech_pb" -require "google/cloud/speech/v1p1beta1/speech" - -class ::Google::Cloud::Speech::V1p1beta1::Speech::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_recognize - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::RecognizeResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - config = {} - audio = {} - - recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :recognize, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::RecognitionConfig), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::RecognitionAudio), request["audio"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.recognize({ config: config, audio: audio }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.recognize config: config, audio: audio do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.recognize ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new(config: config, audio: audio) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.recognize({ config: config, audio: audio }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.recognize(::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new(config: config, audio: audio), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, recognize_client_stub.call_rpc_count - end - end - - def test_long_running_recognize - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - config = {} - audio = {} - output_config = {} - - long_running_recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :long_running_recognize, name - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::RecognitionConfig), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::RecognitionAudio), request["audio"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig), request["output_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, long_running_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.long_running_recognize({ config: config, audio: audio, output_config: output_config }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.long_running_recognize config: config, audio: audio, output_config: output_config do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.long_running_recognize ::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.long_running_recognize({ config: config, audio: audio, output_config: output_config }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.long_running_recognize(::Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new(config: config, audio: audio, output_config: output_config), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, long_running_recognize_client_stub.call_rpc_count - end - end - - def test_streaming_recognize - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a bidi streaming method. - streaming_config = {} - - streaming_recognize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_recognize, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, streaming_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_recognize enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_recognize stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_recognize enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_recognize stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, streaming_recognize_client_stub.call_rpc_count - streaming_recognize_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest, r - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionConfig), r["streaming_config"] - assert_equal :streaming_config, r.streaming_request - end - end - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::Speech::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::Speech::V1p1beta1::Speech::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Speech::V1p1beta1::Speech::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/helper.rb b/owl-bot-staging/google-cloud-speech-v1p1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v1p1beta1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-speech-v2/.gitignore b/owl-bot-staging/google-cloud-speech-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json deleted file mode 100644 index a731ceb554c7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "speech.googleapis.com", - "api_shortname": "speech", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest", - "distribution_name": "google-cloud-speech-v2", - "is_cloud": true, - "language": "ruby", - "name": "speech", - "name_pretty": "Cloud Speech-to-Text V2 API", - "product_documentation": "https://cloud.google.com/speech-to-text", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SPEECH", - "ruby-cloud-product-url": "https://cloud.google.com/speech-to-text", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml b/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml deleted file mode 100644 index 11a141b34f5b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-speech-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-speech-v2.rb" diff --git a/owl-bot-staging/google-cloud-speech-v2/.toys.rb b/owl-bot-staging/google-cloud-speech-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2/.yardopts b/owl-bot-staging/google-cloud-speech-v2/.yardopts deleted file mode 100644 index bbc8579c72a2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Speech-to-Text 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-speech-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md deleted file mode 100644 index d5ea6bd0837e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-speech-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-speech-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/speech/v2" - -client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/speech/v2" - -::Google::Cloud::Speech::V2::Speech::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Speech::V2::Speech::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-speech-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/speech/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Speech::V2::Speech::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-speech-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-speech-v2/Gemfile b/owl-bot-staging/google-cloud-speech-v2/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-speech-v2/LICENSE.md b/owl-bot-staging/google-cloud-speech-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2/README.md b/owl-bot-staging/google-cloud-speech-v2/README.md deleted file mode 100644 index 357f59f2dd7b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Speech-to-Text V2 API - -Converts audio to text by applying powerful neural network models. - -Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. - -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 Speech-to-Text V2 API. Most users should consider using -the main client gem, -[google-cloud-speech](https://rubygems.org/gems/google-cloud-speech). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-speech-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/speech.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/speech/v2" - -client = ::Google::Cloud::Speech::V2::Speech::Client.new -request = ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new # (request fields as keyword arguments...) -response = client.create_recognizer request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/speech-to-text) -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/speech/v2" -require "logger" - -client = ::Google::Cloud::Speech::V2::Speech::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-speech`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-speech-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-speech`. -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-speech-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-speech-v2/Rakefile b/owl-bot-staging/google-cloud-speech-v2/Rakefile deleted file mode 100644 index d2dc0b8f0e77..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SPEECH_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SPEECH_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SPEECH_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 SPEECH_TEST_PROJECT=test123 SPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/speech/v2/speech/credentials" - ::Google::Cloud::Speech::V2::Speech::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SPEECH_PROJECT"] = project - ENV["SPEECH_TEST_PROJECT"] = project - ENV["SPEECH_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-speech-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-speech-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-speech-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-speech-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-speech-v2" - header "google-cloud-speech-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-speech-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-speech-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-speech-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-speech-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-speech-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json deleted file mode 100644 index d420dfa5479a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/gapic_metadata.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.speech.v2", - "libraryPackage": "::Google::Cloud::Speech::V2", - "services": { - "Speech": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Speech::V2::Speech::Client", - "rpcs": { - "CreateRecognizer": { - "methods": [ - "create_recognizer" - ] - }, - "ListRecognizers": { - "methods": [ - "list_recognizers" - ] - }, - "GetRecognizer": { - "methods": [ - "get_recognizer" - ] - }, - "UpdateRecognizer": { - "methods": [ - "update_recognizer" - ] - }, - "DeleteRecognizer": { - "methods": [ - "delete_recognizer" - ] - }, - "UndeleteRecognizer": { - "methods": [ - "undelete_recognizer" - ] - }, - "Recognize": { - "methods": [ - "recognize" - ] - }, - "StreamingRecognize": { - "methods": [ - "streaming_recognize" - ] - }, - "BatchRecognize": { - "methods": [ - "batch_recognize" - ] - }, - "GetConfig": { - "methods": [ - "get_config" - ] - }, - "UpdateConfig": { - "methods": [ - "update_config" - ] - }, - "CreateCustomClass": { - "methods": [ - "create_custom_class" - ] - }, - "ListCustomClasses": { - "methods": [ - "list_custom_classes" - ] - }, - "GetCustomClass": { - "methods": [ - "get_custom_class" - ] - }, - "UpdateCustomClass": { - "methods": [ - "update_custom_class" - ] - }, - "DeleteCustomClass": { - "methods": [ - "delete_custom_class" - ] - }, - "UndeleteCustomClass": { - "methods": [ - "undelete_custom_class" - ] - }, - "CreatePhraseSet": { - "methods": [ - "create_phrase_set" - ] - }, - "ListPhraseSets": { - "methods": [ - "list_phrase_sets" - ] - }, - "GetPhraseSet": { - "methods": [ - "get_phrase_set" - ] - }, - "UpdatePhraseSet": { - "methods": [ - "update_phrase_set" - ] - }, - "DeletePhraseSet": { - "methods": [ - "delete_phrase_set" - ] - }, - "UndeletePhraseSet": { - "methods": [ - "undelete_phrase_set" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec b/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec deleted file mode 100644 index a5e16d628d34..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/google-cloud-speech-v2.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/speech/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-speech-v2" - gem.version = Google::Cloud::Speech::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology. Note that google-cloud-speech-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-speech instead. See the readme for more details." - gem.summary = "Converts audio to text by applying powerful neural network models." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-v2.rb deleted file mode 100644 index ca01b088ebe3..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google-cloud-speech-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/speech/v2" diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb deleted file mode 100644 index e2a296043fce..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/speech/v2/speech" -require "google/cloud/speech/v2/version" - -module Google - module Cloud - module Speech - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/speech/v2" - # client = ::Google::Cloud::Speech::V2::Speech::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/speech/v2" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module V2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/speech/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/bindings_override.rb deleted file mode 100644 index a89a217f0dc0..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/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 Speech - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/speech/v2/rest" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module V2 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Speech"] - parent_config = while namespace.any? - parent_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: "/v2/{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: "/v2/{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-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb deleted file mode 100644 index 09b1f1cec71a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_pb.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v2/cloud_speech.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/duration_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n)google/cloud/speech/v2/cloud_speech.proto\x12\x16google.cloud.speech.v2\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\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xbe\x01\n\x17\x43reateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rrecognizer_id\x18\x03 \x01(\t\x12\x38\n\x06parent\x18\x04 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 speech.googleapis.com/Recognizer\"\xe7\x0c\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08resource\x18\x03 \x01(\t\x12\x0e\n\x06method\x18\x04 \x01(\t\x12<\n\x0ckms_key_name\x18\x06 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12K\n\x14kms_key_version_name\x18\x07 \x01(\tB-\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12P\n\x17\x62\x61tch_recognize_request\x18\x08 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeRequestH\x00\x12T\n\x19\x63reate_recognizer_request\x18\t \x01(\x0b\x32/.google.cloud.speech.v2.CreateRecognizerRequestH\x00\x12T\n\x19update_recognizer_request\x18\n \x01(\x0b\x32/.google.cloud.speech.v2.UpdateRecognizerRequestH\x00\x12T\n\x19\x64\x65lete_recognizer_request\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.DeleteRecognizerRequestH\x00\x12X\n\x1bundelete_recognizer_request\x18\x0c \x01(\x0b\x32\x31.google.cloud.speech.v2.UndeleteRecognizerRequestH\x00\x12W\n\x1b\x63reate_custom_class_request\x18\r \x01(\x0b\x32\x30.google.cloud.speech.v2.CreateCustomClassRequestH\x00\x12W\n\x1bupdate_custom_class_request\x18\x0e \x01(\x0b\x32\x30.google.cloud.speech.v2.UpdateCustomClassRequestH\x00\x12W\n\x1b\x64\x65lete_custom_class_request\x18\x0f \x01(\x0b\x32\x30.google.cloud.speech.v2.DeleteCustomClassRequestH\x00\x12[\n\x1dundelete_custom_class_request\x18\x10 \x01(\x0b\x32\x32.google.cloud.speech.v2.UndeleteCustomClassRequestH\x00\x12S\n\x19\x63reate_phrase_set_request\x18\x11 \x01(\x0b\x32..google.cloud.speech.v2.CreatePhraseSetRequestH\x00\x12S\n\x19update_phrase_set_request\x18\x12 \x01(\x0b\x32..google.cloud.speech.v2.UpdatePhraseSetRequestH\x00\x12S\n\x19\x64\x65lete_phrase_set_request\x18\x13 \x01(\x0b\x32..google.cloud.speech.v2.DeletePhraseSetRequestH\x00\x12W\n\x1bundelete_phrase_set_request\x18\x14 \x01(\x0b\x32\x30.google.cloud.speech.v2.UndeletePhraseSetRequestH\x00\x12P\n\x15update_config_request\x18\x15 \x01(\x0b\x32+.google.cloud.speech.v2.UpdateConfigRequestB\x02\x18\x01H\x00\x12\x18\n\x10progress_percent\x18\x16 \x01(\x05\x12R\n\x18\x62\x61tch_recognize_metadata\x18\x17 \x01(\x0b\x32..google.cloud.speech.v2.BatchRecognizeMetadataH\x01\x42\t\n\x07requestB\n\n\x08metadata\"\x90\x01\n\x16ListRecognizersRequest\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\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"k\n\x17ListRecognizersResponse\x12\x37\n\x0brecognizers\x18\x01 \x03(\x0b\x32\".google.cloud.speech.v2.Recognizer\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\"\x9e\x01\n\x17UpdateRecognizerRequest\x12;\n\nrecognizer\x18\x01 \x01(\x0b\x32\".google.cloud.speech.v2.RecognizerB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8d\x01\n\x17\x44\x65leteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"x\n\x19UndeleteRecognizerRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xc5\x07\n\nRecognizer\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x14\n\x05model\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x1d\n\x0elanguage_codes\x18\x11 \x03(\tB\x05\x18\x01\xe0\x41\x01\x12M\n\x1a\x64\x65\x66\x61ult_recognition_config\x18\x06 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12H\n\x0b\x61nnotations\x18\x07 \x03(\x0b\x32\x33.google.cloud.speech.v2.Recognizer.AnnotationsEntry\x12<\n\x05state\x18\x08 \x01(\x0e\x32(.google.cloud.speech.v2.Recognizer.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\x0f \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x10 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:j\xea\x41g\n speech.googleapis.com/Recognizer\x12@projects/{project}/locations/{location}/recognizers/{recognizer}R\x01\x01\"\x1a\n\x18\x41utoDetectDecodingConfig\"\xf0\x02\n\x16\x45xplicitDecodingConfig\x12S\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32<.google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13\x61udio_channel_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xbe\x01\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\t\n\x05MULAW\x10\x02\x12\x08\n\x04\x41LAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x08\n\x04\x46LAC\x10\x06\x12\x07\n\x03MP3\x10\x07\x12\x0c\n\x08OGG_OPUS\x10\x08\x12\r\n\tWEBM_OPUS\x10\t\x12\x0b\n\x07MP4_AAC\x10\n\x12\x0b\n\x07M4A_AAC\x10\x0b\x12\x0b\n\x07MOV_AAC\x10\x0c\"Z\n\x18SpeakerDiarizationConfig\x12\x1e\n\x11min_speaker_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11max_speaker_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"0\n\x12\x43ustomPromptConfig\x12\x1a\n\rcustom_prompt\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xc7\x04\n\x13RecognitionFeatures\x12\x18\n\x10profanity_filter\x18\x01 \x01(\x08\x12 \n\x18\x65nable_word_time_offsets\x18\x02 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x03 \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x04 \x01(\x08\x12!\n\x19\x65nable_spoken_punctuation\x18\x0e \x01(\x08\x12\x1c\n\x14\x65nable_spoken_emojis\x18\x0f \x01(\x08\x12X\n\x12multi_channel_mode\x18\x11 \x01(\x0e\x32<.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode\x12L\n\x12\x64iarization_config\x18\t \x01(\x0b\x32\x30.google.cloud.speech.v2.SpeakerDiarizationConfig\x12\x18\n\x10max_alternatives\x18\x10 \x01(\x05\x12M\n\x14\x63ustom_prompt_config\x18\x12 \x01(\x0b\x32*.google.cloud.speech.v2.CustomPromptConfigB\x03\xe0\x41\x01\"\\\n\x10MultiChannelMode\x12\"\n\x1eMULTI_CHANNEL_MODE_UNSPECIFIED\x10\x00\x12$\n SEPARATE_RECOGNITION_PER_CHANNEL\x10\x01\"\xa3\x01\n\x17TranscriptNormalization\x12\x46\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x35.google.cloud.speech.v2.TranscriptNormalization.Entry\x1a@\n\x05\x45ntry\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0f\n\x07replace\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61se_sensitive\x18\x03 \x01(\x08\"1\n\x11TranslationConfig\x12\x1c\n\x0ftarget_language\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xbf\x02\n\x10SpeechAdaptation\x12Q\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32<.google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet\x12;\n\x0e\x63ustom_classes\x18\x02 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x1a\x9a\x01\n\x13\x41\x64\x61ptationPhraseSet\x12:\n\nphrase_set\x18\x01 \x01(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSetH\x00\x12>\n\x11inline_phrase_set\x18\x02 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetH\x00\x42\x07\n\x05value\">\n\x0e\x44\x65noiserConfig\x12\x15\n\rdenoise_audio\x18\x01 \x01(\x08\x12\x15\n\rsnr_threshold\x18\x02 \x01(\x02\"\xe4\x04\n\x11RecognitionConfig\x12P\n\x14\x61uto_decoding_config\x18\x07 \x01(\x0b\x32\x30.google.cloud.speech.v2.AutoDetectDecodingConfigH\x00\x12R\n\x18\x65xplicit_decoding_config\x18\x08 \x01(\x0b\x32..google.cloud.speech.v2.ExplicitDecodingConfigH\x00\x12\x12\n\x05model\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0elanguage_codes\x18\n \x03(\tB\x03\xe0\x41\x01\x12=\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32+.google.cloud.speech.v2.RecognitionFeatures\x12<\n\nadaptation\x18\x06 \x01(\x0b\x32(.google.cloud.speech.v2.SpeechAdaptation\x12V\n\x18transcript_normalization\x18\x0b \x01(\x0b\x32/.google.cloud.speech.v2.TranscriptNormalizationB\x03\xe0\x41\x01\x12J\n\x12translation_config\x18\x0f \x01(\x0b\x32).google.cloud.speech.v2.TranslationConfigB\x03\xe0\x41\x01\x12\x44\n\x0f\x64\x65noiser_config\x18\x10 \x01(\x0b\x32&.google.cloud.speech.v2.DenoiserConfigB\x03\xe0\x41\x01\x42\x11\n\x0f\x64\x65\x63oding_config\"\xee\x01\n\x10RecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x11\n\x07\x63ontent\x18\x05 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x06 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"\x9d\x01\n\x1bRecognitionResponseMetadata\x12\x1c\n\nrequest_id\x18\t \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x38\n\x15total_billed_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1b\n\x06prompt\x18\n \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\t\n\x07_prompt\"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v2.WordInfo\"\xa3\x01\n\x08WordInfo\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x15\n\rspeaker_label\x18\x06 \x01(\t\"\xcc\x01\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\"\x9c\x01\n\x11RecognizeResponse\x12@\n\x07results\x18\x03 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\xf9\x04\n\x1cStreamingRecognitionFeatures\x12$\n\x1c\x65nable_voice_activity_events\x18\x01 \x01(\x08\x12\x17\n\x0finterim_results\x18\x02 \x01(\x08\x12i\n\x16voice_activity_timeout\x18\x03 \x01(\x0b\x32I.google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout\x12q\n\x17\x65ndpointing_sensitivity\x18\x08 \x01(\x0e\x32K.google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivityB\x03\xe0\x41\x01\x1a\x86\x01\n\x14VoiceActivityTimeout\x12\x37\n\x14speech_start_timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x12speech_end_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xb2\x01\n\x16\x45ndpointingSensitivity\x12\'\n#ENDPOINTING_SENSITIVITY_UNSPECIFIED\x10\x00\x12$\n ENDPOINTING_SENSITIVITY_STANDARD\x10\x01\x12&\n\"ENDPOINTING_SENSITIVITY_SUPERSHORT\x10\x02\x12!\n\x1d\x45NDPOINTING_SENSITIVITY_SHORT\x10\x03\"\xdf\x01\n\x1aStreamingRecognitionConfig\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfigB\x03\xe0\x41\x02\x12/\n\x0b\x63onfig_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12P\n\x12streaming_features\x18\x02 \x01(\x0b\x32\x34.google.cloud.speech.v2.StreamingRecognitionFeatures\"\xcf\x01\n\x19StreamingRecognizeRequest\x12<\n\nrecognizer\x18\x03 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12N\n\x10streaming_config\x18\x06 \x01(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionConfigH\x00\x12\x0f\n\x05\x61udio\x18\x05 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\x88\x04\n\x15\x42\x61tchRecognizeRequest\x12<\n\nrecognizer\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n speech.googleapis.com/Recognizer\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x41\n\x05\x66iles\x18\x03 \x03(\x0b\x32\x32.google.cloud.speech.v2.BatchRecognizeFileMetadata\x12R\n\x19recognition_output_config\x18\x06 \x01(\x0b\x32/.google.cloud.speech.v2.RecognitionOutputConfig\x12]\n\x13processing_strategy\x18\x07 \x01(\x0e\x32@.google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy\"O\n\x12ProcessingStrategy\x12#\n\x1fPROCESSING_STRATEGY_UNSPECIFIED\x10\x00\x12\x14\n\x10\x44YNAMIC_BATCHING\x10\x01\"\x1e\n\x0fGcsOutputConfig\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x14\n\x12InlineOutputConfig\"\x1e\n\x1cNativeOutputFileFormatConfig\"\x1b\n\x19VttOutputFileFormatConfig\"\x1b\n\x19SrtOutputFileFormatConfig\"\xda\x01\n\x12OutputFormatConfig\x12\x44\n\x06native\x18\x01 \x01(\x0b\x32\x34.google.cloud.speech.v2.NativeOutputFileFormatConfig\x12>\n\x03vtt\x18\x02 \x01(\x0b\x32\x31.google.cloud.speech.v2.VttOutputFileFormatConfig\x12>\n\x03srt\x18\x03 \x01(\x0b\x32\x31.google.cloud.speech.v2.SrtOutputFileFormatConfig\"\x86\x02\n\x17RecognitionOutputConfig\x12\x44\n\x11gcs_output_config\x18\x01 \x01(\x0b\x32\'.google.cloud.speech.v2.GcsOutputConfigH\x00\x12L\n\x16inline_response_config\x18\x02 \x01(\x0b\x32*.google.cloud.speech.v2.InlineOutputConfigH\x00\x12M\n\x14output_format_config\x18\x03 \x01(\x0b\x32*.google.cloud.speech.v2.OutputFormatConfigB\x03\xe0\x41\x01\x42\x08\n\x06output\"\x82\x02\n\x16\x42\x61tchRecognizeResponse\x12L\n\x07results\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeResponse.ResultsEntry\x12\x38\n\x15total_billed_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a`\n\x0cResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.speech.v2.BatchRecognizeFileResult:\x02\x38\x01\"\xa0\x01\n\x15\x42\x61tchRecognizeResults\x12@\n\x07results\x18\x01 \x03(\x0b\x32/.google.cloud.speech.v2.SpeechRecognitionResult\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"Q\n\x12\x43loudStorageResult\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x16\n\x0evtt_format_uri\x18\x02 \x01(\t\x12\x16\n\x0esrt_format_uri\x18\x03 \x01(\t\"}\n\x0cInlineResult\x12\x41\n\ntranscript\x18\x01 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResults\x12\x14\n\x0cvtt_captions\x18\x02 \x01(\t\x12\x14\n\x0csrt_captions\x18\x03 \x01(\t\"\xf1\x02\n\x18\x42\x61tchRecognizeFileResult\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x45\n\x08metadata\x18\x03 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\x12J\n\x14\x63loud_storage_result\x18\x05 \x01(\x0b\x32*.google.cloud.speech.v2.CloudStorageResultH\x00\x12=\n\rinline_result\x18\x06 \x01(\x0b\x32$.google.cloud.speech.v2.InlineResultH\x00\x12\x0f\n\x03uri\x18\x01 \x01(\tB\x02\x18\x01\x12\x45\n\ntranscript\x18\x04 \x01(\x0b\x32-.google.cloud.speech.v2.BatchRecognizeResultsB\x02\x18\x01\x42\x08\n\x06result\"o\n#BatchRecognizeTranscriptionMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12!\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x12\x0b\n\x03uri\x18\x03 \x01(\t\"\xfe\x01\n\x16\x42\x61tchRecognizeMetadata\x12i\n\x16transcription_metadata\x18\x01 \x03(\x0b\x32I.google.cloud.speech.v2.BatchRecognizeMetadata.TranscriptionMetadataEntry\x1ay\n\x1aTranscriptionMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata:\x02\x38\x01\"\xa7\x01\n\x1a\x42\x61tchRecognizeFileMetadata\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x39\n\x06\x63onfig\x18\x04 \x01(\x0b\x32).google.cloud.speech.v2.RecognitionConfig\x12/\n\x0b\x63onfig_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x0e\n\x0c\x61udio_source\"\xf4\x01\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x34\n\x11result_end_offset\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03\"\xc7\x03\n\x1aStreamingRecognizeResponse\x12\x43\n\x07results\x18\x06 \x03(\x0b\x32\x32.google.cloud.speech.v2.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x03 \x01(\x0e\x32\x42.google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType\x12\x36\n\x13speech_event_offset\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x45\n\x08metadata\x18\x05 \x01(\x0b\x32\x33.google.cloud.speech.v2.RecognitionResponseMetadata\"\x85\x01\n\x0fSpeechEventType\x12!\n\x1dSPEECH_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\x12\x19\n\x15SPEECH_ACTIVITY_BEGIN\x10\x02\x12\x17\n\x13SPEECH_ACTIVITY_END\x10\x03\"\xe8\x01\n\x06\x43onfig\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12?\n\x0ckms_key_name\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:Q\xea\x41N\n\x1cspeech.googleapis.com/Config\x12.projects/{project}/locations/{location}/config\"F\n\x10GetConfigRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cspeech.googleapis.com/Config\"{\n\x13UpdateConfigRequest\x12\x33\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1e.google.cloud.speech.v2.ConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xad\x07\n\x0b\x43ustomClass\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12<\n\x05items\x18\x05 \x03(\x0b\x32-.google.cloud.speech.v2.CustomClass.ClassItem\x12=\n\x05state\x18\x0f \x01(\x0e\x32).google.cloud.speech.v2.CustomClass.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x34.google.cloud.speech.v2.CustomClass.AnnotationsEntryB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a\x1a\n\tClassItem\x12\r\n\x05value\x18\x01 \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\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:o\xea\x41l\n!speech.googleapis.com/CustomClass\x12\x44projects/{project}/locations/{location}/customClasses/{custom_class}R\x01\x01\"\xae\x07\n\tPhraseSet\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x07phrases\x18\x03 \x03(\x0b\x32(.google.cloud.speech.v2.PhraseSet.Phrase\x12\r\n\x05\x62oost\x18\x04 \x01(\x02\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12;\n\x05state\x18\x0f \x01(\x0e\x32\'.google.cloud.speech.v2.PhraseSet.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x32.google.cloud.speech.v2.PhraseSet.AnnotationsEntry\x12\x11\n\x04\x65tag\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x0ckms_key_name\x18\r \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12N\n\x14kms_key_version_name\x18\x0e \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x1a&\n\x06Phrase\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x04:h\xea\x41\x65\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}R\x01\x01\"\xc5\x01\n\x18\x43reateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x17\n\x0f\x63ustom_class_id\x18\x03 \x01(\t\x12\x39\n\x06parent\x18\x04 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!speech.googleapis.com/CustomClass\"\x92\x01\n\x18ListCustomClassesRequest\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\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"q\n\x19ListCustomClassesResponse\x12;\n\x0e\x63ustom_classes\x18\x01 \x03(\x0b\x32#.google.cloud.speech.v2.CustomClass\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x15GetCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\"\xa2\x01\n\x18UpdateCustomClassRequest\x12>\n\x0c\x63ustom_class\x18\x01 \x01(\x0b\x32#.google.cloud.speech.v2.CustomClassB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8f\x01\n\x18\x44\x65leteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"z\n\x1aUndeleteCustomClassRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!speech.googleapis.com/CustomClass\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t\"\xbb\x01\n\x16\x43reatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rphrase_set_id\x18\x03 \x01(\t\x12\x37\n\x06parent\x18\x04 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fspeech.googleapis.com/PhraseSet\"\x8f\x01\n\x15ListPhraseSetsRequest\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\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"i\n\x16ListPhraseSetsResponse\x12\x36\n\x0bphrase_sets\x18\x01 \x03(\x0b\x32!.google.cloud.speech.v2.PhraseSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x13GetPhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\"\x9c\x01\n\x16UpdatePhraseSetRequest\x12:\n\nphrase_set\x18\x01 \x01(\x0b\x32!.google.cloud.speech.v2.PhraseSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rvalidate_only\x18\x04 \x01(\x08\"\x8b\x01\n\x16\x44\x65letePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"v\n\x18UndeletePhraseSetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x15\n\rvalidate_only\x18\x03 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x04 \x01(\t2\xbf%\n\x06Speech\x12\xec\x01\n\x10\x43reateRecognizer\x12/.google.cloud.speech.v2.CreateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x1fparent,recognizer,recognizer_id\x82\xd3\xe4\x93\x02=\"//v2/{parent=projects/*/locations/*}/recognizers:\nrecognizer\x12\xb4\x01\n\x0fListRecognizers\x12..google.cloud.speech.v2.ListRecognizersRequest\x1a/.google.cloud.speech.v2.ListRecognizersResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2/{parent=projects/*/locations/*}/recognizers\x12\xa1\x01\n\rGetRecognizer\x12,.google.cloud.speech.v2.GetRecognizerRequest\x1a\".google.cloud.speech.v2.Recognizer\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2/{name=projects/*/locations/*/recognizers/*}\x12\xee\x01\n\x10UpdateRecognizer\x12/.google.cloud.speech.v2.UpdateRecognizerRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x16recognizer,update_mask\x82\xd3\xe4\x93\x02H2:/v2/{recognizer.name=projects/*/locations/*/recognizers/*}:\nrecognizer\x12\xc4\x01\n\x10\x44\x65leteRecognizer\x12/.google.cloud.speech.v2.DeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"`\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2/{name=projects/*/locations/*/recognizers/*}\x12\xd4\x01\n\x12UndeleteRecognizer\x12\x31.google.cloud.speech.v2.UndeleteRecognizerRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1f\n\nRecognizer\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v2/{name=projects/*/locations/*/recognizers/*}:undelete:\x01*\x12\xf9\x01\n\tRecognize\x12(.google.cloud.speech.v2.RecognizeRequest\x1a).google.cloud.speech.v2.RecognizeResponse\"\x96\x01\xda\x41%recognizer,config,config_mask,content\xda\x41!recognizer,config,config_mask,uri\x82\xd3\xe4\x93\x02\x44\"?/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize:\x01*\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v2.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v2.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x12\x84\x02\n\x0e\x42\x61tchRecognize\x12-.google.cloud.speech.v2.BatchRecognizeRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41+\n\x16\x42\x61tchRecognizeResponse\x12\x11OperationMetadata\xda\x41#recognizer,config,config_mask,files\x82\xd3\xe4\x93\x02I\"D/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize:\x01*\x12\x8e\x01\n\tGetConfig\x12(.google.cloud.speech.v2.GetConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v2/{name=projects/*/locations/*/config}\x12\xb1\x01\n\x0cUpdateConfig\x12+.google.cloud.speech.v2.UpdateConfigRequest\x1a\x1e.google.cloud.speech.v2.Config\"T\xda\x41\x12\x63onfig,update_mask\x82\xd3\xe4\x93\x02\x39\x32//v2/{config.name=projects/*/locations/*/config}:\x06\x63onfig\x12\xf7\x01\n\x11\x43reateCustomClass\x12\x30.google.cloud.speech.v2.CreateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41#parent,custom_class,custom_class_id\x82\xd3\xe4\x93\x02\x41\"1/v2/{parent=projects/*/locations/*}/customClasses:\x0c\x63ustom_class\x12\xbc\x01\n\x11ListCustomClasses\x12\x30.google.cloud.speech.v2.ListCustomClassesRequest\x1a\x31.google.cloud.speech.v2.ListCustomClassesResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{parent=projects/*/locations/*}/customClasses\x12\xa6\x01\n\x0eGetCustomClass\x12-.google.cloud.speech.v2.GetCustomClassRequest\x1a#.google.cloud.speech.v2.CustomClass\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{name=projects/*/locations/*/customClasses/*}\x12\xf9\x01\n\x11UpdateCustomClass\x12\x30.google.cloud.speech.v2.UpdateCustomClassRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x18\x63ustom_class,update_mask\x82\xd3\xe4\x93\x02N2>/v2/{custom_class.name=projects/*/locations/*/customClasses/*}:\x0c\x63ustom_class\x12\xc9\x01\n\x11\x44\x65leteCustomClass\x12\x30.google.cloud.speech.v2.DeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"c\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v2/{name=projects/*/locations/*/customClasses/*}\x12\xd9\x01\n\x13UndeleteCustomClass\x12\x32.google.cloud.speech.v2.UndeleteCustomClassRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41 \n\x0b\x43ustomClass\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?\":/v2/{name=projects/*/locations/*/customClasses/*}:undelete:\x01*\x12\xe8\x01\n\x0f\x43reatePhraseSet\x12..google.cloud.speech.v2.CreatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x1fparent,phrase_set,phrase_set_id\x82\xd3\xe4\x93\x02<\"./v2/{parent=projects/*/locations/*}/phraseSets:\nphrase_set\x12\xb0\x01\n\x0eListPhraseSets\x12-.google.cloud.speech.v2.ListPhraseSetsRequest\x1a..google.cloud.speech.v2.ListPhraseSetsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v2/{parent=projects/*/locations/*}/phraseSets\x12\x9d\x01\n\x0cGetPhraseSet\x12+.google.cloud.speech.v2.GetPhraseSetRequest\x1a!.google.cloud.speech.v2.PhraseSet\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xea\x01\n\x0fUpdatePhraseSet\x12..google.cloud.speech.v2.UpdatePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x16phrase_set,update_mask\x82\xd3\xe4\x93\x02G29/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}:\nphrase_set\x12\xc0\x01\n\x0f\x44\x65letePhraseSet\x12..google.cloud.speech.v2.DeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"^\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v2/{name=projects/*/locations/*/phraseSets/*}\x12\xd0\x01\n\x11UndeletePhraseSet\x12\x30.google.cloud.speech.v2.UndeletePhraseSetRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41\x1e\n\tPhraseSet\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v2/{name=projects/*/locations/*/phraseSets/*}:undelete:\x01*\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x03\n\x1a\x63om.google.cloud.speech.v2B\x10\x43loudSpeechProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpb\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Speech - module V2 - CreateRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreateRecognizerRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.OperationMetadata").msgclass - ListRecognizersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListRecognizersRequest").msgclass - ListRecognizersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListRecognizersResponse").msgclass - GetRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetRecognizerRequest").msgclass - UpdateRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateRecognizerRequest").msgclass - DeleteRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeleteRecognizerRequest").msgclass - UndeleteRecognizerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeleteRecognizerRequest").msgclass - Recognizer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Recognizer").msgclass - Recognizer::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Recognizer.State").enummodule - AutoDetectDecodingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AutoDetectDecodingConfig").msgclass - ExplicitDecodingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ExplicitDecodingConfig").msgclass - ExplicitDecodingConfig::AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ExplicitDecodingConfig.AudioEncoding").enummodule - SpeakerDiarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeakerDiarizationConfig").msgclass - CustomPromptConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomPromptConfig").msgclass - RecognitionFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionFeatures").msgclass - RecognitionFeatures::MultiChannelMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode").enummodule - TranscriptNormalization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranscriptNormalization").msgclass - TranscriptNormalization::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranscriptNormalization.Entry").msgclass - TranslationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.TranslationConfig").msgclass - SpeechAdaptation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechAdaptation").msgclass - SpeechAdaptation::AdaptationPhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet").msgclass - DenoiserConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DenoiserConfig").msgclass - RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionConfig").msgclass - RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognizeRequest").msgclass - RecognitionResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionResponseMetadata").msgclass - SpeechRecognitionAlternative = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechRecognitionAlternative").msgclass - WordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.WordInfo").msgclass - SpeechRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SpeechRecognitionResult").msgclass - RecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognizeResponse").msgclass - StreamingRecognitionFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures").msgclass - StreamingRecognitionFeatures::VoiceActivityTimeout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.VoiceActivityTimeout").msgclass - StreamingRecognitionFeatures::EndpointingSensitivity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionFeatures.EndpointingSensitivity").enummodule - StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionConfig").msgclass - StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeRequest").msgclass - BatchRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest").msgclass - BatchRecognizeRequest::ProcessingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy").enummodule - GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GcsOutputConfig").msgclass - InlineOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineOutputConfig").msgclass - NativeOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.NativeOutputFileFormatConfig").msgclass - VttOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.VttOutputFileFormatConfig").msgclass - SrtOutputFileFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.SrtOutputFileFormatConfig").msgclass - OutputFormatConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.OutputFormatConfig").msgclass - RecognitionOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionOutputConfig").msgclass - BatchRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResponse").msgclass - BatchRecognizeResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResults").msgclass - CloudStorageResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CloudStorageResult").msgclass - InlineResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineResult").msgclass - BatchRecognizeFileResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileResult").msgclass - BatchRecognizeTranscriptionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata").msgclass - BatchRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeMetadata").msgclass - BatchRecognizeFileMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileMetadata").msgclass - StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionResult").msgclass - StreamingRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeResponse").msgclass - StreamingRecognizeResponse::SpeechEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeResponse.SpeechEventType").enummodule - Config = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.Config").msgclass - GetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetConfigRequest").msgclass - UpdateConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateConfigRequest").msgclass - CustomClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass").msgclass - CustomClass::ClassItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass.ClassItem").msgclass - CustomClass::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CustomClass.State").enummodule - PhraseSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet").msgclass - PhraseSet::Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet.Phrase").msgclass - PhraseSet::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.PhraseSet.State").enummodule - CreateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreateCustomClassRequest").msgclass - ListCustomClassesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListCustomClassesRequest").msgclass - ListCustomClassesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListCustomClassesResponse").msgclass - GetCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetCustomClassRequest").msgclass - UpdateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdateCustomClassRequest").msgclass - DeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeleteCustomClassRequest").msgclass - UndeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeleteCustomClassRequest").msgclass - CreatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.CreatePhraseSetRequest").msgclass - ListPhraseSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListPhraseSetsRequest").msgclass - ListPhraseSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ListPhraseSetsResponse").msgclass - GetPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GetPhraseSetRequest").msgclass - UpdatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UpdatePhraseSetRequest").msgclass - DeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.DeletePhraseSetRequest").msgclass - UndeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.UndeletePhraseSetRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb deleted file mode 100644 index 5a22ae3fcf4a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb +++ /dev/null @@ -1,98 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/speech/v2/cloud_speech.proto for package 'google.cloud.speech.v2' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/speech/v2/cloud_speech_pb' - -module Google - module Cloud - module Speech - module V2 - module Speech - # Enables speech transcription and resource management. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.speech.v2.Speech' - - # Creates a [Recognizer][google.cloud.speech.v2.Recognizer]. - rpc :CreateRecognizer, ::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Google::Longrunning::Operation - # Lists Recognizers. - rpc :ListRecognizers, ::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Google::Cloud::Speech::V2::ListRecognizersResponse - # Returns the requested - # [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't - # exist. - rpc :GetRecognizer, ::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Google::Cloud::Speech::V2::Recognizer - # Updates the [Recognizer][google.cloud.speech.v2.Recognizer]. - rpc :UpdateRecognizer, ::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Google::Longrunning::Operation - # Deletes the [Recognizer][google.cloud.speech.v2.Recognizer]. - rpc :DeleteRecognizer, ::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Google::Longrunning::Operation - # Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer]. - rpc :UndeleteRecognizer, ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Google::Longrunning::Operation - # Performs synchronous Speech recognition: receive results after all audio - # has been sent and processed. - rpc :Recognize, ::Google::Cloud::Speech::V2::RecognizeRequest, ::Google::Cloud::Speech::V2::RecognizeResponse - # Performs bidirectional streaming speech recognition: receive results while - # sending audio. This method is only available via the gRPC API (not REST). - rpc :StreamingRecognize, stream(::Google::Cloud::Speech::V2::StreamingRecognizeRequest), stream(::Google::Cloud::Speech::V2::StreamingRecognizeResponse) - # Performs batch asynchronous speech recognition: send a request with N - # audio files and receive a long running operation that can be polled to see - # when the transcriptions are finished. - rpc :BatchRecognize, ::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Google::Longrunning::Operation - # Returns the requested [Config][google.cloud.speech.v2.Config]. - rpc :GetConfig, ::Google::Cloud::Speech::V2::GetConfigRequest, ::Google::Cloud::Speech::V2::Config - # Updates the [Config][google.cloud.speech.v2.Config]. - rpc :UpdateConfig, ::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Google::Cloud::Speech::V2::Config - # Creates a [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :CreateCustomClass, ::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Google::Longrunning::Operation - # Lists CustomClasses. - rpc :ListCustomClasses, ::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Google::Cloud::Speech::V2::ListCustomClassesResponse - # Returns the requested - # [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :GetCustomClass, ::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Google::Cloud::Speech::V2::CustomClass - # Updates the [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :UpdateCustomClass, ::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Google::Longrunning::Operation - # Deletes the [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :DeleteCustomClass, ::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Google::Longrunning::Operation - # Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass]. - rpc :UndeleteCustomClass, ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Google::Longrunning::Operation - # Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :CreatePhraseSet, ::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Google::Longrunning::Operation - # Lists PhraseSets. - rpc :ListPhraseSets, ::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Google::Cloud::Speech::V2::ListPhraseSetsResponse - # Returns the requested - # [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :GetPhraseSet, ::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Google::Cloud::Speech::V2::PhraseSet - # Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :UpdatePhraseSet, ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Google::Longrunning::Operation - # Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :DeletePhraseSet, ::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Google::Longrunning::Operation - # Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet]. - rpc :UndeletePhraseSet, ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb deleted file mode 100644 index c6f970cacdd5..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/locations_metadata_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech/v2/locations_metadata.proto - -require 'google/protobuf' - - -descriptor_data = "\n/google/cloud/speech/v2/locations_metadata.proto\x12\x16google.cloud.speech.v2\"6\n\x0cModelFeature\x12\x0f\n\x07\x66\x65\x61ture\x18\x01 \x01(\t\x12\x15\n\rrelease_state\x18\x02 \x01(\t\"L\n\rModelFeatures\x12;\n\rmodel_feature\x18\x01 \x03(\x0b\x32$.google.cloud.speech.v2.ModelFeature\"\xbe\x01\n\rModelMetadata\x12P\n\x0emodel_features\x18\x01 \x03(\x0b\x32\x38.google.cloud.speech.v2.ModelMetadata.ModelFeaturesEntry\x1a[\n\x12ModelFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.speech.v2.ModelFeatures:\x02\x38\x01\"\xae\x01\n\x10LanguageMetadata\x12\x44\n\x06models\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v2.LanguageMetadata.ModelsEntry\x1aT\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.speech.v2.ModelMetadata:\x02\x38\x01\"\xc8\x01\n\x0e\x41\x63\x63\x65ssMetadata\x12N\n\x0f\x63onstraint_type\x18\x01 \x01(\x0e\x32\x35.google.cloud.speech.v2.AccessMetadata.ConstraintType\"f\n\x0e\x43onstraintType\x12\x1f\n\x1b\x43ONSTRAINT_TYPE_UNSPECIFIED\x10\x00\x12\x33\n/RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT\x10\x01\"\x91\x01\n\x11LocationsMetadata\x12;\n\tlanguages\x18\x01 \x01(\x0b\x32(.google.cloud.speech.v2.LanguageMetadata\x12?\n\x0f\x61\x63\x63\x65ss_metadata\x18\x02 \x01(\x0b\x32&.google.cloud.speech.v2.AccessMetadataBj\n\x1a\x63om.google.cloud.speech.v2B\x16LocationsMetadataProtoP\x01Z2cloud.google.com/go/speech/apiv2/speechpb;speechpbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Speech - module V2 - ModelFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelFeature").msgclass - ModelFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelFeatures").msgclass - ModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.ModelMetadata").msgclass - LanguageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.LanguageMetadata").msgclass - AccessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AccessMetadata").msgclass - AccessMetadata::ConstraintType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.AccessMetadata.ConstraintType").enummodule - LocationsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.LocationsMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/rest.rb deleted file mode 100644 index 9f0d92b6e97b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/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/speech/v2/speech/rest" -require "google/cloud/speech/v2/bindings_override" -require "google/cloud/speech/v2/version" - -module Google - module Cloud - module Speech - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/speech/v2/rest" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module V2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.rb deleted file mode 100644 index 5a66d0bd8b48..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech.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/speech/v2/version" - -require "google/cloud/speech/v2/speech/credentials" -require "google/cloud/speech/v2/speech/paths" -require "google/cloud/speech/v2/speech/operations" -require "google/cloud/speech/v2/speech/client" -require "google/cloud/speech/v2/speech/rest" - -module Google - module Cloud - module Speech - module V2 - ## - # Enables speech transcription and resource management. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/speech/v2/speech" - # client = ::Google::Cloud::Speech::V2::Speech::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/speech/v2/speech/rest" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module Speech - end - end - end - end -end - -helper_path = ::File.join __dir__, "speech", "helpers.rb" -require "google/cloud/speech/v2/speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb deleted file mode 100644 index eddbc08258d0..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb +++ /dev/null @@ -1,2922 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v2/cloud_speech_pb" -require "google/cloud/location" - -module Google - module Cloud - module Speech - module V2 - module Speech - ## - # Client for the Speech service. - # - # Enables speech transcription and resource management. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :speech_stub - - ## - # Configure the Speech Client class. - # - # See {::Google::Cloud::Speech::V2::Speech::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Speech clients - # ::Google::Cloud::Speech::V2::Speech::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Speech", "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 = 5000.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Speech Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V2::Speech::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @speech_stub.universe_domain - end - - ## - # Create a new Speech client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Speech 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/speech/v2/cloud_speech_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 - - @speech_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Speech::V2::Speech::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 - ) - - @speech_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 = @speech_stub.endpoint - config.universe_domain = @speech_stub.universe_domain - config.logger = @speech_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Speech::V2::Speech::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 - @speech_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload create_recognizer(request, options = nil) - # Pass arguments to `create_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreateRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) - # Pass arguments to `create_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] - # Required. The Recognizer to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the Recognizer, but do not - # actually create it. - # @param recognizer_id [::String] - # The ID to use for the Recognizer, which will become the final component of - # the Recognizer's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this Recognizer will be created. - # The expected format is `projects/{project}/locations/{location}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new - # - # # Call the create_recognizer method. - # result = client.create_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateRecognizerRequest - - # Converts hash and nil to 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_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :create_recognizer, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 Recognizers. - # - # @overload list_recognizers(request, options = nil) - # Pass arguments to `list_recognizers` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListRecognizersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_recognizers` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of Recognizers to list. The expected - # format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of Recognizers to return. The service may return fewer - # than this value. If unspecified, at most 5 Recognizers will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} must match - # the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListRecognizersRequest.new - # - # # Call the list_recognizers method. - # result = client.list_recognizers request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V2::Recognizer. - # p item - # end - # - def list_recognizers request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListRecognizersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_recognizers.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_recognizers.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_recognizers.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :list_recognizers, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @speech_stub, :list_recognizers, request, response, 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 requested - # {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't - # exist. - # - # @overload get_recognizer(request, options = nil) - # Pass arguments to `get_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_recognizer(name: nil) - # Pass arguments to `get_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 Recognizer to retrieve. The expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::Recognizer] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::Recognizer] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetRecognizerRequest.new - # - # # Call the get_recognizer method. - # result = client.get_recognizer request - # - # # The returned object is of type Google::Cloud::Speech::V2::Recognizer. - # p result - # - def get_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetRecognizerRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :get_recognizer, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload update_recognizer(request, options = nil) - # Pass arguments to `update_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] - # Required. The Recognizer to update. - # - # The Recognizer's `name` field is used to identify the Recognizer to update. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire Recognizer resource. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated Recognizer, but do not - # actually update it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new - # - # # Call the update_recognizer method. - # result = client.update_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateRecognizerRequest - - # Converts hash and nil to 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_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.recognizer&.name - header_params["recognizer.name"] = request.recognizer.name - end - - request_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_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :update_recognizer, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload delete_recognizer(request, options = nil) - # Pass arguments to `delete_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeleteRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 Recognizer to delete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted Recognizer, but do not - # actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the Recognizer is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new - # - # # Call the delete_recognizer method. - # result = client.delete_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteRecognizerRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :delete_recognizer, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeletes the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload undelete_recognizer(request, options = nil) - # Pass arguments to `undelete_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeleteRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_recognizer(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 Recognizer to undelete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted Recognizer, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new - # - # # Call the undelete_recognizer method. - # result = client.undelete_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.undelete_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.undelete_recognizer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :undelete_recognizer, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs synchronous Speech recognition: receive results after all audio - # has been sent and processed. - # - # @overload recognize(request, options = nil) - # Pass arguments to `recognize` via a request object, either of type - # {::Google::Cloud::Speech::V2::RecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::RecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) - # Pass arguments to `recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field - # can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the - # values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @param content [::String] - # The audio data bytes encoded as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As - # with all bytes fields, proto buffers use a pure binary representation, - # whereas JSON representations use base64. - # - # Note: The following parameters are mutually exclusive: `content`, `uri`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param uri [::String] - # URI that points to a file that contains audio data bytes as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file - # must not be compressed (for example, gzip). Currently, only Google Cloud - # Storage URIs are supported, which must be specified in the following - # format: `gs://bucket_name/object_name` (other URI formats return - # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more - # information, see [Request - # URIs](https://cloud.google.com/storage/docs/reference-uris). - # - # Note: The following parameters are mutually exclusive: `uri`, `content`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::RecognizeResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::RecognizeResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::RecognizeRequest.new - # - # # Call the recognize method. - # result = client.recognize request - # - # # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. - # p result - # - def recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::RecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.recognizer - header_params["recognizer"] = request.recognizer - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :recognize, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs bidirectional streaming speech recognition: receive results while - # sending audio. This method is only available via the gRPC API (not REST). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeRequest, ::Hash>] - # An enumerable of {::Google::Cloud::Speech::V2::StreamingRecognizeRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the streaming_recognize method to start streaming. - # output = client.streaming_recognize input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new - # input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse - # output.each do |current_response| - # p current_response - # end - # - def streaming_recognize request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V2::StreamingRecognizeRequest - end - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.streaming_recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::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.streaming_recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :streaming_recognize, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs batch asynchronous speech recognition: send a request with N - # audio files and receive a long running operation that can be polled to see - # when the transcriptions are finished. - # - # @overload batch_recognize(request, options = nil) - # Pass arguments to `batch_recognize` via a request object, either of type - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) - # Pass arguments to `batch_recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override - # the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all given fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>] - # Audio files with file metadata for ASR. - # The maximum number of files allowed to be specified is 15. - # @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash] - # Configuration options for where to output the transcripts of each file. - # @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] - # Processing strategy to use for this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new - # - # # Call the batch_recognize method. - # result = client.batch_recognize request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::BatchRecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.recognizer - header_params["recognizer"] = request.recognizer - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_recognize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :batch_recognize, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested {::Google::Cloud::Speech::V2::Config Config}. - # - # @overload get_config(request, options = nil) - # Pass arguments to `get_config` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_config(name: nil) - # Pass arguments to `get_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the config to retrieve. There is exactly one config - # resource per project per location. The expected format is - # `projects/{project}/locations/{location}/config`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetConfigRequest.new - # - # # Call the get_config method. - # result = client.get_config request - # - # # The returned object is of type Google::Cloud::Speech::V2::Config. - # p result - # - def get_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_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::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :get_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Speech::V2::Config Config}. - # - # @overload update_config(request, options = nil) - # Pass arguments to `update_config` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_config(config: nil, update_mask: nil) - # Pass arguments to `update_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 config [::Google::Cloud::Speech::V2::Config, ::Hash] - # Required. The config to update. - # - # The config's `name` field is used to identify the config to be updated. - # The expected format is `projects/{project}/locations/{location}/config`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateConfigRequest.new - # - # # Call the update_config method. - # result = client.update_config request - # - # # The returned object is of type Google::Cloud::Speech::V2::Config. - # p result - # - def update_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateConfigRequest - - # Converts hash and nil to 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_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::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.config&.name - header_params["config.name"] = request.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_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :update_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload create_custom_class(request, options = nil) - # Pass arguments to `create_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) - # Pass arguments to `create_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] - # Required. The CustomClass to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the CustomClass, but do not - # actually create it. - # @param custom_class_id [::String] - # The ID to use for the CustomClass, which will become the final component of - # the CustomClass's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this CustomClass will be created. - # The expected format is `projects/{project}/locations/{location}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new - # - # # Call the create_custom_class method. - # result = client.create_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateCustomClassRequest - - # Converts hash and nil to 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :create_custom_class, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 CustomClasses. - # - # @overload list_custom_classes(request, options = nil) - # Pass arguments to `list_custom_classes` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListCustomClassesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_custom_classes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of CustomClass resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # Number of results per requests. A valid page_size ranges from 0 to 100 - # inclusive. If the page_size is zero or unspecified, a page size of 5 will - # be chosen. If the page size exceeds 100, it will be coerced down to 100. - # Note that a call might return fewer results than the requested page size. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} must - # match the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new - # - # # Call the list_custom_classes method. - # result = client.list_custom_classes request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V2::CustomClass. - # p item - # end - # - def list_custom_classes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListCustomClassesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_custom_classes.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_custom_classes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :list_custom_classes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @speech_stub, :list_custom_classes, request, response, 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 requested - # {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload get_custom_class(request, options = nil) - # Pass arguments to `get_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_custom_class(name: nil) - # Pass arguments to `get_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 CustomClass to retrieve. The expected format is - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::CustomClass] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::CustomClass] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetCustomClassRequest.new - # - # # Call the get_custom_class method. - # result = client.get_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V2::CustomClass. - # p result - # - def get_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :get_custom_class, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload update_custom_class(request, options = nil) - # Pass arguments to `update_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] - # Required. The CustomClass to update. - # - # The CustomClass's `name` field is used to identify the CustomClass to - # update. Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. If empty, all fields are considered for - # update. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated CustomClass, but do - # not actually update it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new - # - # # Call the update_custom_class method. - # result = client.update_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateCustomClassRequest - - # Converts hash and nil to 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.custom_class&.name - header_params["custom_class.name"] = request.custom_class.name - end - - request_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_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :update_custom_class, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload delete_custom_class(request, options = nil) - # Pass arguments to `delete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 CustomClass to delete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted CustomClass, but do - # not actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the CustomClass is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new - # - # # Call the delete_custom_class method. - # result = client.delete_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :delete_custom_class, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeletes the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload undelete_custom_class(request, options = nil) - # Pass arguments to `undelete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_custom_class(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 CustomClass to undelete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted CustomClass, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new - # - # # Call the undelete_custom_class method. - # result = client.undelete_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.undelete_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.undelete_custom_class.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :undelete_custom_class, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload create_phrase_set(request, options = nil) - # Pass arguments to `create_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) - # Pass arguments to `create_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] - # Required. The PhraseSet to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the PhraseSet, but do not - # actually create it. - # @param phrase_set_id [::String] - # The ID to use for the PhraseSet, which will become the final component of - # the PhraseSet's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this PhraseSet will be created. - # The expected format is `projects/{project}/locations/{location}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new - # - # # Call the create_phrase_set method. - # result = client.create_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreatePhraseSetRequest - - # Converts hash and nil to 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :create_phrase_set, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 PhraseSets. - # - # @overload list_phrase_sets(request, options = nil) - # Pass arguments to `list_phrase_sets` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_phrase_sets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of PhraseSet resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of PhraseSets to return. The service may return fewer - # than this value. If unspecified, at most 5 PhraseSets will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} must match - # the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new - # - # # Call the list_phrase_sets method. - # result = client.list_phrase_sets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet. - # p item - # end - # - def list_phrase_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListPhraseSetsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_phrase_sets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_phrase_sets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_phrase_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :list_phrase_sets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @speech_stub, :list_phrase_sets, request, response, 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 requested - # {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload get_phrase_set(request, options = nil) - # Pass arguments to `get_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_phrase_set(name: nil) - # Pass arguments to `get_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 PhraseSet to retrieve. The expected format is - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Speech::V2::PhraseSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new - # - # # Call the get_phrase_set method. - # result = client.get_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. - # p result - # - def get_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :get_phrase_set, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload update_phrase_set(request, options = nil) - # Pass arguments to `update_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] - # Required. The PhraseSet to update. - # - # The PhraseSet's `name` field is used to identify the PhraseSet to update. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire PhraseSet resource. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated PhraseSet, but do not - # actually update it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new - # - # # Call the update_phrase_set method. - # result = client.update_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest - - # Converts hash and nil to 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.phrase_set&.name - header_params["phrase_set.name"] = request.phrase_set.name - end - - request_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_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :update_phrase_set, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload delete_phrase_set(request, options = nil) - # Pass arguments to `delete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 PhraseSet to delete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted PhraseSet, but do not - # actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the PhraseSet is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new - # - # # Call the delete_phrase_set method. - # result = client.delete_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeletePhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :delete_phrase_set, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeletes the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload undelete_phrase_set(request, options = nil) - # Pass arguments to `undelete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_phrase_set(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 PhraseSet to undelete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted PhraseSet, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new - # - # # Call the undelete_phrase_set method. - # result = client.undelete_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.undelete_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.undelete_phrase_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.call_rpc :undelete_phrase_set, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 Speech API. - # - # This class represents the configuration for Speech, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V2::Speech::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_recognizer to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V2::Speech::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_recognizer.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_recognizer.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Speech::V2::Speech::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Speech API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :create_recognizer - ## - # RPC-specific configuration for `list_recognizers` - # @return [::Gapic::Config::Method] - # - attr_reader :list_recognizers - ## - # RPC-specific configuration for `get_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :get_recognizer - ## - # RPC-specific configuration for `update_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :update_recognizer - ## - # RPC-specific configuration for `delete_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_recognizer - ## - # RPC-specific configuration for `undelete_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_recognizer - ## - # RPC-specific configuration for `recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :recognize - ## - # RPC-specific configuration for `streaming_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_recognize - ## - # RPC-specific configuration for `batch_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_recognize - ## - # RPC-specific configuration for `get_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_config - ## - # RPC-specific configuration for `update_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_config - ## - # RPC-specific configuration for `create_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_class - ## - # RPC-specific configuration for `list_custom_classes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_classes - ## - # RPC-specific configuration for `get_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_class - ## - # RPC-specific configuration for `update_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :update_custom_class - ## - # RPC-specific configuration for `delete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_class - ## - # RPC-specific configuration for `undelete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_custom_class - ## - # RPC-specific configuration for `create_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_phrase_set - ## - # RPC-specific configuration for `list_phrase_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_phrase_sets - ## - # RPC-specific configuration for `get_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_phrase_set - ## - # RPC-specific configuration for `update_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_phrase_set - ## - # RPC-specific configuration for `delete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_phrase_set - ## - # RPC-specific configuration for `undelete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_phrase_set - - # @private - def initialize parent_rpcs = nil - create_recognizer_config = parent_rpcs.create_recognizer if parent_rpcs.respond_to? :create_recognizer - @create_recognizer = ::Gapic::Config::Method.new create_recognizer_config - list_recognizers_config = parent_rpcs.list_recognizers if parent_rpcs.respond_to? :list_recognizers - @list_recognizers = ::Gapic::Config::Method.new list_recognizers_config - get_recognizer_config = parent_rpcs.get_recognizer if parent_rpcs.respond_to? :get_recognizer - @get_recognizer = ::Gapic::Config::Method.new get_recognizer_config - update_recognizer_config = parent_rpcs.update_recognizer if parent_rpcs.respond_to? :update_recognizer - @update_recognizer = ::Gapic::Config::Method.new update_recognizer_config - delete_recognizer_config = parent_rpcs.delete_recognizer if parent_rpcs.respond_to? :delete_recognizer - @delete_recognizer = ::Gapic::Config::Method.new delete_recognizer_config - undelete_recognizer_config = parent_rpcs.undelete_recognizer if parent_rpcs.respond_to? :undelete_recognizer - @undelete_recognizer = ::Gapic::Config::Method.new undelete_recognizer_config - recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize - @recognize = ::Gapic::Config::Method.new recognize_config - streaming_recognize_config = parent_rpcs.streaming_recognize if parent_rpcs.respond_to? :streaming_recognize - @streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config - batch_recognize_config = parent_rpcs.batch_recognize if parent_rpcs.respond_to? :batch_recognize - @batch_recognize = ::Gapic::Config::Method.new batch_recognize_config - get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config - @get_config = ::Gapic::Config::Method.new get_config_config - update_config_config = parent_rpcs.update_config if parent_rpcs.respond_to? :update_config - @update_config = ::Gapic::Config::Method.new update_config_config - create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class - @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config - list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes - @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config - get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class - @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config - update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class - @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config - delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class - @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config - undelete_custom_class_config = parent_rpcs.undelete_custom_class if parent_rpcs.respond_to? :undelete_custom_class - @undelete_custom_class = ::Gapic::Config::Method.new undelete_custom_class_config - create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set - @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config - list_phrase_sets_config = parent_rpcs.list_phrase_sets if parent_rpcs.respond_to? :list_phrase_sets - @list_phrase_sets = ::Gapic::Config::Method.new list_phrase_sets_config - get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set - @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config - update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set - @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config - delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set - @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config - undelete_phrase_set_config = parent_rpcs.undelete_phrase_set if parent_rpcs.respond_to? :undelete_phrase_set - @undelete_phrase_set = ::Gapic::Config::Method.new undelete_phrase_set_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/credentials.rb deleted file mode 100644 index 815acecc565d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/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 Speech - module V2 - module Speech - # Credentials for the Speech API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SPEECH_CREDENTIALS", - "SPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SPEECH_CREDENTIALS_JSON", - "SPEECH_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-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/operations.rb deleted file mode 100644 index 7972b3add947..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/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 Speech - module V2 - module Speech - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Speech 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 Speech 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::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Speech::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::Speech::V2::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 = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.rb deleted file mode 100644 index b1310528c078..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/paths.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 Speech - module V2 - module Speech - # Path helper methods for the Speech API. - module Paths - ## - # Create a fully-qualified Config resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/config` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def config_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/config" - 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 CustomClass resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # - # @param project [String] - # @param location [String] - # @param custom_class [String] - # - # @return [::String] - def custom_class_path project:, location:, custom_class: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/customClasses/#{custom_class}" - 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 PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - ## - # Create a fully-qualified Recognizer resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/recognizers/{recognizer}` - # - # @param project [String] - # @param location [String] - # @param recognizer [String] - # - # @return [::String] - def recognizer_path project:, location:, recognizer: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/recognizers/#{recognizer}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest.rb deleted file mode 100644 index c28a87547a1b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/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/speech/v2/version" -require "google/cloud/speech/v2/bindings_override" - -require "google/cloud/speech/v2/speech/credentials" -require "google/cloud/speech/v2/speech/paths" -require "google/cloud/speech/v2/speech/rest/operations" -require "google/cloud/speech/v2/speech/rest/client" - -module Google - module Cloud - module Speech - module V2 - ## - # Enables speech transcription and resource management. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/speech/v2/speech/rest" - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - module Speech - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/speech/v2/speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb deleted file mode 100644 index 5baef8881324..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb +++ /dev/null @@ -1,2647 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/speech/v2/cloud_speech_pb" -require "google/cloud/speech/v2/speech/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Speech - module V2 - module Speech - module Rest - ## - # REST client for the Speech service. - # - # Enables speech transcription and resource management. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :speech_stub - - ## - # Configure the Speech Client class. - # - # See {::Google::Cloud::Speech::V2::Speech::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Speech clients - # ::Google::Cloud::Speech::V2::Speech::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", "Speech", "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 = 5000.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Speech Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Speech::V2::Speech::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 - @speech_stub.universe_domain - end - - ## - # Create a new Speech REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Speech 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::Speech::V2::Speech::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 - - @speech_stub = ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @speech_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 = @speech_stub.endpoint - config.universe_domain = @speech_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @speech_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Speech::V2::Speech::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 - @speech_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload create_recognizer(request, options = nil) - # Pass arguments to `create_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreateRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreateRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) - # Pass arguments to `create_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] - # Required. The Recognizer to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the Recognizer, but do not - # actually create it. - # @param recognizer_id [::String] - # The ID to use for the Recognizer, which will become the final component of - # the Recognizer's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this Recognizer will be created. - # The expected format is `projects/{project}/locations/{location}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new - # - # # Call the create_recognizer method. - # result = client.create_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateRecognizerRequest - - # Converts hash and nil to an 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_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.create_recognizer request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 Recognizers. - # - # @overload list_recognizers(request, options = nil) - # Pass arguments to `list_recognizers` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListRecognizersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_recognizers` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of Recognizers to list. The expected - # format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of Recognizers to return. The service may return fewer - # than this value. If unspecified, at most 5 Recognizers will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers ListRecognizers} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers ListRecognizers} must match - # the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListRecognizersRequest.new - # - # # Call the list_recognizers method. - # result = client.list_recognizers request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V2::Recognizer. - # p item - # end - # - def list_recognizers request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListRecognizersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_recognizers.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_recognizers.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_recognizers.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.list_recognizers request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_recognizers, "recognizers", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested - # {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't - # exist. - # - # @overload get_recognizer(request, options = nil) - # Pass arguments to `get_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_recognizer(name: nil) - # Pass arguments to `get_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 Recognizer to retrieve. The expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::Recognizer] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Recognizer] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetRecognizerRequest.new - # - # # Call the get_recognizer method. - # result = client.get_recognizer request - # - # # The returned object is of type Google::Cloud::Speech::V2::Recognizer. - # p result - # - def get_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetRecognizerRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.get_recognizer request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload update_recognizer(request, options = nil) - # Pass arguments to `update_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::Google::Cloud::Speech::V2::Recognizer, ::Hash] - # Required. The Recognizer to update. - # - # The Recognizer's `name` field is used to identify the Recognizer to update. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire Recognizer resource. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated Recognizer, but do not - # actually update it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new - # - # # Call the update_recognizer method. - # result = client.update_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateRecognizerRequest - - # Converts hash and nil to an 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_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.update_recognizer request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload delete_recognizer(request, options = nil) - # Pass arguments to `delete_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeleteRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeleteRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 Recognizer to delete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted Recognizer, but do not - # actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the Recognizer is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new - # - # # Call the delete_recognizer method. - # result = client.delete_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteRecognizerRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.delete_recognizer request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeletes the {::Google::Cloud::Speech::V2::Recognizer Recognizer}. - # - # @overload undelete_recognizer(request, options = nil) - # Pass arguments to `undelete_recognizer` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeleteRecognizerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_recognizer(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_recognizer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 Recognizer to undelete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted Recognizer, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new - # - # # Call the undelete_recognizer method. - # result = client.undelete_recognizer request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_recognizer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.undelete_recognizer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.undelete_recognizer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_recognizer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.undelete_recognizer request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs synchronous Speech recognition: receive results after all audio - # has been sent and processed. - # - # @overload recognize(request, options = nil) - # Pass arguments to `recognize` via a request object, either of type - # {::Google::Cloud::Speech::V2::RecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::RecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) - # Pass arguments to `recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field - # can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the - # values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @param content [::String] - # The audio data bytes encoded as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As - # with all bytes fields, proto buffers use a pure binary representation, - # whereas JSON representations use base64. - # - # Note: The following parameters are mutually exclusive: `content`, `uri`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param uri [::String] - # URI that points to a file that contains audio data bytes as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file - # must not be compressed (for example, gzip). Currently, only Google Cloud - # Storage URIs are supported, which must be specified in the following - # format: `gs://bucket_name/object_name` (other URI formats return - # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more - # information, see [Request - # URIs](https://cloud.google.com/storage/docs/reference-uris). - # - # Note: The following parameters are mutually exclusive: `uri`, `content`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::RecognizeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::RecognizeResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::RecognizeRequest.new - # - # # Call the recognize method. - # result = client.recognize request - # - # # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. - # p result - # - def recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::RecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.recognize.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.recognize request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs batch asynchronous speech recognition: send a request with N - # audio files and receive a long running operation that can be polled to see - # when the transcriptions are finished. - # - # @overload batch_recognize(request, options = nil) - # Pass arguments to `batch_recognize` via a request object, either of type - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::BatchRecognizeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) - # Pass arguments to `batch_recognize` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param recognizer [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @param config [::Google::Cloud::Speech::V2::RecognitionConfig, ::Hash] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @param config_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override - # the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all given fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>] - # Audio files with file metadata for ASR. - # The maximum number of files allowed to be specified is 15. - # @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash] - # Configuration options for where to output the transcripts of each file. - # @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] - # Processing strategy to use for this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new - # - # # Call the batch_recognize method. - # result = client.batch_recognize request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_recognize request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::BatchRecognizeRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_recognize.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_recognize.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_recognize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.batch_recognize request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested {::Google::Cloud::Speech::V2::Config Config}. - # - # @overload get_config(request, options = nil) - # Pass arguments to `get_config` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_config(name: nil) - # Pass arguments to `get_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the config to retrieve. There is exactly one config - # resource per project per location. The expected format is - # `projects/{project}/locations/{location}/config`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetConfigRequest.new - # - # # Call the get_config method. - # result = client.get_config request - # - # # The returned object is of type Google::Cloud::Speech::V2::Config. - # p result - # - def get_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_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::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.get_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Speech::V2::Config Config}. - # - # @overload update_config(request, options = nil) - # Pass arguments to `update_config` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_config(config: nil, update_mask: nil) - # Pass arguments to `update_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 config [::Google::Cloud::Speech::V2::Config, ::Hash] - # Required. The config to update. - # - # The config's `name` field is used to identify the config to be updated. - # The expected format is `projects/{project}/locations/{location}/config`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateConfigRequest.new - # - # # Call the update_config method. - # result = client.update_config request - # - # # The returned object is of type Google::Cloud::Speech::V2::Config. - # p result - # - def update_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateConfigRequest - - # Converts hash and nil to an 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_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::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.update_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload create_custom_class(request, options = nil) - # Pass arguments to `create_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) - # Pass arguments to `create_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] - # Required. The CustomClass to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the CustomClass, but do not - # actually create it. - # @param custom_class_id [::String] - # The ID to use for the CustomClass, which will become the final component of - # the CustomClass's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this CustomClass will be created. - # The expected format is `projects/{project}/locations/{location}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new - # - # # Call the create_custom_class method. - # result = client.create_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreateCustomClassRequest - - # Converts hash and nil to an 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.create_custom_class request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 CustomClasses. - # - # @overload list_custom_classes(request, options = nil) - # Pass arguments to `list_custom_classes` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListCustomClassesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListCustomClassesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_custom_classes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of CustomClass resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # Number of results per requests. A valid page_size ranges from 0 to 100 - # inclusive. If the page_size is zero or unspecified, a page size of 5 will - # be chosen. If the page size exceeds 100, it will be coerced down to 100. - # Note that a call might return fewer results than the requested page size. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes ListCustomClasses} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes ListCustomClasses} must - # match the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new - # - # # Call the list_custom_classes method. - # result = client.list_custom_classes request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V2::CustomClass. - # p item - # end - # - def list_custom_classes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListCustomClassesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_custom_classes.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_custom_classes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.list_custom_classes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_custom_classes, "custom_classes", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested - # {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload get_custom_class(request, options = nil) - # Pass arguments to `get_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_custom_class(name: nil) - # Pass arguments to `get_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 CustomClass to retrieve. The expected format is - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::CustomClass] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetCustomClassRequest.new - # - # # Call the get_custom_class method. - # result = client.get_custom_class request - # - # # The returned object is of type Google::Cloud::Speech::V2::CustomClass. - # p result - # - def get_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.get_custom_class request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload update_custom_class(request, options = nil) - # Pass arguments to `update_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdateCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdateCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param custom_class [::Google::Cloud::Speech::V2::CustomClass, ::Hash] - # Required. The CustomClass to update. - # - # The CustomClass's `name` field is used to identify the CustomClass to - # update. Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. If empty, all fields are considered for - # update. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated CustomClass, but do - # not actually update it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new - # - # # Call the update_custom_class method. - # result = client.update_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdateCustomClassRequest - - # Converts hash and nil to an 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_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.update_custom_class request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload delete_custom_class(request, options = nil) - # Pass arguments to `delete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 CustomClass to delete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted CustomClass, but do - # not actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the CustomClass is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new - # - # # Call the delete_custom_class method. - # result = client.delete_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeleteCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.delete_custom_class request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeletes the {::Google::Cloud::Speech::V2::CustomClass CustomClass}. - # - # @overload undelete_custom_class(request, options = nil) - # Pass arguments to `undelete_custom_class` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeleteCustomClassRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_custom_class(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_custom_class` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 CustomClass to undelete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted CustomClass, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new - # - # # Call the undelete_custom_class method. - # result = client.undelete_custom_class request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_custom_class request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.undelete_custom_class.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.undelete_custom_class.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_custom_class.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.undelete_custom_class request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload create_phrase_set(request, options = nil) - # Pass arguments to `create_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::CreatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::CreatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) - # Pass arguments to `create_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] - # Required. The PhraseSet to create. - # @param validate_only [::Boolean] - # If set, validate the request and preview the PhraseSet, but do not - # actually create it. - # @param phrase_set_id [::String] - # The ID to use for the PhraseSet, which will become the final component of - # the PhraseSet's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @param parent [::String] - # Required. The project and location where this PhraseSet will be created. - # The expected format is `projects/{project}/locations/{location}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new - # - # # Call the create_phrase_set method. - # result = client.create_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::CreatePhraseSetRequest - - # Converts hash and nil to an 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.create_phrase_set request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 PhraseSets. - # - # @overload list_phrase_sets(request, options = nil) - # Pass arguments to `list_phrase_sets` via a request object, either of type - # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::ListPhraseSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_phrase_sets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The project and location of PhraseSet resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of PhraseSets to return. The service may return fewer - # than this value. If unspecified, at most 5 PhraseSets will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets ListPhraseSets} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets ListPhraseSets} must match - # the call that provided the page token. - # @param show_deleted [::Boolean] - # Whether, or not, to show resources that have been deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new - # - # # Call the list_phrase_sets method. - # result = client.list_phrase_sets request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet. - # p item - # end - # - def list_phrase_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::ListPhraseSetsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_phrase_sets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_phrase_sets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_phrase_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.list_phrase_sets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @speech_stub, :list_phrase_sets, "phrase_sets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested - # {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload get_phrase_set(request, options = nil) - # Pass arguments to `get_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::GetPhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::GetPhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_phrase_set(name: nil) - # Pass arguments to `get_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 PhraseSet to retrieve. The expected format is - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new - # - # # Call the get_phrase_set method. - # result = client.get_phrase_set request - # - # # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. - # p result - # - def get_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::GetPhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.get_phrase_set request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload update_phrase_set(request, options = nil) - # Pass arguments to `update_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::UpdatePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param phrase_set [::Google::Cloud::Speech::V2::PhraseSet, ::Hash] - # Required. The PhraseSet to update. - # - # The PhraseSet's `name` field is used to identify the PhraseSet to update. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire PhraseSet resource. - # @param validate_only [::Boolean] - # If set, validate the request and preview the updated PhraseSet, but do not - # actually update it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new - # - # # Call the update_phrase_set method. - # result = client.update_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest - - # Converts hash and nil to an 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_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.update_phrase_set request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload delete_phrase_set(request, options = nil) - # Pass arguments to `delete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::DeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::DeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) - # Pass arguments to `delete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 PhraseSet to delete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the deleted PhraseSet, but do not - # actually delete it. - # @param allow_missing [::Boolean] - # If set to true, and the PhraseSet is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new - # - # # Call the delete_phrase_set method. - # result = client.delete_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::DeletePhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.delete_phrase_set request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Undeletes the {::Google::Cloud::Speech::V2::PhraseSet PhraseSet}. - # - # @overload undelete_phrase_set(request, options = nil) - # Pass arguments to `undelete_phrase_set` via a request object, either of type - # {::Google::Cloud::Speech::V2::UndeletePhraseSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_phrase_set(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `undelete_phrase_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 PhraseSet to undelete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @param validate_only [::Boolean] - # If set, validate the request and preview the undeleted PhraseSet, but do - # not actually undelete it. - # @param etag [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/speech/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Speech::V2::Speech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new - # - # # Call the undelete_phrase_set method. - # result = client.undelete_phrase_set request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def undelete_phrase_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.undelete_phrase_set.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.undelete_phrase_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_phrase_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @speech_stub.undelete_phrase_set request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 Speech REST API. - # - # This class represents the configuration for Speech REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Speech::V2::Speech::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_recognizer to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Speech::V2::Speech::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_recognizer.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_recognizer.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 Speech API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :create_recognizer - ## - # RPC-specific configuration for `list_recognizers` - # @return [::Gapic::Config::Method] - # - attr_reader :list_recognizers - ## - # RPC-specific configuration for `get_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :get_recognizer - ## - # RPC-specific configuration for `update_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :update_recognizer - ## - # RPC-specific configuration for `delete_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_recognizer - ## - # RPC-specific configuration for `undelete_recognizer` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_recognizer - ## - # RPC-specific configuration for `recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :recognize - ## - # RPC-specific configuration for `batch_recognize` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_recognize - ## - # RPC-specific configuration for `get_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_config - ## - # RPC-specific configuration for `update_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_config - ## - # RPC-specific configuration for `create_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_class - ## - # RPC-specific configuration for `list_custom_classes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_classes - ## - # RPC-specific configuration for `get_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_class - ## - # RPC-specific configuration for `update_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :update_custom_class - ## - # RPC-specific configuration for `delete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_class - ## - # RPC-specific configuration for `undelete_custom_class` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_custom_class - ## - # RPC-specific configuration for `create_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_phrase_set - ## - # RPC-specific configuration for `list_phrase_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_phrase_sets - ## - # RPC-specific configuration for `get_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_phrase_set - ## - # RPC-specific configuration for `update_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_phrase_set - ## - # RPC-specific configuration for `delete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_phrase_set - ## - # RPC-specific configuration for `undelete_phrase_set` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_phrase_set - - # @private - def initialize parent_rpcs = nil - create_recognizer_config = parent_rpcs.create_recognizer if parent_rpcs.respond_to? :create_recognizer - @create_recognizer = ::Gapic::Config::Method.new create_recognizer_config - list_recognizers_config = parent_rpcs.list_recognizers if parent_rpcs.respond_to? :list_recognizers - @list_recognizers = ::Gapic::Config::Method.new list_recognizers_config - get_recognizer_config = parent_rpcs.get_recognizer if parent_rpcs.respond_to? :get_recognizer - @get_recognizer = ::Gapic::Config::Method.new get_recognizer_config - update_recognizer_config = parent_rpcs.update_recognizer if parent_rpcs.respond_to? :update_recognizer - @update_recognizer = ::Gapic::Config::Method.new update_recognizer_config - delete_recognizer_config = parent_rpcs.delete_recognizer if parent_rpcs.respond_to? :delete_recognizer - @delete_recognizer = ::Gapic::Config::Method.new delete_recognizer_config - undelete_recognizer_config = parent_rpcs.undelete_recognizer if parent_rpcs.respond_to? :undelete_recognizer - @undelete_recognizer = ::Gapic::Config::Method.new undelete_recognizer_config - recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize - @recognize = ::Gapic::Config::Method.new recognize_config - batch_recognize_config = parent_rpcs.batch_recognize if parent_rpcs.respond_to? :batch_recognize - @batch_recognize = ::Gapic::Config::Method.new batch_recognize_config - get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config - @get_config = ::Gapic::Config::Method.new get_config_config - update_config_config = parent_rpcs.update_config if parent_rpcs.respond_to? :update_config - @update_config = ::Gapic::Config::Method.new update_config_config - create_custom_class_config = parent_rpcs.create_custom_class if parent_rpcs.respond_to? :create_custom_class - @create_custom_class = ::Gapic::Config::Method.new create_custom_class_config - list_custom_classes_config = parent_rpcs.list_custom_classes if parent_rpcs.respond_to? :list_custom_classes - @list_custom_classes = ::Gapic::Config::Method.new list_custom_classes_config - get_custom_class_config = parent_rpcs.get_custom_class if parent_rpcs.respond_to? :get_custom_class - @get_custom_class = ::Gapic::Config::Method.new get_custom_class_config - update_custom_class_config = parent_rpcs.update_custom_class if parent_rpcs.respond_to? :update_custom_class - @update_custom_class = ::Gapic::Config::Method.new update_custom_class_config - delete_custom_class_config = parent_rpcs.delete_custom_class if parent_rpcs.respond_to? :delete_custom_class - @delete_custom_class = ::Gapic::Config::Method.new delete_custom_class_config - undelete_custom_class_config = parent_rpcs.undelete_custom_class if parent_rpcs.respond_to? :undelete_custom_class - @undelete_custom_class = ::Gapic::Config::Method.new undelete_custom_class_config - create_phrase_set_config = parent_rpcs.create_phrase_set if parent_rpcs.respond_to? :create_phrase_set - @create_phrase_set = ::Gapic::Config::Method.new create_phrase_set_config - list_phrase_sets_config = parent_rpcs.list_phrase_sets if parent_rpcs.respond_to? :list_phrase_sets - @list_phrase_sets = ::Gapic::Config::Method.new list_phrase_sets_config - get_phrase_set_config = parent_rpcs.get_phrase_set if parent_rpcs.respond_to? :get_phrase_set - @get_phrase_set = ::Gapic::Config::Method.new get_phrase_set_config - update_phrase_set_config = parent_rpcs.update_phrase_set if parent_rpcs.respond_to? :update_phrase_set - @update_phrase_set = ::Gapic::Config::Method.new update_phrase_set_config - delete_phrase_set_config = parent_rpcs.delete_phrase_set if parent_rpcs.respond_to? :delete_phrase_set - @delete_phrase_set = ::Gapic::Config::Method.new delete_phrase_set_config - undelete_phrase_set_config = parent_rpcs.undelete_phrase_set if parent_rpcs.respond_to? :undelete_phrase_set - @undelete_phrase_set = ::Gapic::Config::Method.new undelete_phrase_set_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/operations.rb deleted file mode 100644 index f2d7c9d11500..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/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 Speech - module V2 - module Speech - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Speech 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 Speech 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::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Speech::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "speech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^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: "/v2/{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-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb deleted file mode 100644 index 643afd7c54c8..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb +++ /dev/null @@ -1,1435 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/speech/v2/cloud_speech_pb" - -module Google - module Cloud - module Speech - module V2 - module Speech - module Rest - ## - # REST service stub for the Speech 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_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreateRecognizerRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_recognizer_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_recognizer", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_recognizers REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListRecognizersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::ListRecognizersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::ListRecognizersResponse] - # A result object deserialized from the server's reply - def list_recognizers request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_recognizers_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_recognizers", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::ListRecognizersResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetRecognizerRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::Recognizer] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Recognizer] - # A result object deserialized from the server's reply - def get_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_recognizer_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_recognizer", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::Recognizer.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_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_recognizer_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_recognizer", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_recognizer_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_recognizer", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the undelete_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def undelete_recognizer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_recognizer_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "undelete_recognizer", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::RecognizeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::RecognizeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::RecognizeResponse] - # A result object deserialized from the server's reply - def recognize request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_recognize_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "recognize", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::RecognizeResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::BatchRecognizeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_recognize request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_recognize_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_recognize", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_config REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # A result object deserialized from the server's reply - def get_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_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_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::Config.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_config REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::Config] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::Config] - # A result object deserialized from the server's reply - def update_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_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_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::Config.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_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreateCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_custom_classes REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListCustomClassesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::ListCustomClassesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::ListCustomClassesResponse] - # A result object deserialized from the server's reply - def list_custom_classes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_classes_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_custom_classes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::CustomClass] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::CustomClass] - # A result object deserialized from the server's reply - def get_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::CustomClass.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_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the undelete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def undelete_custom_class request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_custom_class_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "undelete_custom_class", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_phrase_sets REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListPhraseSetsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::ListPhraseSetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::ListPhraseSetsResponse] - # A result object deserialized from the server's reply - def list_phrase_sets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_phrase_sets_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_phrase_sets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetPhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Speech::V2::PhraseSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # A result object deserialized from the server's reply - def get_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Speech::V2::PhraseSet.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_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the undelete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def undelete_phrase_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_phrase_set_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "undelete_phrase_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreateRecognizerRequest] - # 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_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/recognizers", - body: "recognizer", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_recognizers REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListRecognizersRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_recognizers_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/recognizers", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetRecognizerRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] - # 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_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{recognizer.name}", - body: "recognizer", - matches: [ - ["recognizer.name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_recognizer REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_recognizer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::RecognizeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_recognize_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{recognizer}:recognize", - body: "*", - matches: [ - ["recognizer", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_recognize REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::BatchRecognizeRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_recognize_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{recognizer}:batchRecognize", - body: "*", - matches: [ - ["recognizer", %r{^projects/[^/]+/locations/[^/]+/recognizers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_config REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/config/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_config REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateConfigRequest] - # 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_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{config.name}", - body: "config", - matches: [ - ["config.name", %r{^projects/[^/]+/locations/[^/]+/config/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreateCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/customClasses", - body: "custom_class", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_custom_classes REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListCustomClassesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_custom_classes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/customClasses", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetCustomClassRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] - # 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_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{custom_class.name}", - body: "custom_class", - matches: [ - ["custom_class.name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_custom_class REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_custom_class_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/customClasses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/phraseSets", - body: "phrase_set", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_phrase_sets REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::ListPhraseSetsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_phrase_sets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/phraseSets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::GetPhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] - # 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_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{phrase_set.name}", - body: "phrase_set", - matches: [ - ["phrase_set.name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_phrase_set REST call - # - # @param request_pb [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_phrase_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/phraseSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb b/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/v2/version.rb deleted file mode 100644 index b3aeb607f80f..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/lib/google/cloud/speech/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 Speech - module V2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md deleted file mode 100644 index 97cb89a70a74..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Speech-to-Text 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-speech-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/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-speech-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb deleted file mode 100644 index 727666e1d47d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/cloud_speech.rb +++ /dev/null @@ -1,2086 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Speech - module V2 - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#create_recognizer CreateRecognizer} method. - # @!attribute [rw] recognizer - # @return [::Google::Cloud::Speech::V2::Recognizer] - # Required. The Recognizer to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the Recognizer, but do not - # actually create it. - # @!attribute [rw] recognizer_id - # @return [::String] - # The ID to use for the Recognizer, which will become the final component of - # the Recognizer's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location where this Recognizer will be created. - # The expected format is `projects/{project}/locations/{location}`. - class CreateRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of a long-running operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation was created. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation was last updated. - # @!attribute [rw] resource - # @return [::String] - # The resource path for the target of the operation. - # @!attribute [rw] method - # @return [::String] - # The method that triggered the operation. - # @!attribute [rw] kms_key_name - # @return [::String] - # The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the content of the Operation is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [rw] kms_key_version_name - # @return [::String] - # The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which content of the Operation is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - # @!attribute [rw] batch_recognize_request - # @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest] - # The BatchRecognizeRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] create_recognizer_request - # @return [::Google::Cloud::Speech::V2::CreateRecognizerRequest] - # The CreateRecognizerRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `create_recognizer_request`, `batch_recognize_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_recognizer_request - # @return [::Google::Cloud::Speech::V2::UpdateRecognizerRequest] - # The UpdateRecognizerRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `update_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_recognizer_request - # @return [::Google::Cloud::Speech::V2::DeleteRecognizerRequest] - # The DeleteRecognizerRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `delete_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] undelete_recognizer_request - # @return [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest] - # The UndeleteRecognizerRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `undelete_recognizer_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] create_custom_class_request - # @return [::Google::Cloud::Speech::V2::CreateCustomClassRequest] - # The CreateCustomClassRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `create_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_custom_class_request - # @return [::Google::Cloud::Speech::V2::UpdateCustomClassRequest] - # The UpdateCustomClassRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `update_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_custom_class_request - # @return [::Google::Cloud::Speech::V2::DeleteCustomClassRequest] - # The DeleteCustomClassRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `delete_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] undelete_custom_class_request - # @return [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest] - # The UndeleteCustomClassRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `undelete_custom_class_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] create_phrase_set_request - # @return [::Google::Cloud::Speech::V2::CreatePhraseSetRequest] - # The CreatePhraseSetRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `create_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_phrase_set_request - # @return [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest] - # The UpdatePhraseSetRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `update_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_phrase_set_request - # @return [::Google::Cloud::Speech::V2::DeletePhraseSetRequest] - # The DeletePhraseSetRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `delete_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `undelete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] undelete_phrase_set_request - # @return [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest] - # The UndeletePhraseSetRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `undelete_phrase_set_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `update_config_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_config_request - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Speech::V2::UpdateConfigRequest] - # The UpdateConfigRequest that spawned the Operation. - # - # Note: The following fields are mutually exclusive: `update_config_request`, `batch_recognize_request`, `create_recognizer_request`, `update_recognizer_request`, `delete_recognizer_request`, `undelete_recognizer_request`, `create_custom_class_request`, `update_custom_class_request`, `delete_custom_class_request`, `undelete_custom_class_request`, `create_phrase_set_request`, `update_phrase_set_request`, `delete_phrase_set_request`, `undelete_phrase_set_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] progress_percent - # @return [::Integer] - # The percent progress of the Operation. Values can range from 0-100. If the - # value is 100, then the operation is finished. - # @!attribute [rw] batch_recognize_metadata - # @return [::Google::Cloud::Speech::V2::BatchRecognizeMetadata] - # Metadata specific to the BatchRecognize method. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location of Recognizers to list. The expected - # format is `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of Recognizers to return. The service may return fewer - # than this value. If unspecified, at most 5 Recognizers will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} must match - # the call that provided the page token. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Whether, or not, to show resources that have been deleted. - class ListRecognizersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method. - # @!attribute [rw] recognizers - # @return [::Array<::Google::Cloud::Speech::V2::Recognizer>] - # The list of requested Recognizers. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::Speech::V2::ListRecognizersRequest#page_token page_token} to - # retrieve the next page. If this field is omitted, there are no subsequent - # pages. This token expires after 72 hours. - class ListRecognizersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#get_recognizer GetRecognizer} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Recognizer to retrieve. The expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. - class GetRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#update_recognizer UpdateRecognizer} method. - # @!attribute [rw] recognizer - # @return [::Google::Cloud::Speech::V2::Recognizer] - # Required. The Recognizer to update. - # - # The Recognizer's `name` field is used to identify the Recognizer to update. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire Recognizer resource. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the updated Recognizer, but do not - # actually update it. - class UpdateRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#delete_recognizer DeleteRecognizer} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Recognizer to delete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the deleted Recognizer, but do not - # actually delete it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the Recognizer is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class DeleteRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer UndeleteRecognizer} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Recognizer to undelete. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the undeleted Recognizer, but do - # not actually undelete it. - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class UndeleteRecognizerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Recognizer message. Stores recognition configuration and metadata. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the Recognizer. - # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`. - # @!attribute [r] uid - # @return [::String] - # Output only. System-assigned unique identifier for the Recognizer. - # @!attribute [rw] display_name - # @return [::String] - # User-settable, human-readable name for the Recognizer. Must be 63 - # characters or less. - # @!attribute [rw] model - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Optional. This field is now deprecated. Prefer the - # {::Google::Cloud::Speech::V2::RecognitionConfig#model `model`} field in the - # {::Google::Cloud::Speech::V2::RecognitionConfig `RecognitionConfig`} message. - # - # Which model to use for recognition requests. Select the model best suited - # to your domain to get best results. - # - # Guidance for choosing which model to use can be found in the [Transcription - # Models - # Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) - # and the models supported in each region can be found in the [Table Of - # Supported - # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). - # @!attribute [rw] language_codes - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # Optional. This field is now deprecated. Prefer the - # {::Google::Cloud::Speech::V2::RecognitionConfig#language_codes `language_codes`} - # field in the - # {::Google::Cloud::Speech::V2::RecognitionConfig `RecognitionConfig`} message. - # - # The language of the supplied audio as a - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # - # Supported languages for each model are listed in the [Table of Supported - # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). - # - # If additional languages are provided, recognition result will contain - # recognition in the most likely language detected. The recognition result - # will include the language tag of the language detected in the audio. - # When you create or update a Recognizer, these values are - # stored in normalized BCP-47 form. For example, "en-us" is stored as - # "en-US". - # @!attribute [rw] default_recognition_config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Default configuration to use for requests with this Recognizer. - # This can be overwritten by inline configuration in the - # {::Google::Cloud::Speech::V2::RecognizeRequest#config RecognizeRequest.config} - # field. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Allows users to store small amounts of arbitrary data. - # Both the key and the value must be 63 characters or less each. - # At most 100 annotations. - # @!attribute [r] state - # @return [::Google::Cloud::Speech::V2::Recognizer::State] - # Output only. The Recognizer lifecycle state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this Recognizer was modified. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this Recognizer was requested for deletion. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this Recognizer will be purged. - # @!attribute [r] etag - # @return [::String] - # Output only. This checksum is computed by the server based on the value of - # other fields. This may be sent on update, undelete, and delete requests to - # ensure the client has an up-to-date value before proceeding. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Whether or not this Recognizer is in the process of being - # updated. - # @!attribute [r] kms_key_name - # @return [::String] - # Output only. The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the Recognizer is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] kms_key_version_name - # @return [::String] - # Output only. The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which the Recognizer is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - class Recognizer - 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 - - # Set of states that define the lifecycle of a Recognizer. - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # The Recognizer is active and ready for use. - ACTIVE = 2 - - # This Recognizer has been deleted. - DELETED = 4 - end - end - - # Automatically detected decoding parameters. - # Supported for the following encodings: - # - # * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container. - # - # * WAV_MULAW: 8-bit companded mulaw samples in a WAV container. - # - # * WAV_ALAW: 8-bit companded alaw samples in a WAV container. - # - # * RFC4867_5_AMR: AMR frames with an rfc4867.5 header. - # - # * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header. - # - # * FLAC: FLAC frames in the "native FLAC" container format. - # - # * MP3: MPEG audio frames with optional (ignored) ID3 metadata. - # - # * OGG_OPUS: Opus audio frames in an Ogg container. - # - # * WEBM_OPUS: Opus audio frames in a WebM container. - # - # * MP4_AAC: AAC audio frames in an MP4 container. - # - # * M4A_AAC: AAC audio frames in an M4A container. - # - # * MOV_AAC: AAC audio frames in an MOV container. - class AutoDetectDecodingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Explicitly specified decoding parameters. - # @!attribute [rw] encoding - # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig::AudioEncoding] - # Required. Encoding of the audio data sent for recognition. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Optional. Sample rate in Hertz of the audio data sent for recognition. - # Valid values are: 8000-48000, and 16000 is optimal. For best results, set - # the sampling rate of the audio source to 16000 Hz. If that's not possible, - # use the native sample rate of the audio source (instead of resampling). - # Note that this field is marked as OPTIONAL for backward compatibility - # reasons. It is (and has always been) effectively REQUIRED. - # @!attribute [rw] audio_channel_count - # @return [::Integer] - # Optional. Number of channels present in the audio data sent for - # recognition. Note that this field is marked as OPTIONAL for backward - # compatibility reasons. It is (and has always been) effectively REQUIRED. - # - # The maximum allowed value is 8. - class ExplicitDecodingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Supported audio data encodings. - module AudioEncoding - # Default value. This value is unused. - AUDIO_ENCODING_UNSPECIFIED = 0 - - # Headerless 16-bit signed little-endian PCM samples. - LINEAR16 = 1 - - # Headerless 8-bit companded mulaw samples. - MULAW = 2 - - # Headerless 8-bit companded alaw samples. - ALAW = 3 - - # AMR frames with an rfc4867.5 header. - AMR = 4 - - # AMR-WB frames with an rfc4867.5 header. - AMR_WB = 5 - - # FLAC frames in the "native FLAC" container format. - FLAC = 6 - - # MPEG audio frames with optional (ignored) ID3 metadata. - MP3 = 7 - - # Opus audio frames in an Ogg container. - OGG_OPUS = 8 - - # Opus audio frames in a WebM container. - WEBM_OPUS = 9 - - # AAC audio frames in an MP4 container. - MP4_AAC = 10 - - # AAC audio frames in an M4A container. - M4A_AAC = 11 - - # AAC audio frames in an MOV container. - MOV_AAC = 12 - end - end - - # Configuration to enable speaker diarization. - # @!attribute [rw] min_speaker_count - # @return [::Integer] - # Optional. The system automatically determines the number of speakers. This - # value is not currently used. - # @!attribute [rw] max_speaker_count - # @return [::Integer] - # Optional. The system automatically determines the number of speakers. This - # value is not currently used. - class SpeakerDiarizationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration to enable custom prompt in chirp3. - # @!attribute [rw] custom_prompt - # @return [::String] - # Optional. The custom instructions to override the existing instructions for - # chirp3. - class CustomPromptConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Available recognition features. - # @!attribute [rw] profanity_filter - # @return [::Boolean] - # If set to `true`, the server will attempt to filter out profanities, - # replacing all but the initial character in each filtered word with - # asterisks, for instance, "f***". If set to `false` or omitted, profanities - # won't be filtered out. - # @!attribute [rw] enable_word_time_offsets - # @return [::Boolean] - # If `true`, the top result includes a list of words and the start and end - # time offsets (timestamps) for those words. If `false`, no word-level time - # offset information is returned. The default is `false`. - # @!attribute [rw] enable_word_confidence - # @return [::Boolean] - # If `true`, the top result includes a list of words and the confidence for - # those words. If `false`, no word-level confidence information is returned. - # The default is `false`. - # @!attribute [rw] enable_automatic_punctuation - # @return [::Boolean] - # If `true`, adds punctuation to recognition result hypotheses. This feature - # is only available in select languages. The default `false` value does not - # add punctuation to result hypotheses. - # @!attribute [rw] enable_spoken_punctuation - # @return [::Boolean] - # The spoken punctuation behavior for the call. If `true`, replaces spoken - # punctuation with the corresponding symbols in the request. For example, - # "how are you question mark" becomes "how are you?". See - # https://cloud.google.com/speech-to-text/docs/spoken-punctuation for - # support. If `false`, spoken punctuation is not replaced. - # @!attribute [rw] enable_spoken_emojis - # @return [::Boolean] - # The spoken emoji behavior for the call. If `true`, adds spoken emoji - # formatting for the request. This will replace spoken emojis with the - # corresponding Unicode symbols in the final transcript. If `false`, spoken - # emojis are not replaced. - # @!attribute [rw] multi_channel_mode - # @return [::Google::Cloud::Speech::V2::RecognitionFeatures::MultiChannelMode] - # Mode for recognizing multi-channel audio. - # @!attribute [rw] diarization_config - # @return [::Google::Cloud::Speech::V2::SpeakerDiarizationConfig] - # Configuration to enable speaker diarization. To enable diarization, set - # this field to an empty SpeakerDiarizationConfig message. - # @!attribute [rw] max_alternatives - # @return [::Integer] - # Maximum number of recognition hypotheses to be returned. - # The server may return fewer than `max_alternatives`. - # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - # one. If omitted, will return a maximum of one. - # @!attribute [rw] custom_prompt_config - # @return [::Google::Cloud::Speech::V2::CustomPromptConfig] - # Optional. Configuration to enable custom prompt for chirp3. - class RecognitionFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Options for how to recognize multi-channel audio. - module MultiChannelMode - # Default value for the multi-channel mode. If the audio contains - # multiple channels, only the first channel will be transcribed; other - # channels will be ignored. - MULTI_CHANNEL_MODE_UNSPECIFIED = 0 - - # If selected, each channel in the provided audio is transcribed - # independently. This cannot be selected if the selected - # {::Google::Cloud::Speech::V2::Recognizer#model model} is `latest_short`. - SEPARATE_RECOGNITION_PER_CHANNEL = 1 - end - end - - # Transcription normalization configuration. Use transcription normalization - # to automatically replace parts of the transcript with phrases of your - # choosing. For StreamingRecognize, this normalization only applies to stable - # partial transcripts (stability > 0.8) and final transcripts. - # @!attribute [rw] entries - # @return [::Array<::Google::Cloud::Speech::V2::TranscriptNormalization::Entry>] - # A list of replacement entries. We will perform replacement with one entry - # at a time. For example, the second entry in ["cat" => "dog", "mountain cat" - # => "mountain dog"] will never be applied because we will always process the - # first entry before it. At most 100 entries. - class TranscriptNormalization - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single replacement configuration. - # @!attribute [rw] search - # @return [::String] - # What to replace. Max length is 100 characters. - # @!attribute [rw] replace - # @return [::String] - # What to replace with. Max length is 100 characters. - # @!attribute [rw] case_sensitive - # @return [::Boolean] - # Whether the search is case sensitive. - class Entry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Translation configuration. Use to translate the given audio into text for the - # desired language. - # @!attribute [rw] target_language - # @return [::String] - # Required. The language code to translate to. - class TranslationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides "hints" to the speech recognizer to favor specific words and phrases - # in the results. PhraseSets can be specified as an inline resource, or a - # reference to an existing PhraseSet resource. - # @!attribute [rw] phrase_sets - # @return [::Array<::Google::Cloud::Speech::V2::SpeechAdaptation::AdaptationPhraseSet>] - # A list of inline or referenced PhraseSets. - # @!attribute [rw] custom_classes - # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>] - # A list of inline CustomClasses. Existing CustomClass resources can be - # referenced directly in a PhraseSet. - class SpeechAdaptation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A biasing PhraseSet, which can be either a string referencing the name of - # an existing PhraseSets resource, or an inline definition of a PhraseSet. - # @!attribute [rw] phrase_set - # @return [::String] - # The name of an existing PhraseSet resource. The user must have read - # access to the resource and it must not be deleted. - # - # Note: The following fields are mutually exclusive: `phrase_set`, `inline_phrase_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] inline_phrase_set - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # An inline defined PhraseSet. - # - # Note: The following fields are mutually exclusive: `inline_phrase_set`, `phrase_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AdaptationPhraseSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Denoiser config. May not be supported for all models and may - # have no effect. - # @!attribute [rw] denoise_audio - # @return [::Boolean] - # Denoise audio before sending to the transcription model. - # @!attribute [rw] snr_threshold - # @return [::Float] - # Signal-to-Noise Ratio (SNR) threshold for the denoiser. Here SNR means the - # loudness of the speech signal. Audio with an SNR below this threshold, - # meaning the speech is too quiet, will be prevented from being sent to the - # transcription model. - # - # If snr_threshold=0, no filtering will be applied. - class DenoiserConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides information to the Recognizer that specifies how to process the - # recognition request. - # @!attribute [rw] auto_decoding_config - # @return [::Google::Cloud::Speech::V2::AutoDetectDecodingConfig] - # Automatically detect decoding parameters. - # Preferred for supported formats. - # - # Note: The following fields are mutually exclusive: `auto_decoding_config`, `explicit_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] explicit_decoding_config - # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig] - # Explicitly specified decoding parameters. - # Required if using headerless PCM audio (linear16, mulaw, alaw). - # - # Note: The following fields are mutually exclusive: `explicit_decoding_config`, `auto_decoding_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] model - # @return [::String] - # Optional. Which model to use for recognition requests. Select the model - # best suited to your domain to get best results. - # - # Guidance for choosing which model to use can be found in the [Transcription - # Models - # Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model) - # and the models supported in each region can be found in the [Table Of - # Supported - # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # Optional. The language of the supplied audio as a - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # Language tags are normalized to BCP-47 before they are used eg "en-us" - # becomes "en-US". - # - # Supported languages for each model are listed in the [Table of Supported - # Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages). - # - # If additional languages are provided, recognition result will contain - # recognition in the most likely language detected. The recognition result - # will include the language tag of the language detected in the audio. - # @!attribute [rw] features - # @return [::Google::Cloud::Speech::V2::RecognitionFeatures] - # Speech recognition features to enable. - # @!attribute [rw] adaptation - # @return [::Google::Cloud::Speech::V2::SpeechAdaptation] - # Speech adaptation context that weights recognizer predictions for specific - # words and phrases. - # @!attribute [rw] transcript_normalization - # @return [::Google::Cloud::Speech::V2::TranscriptNormalization] - # Optional. Use transcription normalization to automatically replace parts of - # the transcript with phrases of your choosing. For StreamingRecognize, this - # normalization only applies to stable partial transcripts (stability > 0.8) - # and final transcripts. - # @!attribute [rw] translation_config - # @return [::Google::Cloud::Speech::V2::TranslationConfig] - # Optional. Optional configuration used to automatically run translation on - # the given audio to the desired language for supported models. - # @!attribute [rw] denoiser_config - # @return [::Google::Cloud::Speech::V2::DenoiserConfig] - # Optional. Optional denoiser config. May not be supported for all models - # and may have no effect. - class RecognitionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method. Either - # `content` or `uri` must be supplied. Supplying both or neither returns - # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See [content - # limits](https://cloud.google.com/speech-to-text/quotas#content). - # @!attribute [rw] recognizer - # @return [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field - # can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @!attribute [rw] config_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the - # values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @!attribute [rw] content - # @return [::String] - # The audio data bytes encoded as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As - # with all bytes fields, proto buffers use a pure binary representation, - # whereas JSON representations use base64. - # - # Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] uri - # @return [::String] - # URI that points to a file that contains audio data bytes as specified in - # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file - # must not be compressed (for example, gzip). Currently, only Google Cloud - # Storage URIs are supported, which must be specified in the following - # format: `gs://bucket_name/object_name` (other URI formats return - # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more - # information, see [Request - # URIs](https://cloud.google.com/storage/docs/reference-uris). - # - # Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class RecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about the recognition request and response. - # @!attribute [rw] request_id - # @return [::String] - # Global request identifier auto-generated by the API. - # @!attribute [rw] total_billed_duration - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the corresponding request. - # @!attribute [r] prompt - # @return [::String] - # Optional. Output only. Provides the prompt used for the recognition - # request. - class RecognitionResponseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Alternative hypotheses (a.k.a. n-best list). - # @!attribute [rw] transcript - # @return [::String] - # Transcript text representing the words that the user spoke. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence estimate between 0.0 and 1.0. A higher number - # indicates an estimated greater likelihood that the recognized words are - # correct. This field is set only for the top alternative of a non-streaming - # result or, of a streaming result where - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is - # set to `true`. This field is not guaranteed to be accurate and users should - # not rely on it to be always provided. The default of 0.0 is a sentinel - # value indicating `confidence` was not set. - # @!attribute [rw] words - # @return [::Array<::Google::Cloud::Speech::V2::WordInfo>] - # A list of word-specific information for each recognized word. - # When the - # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig} - # is set, you will see all the words from the beginning of the audio. - class SpeechRecognitionAlternative - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Word-specific information for recognized words. - # @!attribute [rw] start_offset - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio, - # and corresponding to the start of the spoken word. - # This field is only set if - # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets} - # is `true` and only in the top hypothesis. This is an experimental feature - # and the accuracy of the time offset can vary. - # @!attribute [rw] end_offset - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio, - # and corresponding to the end of the spoken word. - # This field is only set if - # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets} - # is `true` and only in the top hypothesis. This is an experimental feature - # and the accuracy of the time offset can vary. - # @!attribute [rw] word - # @return [::String] - # The word corresponding to this set of information. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence estimate between 0.0 and 1.0. A higher number - # indicates an estimated greater likelihood that the recognized words are - # correct. This field is set only for the top alternative of a non-streaming - # result or, of a streaming result where - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is - # set to `true`. This field is not guaranteed to be accurate and users should - # not rely on it to be always provided. The default of 0.0 is a sentinel - # value indicating `confidence` was not set. - # @!attribute [rw] speaker_label - # @return [::String] - # A distinct label is assigned for every speaker within the audio. This field - # specifies which one of those speakers was detected to have spoken this - # word. `speaker_label` is set if - # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig} - # is given and only in the top alternative. - class WordInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A speech recognition result corresponding to a portion of the audio. - # @!attribute [rw] alternatives - # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>] - # May contain one or more recognition hypotheses. These alternatives are - # ordered in terms of accuracy, with the top (first) alternative being the - # most probable, as ranked by the recognizer. - # @!attribute [rw] channel_tag - # @return [::Integer] - # For multi-channel audio, this is the channel number corresponding to the - # recognized result for the audio from that channel. - # For `audio_channel_count` = `N`, its output values can range from `1` to - # `N`. - # @!attribute [rw] result_end_offset - # @return [::Google::Protobuf::Duration] - # Time offset of the end of this result relative to the beginning of the - # audio. - # @!attribute [r] language_code - # @return [::String] - # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag of the language in this result. This language code was - # detected to have the most likelihood of being spoken in the audio. - class SpeechRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>] - # Sequential list of transcription results corresponding to sequential - # portions of audio. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] - # Metadata about the recognition. - class RecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Available recognition features specific to streaming recognition requests. - # @!attribute [rw] enable_voice_activity_events - # @return [::Boolean] - # If `true`, responses with voice activity speech events will be returned as - # they are detected. - # @!attribute [rw] interim_results - # @return [::Boolean] - # Whether or not to stream interim results to the client. If set to true, - # interim results will be streamed to the client. Otherwise, only the final - # response will be streamed back. - # @!attribute [rw] voice_activity_timeout - # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::VoiceActivityTimeout] - # If set, the server will automatically close the stream after the specified - # duration has elapsed after the last VOICE_ACTIVITY speech event has been - # sent. The field `voice_activity_events` must also be set to true. - # @!attribute [rw] endpointing_sensitivity - # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::EndpointingSensitivity] - # Optional. Endpointing sensitivity for this stream. - class StreamingRecognitionFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Events that a timeout can be set on for voice activity. - # @!attribute [rw] speech_start_timeout - # @return [::Google::Protobuf::Duration] - # Duration to timeout the stream if no speech begins. If this is set and - # no speech is detected in this duration at the start of the stream, the - # server will close the stream. - # @!attribute [rw] speech_end_timeout - # @return [::Google::Protobuf::Duration] - # Duration to timeout the stream after speech ends. If this is set and no - # speech is detected in this duration after speech was detected, the server - # will close the stream. - class VoiceActivityTimeout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Endpointing sensitivity is intended for applications that want to minimize - # result latency, possibly at the expense of quality. Some utterances may be - # broken up into multiple fragments. - module EndpointingSensitivity - # If no value is specified, the values for - # ENDPOINTING_SENSITIVITY_STANDARD will be used. - ENDPOINTING_SENSITIVITY_UNSPECIFIED = 0 - - # Standard sensitivity, no optimization for latency. - ENDPOINTING_SENSITIVITY_STANDARD = 1 - - # Super short sensitivity, optimized for super short utterances like single - # words ("Yes", "No", "Hello", etc.) or a single phrase, command or short - # query (e.g. "check balance", "five dollars", "call Mom"). - ENDPOINTING_SENSITIVITY_SUPERSHORT = 2 - - # Short sensitivity, optimized for short utterances like single sentences. - # (e.g. "Remind me to call the dentist tomorrow morning at nine", - # "Navigate to the nearest coffee shop that is currently open") - ENDPOINTING_SENSITIVITY_SHORT = 3 - end - end - - # Provides configuration information for the StreamingRecognize request. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Required. Features and audio metadata to use for the Automatic Speech - # Recognition. This field in combination with the - # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @!attribute [rw] config_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields in - # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} that - # override the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} override - # the values in the Recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # Recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} - # completely overrides and replaces the config in the recognizer for this - # recognition request. - # @!attribute [rw] streaming_features - # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures] - # Speech recognition features to enable specific to streaming audio - # recognition requests. - class StreamingRecognitionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#streaming_recognize StreamingRecognize} - # method. Multiple - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest StreamingRecognizeRequest} - # messages are sent in one call. - # - # If the {::Google::Cloud::Speech::V2::Recognizer Recognizer} referenced by - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer recognizer} - # contains a fully specified request configuration then the stream may only - # contain messages with only - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio} set. - # - # Otherwise the first message must contain a - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer recognizer} and - # a - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#streaming_config streaming_config} - # message that together fully specify the request configuration and must not - # contain {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio}. All - # subsequent messages must only have - # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio} set. - # @!attribute [rw] recognizer - # @return [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @!attribute [rw] streaming_config - # @return [::Google::Cloud::Speech::V2::StreamingRecognitionConfig] - # StreamingRecognitionConfig to be used in this recognition attempt. - # If provided, it will override the default RecognitionConfig stored in the - # Recognizer. - # - # Note: The following fields are mutually exclusive: `streaming_config`, `audio`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] audio - # @return [::String] - # Inline audio bytes to be Recognized. - # Maximum size for this field is 15 KB per request. - # - # Note: The following fields are mutually exclusive: `audio`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class StreamingRecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} - # method. - # @!attribute [rw] recognizer - # @return [::String] - # Required. The name of the Recognizer to use during recognition. The - # expected format is - # `projects/{project}/locations/{location}/recognizers/{recognizer}`. The - # \\{recognizer} segment may be set to `_` to use an empty implicit Recognizer. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource. - # @!attribute [rw] config_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override - # the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all given fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the - # values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely - # overrides and replaces the config in the recognizer for this recognition - # request. - # @!attribute [rw] files - # @return [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata>] - # Audio files with file metadata for ASR. - # The maximum number of files allowed to be specified is 15. - # @!attribute [rw] recognition_output_config - # @return [::Google::Cloud::Speech::V2::RecognitionOutputConfig] - # Configuration options for where to output the transcripts of each file. - # @!attribute [rw] processing_strategy - # @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy] - # Processing strategy to use for this request. - class BatchRecognizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible processing strategies for batch requests. - module ProcessingStrategy - # Default value for the processing strategy. The request is processed as - # soon as its received. - PROCESSING_STRATEGY_UNSPECIFIED = 0 - - # If selected, processes the request during lower utilization periods for a - # price discount. The request is fulfilled within 24 hours. - DYNAMIC_BATCHING = 1 - end - end - - # Output configurations for Cloud Storage. - # @!attribute [rw] uri - # @return [::String] - # The Cloud Storage URI prefix with which recognition results will be - # written. - class GcsOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configurations for inline response. - class InlineOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configurations for serialized `BatchRecognizeResults` protos. - class NativeOutputFileFormatConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configurations for [WebVTT](https://www.w3.org/TR/webvtt1/) formatted - # subtitle file. - class VttOutputFileFormatConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configurations [SubRip - # Text](https://www.matroska.org/technical/subtitles.html#srt-subtitles) - # formatted subtitle file. - class SrtOutputFileFormatConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for the format of the results stored to `output`. - # @!attribute [rw] native - # @return [::Google::Cloud::Speech::V2::NativeOutputFileFormatConfig] - # Configuration for the native output format. If this field is set or if no - # other output format field is set, then transcripts will be written to the - # sink in the native format. - # @!attribute [rw] vtt - # @return [::Google::Cloud::Speech::V2::VttOutputFileFormatConfig] - # Configuration for the VTT output format. If this field is set, then - # transcripts will be written to the sink in the VTT format. - # @!attribute [rw] srt - # @return [::Google::Cloud::Speech::V2::SrtOutputFileFormatConfig] - # Configuration for the SRT output format. If this field is set, then - # transcripts will be written to the sink in the SRT format. - class OutputFormatConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration options for the output(s) of recognition. - # @!attribute [rw] gcs_output_config - # @return [::Google::Cloud::Speech::V2::GcsOutputConfig] - # If this message is populated, recognition results are written to the - # provided Google Cloud Storage URI. - # - # Note: The following fields are mutually exclusive: `gcs_output_config`, `inline_response_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] inline_response_config - # @return [::Google::Cloud::Speech::V2::InlineOutputConfig] - # If this message is populated, recognition results are provided in the - # {::Google::Cloud::Speech::V2::BatchRecognizeResponse BatchRecognizeResponse} - # message of the Operation when completed. This is only supported when - # calling {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} - # with just one audio file. - # - # Note: The following fields are mutually exclusive: `inline_response_config`, `gcs_output_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] output_format_config - # @return [::Google::Cloud::Speech::V2::OutputFormatConfig] - # Optional. Configuration for the format of the results stored to `output`. - # If unspecified transcripts will be written in the `NATIVE` format only. - class RecognitionOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} that is - # packaged into a longrunning {::Google::Longrunning::Operation Operation}. - # @!attribute [rw] results - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeFileResult}] - # Map from filename to the final result for that file. - # @!attribute [rw] total_billed_duration - # @return [::Google::Protobuf::Duration] - # When available, billed audio seconds for the corresponding request. - class BatchRecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Speech::V2::BatchRecognizeFileResult] - class ResultsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Output type for Cloud Storage of BatchRecognize transcripts. Though this - # proto isn't returned in this API anywhere, the Cloud Storage transcripts will - # be this proto serialized and should be parsed as such. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>] - # Sequential list of transcription results corresponding to sequential - # portions of audio. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] - # Metadata about the recognition. - class BatchRecognizeResults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Final results written to Cloud Storage. - # @!attribute [rw] uri - # @return [::String] - # The Cloud Storage URI to which recognition results were written. - # @!attribute [rw] vtt_format_uri - # @return [::String] - # The Cloud Storage URI to which recognition results were written as VTT - # formatted captions. This is populated only when `VTT` output is requested. - # @!attribute [rw] srt_format_uri - # @return [::String] - # The Cloud Storage URI to which recognition results were written as SRT - # formatted captions. This is populated only when `SRT` output is requested. - class CloudStorageResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Final results returned inline in the recognition response. - # @!attribute [rw] transcript - # @return [::Google::Cloud::Speech::V2::BatchRecognizeResults] - # The transcript for the audio file. - # @!attribute [rw] vtt_captions - # @return [::String] - # The transcript for the audio file as VTT formatted captions. This is - # populated only when `VTT` output is requested. - # @!attribute [rw] srt_captions - # @return [::String] - # The transcript for the audio file as SRT formatted captions. This is - # populated only when `SRT` output is requested. - class InlineResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Final results for a single file. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Error if one was encountered. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] - # @!attribute [rw] cloud_storage_result - # @return [::Google::Cloud::Speech::V2::CloudStorageResult] - # Recognition results written to Cloud Storage. This is - # populated only when - # {::Google::Cloud::Speech::V2::GcsOutputConfig GcsOutputConfig} is set in - # the - # [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. - # - # Note: The following fields are mutually exclusive: `cloud_storage_result`, `inline_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] inline_result - # @return [::Google::Cloud::Speech::V2::InlineResult] - # Recognition results. This is populated only when - # {::Google::Cloud::Speech::V2::InlineOutputConfig InlineOutputConfig} is set in - # the - # [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig]. - # - # Note: The following fields are mutually exclusive: `inline_result`, `cloud_storage_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Deprecated. Use `cloud_storage_result.native_format_uri` instead. - # @!attribute [rw] transcript - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Speech::V2::BatchRecognizeResults] - # Deprecated. Use `inline_result.transcript` instead. - class BatchRecognizeFileResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about transcription for a single file (for example, progress - # percent). - # @!attribute [rw] progress_percent - # @return [::Integer] - # How much of the file has been transcribed so far. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Error if one was encountered. - # @!attribute [rw] uri - # @return [::String] - # The Cloud Storage URI to which recognition results will be written. - class BatchRecognizeTranscriptionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Operation metadata for - # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize}. - # @!attribute [rw] transcription_metadata - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata}] - # Map from provided filename to the transcription metadata for that file. - class BatchRecognizeMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata] - class TranscriptionMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata about a single file in a batch for BatchRecognize. - # @!attribute [rw] uri - # @return [::String] - # Cloud Storage URI for the audio file. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::RecognitionConfig] - # Features and audio metadata to use for the Automatic Speech Recognition. - # This field in combination with the - # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config_mask config_mask} - # field can be used to override parts of the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the Recognizer resource as well as the - # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} at the - # request level. - # @!attribute [rw] config_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} that - # override the values in the - # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config} - # of the recognizer during this recognition request. If no mask is provided, - # all non-default valued fields in - # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} override - # the values in the recognizer for this recognition request. If a mask is - # provided, only the fields listed in the mask override the config in the - # recognizer for this recognition request. If a wildcard (`*`) is provided, - # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} - # completely overrides and replaces the config in the recognizer for this - # recognition request. - class BatchRecognizeFileMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A streaming speech recognition result corresponding to a portion of the audio - # that is currently being processed. - # @!attribute [rw] alternatives - # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>] - # May contain one or more recognition hypotheses. These alternatives are - # ordered in terms of accuracy, with the top (first) alternative being the - # most probable, as ranked by the recognizer. - # @!attribute [rw] is_final - # @return [::Boolean] - # If `false`, this - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult} - # represents an interim result that may change. If `true`, this is the final - # time the speech service will return this particular - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult}, - # the recognizer will not return any further hypotheses for this portion of - # the transcript and corresponding audio. - # @!attribute [rw] stability - # @return [::Float] - # An estimate of the likelihood that the recognizer will not change its guess - # about this interim result. Values range from 0.0 (completely unstable) - # to 1.0 (completely stable). This field is only provided for interim results - # ({::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false`). - # The default of 0.0 is a sentinel value indicating `stability` was not set. - # @!attribute [rw] result_end_offset - # @return [::Google::Protobuf::Duration] - # Time offset of the end of this result relative to the beginning of the - # audio. - # @!attribute [rw] channel_tag - # @return [::Integer] - # For multi-channel audio, this is the channel number corresponding to the - # recognized result for the audio from that channel. - # For - # `audio_channel_count` = `N`, its output values can range from `1` to `N`. - # @!attribute [r] language_code - # @return [::String] - # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag of the language in this result. This language code was - # detected to have the most likelihood of being spoken in the audio. - class StreamingRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `StreamingRecognizeResponse` is the only message returned to the client by - # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` - # messages are streamed back to the client. If there is no recognizable - # audio then no messages are streamed back to the client. - # - # Here are some examples of `StreamingRecognizeResponse`s that might - # be returned while processing audio: - # - # 1. results { alternatives { transcript: "tube" } stability: 0.01 } - # - # 2. results { alternatives { transcript: "to be a" } stability: 0.01 } - # - # 3. results { alternatives { transcript: "to be" } stability: 0.9 } - # results { alternatives { transcript: " or not to be" } stability: 0.01 } - # - # 4. results { alternatives { transcript: "to be or not to be" - # confidence: 0.92 } - # alternatives { transcript: "to bee or not to bee" } - # is_final: true } - # - # 5. results { alternatives { transcript: " that's" } stability: 0.01 } - # - # 6. results { alternatives { transcript: " that is" } stability: 0.9 } - # results { alternatives { transcript: " the question" } stability: 0.01 } - # - # 7. results { alternatives { transcript: " that is the question" - # confidence: 0.98 } - # alternatives { transcript: " that was the question" } - # is_final: true } - # - # Notes: - # - # - Only two of the above responses #4 and #7 contain final results; they are - # indicated by `is_final: true`. Concatenating these together generates the - # full transcript: "to be or not to be that is the question". - # - # - The others contain interim `results`. #3 and #6 contain two interim - # `results`: the first portion has a high stability and is less likely to - # change; the second portion has a low stability and is very likely to - # change. A UI designer might choose to show only high stability `results`. - # - # - The specific `stability` and `confidence` values shown above are only for - # illustrative purposes. Actual values may vary. - # - # - In each response, only one of these fields will be set: - # `error`, - # `speech_event_type`, or - # one or more (repeated) `results`. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Speech::V2::StreamingRecognitionResult>] - # This repeated list contains zero or more results that - # correspond to consecutive portions of the audio currently being processed. - # It contains zero or one - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`true` - # result (the newly settled portion), followed by zero or more - # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false` - # results (the interim results). - # @!attribute [rw] speech_event_type - # @return [::Google::Cloud::Speech::V2::StreamingRecognizeResponse::SpeechEventType] - # Indicates the type of speech event. - # @!attribute [rw] speech_event_offset - # @return [::Google::Protobuf::Duration] - # Time offset between the beginning of the audio and event emission. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata] - # Metadata about the recognition. - class StreamingRecognizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates the type of speech event. - module SpeechEventType - # No speech event specified. - SPEECH_EVENT_TYPE_UNSPECIFIED = 0 - - # This event indicates that the server has detected the end of the user's - # speech utterance and expects no additional speech. Therefore, the server - # will not process additional audio and will close the gRPC bidirectional - # stream. This event is only sent if there was a force cutoff due to - # silence being detected early. This event is only available through the - # `latest_short` {::Google::Cloud::Speech::V2::Recognizer#model model}. - END_OF_SINGLE_UTTERANCE = 1 - - # This event indicates that the server has detected the beginning of human - # voice activity in the stream. This event can be returned multiple times - # if speech starts and stops repeatedly throughout the stream. This event - # is only sent if `voice_activity_events` is set to true. - SPEECH_ACTIVITY_BEGIN = 2 - - # This event indicates that the server has detected the end of human voice - # activity in the stream. This event can be returned multiple times if - # speech starts and stops repeatedly throughout the stream. This event is - # only sent if `voice_activity_events` is set to true. - SPEECH_ACTIVITY_END = 3 - end - end - - # Message representing the config for the Speech-to-Text API. This includes an - # optional [KMS key](https://cloud.google.com/kms/docs/resource-hierarchy#keys) - # with which incoming data will be encrypted. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The name of the config resource. There is exactly - # one config resource per project per location. The expected format is - # `projects/{project}/locations/{location}/config`. - # @!attribute [rw] kms_key_name - # @return [::String] - # Optional. An optional [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if - # present, will be used to encrypt Speech-to-Text resources at-rest. Updating - # this key will not encrypt existing resources using this key; only new - # resources will be encrypted using this key. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this resource was modified. - class Config - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#get_config GetConfig} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the config to retrieve. There is exactly one config - # resource per project per location. The expected format is - # `projects/{project}/locations/{location}/config`. - class GetConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#update_config UpdateConfig} method. - # @!attribute [rw] config - # @return [::Google::Cloud::Speech::V2::Config] - # Required. The config to update. - # - # The config's `name` field is used to identify the config to be updated. - # The expected format is `projects/{project}/locations/{location}/config`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CustomClass for biasing in speech recognition. Used to define a set of words - # or phrases that represents a common concept or theme likely to appear in your - # audio, for example a list of passenger ship names. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the CustomClass. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @!attribute [r] uid - # @return [::String] - # Output only. System-assigned unique identifier for the CustomClass. - # @!attribute [rw] display_name - # @return [::String] - # Optional. User-settable, human-readable name for the CustomClass. Must be - # 63 characters or less. - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::Speech::V2::CustomClass::ClassItem>] - # A collection of class items. - # @!attribute [r] state - # @return [::Google::Cloud::Speech::V2::CustomClass::State] - # Output only. The CustomClass lifecycle state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this resource was modified. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource was requested for deletion. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource will be purged. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Allows users to store small amounts of arbitrary data. - # Both the key and the value must be 63 characters or less each. - # At most 100 annotations. - # @!attribute [r] etag - # @return [::String] - # Output only. This checksum is computed by the server based on the value of - # other fields. This may be sent on update, undelete, and delete requests to - # ensure the client has an up-to-date value before proceeding. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Whether or not this CustomClass is in the process of being - # updated. - # @!attribute [r] kms_key_name - # @return [::String] - # Output only. The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the CustomClass is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] kms_key_version_name - # @return [::String] - # Output only. The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which the CustomClass is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - class CustomClass - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An item of the class. - # @!attribute [rw] value - # @return [::String] - # The class item's value. - class ClassItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of states that define the lifecycle of a CustomClass. - module State - # Unspecified state. This is only used/useful for distinguishing - # unset values. - STATE_UNSPECIFIED = 0 - - # The normal and active state. - ACTIVE = 2 - - # This CustomClass has been deleted. - DELETED = 4 - end - end - - # PhraseSet for biasing in speech recognition. A PhraseSet is used to provide - # "hints" to the speech recognizer to favor specific words and phrases in the - # results. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the PhraseSet. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @!attribute [r] uid - # @return [::String] - # Output only. System-assigned unique identifier for the PhraseSet. - # @!attribute [rw] phrases - # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet::Phrase>] - # A list of word and phrases. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Positive value will increase the probability that a specific - # phrase will be recognized over other similar sounding phrases. The higher - # the boost, the higher the chance of false positive recognition as well. - # Valid `boost` values are between 0 (exclusive) and 20. We recommend using a - # binary search approach to finding the optimal value for your use case as - # well as adding phrases both with and without boost to your requests. - # @!attribute [rw] display_name - # @return [::String] - # User-settable, human-readable name for the PhraseSet. Must be 63 - # characters or less. - # @!attribute [r] state - # @return [::Google::Cloud::Speech::V2::PhraseSet::State] - # Output only. The PhraseSet lifecycle state. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time this resource was modified. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource was requested for deletion. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this resource will be purged. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Allows users to store small amounts of arbitrary data. - # Both the key and the value must be 63 characters or less each. - # At most 100 annotations. - # @!attribute [r] etag - # @return [::String] - # Output only. This checksum is computed by the server based on the value of - # other fields. This may be sent on update, undelete, and delete requests to - # ensure the client has an up-to-date value before proceeding. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Whether or not this PhraseSet is in the process of being - # updated. - # @!attribute [r] kms_key_name - # @return [::String] - # Output only. The [KMS key - # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which - # the PhraseSet is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. - # @!attribute [r] kms_key_version_name - # @return [::String] - # Output only. The [KMS key version - # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions) - # with which the PhraseSet is encrypted. The expected format is - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`. - class PhraseSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A Phrase contains words and phrase "hints" so that the speech recognition - # is more likely to recognize them. This can be used to improve the accuracy - # for specific words and phrases, for example, if specific commands are - # typically spoken by the user. This can also be used to add additional words - # to the vocabulary of the recognizer. - # - # List items can also include CustomClass references containing groups of - # words that represent common concepts that occur in natural language. - # @!attribute [rw] value - # @return [::String] - # The phrase itself. - # @!attribute [rw] boost - # @return [::Float] - # Hint Boost. Overrides the boost set at the phrase set level. - # Positive value will increase the probability that a specific phrase will - # be recognized over other similar sounding phrases. The higher the boost, - # the higher the chance of false positive recognition as well. Negative - # boost values would correspond to anti-biasing. Anti-biasing is not - # enabled, so negative boost values will return an error. Boost values must - # be between 0 and 20. Any values outside that range will return an error. - # We recommend using a binary search approach to finding the optimal value - # for your use case as well as adding phrases both with and without boost - # to your requests. - class Phrase - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of states that define the lifecycle of a PhraseSet. - module State - # Unspecified state. This is only used/useful for distinguishing - # unset values. - STATE_UNSPECIFIED = 0 - - # The normal and active state. - ACTIVE = 2 - - # This PhraseSet has been deleted. - DELETED = 4 - end - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#create_custom_class CreateCustomClass} method. - # @!attribute [rw] custom_class - # @return [::Google::Cloud::Speech::V2::CustomClass] - # Required. The CustomClass to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the CustomClass, but do not - # actually create it. - # @!attribute [rw] custom_class_id - # @return [::String] - # The ID to use for the CustomClass, which will become the final component of - # the CustomClass's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location where this CustomClass will be created. - # The expected format is `projects/{project}/locations/{location}`. - class CreateCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location of CustomClass resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Number of results per requests. A valid page_size ranges from 0 to 100 - # inclusive. If the page_size is zero or unspecified, a page size of 5 will - # be chosen. If the page size exceeds 100, it will be coerced down to 100. - # Note that a call might return fewer results than the requested page size. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} must - # match the call that provided the page token. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Whether, or not, to show resources that have been deleted. - class ListCustomClassesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method. - # @!attribute [rw] custom_classes - # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>] - # The list of requested CustomClasses. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::Speech::V2::ListCustomClassesRequest#page_token page_token} to - # retrieve the next page. If this field is omitted, there are no subsequent - # pages. This token expires after 72 hours. - class ListCustomClassesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#get_custom_class GetCustomClass} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the CustomClass to retrieve. The expected format is - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - class GetCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#update_custom_class UpdateCustomClass} method. - # @!attribute [rw] custom_class - # @return [::Google::Cloud::Speech::V2::CustomClass] - # Required. The CustomClass to update. - # - # The CustomClass's `name` field is used to identify the CustomClass to - # update. Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. If empty, all fields are considered for - # update. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the updated CustomClass, but do - # not actually update it. - class UpdateCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#delete_custom_class DeleteCustomClass} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the CustomClass to delete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the deleted CustomClass, but do - # not actually delete it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the CustomClass is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class DeleteCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class UndeleteCustomClass} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the CustomClass to undelete. - # Format: - # `projects/{project}/locations/{location}/customClasses/{custom_class}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the undeleted CustomClass, but do - # not actually undelete it. - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class UndeleteCustomClassRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#create_phrase_set CreatePhraseSet} method. - # @!attribute [rw] phrase_set - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # Required. The PhraseSet to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the PhraseSet, but do not - # actually create it. - # @!attribute [rw] phrase_set_id - # @return [::String] - # The ID to use for the PhraseSet, which will become the final component of - # the PhraseSet's resource name. - # - # This value should be 4-63 characters, and valid characters - # are /[a-z][0-9]-/. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location where this PhraseSet will be created. - # The expected format is `projects/{project}/locations/{location}`. - class CreatePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location of PhraseSet resources to list. The - # expected format is `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of PhraseSets to return. The service may return fewer - # than this value. If unspecified, at most 5 PhraseSets will be returned. - # The maximum value is 100; values above 100 will be coerced to 100. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} must match - # the call that provided the page token. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Whether, or not, to show resources that have been deleted. - class ListPhraseSetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the - # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method. - # @!attribute [rw] phrase_sets - # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet>] - # The list of requested PhraseSets. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as - # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest#page_token page_token} to - # retrieve the next page. If this field is omitted, there are no subsequent - # pages. This token expires after 72 hours. - class ListPhraseSetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#get_phrase_set GetPhraseSet} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the PhraseSet to retrieve. The expected format is - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - class GetPhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#update_phrase_set UpdatePhraseSet} method. - # @!attribute [rw] phrase_set - # @return [::Google::Cloud::Speech::V2::PhraseSet] - # Required. The PhraseSet to update. - # - # The PhraseSet's `name` field is used to identify the PhraseSet to update. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to update. If empty, all non-default valued fields are - # considered for update. Use `*` to update the entire PhraseSet resource. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the updated PhraseSet, but do not - # actually update it. - class UpdatePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set DeletePhraseSet} method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the PhraseSet to delete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the deleted PhraseSet, but do not - # actually delete it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the PhraseSet is not found, the request will succeed - # and be a no-op (no Operation is recorded in this case). - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class DeletePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the - # {::Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set UndeletePhraseSet} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the PhraseSet to undelete. - # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the undeleted PhraseSet, but do - # not actually undelete it. - # @!attribute [rw] etag - # @return [::String] - # This checksum is computed by the server based on the value of other - # fields. This may be sent on update, undelete, and delete requests to ensure - # the client has an up-to-date value before proceeding. - class UndeletePhraseSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb deleted file mode 100644 index 84cc8a10dfcd..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/cloud/speech/v2/locations_metadata.rb +++ /dev/null @@ -1,120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Speech - module V2 - # Represents a singular feature of a model. If the feature is `recognizer`, - # the release_state of the feature represents the release_state of the model - # @!attribute [rw] feature - # @return [::String] - # The name of the feature (Note: the feature can be `recognizer`) - # @!attribute [rw] release_state - # @return [::String] - # The release state of the feature - class ModelFeature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the collection of features belonging to a model - # @!attribute [rw] model_feature - # @return [::Array<::Google::Cloud::Speech::V2::ModelFeature>] - # Repeated field that contains all features of the model - class ModelFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The metadata about the models in a given region for a specific locale. - # Currently this is just the features of the model - # @!attribute [rw] model_features - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::ModelFeatures}] - # Map of the model name -> features of that model - class ModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Speech::V2::ModelFeatures] - class ModelFeaturesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The metadata about locales available in a given region. Currently this is - # just the models that are available for each locale - # @!attribute [rw] models - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::ModelMetadata}] - # Map of locale (language code) -> models - class LanguageMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Speech::V2::ModelMetadata] - class ModelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The access metadata for a particular region. This can be applied if the org - # policy for the given project disallows a particular region. - # @!attribute [rw] constraint_type - # @return [::Google::Cloud::Speech::V2::AccessMetadata::ConstraintType] - # Describes the different types of constraints that are applied. - class AccessMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the different types of constraints that can be applied on a - # region. - module ConstraintType - # Unspecified constraint applied. - CONSTRAINT_TYPE_UNSPECIFIED = 0 - - # The project's org policy disallows the given region. - RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT = 1 - end - end - - # Main metadata for the Locations API for STT V2. Currently this is just the - # metadata about locales, models, and features - # @!attribute [rw] languages - # @return [::Google::Cloud::Speech::V2::LanguageMetadata] - # Information about available locales, models, and features represented in - # the hierarchical structure of locales -> models -> features - # @!attribute [rw] access_metadata - # @return [::Google::Cloud::Speech::V2::AccessMetadata] - # Information about access metadata for the region and given project. - class LocationsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-speech-v2/snippets/Gemfile deleted file mode 100644 index 9099ccea67fd..000000000000 --- a/owl-bot-staging/google-cloud-speech-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-speech-v2", path: "../" -else - gem "google-cloud-speech-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-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json b/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json deleted file mode 100644 index 5c30e3c81908..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json +++ /dev/null @@ -1,935 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-speech-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.speech.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "speech_v2_generated_Speech_CreateRecognizer_sync", - "title": "Snippet for the create_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_recognizer.", - "file": "speech/create_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::CreateRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "CreateRecognizer", - "full_name": "google.cloud.speech.v2.Speech.CreateRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_ListRecognizers_sync", - "title": "Snippet for the list_recognizers call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_recognizers.", - "file": "speech/list_recognizers.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_recognizers", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_recognizers", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::ListRecognizersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::ListRecognizersResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "ListRecognizers", - "full_name": "google.cloud.speech.v2.Speech.ListRecognizers", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_GetRecognizer_sync", - "title": "Snippet for the get_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_recognizer.", - "file": "speech/get_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::GetRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::Recognizer", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "GetRecognizer", - "full_name": "google.cloud.speech.v2.Speech.GetRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UpdateRecognizer_sync", - "title": "Snippet for the update_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_recognizer.", - "file": "speech/update_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UpdateRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UpdateRecognizer", - "full_name": "google.cloud.speech.v2.Speech.UpdateRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_DeleteRecognizer_sync", - "title": "Snippet for the delete_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_recognizer.", - "file": "speech/delete_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::DeleteRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "DeleteRecognizer", - "full_name": "google.cloud.speech.v2.Speech.DeleteRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UndeleteRecognizer_sync", - "title": "Snippet for the undelete_recognizer call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer.", - "file": "speech/undelete_recognizer.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_recognizer", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UndeleteRecognizerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UndeleteRecognizer", - "full_name": "google.cloud.speech.v2.Speech.UndeleteRecognizer", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_Recognize_sync", - "title": "Snippet for the recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#recognize.", - "file": "speech/recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "recognize", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::RecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::RecognizeResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "Recognize", - "full_name": "google.cloud.speech.v2.Speech.Recognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_StreamingRecognize_sync", - "title": "Snippet for the streaming_recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#streaming_recognize.", - "file": "speech/streaming_recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_recognize", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#streaming_recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::StreamingRecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::StreamingRecognizeResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "StreamingRecognize", - "full_name": "google.cloud.speech.v2.Speech.StreamingRecognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_BatchRecognize_sync", - "title": "Snippet for the batch_recognize call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#batch_recognize.", - "file": "speech/batch_recognize.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_recognize", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#batch_recognize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::BatchRecognizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "BatchRecognize", - "full_name": "google.cloud.speech.v2.Speech.BatchRecognize", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_GetConfig_sync", - "title": "Snippet for the get_config call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_config.", - "file": "speech/get_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_config", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::GetConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::Config", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "GetConfig", - "full_name": "google.cloud.speech.v2.Speech.GetConfig", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UpdateConfig_sync", - "title": "Snippet for the update_config call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_config.", - "file": "speech/update_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_config", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UpdateConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::Config", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UpdateConfig", - "full_name": "google.cloud.speech.v2.Speech.UpdateConfig", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_CreateCustomClass_sync", - "title": "Snippet for the create_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_custom_class.", - "file": "speech/create_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::CreateCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "CreateCustomClass", - "full_name": "google.cloud.speech.v2.Speech.CreateCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_ListCustomClasses_sync", - "title": "Snippet for the list_custom_classes call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_custom_classes.", - "file": "speech/list_custom_classes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_custom_classes", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::ListCustomClassesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::ListCustomClassesResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "ListCustomClasses", - "full_name": "google.cloud.speech.v2.Speech.ListCustomClasses", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_GetCustomClass_sync", - "title": "Snippet for the get_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_custom_class.", - "file": "speech/get_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::GetCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::CustomClass", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "GetCustomClass", - "full_name": "google.cloud.speech.v2.Speech.GetCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UpdateCustomClass_sync", - "title": "Snippet for the update_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_custom_class.", - "file": "speech/update_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UpdateCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UpdateCustomClass", - "full_name": "google.cloud.speech.v2.Speech.UpdateCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_DeleteCustomClass_sync", - "title": "Snippet for the delete_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_custom_class.", - "file": "speech/delete_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::DeleteCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "DeleteCustomClass", - "full_name": "google.cloud.speech.v2.Speech.DeleteCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UndeleteCustomClass_sync", - "title": "Snippet for the undelete_custom_class call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class.", - "file": "speech/undelete_custom_class.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_custom_class", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UndeleteCustomClassRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UndeleteCustomClass", - "full_name": "google.cloud.speech.v2.Speech.UndeleteCustomClass", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_CreatePhraseSet_sync", - "title": "Snippet for the create_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#create_phrase_set.", - "file": "speech/create_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#create_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::CreatePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "CreatePhraseSet", - "full_name": "google.cloud.speech.v2.Speech.CreatePhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_ListPhraseSets_sync", - "title": "Snippet for the list_phrase_sets call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets.", - "file": "speech/list_phrase_sets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_phrase_sets", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::ListPhraseSetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::ListPhraseSetsResponse", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "ListPhraseSets", - "full_name": "google.cloud.speech.v2.Speech.ListPhraseSets", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_GetPhraseSet_sync", - "title": "Snippet for the get_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#get_phrase_set.", - "file": "speech/get_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#get_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::GetPhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Speech::V2::PhraseSet", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "GetPhraseSet", - "full_name": "google.cloud.speech.v2.Speech.GetPhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UpdatePhraseSet_sync", - "title": "Snippet for the update_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#update_phrase_set.", - "file": "speech/update_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#update_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UpdatePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UpdatePhraseSet", - "full_name": "google.cloud.speech.v2.Speech.UpdatePhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_DeletePhraseSet_sync", - "title": "Snippet for the delete_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set.", - "file": "speech/delete_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::DeletePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "DeletePhraseSet", - "full_name": "google.cloud.speech.v2.Speech.DeletePhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "speech_v2_generated_Speech_UndeletePhraseSet_sync", - "title": "Snippet for the undelete_phrase_set call in the Speech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set.", - "file": "speech/undelete_phrase_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_phrase_set", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Speech::V2::UndeletePhraseSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Speech::Client", - "full_name": "::Google::Cloud::Speech::V2::Speech::Client" - }, - "method": { - "short_name": "UndeletePhraseSet", - "full_name": "google.cloud.speech.v2.Speech.UndeletePhraseSet", - "service": { - "short_name": "Speech", - "full_name": "google.cloud.speech.v2.Speech" - } - } - }, - "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-speech-v2/snippets/speech/batch_recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb deleted file mode 100644 index 4f957e4b6175..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/batch_recognize.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_BatchRecognize_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the batch_recognize call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#batch_recognize. -# -def batch_recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new - - # Call the batch_recognize method. - result = client.batch_recognize request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_BatchRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb deleted file mode 100644 index b68ec04f2ee7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_custom_class.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_CreateCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the create_custom_class call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#create_custom_class. -# -def create_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new - - # Call the create_custom_class method. - result = client.create_custom_class request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_CreateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb deleted file mode 100644 index eba29d95b333..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_CreatePhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the create_phrase_set call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#create_phrase_set. -# -def create_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new - - # Call the create_phrase_set method. - result = client.create_phrase_set request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_CreatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb deleted file mode 100644 index 75242ecadf32..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/create_recognizer.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_CreateRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the create_recognizer call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#create_recognizer. -# -def create_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new - - # Call the create_recognizer method. - result = client.create_recognizer request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_CreateRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb deleted file mode 100644 index e8ddd07289dd..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_DeleteCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the delete_custom_class call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#delete_custom_class. -# -def delete_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new - - # Call the delete_custom_class method. - result = client.delete_custom_class request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_DeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb deleted file mode 100644 index ed0f5b5e30c4..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_DeletePhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the delete_phrase_set call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set. -# -def delete_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new - - # Call the delete_phrase_set method. - result = client.delete_phrase_set request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_DeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb deleted file mode 100644 index 0884f27f9d8e..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_DeleteRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the delete_recognizer call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#delete_recognizer. -# -def delete_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new - - # Call the delete_recognizer method. - result = client.delete_recognizer request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_DeleteRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_config.rb deleted file mode 100644 index 3fc3f9e7fcd5..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_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 speech_v2_generated_Speech_GetConfig_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the get_config call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#get_config. -# -def get_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::GetConfigRequest.new - - # Call the get_config method. - result = client.get_config request - - # The returned object is of type Google::Cloud::Speech::V2::Config. - p result -end -# [END speech_v2_generated_Speech_GetConfig_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb deleted file mode 100644 index 784ffc18c23d..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_custom_class.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_GetCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the get_custom_class call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#get_custom_class. -# -def get_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::GetCustomClassRequest.new - - # Call the get_custom_class method. - result = client.get_custom_class request - - # The returned object is of type Google::Cloud::Speech::V2::CustomClass. - p result -end -# [END speech_v2_generated_Speech_GetCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb deleted file mode 100644 index 9708b47cf3e3..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_GetPhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the get_phrase_set call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#get_phrase_set. -# -def get_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new - - # Call the get_phrase_set method. - result = client.get_phrase_set request - - # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. - p result -end -# [END speech_v2_generated_Speech_GetPhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb deleted file mode 100644 index 3aaa1b269594..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/get_recognizer.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_GetRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the get_recognizer call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#get_recognizer. -# -def get_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::GetRecognizerRequest.new - - # Call the get_recognizer method. - result = client.get_recognizer request - - # The returned object is of type Google::Cloud::Speech::V2::Recognizer. - p result -end -# [END speech_v2_generated_Speech_GetRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb deleted file mode 100644 index a9e5534d5b7b..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_custom_classes.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 speech_v2_generated_Speech_ListCustomClasses_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the list_custom_classes call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#list_custom_classes. -# -def list_custom_classes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new - - # Call the list_custom_classes method. - result = client.list_custom_classes request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Speech::V2::CustomClass. - p item - end -end -# [END speech_v2_generated_Speech_ListCustomClasses_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb deleted file mode 100644 index 438c90e974fe..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_phrase_sets.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 speech_v2_generated_Speech_ListPhraseSets_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the list_phrase_sets call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets. -# -def list_phrase_sets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new - - # Call the list_phrase_sets method. - result = client.list_phrase_sets request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet. - p item - end -end -# [END speech_v2_generated_Speech_ListPhraseSets_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.rb deleted file mode 100644 index 5ca1e1af20ed..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/list_recognizers.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 speech_v2_generated_Speech_ListRecognizers_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the list_recognizers call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#list_recognizers. -# -def list_recognizers - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::ListRecognizersRequest.new - - # Call the list_recognizers method. - result = client.list_recognizers request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Speech::V2::Recognizer. - p item - end -end -# [END speech_v2_generated_Speech_ListRecognizers_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb deleted file mode 100644 index 194e4add7771..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/recognize.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_Recognize_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the recognize call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#recognize. -# -def recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::RecognizeRequest.new - - # Call the recognize method. - result = client.recognize request - - # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. - p result -end -# [END speech_v2_generated_Speech_Recognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb deleted file mode 100644 index a09a15c0f87a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/streaming_recognize.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! - -# [START speech_v2_generated_Speech_StreamingRecognize_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the streaming_recognize call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#streaming_recognize. -# -def streaming_recognize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the streaming_recognize method to start streaming. - output = client.streaming_recognize input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new - input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse - output.each do |current_response| - p current_response - end -end -# [END speech_v2_generated_Speech_StreamingRecognize_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb deleted file mode 100644 index c674fe781687..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_UndeleteCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the undelete_custom_class call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class. -# -def undelete_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new - - # Call the undelete_custom_class method. - result = client.undelete_custom_class request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_UndeleteCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb deleted file mode 100644 index 13f47439e6f1..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_UndeletePhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the undelete_phrase_set call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set. -# -def undelete_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new - - # Call the undelete_phrase_set method. - result = client.undelete_phrase_set request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_UndeletePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb deleted file mode 100644 index 9e9efaa6f2f3..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_UndeleteRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the undelete_recognizer call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer. -# -def undelete_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new - - # Call the undelete_recognizer method. - result = client.undelete_recognizer request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_UndeleteRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_config.rb deleted file mode 100644 index f0e6f043b9b2..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_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 speech_v2_generated_Speech_UpdateConfig_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the update_config call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#update_config. -# -def update_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UpdateConfigRequest.new - - # Call the update_config method. - result = client.update_config request - - # The returned object is of type Google::Cloud::Speech::V2::Config. - p result -end -# [END speech_v2_generated_Speech_UpdateConfig_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb deleted file mode 100644 index 41f39d156939..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_custom_class.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_UpdateCustomClass_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the update_custom_class call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#update_custom_class. -# -def update_custom_class - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new - - # Call the update_custom_class method. - result = client.update_custom_class request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_UpdateCustomClass_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb deleted file mode 100644 index c35958f5d92a..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_UpdatePhraseSet_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the update_phrase_set call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#update_phrase_set. -# -def update_phrase_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new - - # Call the update_phrase_set method. - result = client.update_phrase_set request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_UpdatePhraseSet_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb b/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb deleted file mode 100644 index 6eba5f9d7d62..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/snippets/speech/update_recognizer.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START speech_v2_generated_Speech_UpdateRecognizer_sync] -require "google/cloud/speech/v2" - -## -# Snippet for the update_recognizer call in the Speech service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Speech::V2::Speech::Client#update_recognizer. -# -def update_recognizer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Speech::V2::Speech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new - - # Call the update_recognizer method. - result = client.update_recognizer request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END speech_v2_generated_Speech_UpdateRecognizer_sync] diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb deleted file mode 100644 index f6538455ac47..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_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/speech/v2/cloud_speech_pb" -require "google/cloud/speech/v2/cloud_speech_services_pb" -require "google/cloud/speech/v2/speech" - -class ::Google::Cloud::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb deleted file mode 100644 index d704a59e482c..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_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 "gapic/grpc/service_stub" - -require "google/cloud/speech/v2/speech" - -class ::Google::Cloud::Speech::V2::Speech::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_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::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.config_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/config", 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::Speech::V2::Speech::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::Speech::V2::Speech::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_custom_class_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.custom_class_path project: "value0", location: "value1", custom_class: "value2" - assert_equal "projects/value0/locations/value1/customClasses/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::Speech::V2::Speech::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_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", path - end - end - - def test_recognizer_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.recognizer_path project: "value0", location: "value1", recognizer: "value2" - assert_equal "projects/value0/locations/value1/recognizers/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb deleted file mode 100644 index 30ed3613ce74..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb +++ /dev/null @@ -1,1335 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/speech/v2/cloud_speech_pb" -require "google/cloud/speech/v2/speech/rest" - - -class ::Google::Cloud::Speech::V2::Speech::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_recognizer - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - recognizer = {} - validate_only = true - recognizer_id = "hello world" - parent = "hello world" - - create_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_recognizer recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_recognizer ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_recognizer(::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_recognizer_client_stub.call_count - end - end - end - - def test_list_recognizers - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::ListRecognizersResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_recognizers_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_recognizers_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_recognizers_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_recognizers parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_recognizers ::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_recognizers(::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_recognizers_client_stub.call_count - end - end - end - - def test_get_recognizer - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::Recognizer.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_recognizer({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_recognizer name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_recognizer ::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_recognizer({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_recognizer(::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_recognizer_client_stub.call_count - end - end - end - - def test_update_recognizer - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - recognizer = {} - update_mask = {} - validate_only = true - - update_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_recognizer recognizer: recognizer, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_recognizer ::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, 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_recognizer({ recognizer: recognizer, 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_recognizer(::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, 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_recognizer_client_stub.call_count - end - end - end - - def test_delete_recognizer - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_recognizer name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_recognizer ::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_recognizer(::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_recognizer_client_stub.call_count - end - end - end - - def test_undelete_recognizer - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - etag = "hello world" - - undelete_recognizer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_recognizer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_recognizer name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_recognizer ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_recognizer(::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_recognizer_client_stub.call_count - end - end - end - - def test_recognize - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::RecognizeResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - recognizer = "hello world" - config = {} - config_mask = {} - content = "hello world" - - recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_recognize_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.recognize recognizer: recognizer, config: config, config_mask: config_mask, content: content do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.recognize ::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.recognize(::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, recognize_client_stub.call_count - end - end - end - - def test_batch_recognize - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - recognizer = "hello world" - config = {} - config_mask = {} - files = [{}] - recognition_output_config = {} - processing_strategy = :PROCESSING_STRATEGY_UNSPECIFIED - - batch_recognize_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_batch_recognize_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_recognize recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_recognize ::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_recognize(::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_recognize_client_stub.call_count - end - end - end - - def test_get_config - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::Config.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_config_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_config ::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_config(::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_config_client_stub.call_count - end - end - end - - def test_update_config - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::Config.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - config = {} - update_mask = {} - - update_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::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_config_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_config({ config: config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_config config: config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_config ::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_config({ config: config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_config(::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_config_client_stub.call_count - end - end - end - - def test_create_custom_class - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - custom_class = {} - validate_only = true - custom_class_id = "hello world" - parent = "hello world" - - create_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_custom_class custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_custom_class ::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_custom_class(::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_custom_class_client_stub.call_count - end - end - end - - def test_list_custom_classes - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_custom_classes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_custom_classes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_custom_classes_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_custom_classes parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_custom_classes ::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_custom_classes(::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_custom_classes_client_stub.call_count - end - end - end - - def test_get_custom_class - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::CustomClass.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_custom_class({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_custom_class name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_custom_class ::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_custom_class({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_custom_class(::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_custom_class_client_stub.call_count - end - end - end - - def test_update_custom_class - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - custom_class = {} - update_mask = {} - validate_only = true - - update_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_custom_class custom_class: custom_class, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_custom_class ::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class({ custom_class: custom_class, 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_custom_class(::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, 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_custom_class_client_stub.call_count - end - end - end - - def test_delete_custom_class - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_custom_class name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_custom_class ::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_custom_class(::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_custom_class_client_stub.call_count - end - end - end - - def test_undelete_custom_class - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - etag = "hello world" - - undelete_custom_class_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_custom_class_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_custom_class name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_custom_class ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_custom_class(::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_custom_class_client_stub.call_count - end - end - end - - def test_create_phrase_set - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - phrase_set = {} - validate_only = true - phrase_set_id = "hello world" - parent = "hello world" - - create_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_create_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_phrase_set phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_phrase_set ::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_phrase_set(::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_phrase_set_client_stub.call_count - end - end - end - - def test_list_phrase_sets - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_phrase_sets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_list_phrase_sets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_phrase_sets_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_phrase_sets parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_phrase_sets ::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_phrase_sets(::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_phrase_sets_client_stub.call_count - end - end - end - - def test_get_phrase_set - # Create test objects. - client_result = ::Google::Cloud::Speech::V2::PhraseSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_get_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_phrase_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_phrase_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_phrase_set ::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_phrase_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_phrase_set(::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_phrase_set_client_stub.call_count - end - end - end - - def test_update_phrase_set - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - phrase_set = {} - update_mask = {} - validate_only = true - - update_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_update_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_phrase_set ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set({ phrase_set: phrase_set, 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_phrase_set(::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, 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_phrase_set_client_stub.call_count - end - end - end - - def test_delete_phrase_set - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_delete_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_phrase_set name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_phrase_set ::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_phrase_set(::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_phrase_set_client_stub.call_count - end - end - end - - def test_undelete_phrase_set - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - etag = "hello world" - - undelete_phrase_set_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.stub :transcode_undelete_phrase_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_phrase_set name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_phrase_set ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_phrase_set(::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_phrase_set_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::Speech::V2::Speech::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::Speech::V2::Speech::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb b/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb deleted file mode 100644 index 9e7fc7fc7014..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb +++ /dev/null @@ -1,1662 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/speech/v2/cloud_speech_pb" -require "google/cloud/speech/v2/speech" - -class ::Google::Cloud::Speech::V2::Speech::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_recognizer - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - recognizer = {} - validate_only = true - recognizer_id = "hello world" - parent = "hello world" - - create_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::CreateRecognizerRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Recognizer), request["recognizer"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["recognizer_id"] - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_recognizer recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_recognizer ::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_recognizer({ recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_recognizer(::Google::Cloud::Speech::V2::CreateRecognizerRequest.new(recognizer: recognizer, validate_only: validate_only, recognizer_id: recognizer_id, parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_recognizer_client_stub.call_rpc_count - end - end - - def test_list_recognizers - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::ListRecognizersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_recognizers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_recognizers, name - assert_kind_of ::Google::Cloud::Speech::V2::ListRecognizersRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_recognizers_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_recognizers parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_recognizers ::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_recognizers({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_recognizers(::Google::Cloud::Speech::V2::ListRecognizersRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_recognizers_client_stub.call_rpc_count - end - end - - def test_get_recognizer - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::Recognizer.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::GetRecognizerRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_recognizer({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_recognizer name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_recognizer ::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_recognizer({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_recognizer(::Google::Cloud::Speech::V2::GetRecognizerRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_recognizer_client_stub.call_rpc_count - end - end - - def test_update_recognizer - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - recognizer = {} - update_mask = {} - validate_only = true - - update_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::UpdateRecognizerRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Recognizer), request["recognizer"] - 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_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_recognizer recognizer: recognizer, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_recognizer ::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_recognizer({ recognizer: recognizer, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_recognizer(::Google::Cloud::Speech::V2::UpdateRecognizerRequest.new(recognizer: recognizer, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_recognizer_client_stub.call_rpc_count - end - end - - def test_delete_recognizer - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::DeleteRecognizerRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_recognizer name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_recognizer ::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_recognizer({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_recognizer(::Google::Cloud::Speech::V2::DeleteRecognizerRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_recognizer_client_stub.call_rpc_count - end - end - - def test_undelete_recognizer - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - etag = "hello world" - - undelete_recognizer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_recognizer, name - assert_kind_of ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_recognizer_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undelete_recognizer name: name, validate_only: validate_only, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undelete_recognizer ::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undelete_recognizer({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undelete_recognizer(::Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new(name: name, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, undelete_recognizer_client_stub.call_rpc_count - end - end - - def test_recognize - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::RecognizeResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - recognizer = "hello world" - config = {} - config_mask = {} - content = "hello world" - - recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :recognize, name - assert_kind_of ::Google::Cloud::Speech::V2::RecognizeRequest, request - assert_equal "hello world", request["recognizer"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionConfig), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["config_mask"] - assert_equal "hello world", request["content"] - assert_equal :content, request.audio_source - refute_nil options - end - - Gapic::ServiceStub.stub :new, recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.recognize recognizer: recognizer, config: config, config_mask: config_mask, content: content do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.recognize ::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.recognize({ recognizer: recognizer, config: config, config_mask: config_mask, content: content }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.recognize(::Google::Cloud::Speech::V2::RecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, content: content), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, recognize_client_stub.call_rpc_count - end - end - - def test_streaming_recognize - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::StreamingRecognizeResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a bidi streaming method. - recognizer = "hello world" - streaming_config = {} - - streaming_recognize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_recognize, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, streaming_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { recognizer: recognizer, streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_recognize enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { recognizer: recognizer, streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_recognize stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { recognizer: recognizer, streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_recognize enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { recognizer: recognizer, streaming_config: streaming_config } - request_proto = ::Google::Cloud::Speech::V2::StreamingRecognizeRequest.new recognizer: recognizer, streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_recognize stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, streaming_recognize_client_stub.call_rpc_count - streaming_recognize_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::Speech::V2::StreamingRecognizeRequest, r - assert_equal "hello world", r["recognizer"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::StreamingRecognitionConfig), r["streaming_config"] - assert_equal :streaming_config, r.streaming_request - end - end - end - end - - def test_batch_recognize - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - recognizer = "hello world" - config = {} - config_mask = {} - files = [{}] - recognition_output_config = {} - processing_strategy = :PROCESSING_STRATEGY_UNSPECIFIED - - batch_recognize_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_recognize, name - assert_kind_of ::Google::Cloud::Speech::V2::BatchRecognizeRequest, request - assert_equal "hello world", request["recognizer"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionConfig), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["config_mask"] - assert_kind_of ::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, request["files"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::RecognitionOutputConfig), request["recognition_output_config"] - assert_equal :PROCESSING_STRATEGY_UNSPECIFIED, request["processing_strategy"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_recognize_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_recognize recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_recognize ::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_recognize({ recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_recognize(::Google::Cloud::Speech::V2::BatchRecognizeRequest.new(recognizer: recognizer, config: config, config_mask: config_mask, files: files, recognition_output_config: recognition_output_config, processing_strategy: processing_strategy), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_recognize_client_stub.call_rpc_count - end - end - - def test_get_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::Config.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_config, name - assert_kind_of ::Google::Cloud::Speech::V2::GetConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_config_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_config ::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_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_config(::Google::Cloud::Speech::V2::GetConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_config_client_stub.call_rpc_count - end - end - - def test_update_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::Config.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - config = {} - update_mask = {} - - update_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_config, name - assert_kind_of ::Google::Cloud::Speech::V2::UpdateConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::Config), request["config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_config_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_config({ config: config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_config config: config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_config ::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_config({ config: config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_config(::Google::Cloud::Speech::V2::UpdateConfigRequest.new(config: config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_config_client_stub.call_rpc_count - end - end - - def test_create_custom_class - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - custom_class = {} - validate_only = true - custom_class_id = "hello world" - parent = "hello world" - - create_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::CreateCustomClassRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::CustomClass), request["custom_class"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["custom_class_id"] - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_custom_class custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_custom_class ::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_custom_class({ custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_custom_class(::Google::Cloud::Speech::V2::CreateCustomClassRequest.new(custom_class: custom_class, validate_only: validate_only, custom_class_id: custom_class_id, parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_custom_class_client_stub.call_rpc_count - end - end - - def test_list_custom_classes - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::ListCustomClassesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_custom_classes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_custom_classes, name - assert_kind_of ::Google::Cloud::Speech::V2::ListCustomClassesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_custom_classes_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_custom_classes parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_custom_classes ::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_custom_classes({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_custom_classes(::Google::Cloud::Speech::V2::ListCustomClassesRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_custom_classes_client_stub.call_rpc_count - end - end - - def test_get_custom_class - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::CustomClass.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::GetCustomClassRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_custom_class({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_custom_class name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_custom_class ::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_custom_class({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_custom_class(::Google::Cloud::Speech::V2::GetCustomClassRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_custom_class_client_stub.call_rpc_count - end - end - - def test_update_custom_class - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - custom_class = {} - update_mask = {} - validate_only = true - - update_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::UpdateCustomClassRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::CustomClass), request["custom_class"] - 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_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_custom_class custom_class: custom_class, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_custom_class ::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_custom_class({ custom_class: custom_class, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_custom_class(::Google::Cloud::Speech::V2::UpdateCustomClassRequest.new(custom_class: custom_class, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_custom_class_client_stub.call_rpc_count - end - end - - def test_delete_custom_class - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::DeleteCustomClassRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_custom_class name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_custom_class ::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_custom_class({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_custom_class(::Google::Cloud::Speech::V2::DeleteCustomClassRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_custom_class_client_stub.call_rpc_count - end - end - - def test_undelete_custom_class - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - etag = "hello world" - - undelete_custom_class_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_custom_class, name - assert_kind_of ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_custom_class_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undelete_custom_class name: name, validate_only: validate_only, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undelete_custom_class ::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undelete_custom_class({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undelete_custom_class(::Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new(name: name, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, undelete_custom_class_client_stub.call_rpc_count - end - end - - def test_create_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - phrase_set = {} - validate_only = true - phrase_set_id = "hello world" - parent = "hello world" - - create_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::CreatePhraseSetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::PhraseSet), request["phrase_set"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["phrase_set_id"] - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_phrase_set phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_phrase_set ::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_phrase_set({ phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_phrase_set(::Google::Cloud::Speech::V2::CreatePhraseSetRequest.new(phrase_set: phrase_set, validate_only: validate_only, phrase_set_id: phrase_set_id, parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_phrase_set_client_stub.call_rpc_count - end - end - - def test_list_phrase_sets - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::ListPhraseSetsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - show_deleted = true - - list_phrase_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_phrase_sets, name - assert_kind_of ::Google::Cloud::Speech::V2::ListPhraseSetsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_phrase_sets_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_phrase_sets parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_phrase_sets ::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_phrase_sets({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_phrase_sets(::Google::Cloud::Speech::V2::ListPhraseSetsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_phrase_sets_client_stub.call_rpc_count - end - end - - def test_get_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Speech::V2::PhraseSet.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::GetPhraseSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_phrase_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_phrase_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_phrase_set ::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_phrase_set({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_phrase_set(::Google::Cloud::Speech::V2::GetPhraseSetRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_phrase_set_client_stub.call_rpc_count - end - end - - def test_update_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - phrase_set = {} - update_mask = {} - validate_only = true - - update_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Speech::V2::PhraseSet), request["phrase_set"] - 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_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_phrase_set phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_phrase_set ::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_phrase_set({ phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_phrase_set(::Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new(phrase_set: phrase_set, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_phrase_set_client_stub.call_rpc_count - end - end - - def test_delete_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - allow_missing = true - etag = "hello world" - - delete_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::DeletePhraseSetRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_phrase_set name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_phrase_set ::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_phrase_set({ name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_phrase_set(::Google::Cloud::Speech::V2::DeletePhraseSetRequest.new(name: name, validate_only: validate_only, allow_missing: allow_missing, etag: etag), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_phrase_set_client_stub.call_rpc_count - end - end - - def test_undelete_phrase_set - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - validate_only = true - etag = "hello world" - - undelete_phrase_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_phrase_set, name - assert_kind_of ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_phrase_set_client_stub do - # Create client - client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.undelete_phrase_set name: name, validate_only: validate_only, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.undelete_phrase_set ::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.undelete_phrase_set({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.undelete_phrase_set(::Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new(name: name, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, undelete_phrase_set_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Speech::V2::Speech::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::Speech::V2::Speech::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::Speech::V2::Speech::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Speech::V2::Speech::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::Speech::V2::Speech::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Speech::V2::Speech::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-speech-v2/test/helper.rb b/owl-bot-staging/google-cloud-speech-v2/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-speech-v2/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.gitignore b/owl-bot-staging/google-cloud-storage-control-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json deleted file mode 100644 index 9dc1067e6b4b..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "storage.googleapis.com", - "api_shortname": "storage", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage-control-v2/latest", - "distribution_name": "google-cloud-storage-control-v2", - "is_cloud": true, - "language": "ruby", - "name": "storage", - "name_pretty": "Storage Control V2 API", - "product_documentation": "https://cloud.google.com/storage/docs/overview", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. Note that google-cloud-storage-control-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage-control instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/storage/docs/overview", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml b/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml deleted file mode 100644 index c9354c029feb..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-storage-control-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-storage-control-v2.rb" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb b/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/.yardopts b/owl-bot-staging/google-cloud-storage-control-v2/.yardopts deleted file mode 100644 index e4425bd31ee0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Storage Control 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-storage-control-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md deleted file mode 100644 index 9672b7b75ce0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-storage-control-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-storage-control-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/storage/control/v2" - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/storage/control/v2" - -::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-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/storage/control/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-storage-control-v2/Gemfile b/owl-bot-staging/google-cloud-storage-control-v2/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md b/owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/README.md b/owl-bot-staging/google-cloud-storage-control-v2/README.md deleted file mode 100644 index ba465335ff4a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Storage Control V2 API - -The Storage Control API lets you perform metadata-specific, control plane, and long-running operations. The Storage Control API creates one space to perform metadata-specific, control plane, and long-running operations apart from the Storage API. Separating these operations from the Storage API improves API standardization and lets you run faster releases. - -The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Storage Control V2 API. Most users should consider using -the main client gem, -[google-cloud-storage-control](https://rubygems.org/gems/google-cloud-storage-control). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-storage-control-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/storage.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/storage/control/v2" - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new -request = ::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new # (request fields as keyword arguments...) -response = client.create_folder request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage-control-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/storage/docs/overview) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/storage/control/v2" -require "logger" - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-storage-control-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-storage-control`. -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-storage-control-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-storage-control-v2/Rakefile b/owl-bot-staging/google-cloud-storage-control-v2/Rakefile deleted file mode 100644 index c1ef5dea7f73..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2 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/storage/control/v2/storage_control/credentials" - ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-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-storage-control-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-storage-control-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-storage-control-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-storage-control-v2" - header "google-cloud-storage-control-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-storage-control-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-storage-control-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-storage-control-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-storage-control-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-storage-control-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json deleted file mode 100644 index c36e20575fbc..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.storage.control.v2", - "libraryPackage": "::Google::Cloud::Storage::Control::V2", - "services": { - "StorageControl": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Storage::Control::V2::StorageControl::Client", - "rpcs": { - "CreateFolder": { - "methods": [ - "create_folder" - ] - }, - "DeleteFolder": { - "methods": [ - "delete_folder" - ] - }, - "GetFolder": { - "methods": [ - "get_folder" - ] - }, - "ListFolders": { - "methods": [ - "list_folders" - ] - }, - "RenameFolder": { - "methods": [ - "rename_folder" - ] - }, - "DeleteFolderRecursive": { - "methods": [ - "delete_folder_recursive" - ] - }, - "GetStorageLayout": { - "methods": [ - "get_storage_layout" - ] - }, - "CreateManagedFolder": { - "methods": [ - "create_managed_folder" - ] - }, - "DeleteManagedFolder": { - "methods": [ - "delete_managed_folder" - ] - }, - "GetManagedFolder": { - "methods": [ - "get_managed_folder" - ] - }, - "ListManagedFolders": { - "methods": [ - "list_managed_folders" - ] - }, - "CreateAnywhereCache": { - "methods": [ - "create_anywhere_cache" - ] - }, - "UpdateAnywhereCache": { - "methods": [ - "update_anywhere_cache" - ] - }, - "DisableAnywhereCache": { - "methods": [ - "disable_anywhere_cache" - ] - }, - "PauseAnywhereCache": { - "methods": [ - "pause_anywhere_cache" - ] - }, - "ResumeAnywhereCache": { - "methods": [ - "resume_anywhere_cache" - ] - }, - "GetAnywhereCache": { - "methods": [ - "get_anywhere_cache" - ] - }, - "ListAnywhereCaches": { - "methods": [ - "list_anywhere_caches" - ] - }, - "GetProjectIntelligenceConfig": { - "methods": [ - "get_project_intelligence_config" - ] - }, - "UpdateProjectIntelligenceConfig": { - "methods": [ - "update_project_intelligence_config" - ] - }, - "GetFolderIntelligenceConfig": { - "methods": [ - "get_folder_intelligence_config" - ] - }, - "UpdateFolderIntelligenceConfig": { - "methods": [ - "update_folder_intelligence_config" - ] - }, - "GetOrganizationIntelligenceConfig": { - "methods": [ - "get_organization_intelligence_config" - ] - }, - "UpdateOrganizationIntelligenceConfig": { - "methods": [ - "update_organization_intelligence_config" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec b/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec deleted file mode 100644 index 995035118c6a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/storage/control/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-storage-control-v2" - gem.version = Google::Cloud::Storage::Control::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. Note that google-cloud-storage-control-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage-control instead. See the readme for more details." - gem.summary = "The Storage Control API lets you perform metadata-specific, control plane, and long-running operations. The Storage Control API creates one space to perform metadata-specific, control plane, and long-running operations apart from the Storage API. Separating these operations from the Storage API improves API standardization and lets you run faster releases." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb deleted file mode 100644 index c8a5475de0b5..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-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/storage/control/v2" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb deleted file mode 100644 index b529c031a2e8..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/storage/control/v2/storage_control" -require "google/cloud/storage/control/v2/version" - -module Google - module Cloud - module Storage - module Control - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/storage/control/v2" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/storage/control/v2" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - module V2 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/storage/control/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb deleted file mode 100644 index 8e031b6fa014..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/storage/control/v2/storage_control/rest" -require "google/cloud/storage/control/v2/version" - -module Google - module Cloud - module Storage - module Control - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/storage/control/v2/rest" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - module V2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb deleted file mode 100644 index 4cfe356728f2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.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/storage/control/v2/version" - -require "google/cloud/storage/control/v2/storage_control/credentials" -require "google/cloud/storage/control/v2/storage_control/paths" -require "google/cloud/storage/control/v2/storage_control/operations" -require "google/cloud/storage/control/v2/storage_control/client" -require "google/cloud/storage/control/v2/storage_control/rest" - -module Google - module Cloud - module Storage - module Control - module V2 - ## - # StorageControl service includes selected control plane operations. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/storage/control/v2/storage_control" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/storage/control/v2/storage_control/rest" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - module StorageControl - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "storage_control", "helpers.rb" -require "google/cloud/storage/control/v2/storage_control/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb deleted file mode 100644 index 4a311841cf98..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb +++ /dev/null @@ -1,3379 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/storage/control/v2/storage_control_pb" - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - ## - # Client for the StorageControl service. - # - # StorageControl service includes selected control plane operations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_control_stub - - ## - # Configure the StorageControl Client class. - # - # See {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageControl clients - # ::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Storage", "Control", "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.rpcs.create_folder.timeout = 60.0 - default_config.rpcs.create_folder.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_folder.timeout = 60.0 - default_config.rpcs.get_folder.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.list_folders.timeout = 60.0 - default_config.rpcs.list_folders.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.rename_folder.timeout = 60.0 - default_config.rpcs.rename_folder.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.delete_folder_recursive.timeout = 60.0 - default_config.rpcs.delete_folder_recursive.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_storage_layout.timeout = 60.0 - default_config.rpcs.get_storage_layout.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_managed_folder.timeout = 60.0 - default_config.rpcs.get_managed_folder.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.list_managed_folders.timeout = 60.0 - default_config.rpcs.list_managed_folders.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.create_anywhere_cache.timeout = 60.0 - default_config.rpcs.create_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_anywhere_cache.timeout = 60.0 - default_config.rpcs.update_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.disable_anywhere_cache.timeout = 60.0 - default_config.rpcs.disable_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.pause_anywhere_cache.timeout = 60.0 - default_config.rpcs.pause_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.resume_anywhere_cache.timeout = 60.0 - default_config.rpcs.resume_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_anywhere_cache.timeout = 60.0 - default_config.rpcs.get_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.list_anywhere_caches.timeout = 60.0 - default_config.rpcs.list_anywhere_caches.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_project_intelligence_config.timeout = 60.0 - default_config.rpcs.get_project_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_project_intelligence_config.timeout = 60.0 - default_config.rpcs.update_project_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_folder_intelligence_config.timeout = 60.0 - default_config.rpcs.get_folder_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_folder_intelligence_config.timeout = 60.0 - default_config.rpcs.update_folder_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_organization_intelligence_config.timeout = 60.0 - default_config.rpcs.get_organization_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_organization_intelligence_config.timeout = 60.0 - default_config.rpcs.update_organization_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageControl Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @storage_control_stub.universe_domain - end - - ## - # Create a new StorageControl client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageControl 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/storage/control/v2/storage_control_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 - - @storage_control_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Storage::Control::V2::StorageControl::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 - ) - - @storage_control_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::Storage::Control::V2::StorageControl::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @storage_control_stub.logger - end - - # Service calls - - ## - # Creates a new folder. This operation is only applicable to a hierarchical - # namespace enabled bucket. - # - # @overload create_folder(request, options = nil) - # Pass arguments to `create_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::CreateFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::CreateFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_folder(parent: nil, folder: nil, folder_id: nil, recursive: nil, request_id: nil) - # Pass arguments to `create_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the bucket in which the folder will reside. The bucket - # must be a hierarchical namespace enabled bucket. - # @param folder [::Google::Cloud::Storage::Control::V2::Folder, ::Hash] - # Required. Properties of the new folder being created. - # The bucket and name of the folder are specified in the parent and folder_id - # fields, respectively. Populating those fields in `folder` will result in an - # error. - # @param folder_id [::String] - # Required. The full name of a folder, including all its parent folders. - # Folders use single '/' characters as a delimiter. - # The folder_id must end with a slash. - # For example, the folder_id of "books/biographies/" would create a new - # "biographies/" folder under the "books/" folder. - # @param recursive [::Boolean] - # Optional. If true, parent folder doesn't have to be present and all missing - # ancestor folders will be created atomically. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::Folder] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::Folder] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::CreateFolderRequest.new - # - # # Call the create_folder method. - # result = client.create_folder request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. - # p result - # - def create_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :create_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes an empty folder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # - # @overload delete_folder(request, options = nil) - # Pass arguments to `delete_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::DeleteFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `delete_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @param if_metageneration_match [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration matches the given value. - # @param if_metageneration_not_match [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration does not match the given value. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new - # - # # Call the delete_folder method. - # result = client.delete_folder request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :delete_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for the specified folder. This operation is only - # applicable to a hierarchical namespace enabled bucket. - # - # @overload get_folder(request, options = nil) - # Pass arguments to `get_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `get_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @param if_metageneration_match [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration matches the given value. - # @param if_metageneration_not_match [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration does not match the given value. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::Folder] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::Folder] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetFolderRequest.new - # - # # Call the get_folder method. - # result = client.get_folder request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. - # p result - # - def get_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a list of folders. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # - # @overload list_folders(request, options = nil) - # Pass arguments to `list_folders` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::ListFoldersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::ListFoldersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, delimiter: nil, lexicographic_start: nil, lexicographic_end: nil, request_id: nil) - # Pass arguments to `list_folders` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the bucket in which to look for folders. The bucket must - # be a hierarchical namespace enabled bucket. - # @param page_size [::Integer] - # Optional. Maximum number of folders to return in a single response. The - # service will use this parameter or 1,000 items, whichever is smaller. - # @param page_token [::String] - # Optional. A previously-returned page token representing part of the larger - # set of results to view. - # @param prefix [::String] - # Optional. Filter results to folders whose names begin with this prefix. - # If set, the value must either be an empty string or end with a '/'. - # @param delimiter [::String] - # Optional. If set, returns results in a directory-like mode. The results - # will only include folders that either exactly match the above prefix, or - # are one level below the prefix. The only supported value is '/'. - # @param lexicographic_start [::String] - # Optional. Filter results to folders whose names are lexicographically equal - # to or after lexicographic_start. If lexicographic_end is also set, the - # folders listed have names between lexicographic_start (inclusive) and - # lexicographic_end (exclusive). - # @param lexicographic_end [::String] - # Optional. Filter results to folders whose names are lexicographically - # before lexicographic_end. If lexicographic_start is also set, the folders - # listed have names between lexicographic_start (inclusive) and - # lexicographic_end (exclusive). - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::ListFoldersRequest.new - # - # # Call the list_folders method. - # result = client.list_folders request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Storage::Control::V2::Folder. - # p item - # end - # - def list_folders request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListFoldersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_folders.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_folders.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_folders.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :list_folders, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_folders, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Renames a source folder to a destination folder. This operation is only - # applicable to a hierarchical namespace enabled bucket. During a rename, the - # source and destination folders are locked until the long running operation - # completes. - # - # @overload rename_folder(request, options = nil) - # Pass arguments to `rename_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::RenameFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload rename_folder(name: nil, destination_folder_id: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `rename_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the source folder being renamed. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @param destination_folder_id [::String] - # Required. The destination folder ID, e.g. `foo/bar/`. - # @param if_metageneration_match [::Integer] - # Makes the operation only succeed conditional on whether the source - # folder's current metageneration matches the given value. - # @param if_metageneration_not_match [::Integer] - # Makes the operation only succeed conditional on whether the source - # folder's current metageneration does not match the given value. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::RenameFolderRequest.new - # - # # Call the rename_folder method. - # result = client.rename_folder request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def rename_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::RenameFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.rename_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.rename_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rename_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :rename_folder, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a folder recursively. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # - # @overload delete_folder_recursive(request, options = nil) - # Pass arguments to `delete_folder_recursive` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_folder_recursive(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `delete_folder_recursive` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the folder being deleted, however all of its contents - # will be deleted too. Format: - # `projects/{project}/buckets/{bucket}/folders/{folder}` - # @param if_metageneration_match [::Integer] - # Optional. Makes the operation only succeed conditional on whether the root - # folder's current metageneration matches the given value. - # @param if_metageneration_not_match [::Integer] - # Optional. Makes the operation only succeed conditional on whether the root - # folder's current metageneration does not match the given value. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new - # - # # Call the delete_folder_recursive method. - # result = client.delete_folder_recursive request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_folder_recursive request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_folder_recursive.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_folder_recursive.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_folder_recursive.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :delete_folder_recursive, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the storage layout configuration for a given bucket. - # - # @overload get_storage_layout(request, options = nil) - # Pass arguments to `get_storage_layout` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_storage_layout(name: nil, prefix: nil, request_id: nil) - # Pass arguments to `get_storage_layout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 StorageLayout resource. - # Format: `projects/{project}/buckets/{bucket}/storageLayout` - # @param prefix [::String] - # An optional prefix used for permission check. It is useful when the caller - # only has limited permissions under a specific prefix. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::StorageLayout] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::StorageLayout] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new - # - # # Call the get_storage_layout method. - # result = client.get_storage_layout request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::StorageLayout. - # p result - # - def get_storage_layout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_storage_layout.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_storage_layout.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_storage_layout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_storage_layout, request, 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 managed folder. - # - # @overload create_managed_folder(request, options = nil) - # Pass arguments to `create_managed_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_managed_folder(parent: nil, managed_folder: nil, managed_folder_id: nil, request_id: nil) - # Pass arguments to `create_managed_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the bucket this managed folder belongs to. - # @param managed_folder [::Google::Cloud::Storage::Control::V2::ManagedFolder, ::Hash] - # Required. Properties of the managed folder being created. - # The bucket and managed folder names are specified in the `parent` and - # `managed_folder_id` fields. Populating these fields in `managed_folder` - # will result in an error. - # @param managed_folder_id [::String] - # Required. The name of the managed folder. It uses a single `/` as delimiter - # and leading and trailing `/` are allowed. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new - # - # # Call the create_managed_folder method. - # result = client.create_managed_folder request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. - # p result - # - def create_managed_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest - - # Converts hash and nil to 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_managed_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_managed_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_managed_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :create_managed_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes an empty managed folder. - # - # @overload delete_managed_folder(request, options = nil) - # Pass arguments to `delete_managed_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_managed_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, allow_non_empty: nil, request_id: nil) - # Pass arguments to `delete_managed_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @param if_metageneration_match [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration matching the value here specified. - # @param if_metageneration_not_match [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration NOT matching the value here specified. - # @param allow_non_empty [::Boolean] - # Allows deletion of a managed folder even if it is not empty. - # A managed folder is empty if it manages no child managed folders or - # objects. Caller must have permission for - # storage.managedFolders.setIamPolicy. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new - # - # # Call the delete_managed_folder method. - # result = client.delete_managed_folder request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_managed_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_managed_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_managed_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_managed_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :delete_managed_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for the specified managed folder. - # - # @overload get_managed_folder(request, options = nil) - # Pass arguments to `get_managed_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_managed_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `get_managed_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @param if_metageneration_match [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration matching the value here specified. - # @param if_metageneration_not_match [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration NOT matching the value here specified. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new - # - # # Call the get_managed_folder method. - # result = client.get_managed_folder request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. - # p result - # - def get_managed_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_managed_folder.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_managed_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_managed_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_managed_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a list of managed folders for a given bucket. - # - # @overload list_managed_folders(request, options = nil) - # Pass arguments to `list_managed_folders` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_managed_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, request_id: nil) - # Pass arguments to `list_managed_folders` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the bucket this managed folder belongs to. - # @param page_size [::Integer] - # Optional. Maximum number of managed folders to return in a single response. - # The service will use this parameter or 1,000 items, whichever is smaller. - # @param page_token [::String] - # Optional. A previously-returned page token representing part of the larger - # set of results to view. - # @param prefix [::String] - # Optional. Filter results to match managed folders with name starting with - # this prefix. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::ManagedFolder>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::ManagedFolder>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new - # - # # Call the list_managed_folders method. - # result = client.list_managed_folders request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Storage::Control::V2::ManagedFolder. - # p item - # end - # - def list_managed_folders request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_managed_folders.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_managed_folders.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_managed_folders.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :list_managed_folders, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_managed_folders, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an Anywhere Cache instance. - # - # @overload create_anywhere_cache(request, options = nil) - # Pass arguments to `create_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_anywhere_cache(parent: nil, anywhere_cache: nil, request_id: nil) - # Pass arguments to `create_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The bucket to which this cache belongs. - # Format: `projects/{project}/buckets/{bucket}` - # @param anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash] - # Required. Properties of the Anywhere Cache instance being created. - # The parent bucket name is specified in the `parent` field. Server uses the - # default value of `ttl` or `admission_policy` if not specified in - # request. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new - # - # # Call the create_anywhere_cache method. - # result = client.create_anywhere_cache request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest - - # Converts hash and nil to 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_anywhere_cache.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :create_anywhere_cache, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 an Anywhere Cache instance. Mutable fields include `ttl` and - # `admission_policy`. - # - # @overload update_anywhere_cache(request, options = nil) - # Pass arguments to `update_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_anywhere_cache(anywhere_cache: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash] - # Required. The Anywhere Cache instance to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated. Mutable fields of AnywhereCache - # include `ttl` and `admission_policy`. - # - # To specify ALL fields, specify a single field with the value `*`. Note: We - # recommend against doing this. If a new field is introduced at a later time, - # an older client updating with the `*` may accidentally reset the new - # field's value. - # - # Not specifying any fields is an error. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new - # - # # Call the update_anywhere_cache method. - # result = client.update_anywhere_cache request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest - - # Converts hash and nil to 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_anywhere_cache.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.anywhere_cache&.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.anywhere_cache.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :update_anywhere_cache, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables an Anywhere Cache instance. A disabled instance is read-only. The - # disablement could be revoked by calling ResumeAnywhereCache. The cache - # instance will be deleted automatically if it remains in the disabled state - # for at least one hour. - # - # @overload disable_anywhere_cache(request, options = nil) - # Pass arguments to `disable_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_anywhere_cache(name: nil, request_id: nil) - # Pass arguments to `disable_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new - # - # # Call the disable_anywhere_cache method. - # result = client.disable_anywhere_cache request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - # p result - # - def disable_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_anywhere_cache.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :disable_anywhere_cache, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses an Anywhere Cache instance. - # - # @overload pause_anywhere_cache(request, options = nil) - # Pass arguments to `pause_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_anywhere_cache(name: nil, request_id: nil) - # Pass arguments to `pause_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new - # - # # Call the pause_anywhere_cache method. - # result = client.pause_anywhere_cache request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - # p result - # - def pause_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest - - # Converts hash and nil to 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_anywhere_cache.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.pause_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :pause_anywhere_cache, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resumes a disabled or paused Anywhere Cache instance. - # - # @overload resume_anywhere_cache(request, options = nil) - # Pass arguments to `resume_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_anywhere_cache(name: nil, request_id: nil) - # Pass arguments to `resume_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new - # - # # Call the resume_anywhere_cache method. - # result = client.resume_anywhere_cache request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - # p result - # - def resume_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest - - # Converts hash and nil to 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_anywhere_cache.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.resume_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :resume_anywhere_cache, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an Anywhere Cache instance. - # - # @overload get_anywhere_cache(request, options = nil) - # Pass arguments to `get_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_anywhere_cache(name: nil, request_id: nil) - # Pass arguments to `get_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new - # - # # Call the get_anywhere_cache method. - # result = client.get_anywhere_cache request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - # p result - # - def get_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_anywhere_cache.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_anywhere_cache, request, 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 Anywhere Cache instances for a given bucket. - # - # @overload list_anywhere_caches(request, options = nil) - # Pass arguments to `list_anywhere_caches` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_anywhere_caches(parent: nil, page_size: nil, page_token: nil, request_id: nil) - # Pass arguments to `list_anywhere_caches` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The bucket to which this cache belongs. - # @param page_size [::Integer] - # Maximum number of caches to return in a single response. - # The service will use this parameter or 1,000 items, whichever is smaller. - # @param page_token [::String] - # A previously-returned page token representing part of the larger set of - # results to view. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new - # - # # Call the list_anywhere_caches method. - # result = client.list_anywhere_caches request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Storage::Control::V2::AnywhereCache. - # p item - # end - # - def list_anywhere_caches request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_anywhere_caches.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_anywhere_caches.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_anywhere_caches.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :list_anywhere_caches, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_anywhere_caches, request, response, 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 Project scoped singleton IntelligenceConfig resource. - # - # @overload get_project_intelligence_config(request, options = nil) - # Pass arguments to `get_project_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_project_intelligence_config(name: nil) - # Pass arguments to `get_project_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your project. - # - # Format: `projects/{id}/locations/global/intelligenceConfig` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new - # - # # Call the get_project_intelligence_config method. - # result = client.get_project_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_project_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_project_intelligence_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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_project_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_project_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_project_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Project scoped singleton IntelligenceConfig resource. - # - # @overload update_project_intelligence_config(request, options = nil) - # Pass arguments to `update_project_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_project_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new - # - # # Call the update_project_intelligence_config method. - # result = client.update_project_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_project_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_project_intelligence_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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.intelligence_config&.name - header_params["intelligence_config.name"] = request.intelligence_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_project_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_project_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :update_project_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the Folder scoped singleton IntelligenceConfig resource. - # - # @overload get_folder_intelligence_config(request, options = nil) - # Pass arguments to `get_folder_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_folder_intelligence_config(name: nil) - # Pass arguments to `get_folder_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your folder. - # - # Format: `folders/{id}/locations/global/intelligenceConfig` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new - # - # # Call the get_folder_intelligence_config method. - # result = client.get_folder_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_folder_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_folder_intelligence_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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_folder_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_folder_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_folder_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Folder scoped singleton IntelligenceConfig resource. - # - # @overload update_folder_intelligence_config(request, options = nil) - # Pass arguments to `update_folder_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_folder_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new - # - # # Call the update_folder_intelligence_config method. - # result = client.update_folder_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_folder_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_folder_intelligence_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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.intelligence_config&.name - header_params["intelligence_config.name"] = request.intelligence_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_folder_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_folder_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :update_folder_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the Organization scoped singleton IntelligenceConfig resource. - # - # @overload get_organization_intelligence_config(request, options = nil) - # Pass arguments to `get_organization_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_organization_intelligence_config(name: nil) - # Pass arguments to `get_organization_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your organization. - # - # Format: `organizations/{org_id}/locations/global/intelligenceConfig` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new - # - # # Call the get_organization_intelligence_config method. - # result = client.get_organization_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_organization_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_organization_intelligence_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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_organization_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_organization_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_organization_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Organization scoped singleton IntelligenceConfig resource. - # - # @overload update_organization_intelligence_config(request, options = nil) - # Pass arguments to `update_organization_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_organization_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new - # - # # Call the update_organization_intelligence_config method. - # result = client.update_organization_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_organization_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_organization_intelligence_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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.intelligence_config&.name - header_params["intelligence_config.name"] = request.intelligence_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_organization_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_organization_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :update_organization_intelligence_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 IAM policy for a specified bucket. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-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 && !request.resource.empty? - header_params["bucket"] = request.resource - end - if request.resource - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.resource - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an IAM policy for the specified bucket. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-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 && !request.resource.empty? - header_params["bucket"] = request.resource - end - if request.resource - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.resource - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Tests a set of permissions on the given bucket, object, or managed folder - # to see which, if any, are held by the caller. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, - # `projects/_/buckets/{bucket}/objects/{object}` for an object, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION - metadata[:"x-goog-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 && !request.resource.empty? - header_params["bucket"] = request.resource - end - if request.resource - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)/objects(?:/.*)?$}.match request.resource - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - if request.resource - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)/managedFolders(?:/.*)?$}.match request.resource - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the StorageControl API. - # - # This class represents the configuration for StorageControl, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_folder to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_folder.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_folder.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the StorageControl API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :create_folder - ## - # RPC-specific configuration for `delete_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_folder - ## - # RPC-specific configuration for `get_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :get_folder - ## - # RPC-specific configuration for `list_folders` - # @return [::Gapic::Config::Method] - # - attr_reader :list_folders - ## - # RPC-specific configuration for `rename_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :rename_folder - ## - # RPC-specific configuration for `delete_folder_recursive` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_folder_recursive - ## - # RPC-specific configuration for `get_storage_layout` - # @return [::Gapic::Config::Method] - # - attr_reader :get_storage_layout - ## - # RPC-specific configuration for `create_managed_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :create_managed_folder - ## - # RPC-specific configuration for `delete_managed_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_managed_folder - ## - # RPC-specific configuration for `get_managed_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :get_managed_folder - ## - # RPC-specific configuration for `list_managed_folders` - # @return [::Gapic::Config::Method] - # - attr_reader :list_managed_folders - ## - # RPC-specific configuration for `create_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :create_anywhere_cache - ## - # RPC-specific configuration for `update_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :update_anywhere_cache - ## - # RPC-specific configuration for `disable_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_anywhere_cache - ## - # RPC-specific configuration for `pause_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_anywhere_cache - ## - # RPC-specific configuration for `resume_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_anywhere_cache - ## - # RPC-specific configuration for `get_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :get_anywhere_cache - ## - # RPC-specific configuration for `list_anywhere_caches` - # @return [::Gapic::Config::Method] - # - attr_reader :list_anywhere_caches - ## - # RPC-specific configuration for `get_project_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_project_intelligence_config - ## - # RPC-specific configuration for `update_project_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_project_intelligence_config - ## - # RPC-specific configuration for `get_folder_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_folder_intelligence_config - ## - # RPC-specific configuration for `update_folder_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_folder_intelligence_config - ## - # RPC-specific configuration for `get_organization_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_intelligence_config - ## - # RPC-specific configuration for `update_organization_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_organization_intelligence_config - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - create_folder_config = parent_rpcs.create_folder if parent_rpcs.respond_to? :create_folder - @create_folder = ::Gapic::Config::Method.new create_folder_config - delete_folder_config = parent_rpcs.delete_folder if parent_rpcs.respond_to? :delete_folder - @delete_folder = ::Gapic::Config::Method.new delete_folder_config - get_folder_config = parent_rpcs.get_folder if parent_rpcs.respond_to? :get_folder - @get_folder = ::Gapic::Config::Method.new get_folder_config - list_folders_config = parent_rpcs.list_folders if parent_rpcs.respond_to? :list_folders - @list_folders = ::Gapic::Config::Method.new list_folders_config - rename_folder_config = parent_rpcs.rename_folder if parent_rpcs.respond_to? :rename_folder - @rename_folder = ::Gapic::Config::Method.new rename_folder_config - delete_folder_recursive_config = parent_rpcs.delete_folder_recursive if parent_rpcs.respond_to? :delete_folder_recursive - @delete_folder_recursive = ::Gapic::Config::Method.new delete_folder_recursive_config - get_storage_layout_config = parent_rpcs.get_storage_layout if parent_rpcs.respond_to? :get_storage_layout - @get_storage_layout = ::Gapic::Config::Method.new get_storage_layout_config - create_managed_folder_config = parent_rpcs.create_managed_folder if parent_rpcs.respond_to? :create_managed_folder - @create_managed_folder = ::Gapic::Config::Method.new create_managed_folder_config - delete_managed_folder_config = parent_rpcs.delete_managed_folder if parent_rpcs.respond_to? :delete_managed_folder - @delete_managed_folder = ::Gapic::Config::Method.new delete_managed_folder_config - get_managed_folder_config = parent_rpcs.get_managed_folder if parent_rpcs.respond_to? :get_managed_folder - @get_managed_folder = ::Gapic::Config::Method.new get_managed_folder_config - list_managed_folders_config = parent_rpcs.list_managed_folders if parent_rpcs.respond_to? :list_managed_folders - @list_managed_folders = ::Gapic::Config::Method.new list_managed_folders_config - create_anywhere_cache_config = parent_rpcs.create_anywhere_cache if parent_rpcs.respond_to? :create_anywhere_cache - @create_anywhere_cache = ::Gapic::Config::Method.new create_anywhere_cache_config - update_anywhere_cache_config = parent_rpcs.update_anywhere_cache if parent_rpcs.respond_to? :update_anywhere_cache - @update_anywhere_cache = ::Gapic::Config::Method.new update_anywhere_cache_config - disable_anywhere_cache_config = parent_rpcs.disable_anywhere_cache if parent_rpcs.respond_to? :disable_anywhere_cache - @disable_anywhere_cache = ::Gapic::Config::Method.new disable_anywhere_cache_config - pause_anywhere_cache_config = parent_rpcs.pause_anywhere_cache if parent_rpcs.respond_to? :pause_anywhere_cache - @pause_anywhere_cache = ::Gapic::Config::Method.new pause_anywhere_cache_config - resume_anywhere_cache_config = parent_rpcs.resume_anywhere_cache if parent_rpcs.respond_to? :resume_anywhere_cache - @resume_anywhere_cache = ::Gapic::Config::Method.new resume_anywhere_cache_config - get_anywhere_cache_config = parent_rpcs.get_anywhere_cache if parent_rpcs.respond_to? :get_anywhere_cache - @get_anywhere_cache = ::Gapic::Config::Method.new get_anywhere_cache_config - list_anywhere_caches_config = parent_rpcs.list_anywhere_caches if parent_rpcs.respond_to? :list_anywhere_caches - @list_anywhere_caches = ::Gapic::Config::Method.new list_anywhere_caches_config - get_project_intelligence_config_config = parent_rpcs.get_project_intelligence_config if parent_rpcs.respond_to? :get_project_intelligence_config - @get_project_intelligence_config = ::Gapic::Config::Method.new get_project_intelligence_config_config - update_project_intelligence_config_config = parent_rpcs.update_project_intelligence_config if parent_rpcs.respond_to? :update_project_intelligence_config - @update_project_intelligence_config = ::Gapic::Config::Method.new update_project_intelligence_config_config - get_folder_intelligence_config_config = parent_rpcs.get_folder_intelligence_config if parent_rpcs.respond_to? :get_folder_intelligence_config - @get_folder_intelligence_config = ::Gapic::Config::Method.new get_folder_intelligence_config_config - update_folder_intelligence_config_config = parent_rpcs.update_folder_intelligence_config if parent_rpcs.respond_to? :update_folder_intelligence_config - @update_folder_intelligence_config = ::Gapic::Config::Method.new update_folder_intelligence_config_config - get_organization_intelligence_config_config = parent_rpcs.get_organization_intelligence_config if parent_rpcs.respond_to? :get_organization_intelligence_config - @get_organization_intelligence_config = ::Gapic::Config::Method.new get_organization_intelligence_config_config - update_organization_intelligence_config_config = parent_rpcs.update_organization_intelligence_config if parent_rpcs.respond_to? :update_organization_intelligence_config - @update_organization_intelligence_config = ::Gapic::Config::Method.new update_organization_intelligence_config_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb deleted file mode 100644 index c65981e2f69b..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/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 Storage - module Control - module V2 - module StorageControl - # Credentials for the StorageControl API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - 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-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb deleted file mode 100644 index 3ba9c91b393a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/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 Storage - module Control - module V2 - module StorageControl - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StorageControl 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 StorageControl 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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Storage::Control::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::Storage::Control::V2::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 = "storage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb deleted file mode 100644 index 669b90f12a51..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb +++ /dev/null @@ -1,178 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - # Path helper methods for the StorageControl API. - module Paths - ## - # Create a fully-qualified AnywhereCache resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # - # @param project [String] - # @param bucket [String] - # @param anywhere_cache [String] - # - # @return [::String] - def anywhere_cache_path project:, bucket:, anywhere_cache: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}/anywhereCaches/#{anywhere_cache}" - end - - ## - # Create a fully-qualified Bucket resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}` - # - # @param project [String] - # @param bucket [String] - # - # @return [::String] - def bucket_path project:, bucket: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}" - end - - ## - # Create a fully-qualified Folder resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}/folders/{folder=**}` - # - # @param project [String] - # @param bucket [String] - # @param folder [String] - # - # @return [::String] - def folder_path project:, bucket:, folder: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}/folders/#{folder}" - end - - ## - # Create a fully-qualified IntelligenceConfig resource string. - # - # @overload intelligence_config_path(folder:, location:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/intelligenceConfig` - # - # @param folder [String] - # @param location [String] - # - # @overload intelligence_config_path(org:, location:) - # The resource will be in the following format: - # - # `organizations/{org}/locations/{location}/intelligenceConfig` - # - # @param org [String] - # @param location [String] - # - # @overload intelligence_config_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/intelligenceConfig` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def intelligence_config_path **args - resources = { - "folder:location" => (proc do |folder:, location:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/intelligenceConfig" - end), - "location:org" => (proc do |org:, location:| - raise ::ArgumentError, "org cannot contain /" if org.to_s.include? "/" - - "organizations/#{org}/locations/#{location}/intelligenceConfig" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/intelligenceConfig" - 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 ManagedFolder resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}` - # - # @param project [String] - # @param bucket [String] - # @param managed_folder [String] - # - # @return [::String] - def managed_folder_path project:, bucket:, managed_folder: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}/managedFolders/#{managed_folder}" - end - - ## - # Create a fully-qualified StorageLayout resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}/storageLayout` - # - # @param project [String] - # @param bucket [String] - # - # @return [::String] - def storage_layout_path project:, bucket: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}/storageLayout" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb deleted file mode 100644 index afbdecc7fabf..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/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/storage/control/v2/version" - -require "google/cloud/storage/control/v2/storage_control/credentials" -require "google/cloud/storage/control/v2/storage_control/paths" -require "google/cloud/storage/control/v2/storage_control/rest/client" - -module Google - module Cloud - module Storage - module Control - module V2 - ## - # StorageControl service includes selected control plane operations. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/storage/control/v2/storage_control/rest" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - module StorageControl - # 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/storage/control/v2/storage_control/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb deleted file mode 100644 index b1c5439c8bfa..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb +++ /dev/null @@ -1,913 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/storage/control/v2/storage_control_pb" -require "google/cloud/storage/control/v2/storage_control/rest/service_stub" - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - module Rest - ## - # REST client for the StorageControl service. - # - # StorageControl service includes selected control plane operations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_control_stub - - ## - # Configure the StorageControl Client class. - # - # See {::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageControl clients - # ::Google::Cloud::Storage::Control::V2::StorageControl::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", "Storage", "Control", "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.rpcs.get_project_intelligence_config.timeout = 60.0 - default_config.rpcs.get_project_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_project_intelligence_config.timeout = 60.0 - default_config.rpcs.update_project_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_folder_intelligence_config.timeout = 60.0 - default_config.rpcs.get_folder_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_folder_intelligence_config.timeout = 60.0 - default_config.rpcs.update_folder_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_organization_intelligence_config.timeout = 60.0 - default_config.rpcs.get_organization_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_organization_intelligence_config.timeout = 60.0 - default_config.rpcs.update_organization_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageControl Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Storage::Control::V2::StorageControl::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 - @storage_control_stub.universe_domain - end - - ## - # Create a new StorageControl REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageControl 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 - - @storage_control_stub = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @storage_control_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 - @storage_control_stub.logger - end - - # Service calls - - ## - # Returns the Project scoped singleton IntelligenceConfig resource. - # - # @overload get_project_intelligence_config(request, options = nil) - # Pass arguments to `get_project_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_project_intelligence_config(name: nil) - # Pass arguments to `get_project_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your project. - # - # Format: `projects/{id}/locations/global/intelligenceConfig` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new - # - # # Call the get_project_intelligence_config method. - # result = client.get_project_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_project_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_project_intelligence_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::Storage::Control::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_project_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_project_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.get_project_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Project scoped singleton IntelligenceConfig resource. - # - # @overload update_project_intelligence_config(request, options = nil) - # Pass arguments to `update_project_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_project_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new - # - # # Call the update_project_intelligence_config method. - # result = client.update_project_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_project_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_project_intelligence_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::Storage::Control::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_project_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_project_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.update_project_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the Folder scoped singleton IntelligenceConfig resource. - # - # @overload get_folder_intelligence_config(request, options = nil) - # Pass arguments to `get_folder_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_folder_intelligence_config(name: nil) - # Pass arguments to `get_folder_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your folder. - # - # Format: `folders/{id}/locations/global/intelligenceConfig` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new - # - # # Call the get_folder_intelligence_config method. - # result = client.get_folder_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_folder_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_folder_intelligence_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::Storage::Control::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_folder_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_folder_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.get_folder_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Folder scoped singleton IntelligenceConfig resource. - # - # @overload update_folder_intelligence_config(request, options = nil) - # Pass arguments to `update_folder_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_folder_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new - # - # # Call the update_folder_intelligence_config method. - # result = client.update_folder_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_folder_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_folder_intelligence_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::Storage::Control::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_folder_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_folder_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.update_folder_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the Organization scoped singleton IntelligenceConfig resource. - # - # @overload get_organization_intelligence_config(request, options = nil) - # Pass arguments to `get_organization_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_organization_intelligence_config(name: nil) - # Pass arguments to `get_organization_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your organization. - # - # Format: `organizations/{org_id}/locations/global/intelligenceConfig` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new - # - # # Call the get_organization_intelligence_config method. - # result = client.get_organization_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_organization_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_organization_intelligence_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::Storage::Control::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_organization_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_organization_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.get_organization_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Organization scoped singleton IntelligenceConfig resource. - # - # @overload update_organization_intelligence_config(request, options = nil) - # Pass arguments to `update_organization_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_organization_intelligence_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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new - # - # # Call the update_organization_intelligence_config method. - # result = client.update_organization_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_organization_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_organization_intelligence_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::Storage::Control::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_organization_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_organization_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.update_organization_intelligence_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 StorageControl REST API. - # - # This class represents the configuration for StorageControl REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_project_intelligence_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_project_intelligence_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_project_intelligence_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the StorageControl API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_project_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_project_intelligence_config - ## - # RPC-specific configuration for `update_project_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_project_intelligence_config - ## - # RPC-specific configuration for `get_folder_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_folder_intelligence_config - ## - # RPC-specific configuration for `update_folder_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_folder_intelligence_config - ## - # RPC-specific configuration for `get_organization_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_intelligence_config - ## - # RPC-specific configuration for `update_organization_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_organization_intelligence_config - - # @private - def initialize parent_rpcs = nil - get_project_intelligence_config_config = parent_rpcs.get_project_intelligence_config if parent_rpcs.respond_to? :get_project_intelligence_config - @get_project_intelligence_config = ::Gapic::Config::Method.new get_project_intelligence_config_config - update_project_intelligence_config_config = parent_rpcs.update_project_intelligence_config if parent_rpcs.respond_to? :update_project_intelligence_config - @update_project_intelligence_config = ::Gapic::Config::Method.new update_project_intelligence_config_config - get_folder_intelligence_config_config = parent_rpcs.get_folder_intelligence_config if parent_rpcs.respond_to? :get_folder_intelligence_config - @get_folder_intelligence_config = ::Gapic::Config::Method.new get_folder_intelligence_config_config - update_folder_intelligence_config_config = parent_rpcs.update_folder_intelligence_config if parent_rpcs.respond_to? :update_folder_intelligence_config - @update_folder_intelligence_config = ::Gapic::Config::Method.new update_folder_intelligence_config_config - get_organization_intelligence_config_config = parent_rpcs.get_organization_intelligence_config if parent_rpcs.respond_to? :get_organization_intelligence_config - @get_organization_intelligence_config = ::Gapic::Config::Method.new get_organization_intelligence_config_config - update_organization_intelligence_config_config = parent_rpcs.update_organization_intelligence_config if parent_rpcs.respond_to? :update_organization_intelligence_config - @update_organization_intelligence_config = ::Gapic::Config::Method.new update_organization_intelligence_config_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-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb deleted file mode 100644 index 5c5d5c81ed57..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb +++ /dev/null @@ -1,452 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/storage/control/v2/storage_control_pb" - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - module Rest - ## - # REST service stub for the StorageControl service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_project_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def get_project_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_project_intelligence_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_project_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_project_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def update_project_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_project_intelligence_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_project_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_folder_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def get_folder_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_folder_intelligence_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_folder_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_folder_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def update_folder_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_folder_intelligence_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_folder_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_organization_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def get_organization_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_intelligence_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_organization_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_organization_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def update_organization_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_organization_intelligence_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_organization_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_project_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_project_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_project_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_project_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{intelligence_config.name}", - body: "intelligence_config", - matches: [ - ["intelligence_config.name", %r{^projects/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_folder_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_folder_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_folder_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_folder_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{intelligence_config.name}", - body: "intelligence_config", - matches: [ - ["intelligence_config.name", %r{^folders/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_organization_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_organization_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_organization_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_organization_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{intelligence_config.name}", - body: "intelligence_config", - matches: [ - ["intelligence_config.name", %r{^organizations/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb deleted file mode 100644 index 41fdc28eedf0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/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 Storage - module Control - module V2 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb deleted file mode 100644 index c7b1ce8e75b9..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/storage/control/v2/storage_control.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/api/routing_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/storage/control/v2/storage_control.proto\x12\x19google.storage.control.v2\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\x18google/api/routing.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"+\n\x11PendingRenameInfo\x12\x16\n\toperation\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xe2\x02\n\x06\x46older\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\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\x12N\n\x13pending_rename_info\x18\x07 \x01(\x0b\x32,.google.storage.control.v2.PendingRenameInfoB\x03\xe0\x41\x03:l\xea\x41i\n\x1dstorage.googleapis.com/Folder\x12\x37projects/{project}/buckets/{bucket}/folders/{folder=**}*\x07\x66olders2\x06\x66older\"\xf4\x01\n\x10GetFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xd5\x01\n\x13\x43reateFolderRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x36\n\x06\x66older\x18\x02 \x01(\x0b\x32!.google.storage.control.v2.FolderB\x03\xe0\x41\x02\x12\x16\n\tfolder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\trecursive\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xf7\x01\n\x13\x44\x65leteFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8c\x02\n\x12ListFoldersRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\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\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdelimiter\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13lexicographic_start\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11lexicographic_end\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\t \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"b\n\x13ListFoldersResponse\x12\x32\n\x07\x66olders\x18\x01 \x03(\x0b\x32!.google.storage.control.v2.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9b\x02\n\x13RenameFolderRequest\x12\x33\n\x04name\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12\"\n\x15\x64\x65stination_folder_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12$\n\x17if_metageneration_match\x18\x04 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x05 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8a\x02\n\x1c\x44\x65leteFolderRecursiveRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12)\n\x17if_metageneration_match\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12-\n\x1bif_metageneration_not_match\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x9a\x02\n\"CommonLongRunningOperationMetadata\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\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1d\n\x10progress_percent\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\"\xa7\x01\n\x14RenameFolderMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x18\n\x10source_folder_id\x18\x02 \x01(\t\x12\x1d\n\x15\x64\x65stination_folder_id\x18\x03 \x01(\t\"\x8a\x01\n\x1d\x44\x65leteFolderRecursiveMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x11\n\tfolder_id\x18\x02 \x01(\t\"\xf8\x03\n\rStorageLayout\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08location\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rlocation_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x64\n\x17\x63ustom_placement_config\x18\x04 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.CustomPlacementConfigB\x03\xe0\x41\x03\x12\x63\n\x16hierarchical_namespace\x18\x05 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.HierarchicalNamespaceB\x03\xe0\x41\x03\x1a/\n\x15\x43ustomPlacementConfig\x12\x16\n\x0e\x64\x61ta_locations\x18\x01 \x03(\t\x1a(\n\x15HierarchicalNamespace\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08:{\xea\x41x\n$storage.googleapis.com/StorageLayout\x12\x31projects/{project}/buckets/{bucket}/storageLayout*\x0estorageLayouts2\rstorageLayout\"\x86\x01\n\x17GetStorageLayoutRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/StorageLayout\x12\x0e\n\x06prefix\x18\x02 \x01(\t\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xbf\x02\n\rManagedFolder\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\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:\x91\x01\xea\x41\x8d\x01\n$storage.googleapis.com/ManagedFolder\x12\x46projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}*\x0emanagedFolders2\rmanagedFolder\"\x82\x02\n\x17GetManagedFolderRequest\x12:\n\x04name\x18\x06 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xe2\x01\n\x1a\x43reateManagedFolderRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x45\n\x0emanaged_folder\x18\x02 \x01(\x0b\x32(.google.storage.control.v2.ManagedFolderB\x03\xe0\x41\x02\x12\x1e\n\x11managed_folder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x9e\x02\n\x1a\x44\x65leteManagedFolderRequest\x12:\n\x04name\x18\x07 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x17\n\x0f\x61llow_non_empty\x18\x05 \x01(\x08\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xc0\x01\n\x19ListManagedFoldersRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\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\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListManagedFoldersResponse\x12\x41\n\x0fmanaged_folders\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.ManagedFolder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x02\n\x1b\x43reateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x06 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x05 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xb0\x02\n\x1bUpdateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x05 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xa5\x03\n\rAnywhereCache\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\x04zone\x18\n \x01(\tB\x03\xe0\x41\x05\x12&\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10\x61\x64mission_policy\x18\t \x01(\t\x12\x12\n\x05state\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0epending_update\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03:\x8e\x01\xea\x41\x8a\x01\n$storage.googleapis.com/AnywhereCache\x12\x43projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}*\x0e\x61nywhereCaches2\ranywhereCache\"\xc2\x01\n\x1a\x43reateAnywhereCacheRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x45\n\x0e\x61nywhere_cache\x18\x03 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xba\x01\n\x1aUpdateAnywhereCacheRequest\x12\x45\n\x0e\x61nywhere_cache\x18\x01 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"z\n\x1b\x44isableAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x19PauseAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"y\n\x1aResumeAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"v\n\x17GetAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xa1\x01\n\x19ListAnywhereCachesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListAnywhereCachesResponse\x12\x41\n\x0f\x61nywhere_caches\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.AnywhereCache\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8e\x0e\n\x12IntelligenceConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12X\n\x0e\x65\x64ition_config\x18\x02 \x01(\x0e\x32;.google.storage.control.v2.IntelligenceConfig.EditionConfigB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x34.google.storage.control.v2.IntelligenceConfig.FilterB\x03\xe0\x41\x01\x12u\n\x1d\x65\x66\x66\x65\x63tive_intelligence_config\x18\x05 \x01(\x0b\x32I.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfigB\x03\xe0\x41\x03\x12O\n\x0ctrial_config\x18\x07 \x01(\x0b\x32\x39.google.storage.control.v2.IntelligenceConfig.TrialConfig\x1a\xfc\x04\n\x06\x46ilter\x12v\n included_cloud_storage_locations\x18\x01 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12v\n excluded_cloud_storage_locations\x18\x02 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12r\n\x1eincluded_cloud_storage_buckets\x18\x03 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x12r\n\x1e\x65xcluded_cloud_storage_buckets\x18\x04 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x1a/\n\x15\x43loudStorageLocations\x12\x16\n\tlocations\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a\x35\n\x13\x43loudStorageBuckets\x12\x1e\n\x11\x62ucket_id_regexes\x18\x01 \x03(\tB\x03\xe0\x41\x01\x42\x19\n\x17\x63loud_storage_locationsB\x17\n\x15\x63loud_storage_buckets\x1a\x8a\x02\n\x1b\x45\x66\x66\x65\x63tiveIntelligenceConfig\x12z\n\x11\x65\x66\x66\x65\x63tive_edition\x18\x01 \x01(\x0e\x32Z.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEditionB\x03\xe0\x41\x03\x12 \n\x13intelligence_config\x18\x02 \x01(\tB\x03\xe0\x41\x03\"M\n\x10\x45\x66\x66\x65\x63tiveEdition\x12!\n\x1d\x45\x46\x46\x45\x43TIVE_EDITION_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08STANDARD\x10\x02\x1a\x43\n\x0bTrialConfig\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\rEditionConfig\x12\x1e\n\x1a\x45\x44ITION_CONFIG_UNSPECIFIED\x10\x00\x12\x0b\n\x07INHERIT\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0c\n\x08STANDARD\x10\x03\x12\t\n\x05TRIAL\x10\x05:\x8b\x02\xea\x41\x87\x02\n)storage.googleapis.com/IntelligenceConfig\x12\x38\x66olders/{folder}/locations/{location}/intelligenceConfig\x12;organizations/{org}/locations/{location}/intelligenceConfig\x12:projects/{project}/locations/{location}/intelligenceConfig*\x13intelligenceConfigs2\x12intelligenceConfig\"\xd5\x01\n+UpdateOrganizationIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xcf\x01\n%UpdateFolderIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xd0\x01\n&UpdateProjectIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"k\n(GetOrganizationIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"e\n\"GetFolderIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"f\n#GetProjectIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig2\xd2,\n\x0eStorageControl\x12\x9a\x01\n\x0c\x43reateFolder\x12..google.storage.control.v2.CreateFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x17parent,folder,folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x8f\x01\n\x0c\x44\x65leteFolder\x12..google.storage.control.v2.DeleteFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\tGetFolder\x12+.google.storage.control.v2.GetFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\x0bListFolders\x12-.google.storage.control.v2.ListFoldersRequest\x1a..google.storage.control.v2.ListFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xcd\x01\n\x0cRenameFolder\x12..google.storage.control.v2.RenameFolderRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1e\n\x06\x46older\x12\x14RenameFolderMetadata\xda\x41\x1aname,destination_folder_id\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xe1\x01\n\x15\x44\x65leteFolderRecursive\x12\x37.google.storage.control.v2.DeleteFolderRecursiveRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x36\n\x15google.protobuf.Empty\x12\x1d\x44\x65leteFolderRecursiveMetadata\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetStorageLayout\x12\x32.google.storage.control.v2.GetStorageLayoutRequest\x1a(.google.storage.control.v2.StorageLayout\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xbf\x01\n\x13\x43reateManagedFolder\x12\x35.google.storage.control.v2.CreateManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"G\xda\x41\'parent,managed_folder,managed_folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x9d\x01\n\x13\x44\x65leteManagedFolder\x12\x35.google.storage.control.v2.DeleteManagedFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetManagedFolder\x12\x32.google.storage.control.v2.GetManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListManagedFolders\x12\x34.google.storage.control.v2.ListManagedFoldersRequest\x1a\x35.google.storage.control.v2.ListManagedFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd1\x01\n\x13\x43reateAnywhereCache\x12\x35.google.storage.control.v2.CreateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41,\n\rAnywhereCache\x12\x1b\x43reateAnywhereCacheMetadata\xda\x41\x15parent,anywhere_cache\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xf9\x01\n\x13UpdateAnywhereCache\x12\x35.google.storage.control.v2.UpdateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41,\n\rAnywhereCache\x12\x1bUpdateAnywhereCacheMetadata\xda\x41\x1a\x61nywhere_cache,update_mask\x8a\xd3\xe4\x93\x02\x39\x12\x37\n\x13\x61nywhere_cache.name\x12 {bucket=projects/*/buckets/*}/**\x12\xb1\x01\n\x14\x44isableAnywhereCache\x12\x36.google.storage.control.v2.DisableAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xad\x01\n\x12PauseAnywhereCache\x12\x34.google.storage.control.v2.PauseAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xaf\x01\n\x13ResumeAnywhereCache\x12\x35.google.storage.control.v2.ResumeAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetAnywhereCache\x12\x32.google.storage.control.v2.GetAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListAnywhereCaches\x12\x34.google.storage.control.v2.ListAnywhereCachesRequest\x1a\x35.google.storage.control.v2.ListAnywhereCachesResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd2\x01\n\x1cGetProjectIntelligenceConfig\x12>.google.storage.control.v2.GetProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v2/{name=projects/*/locations/*/intelligenceConfig}\x12\x9d\x02\n\x1fUpdateProjectIntelligenceConfig\x12\x41.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x87\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02_2H/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xcf\x01\n\x1bGetFolderIntelligenceConfig\x12=.google.storage.control.v2.GetFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v2/{name=folders/*/locations/*/intelligenceConfig}\x12\x9a\x02\n\x1eUpdateFolderIntelligenceConfig\x12@.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x86\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02^2G/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xe1\x01\n!GetOrganizationIntelligenceConfig\x12\x43.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v2/{name=organizations/*/locations/*/intelligenceConfig}\x12\xac\x02\n$UpdateOrganizationIntelligenceConfig\x12\x46.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x8c\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32M/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xa3\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\xda\x41\x08resource\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\xaa\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"_\xda\x41\x0fresource,policy\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\x96\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaa\x01\xda\x41\x14resource,permissions\x8a\xd3\xe4\x93\x02\x8c\x01\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12\x34\n\x08resource\x12({bucket=projects/*/buckets/*}/objects/**\x12;\n\x08resource\x12/{bucket=projects/*/buckets/*}/managedFolders/**\x1a\xa7\x02\xca\x41\x16storage.googleapis.com\xd2\x41\x8a\x02https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/devstorage.read_writeB\xa6\x02\n\x1d\x63om.google.storage.control.v2B\x13StorageControlProtoP\x01Z=cloud.google.com/go/storage/control/apiv2/controlpb;controlpb\xaa\x02\x1fGoogle.Cloud.Storage.Control.V2\xca\x02\x1fGoogle\\Cloud\\Storage\\Control\\V2\xea\x02#Google::Cloud::Storage::Control::V2\xea\x41\x44\n\x1dstorage.googleapis.com/Bucket\x12#projects/{project}/buckets/{bucket}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Storage - module Control - module V2 - PendingRenameInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.PendingRenameInfo").msgclass - Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.Folder").msgclass - GetFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetFolderRequest").msgclass - CreateFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateFolderRequest").msgclass - DeleteFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRequest").msgclass - ListFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersRequest").msgclass - ListFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersResponse").msgclass - RenameFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderRequest").msgclass - DeleteFolderRecursiveRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveRequest").msgclass - CommonLongRunningOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CommonLongRunningOperationMetadata").msgclass - RenameFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderMetadata").msgclass - DeleteFolderRecursiveMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveMetadata").msgclass - StorageLayout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout").msgclass - StorageLayout::CustomPlacementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.CustomPlacementConfig").msgclass - StorageLayout::HierarchicalNamespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.HierarchicalNamespace").msgclass - GetStorageLayoutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetStorageLayoutRequest").msgclass - ManagedFolder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ManagedFolder").msgclass - GetManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetManagedFolderRequest").msgclass - CreateManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateManagedFolderRequest").msgclass - DeleteManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteManagedFolderRequest").msgclass - ListManagedFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListManagedFoldersRequest").msgclass - ListManagedFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListManagedFoldersResponse").msgclass - CreateAnywhereCacheMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateAnywhereCacheMetadata").msgclass - UpdateAnywhereCacheMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateAnywhereCacheMetadata").msgclass - AnywhereCache = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.AnywhereCache").msgclass - CreateAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateAnywhereCacheRequest").msgclass - UpdateAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateAnywhereCacheRequest").msgclass - DisableAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DisableAnywhereCacheRequest").msgclass - PauseAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.PauseAnywhereCacheRequest").msgclass - ResumeAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ResumeAnywhereCacheRequest").msgclass - GetAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetAnywhereCacheRequest").msgclass - ListAnywhereCachesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListAnywhereCachesRequest").msgclass - ListAnywhereCachesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListAnywhereCachesResponse").msgclass - IntelligenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig").msgclass - IntelligenceConfig::Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter").msgclass - IntelligenceConfig::Filter::CloudStorageLocations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations").msgclass - IntelligenceConfig::Filter::CloudStorageBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets").msgclass - IntelligenceConfig::EffectiveIntelligenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig").msgclass - IntelligenceConfig::EffectiveIntelligenceConfig::EffectiveEdition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition").enummodule - IntelligenceConfig::TrialConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.TrialConfig").msgclass - IntelligenceConfig::EditionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EditionConfig").enummodule - UpdateOrganizationIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest").msgclass - UpdateFolderIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateFolderIntelligenceConfigRequest").msgclass - UpdateProjectIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateProjectIntelligenceConfigRequest").msgclass - GetOrganizationIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetOrganizationIntelligenceConfigRequest").msgclass - GetFolderIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetFolderIntelligenceConfigRequest").msgclass - GetProjectIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetProjectIntelligenceConfigRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb deleted file mode 100644 index e631a002bf14..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb +++ /dev/null @@ -1,125 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/storage/control/v2/storage_control.proto for package 'Google.Cloud.Storage.Control.V2' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/storage/control/v2/storage_control_pb' - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - # StorageControl service includes selected control plane operations. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.storage.control.v2.StorageControl' - - # Creates a new folder. This operation is only applicable to a hierarchical - # namespace enabled bucket. - rpc :CreateFolder, ::Google::Cloud::Storage::Control::V2::CreateFolderRequest, ::Google::Cloud::Storage::Control::V2::Folder - # Permanently deletes an empty folder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - rpc :DeleteFolder, ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, ::Google::Protobuf::Empty - # Returns metadata for the specified folder. This operation is only - # applicable to a hierarchical namespace enabled bucket. - rpc :GetFolder, ::Google::Cloud::Storage::Control::V2::GetFolderRequest, ::Google::Cloud::Storage::Control::V2::Folder - # Retrieves a list of folders. This operation is only applicable to a - # hierarchical namespace enabled bucket. - rpc :ListFolders, ::Google::Cloud::Storage::Control::V2::ListFoldersRequest, ::Google::Cloud::Storage::Control::V2::ListFoldersResponse - # Renames a source folder to a destination folder. This operation is only - # applicable to a hierarchical namespace enabled bucket. During a rename, the - # source and destination folders are locked until the long running operation - # completes. - rpc :RenameFolder, ::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::Google::Longrunning::Operation - # Deletes a folder recursively. This operation is only applicable to a - # hierarchical namespace enabled bucket. - rpc :DeleteFolderRecursive, ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::Google::Longrunning::Operation - # Returns the storage layout configuration for a given bucket. - rpc :GetStorageLayout, ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::Google::Cloud::Storage::Control::V2::StorageLayout - # Creates a new managed folder. - rpc :CreateManagedFolder, ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, ::Google::Cloud::Storage::Control::V2::ManagedFolder - # Permanently deletes an empty managed folder. - rpc :DeleteManagedFolder, ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, ::Google::Protobuf::Empty - # Returns metadata for the specified managed folder. - rpc :GetManagedFolder, ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, ::Google::Cloud::Storage::Control::V2::ManagedFolder - # Retrieves a list of managed folders for a given bucket. - rpc :ListManagedFolders, ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, ::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse - # Creates an Anywhere Cache instance. - rpc :CreateAnywhereCache, ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, ::Google::Longrunning::Operation - # Updates an Anywhere Cache instance. Mutable fields include `ttl` and - # `admission_policy`. - rpc :UpdateAnywhereCache, ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, ::Google::Longrunning::Operation - # Disables an Anywhere Cache instance. A disabled instance is read-only. The - # disablement could be revoked by calling ResumeAnywhereCache. The cache - # instance will be deleted automatically if it remains in the disabled state - # for at least one hour. - rpc :DisableAnywhereCache, ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache - # Pauses an Anywhere Cache instance. - rpc :PauseAnywhereCache, ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache - # Resumes a disabled or paused Anywhere Cache instance. - rpc :ResumeAnywhereCache, ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache - # Gets an Anywhere Cache instance. - rpc :GetAnywhereCache, ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache - # Lists Anywhere Cache instances for a given bucket. - rpc :ListAnywhereCaches, ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse - # Returns the Project scoped singleton IntelligenceConfig resource. - rpc :GetProjectIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Updates the Project scoped singleton IntelligenceConfig resource. - rpc :UpdateProjectIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Returns the Folder scoped singleton IntelligenceConfig resource. - rpc :GetFolderIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Updates the Folder scoped singleton IntelligenceConfig resource. - rpc :UpdateFolderIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Returns the Organization scoped singleton IntelligenceConfig resource. - rpc :GetOrganizationIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Updates the Organization scoped singleton IntelligenceConfig resource. - rpc :UpdateOrganizationIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Gets the IAM policy for a specified bucket. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Updates an IAM policy for the specified bucket. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Tests a set of permissions on the given bucket, object, or managed folder - # to see which, if any, are held by the caller. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, - # `projects/_/buckets/{bucket}/objects/{object}` for an object, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md deleted file mode 100644 index 1aefe1559ea2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Storage Control 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-storage-control-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/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-storage-control-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb deleted file mode 100644 index 6d71a9430253..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb +++ /dev/null @@ -1,463 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Specifies the routing information that should be sent along with the request - # in the form of routing header. - # **NOTE:** All service configuration rules follow the "last one wins" order. - # - # The examples below will apply to an RPC which has the following request type: - # - # Message Definition: - # - # message Request { - # // The name of the Table - # // Values can be of the following formats: - # // - `projects//tables/` - # // - `projects//instances//tables/
` - # // - `region//zones//tables/
` - # string table_name = 1; - # - # // This value specifies routing for replication. - # // It can be in the following formats: - # // - `profiles/` - # // - a legacy `profile_id` that can be any string - # string app_profile_id = 2; - # } - # - # Example message: - # - # { - # table_name: projects/proj_foo/instances/instance_bar/table/table_baz, - # app_profile_id: profiles/prof_qux - # } - # - # The routing header consists of one or multiple key-value pairs. The order of - # the key-value pairs is undefined, the order of the `routing_parameters` in - # the `RoutingRule` only matters for the evaluation order of the path - # templates when `field` is the same. See the examples below for more details. - # - # Every key and value in the routing header must be percent-encoded, - # and joined together in the following format: `key1=value1&key2=value2`. - # The examples below skip the percent-encoding for readability. - # - # Example 1 - # - # Extracting a field from the request to put into the routing header - # unchanged, with the key equal to the field name. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `app_profile_id`. - # routing_parameters { - # field: "app_profile_id" - # } - # }; - # - # result: - # - # x-goog-request-params: app_profile_id=profiles/prof_qux - # - # Example 2 - # - # Extracting a field from the request to put into the routing header - # unchanged, with the key different from the field name. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `app_profile_id`, but name it `routing_id` in the header. - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=profiles/prof_qux - # - # Example 3 - # - # Extracting a field from the request to put into the routing - # header, while matching a path template syntax on the field's value. - # - # NB: it is more useful to send nothing than to send garbage for the purpose - # of dynamic routing, since garbage pollutes cache. Thus the matching. - # - # Sub-example 3a - # - # The field matches the template. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed (with project-based - # // syntax). - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=projects/*/instances/*/**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_name=projects/proj_foo/instances/instance_bar/table/table_baz - # - # Sub-example 3b - # - # The field does not match the template. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed (with region-based - # // syntax). - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=regions/*/zones/*/**}" - # } - # }; - # - # result: - # - # - # - # Sub-example 3c - # - # Multiple alternative conflictingly named path templates are - # specified. The one that matches is used to construct the header. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed, whether - # // using the region- or projects-based syntax. - # - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=regions/*/zones/*/**}" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=projects/*/instances/*/**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_name=projects/proj_foo/instances/instance_bar/table/table_baz - # - # Example 4 - # - # Extracting a single routing header key-value pair by matching a - # template syntax on (a part of) a single request field. - # - # annotation: - # - # option (google.api.routing) = { - # // Take just the project id from the `table_name` field. - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=projects/proj_foo - # - # Example 5 - # - # Extracting a single routing header key-value pair by matching - # several conflictingly named path templates on (parts of) a single request - # field. The last template to match "wins" the conflict. - # - # annotation: - # - # option (google.api.routing) = { - # // If the `table_name` does not have instances information, - # // take just the project id for routing. - # // Otherwise take project + instance. - # - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*/instances/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: - # routing_id=projects/proj_foo/instances/instance_bar - # - # Example 6 - # - # Extracting multiple routing header key-value pairs by matching - # several non-conflicting path templates on (parts of) a single request field. - # - # Sub-example 6a - # - # Make the templates strict, so that if the `table_name` does not - # have an instance information, nothing is sent. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing code needs two keys instead of one composite - # // but works only for the tables with the "project-instance" name - # // syntax. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/instances/*/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{instance_id=instances/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: - # project_id=projects/proj_foo&instance_id=instances/instance_bar - # - # Sub-example 6b - # - # Make the templates loose, so that if the `table_name` does not - # have an instance information, just the project id part is sent. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing code wants two keys instead of one composite - # // but will work with just the `project_id` for tables without - # // an instance in the `table_name`. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{instance_id=instances/*}/**" - # } - # }; - # - # result (is the same as 6a for our example message because it has the instance - # information): - # - # x-goog-request-params: - # project_id=projects/proj_foo&instance_id=instances/instance_bar - # - # Example 7 - # - # Extracting multiple routing header key-value pairs by matching - # several path templates on multiple request fields. - # - # NB: note that here there is no way to specify sending nothing if one of the - # fields does not match its template. E.g. if the `table_name` is in the wrong - # format, the `project_id` will not be sent, but the `routing_id` will be. - # The backend routing code has to be aware of that and be prepared to not - # receive a full complement of keys if it expects multiple. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing needs both `project_id` and `routing_id` - # // (from the `app_profile_id` field) for routing. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # project_id=projects/proj_foo&routing_id=profiles/prof_qux - # - # Example 8 - # - # Extracting a single routing header key-value pair by matching - # several conflictingly named path templates on several request fields. The - # last template to match "wins" the conflict. - # - # annotation: - # - # option (google.api.routing) = { - # // The `routing_id` can be a project id or a region id depending on - # // the table name format, but only if the `app_profile_id` is not set. - # // If `app_profile_id` is set it should be used instead. - # - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=regions/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=profiles/prof_qux - # - # Example 9 - # - # Bringing it all together. - # - # annotation: - # - # option (google.api.routing) = { - # // For routing both `table_location` and a `routing_id` are needed. - # // - # // table_location can be either an instance id or a region+zone id. - # // - # // For `routing_id`, take the value of `app_profile_id` - # // - If it's in the format `profiles/`, send - # // just the `` part. - # // - If it's any other literal, send it as is. - # // If the `app_profile_id` is empty, and the `table_name` starts with - # // the project_id, send that instead. - # - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{table_location=instances/*}/tables/*" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{table_location=regions/*/zones/*}/tables/*" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "profiles/{routing_id=*}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_location=instances/instance_bar&routing_id=prof_qux - # @!attribute [rw] routing_parameters - # @return [::Array<::Google::Api::RoutingParameter>] - # A collection of Routing Parameter specifications. - # **NOTE:** If multiple Routing Parameters describe the same key - # (via the `path_template` field or via the `field` field when - # `path_template` is not provided), "last one wins" rule - # determines which Parameter gets used. - # See the examples for more details. - class RoutingRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A projection from an input message to the GRPC or REST header. - # @!attribute [rw] field - # @return [::String] - # A request field to extract the header key-value pair from. - # @!attribute [rw] path_template - # @return [::String] - # A pattern matching the key-value field. Optional. - # If not specified, the whole field specified in the `field` field will be - # taken as value, and its name used as key. If specified, it MUST contain - # exactly one named segment (along with any number of unnamed segments) The - # pattern will be matched over the field specified in the `field` field, then - # if the match is successful: - # - the name of the single named segment will be used as a header name, - # - the match value of the segment will be used as a header value; - # if the match is NOT successful, nothing will be sent. - # - # Example: - # - # -- This is a field in the request message - # | that the header value will be extracted from. - # | - # | -- This is the key name in the - # | | routing header. - # V | - # field: "table_name" v - # path_template: "projects/*/{table_location=instances/*}/tables/*" - # ^ ^ - # | | - # In the {} brackets is the pattern that -- | - # specifies what to extract from the | - # field as a value to be sent. | - # | - # The string in the field must match the whole pattern -- - # before brackets, inside brackets, after brackets. - # - # When looking at this specific example, we can see that: - # - A key-value pair with the key `table_location` - # and the value matching `instances/*` should be added - # to the x-goog-request-params routing header. - # - The value is extracted from the request message's `table_name` field - # if it matches the full pattern specified: - # `projects/*/instances/*/tables/*`. - # - # **NB:** If the `path_template` field is not provided, the key name is - # equal to the field name, and the whole field should be sent as a value. - # This makes the pattern for the field and the value functionally equivalent - # to `**`, and the configuration - # - # { - # field: "table_name" - # } - # - # is a functionally equivalent shorthand to: - # - # { - # field: "table_name" - # path_template: "{table_name=**}" - # } - # - # See Example 1 for more details. - class RoutingParameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb deleted file mode 100644 index 6ab7a9a20ea8..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb +++ /dev/null @@ -1,1026 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Storage - module Control - module V2 - # Contains information about a pending rename operation. - # @!attribute [r] operation - # @return [::String] - # Output only. The name of the rename operation. - class PendingRenameInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A folder resource. This resource can only exist in a hierarchical namespace - # enabled bucket. - # @!attribute [rw] name - # @return [::String] - # Identifier. The name of this folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [r] metageneration - # @return [::Integer] - # Output only. The version of the metadata for this folder. Used for - # preconditions and for detecting changes in metadata. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time of the folder. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The modification time of the folder. - # @!attribute [r] pending_rename_info - # @return [::Google::Cloud::Storage::Control::V2::PendingRenameInfo] - # Output only. Only present if the folder is part of an ongoing RenameFolder - # operation. Contains information which can be used to query the operation - # status. The presence of this field also indicates all write operations are - # blocked for this folder, including folder, managed folder, and object - # operations. - class Folder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetFolder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration matches the given value. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration does not match the given value. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class GetFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateFolder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the bucket in which the folder will reside. The bucket - # must be a hierarchical namespace enabled bucket. - # @!attribute [rw] folder - # @return [::Google::Cloud::Storage::Control::V2::Folder] - # Required. Properties of the new folder being created. - # The bucket and name of the folder are specified in the parent and folder_id - # fields, respectively. Populating those fields in `folder` will result in an - # error. - # @!attribute [rw] folder_id - # @return [::String] - # Required. The full name of a folder, including all its parent folders. - # Folders use single '/' characters as a delimiter. - # The folder_id must end with a slash. - # For example, the folder_id of "books/biographies/" would create a new - # "biographies/" folder under the "books/" folder. - # @!attribute [rw] recursive - # @return [::Boolean] - # Optional. If true, parent folder doesn't have to be present and all missing - # ancestor folders will be created atomically. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class CreateFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteFolder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration matches the given value. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration does not match the given value. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class DeleteFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListFolders. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the bucket in which to look for folders. The bucket must - # be a hierarchical namespace enabled bucket. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of folders to return in a single response. The - # service will use this parameter or 1,000 items, whichever is smaller. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A previously-returned page token representing part of the larger - # set of results to view. - # @!attribute [rw] prefix - # @return [::String] - # Optional. Filter results to folders whose names begin with this prefix. - # If set, the value must either be an empty string or end with a '/'. - # @!attribute [rw] delimiter - # @return [::String] - # Optional. If set, returns results in a directory-like mode. The results - # will only include folders that either exactly match the above prefix, or - # are one level below the prefix. The only supported value is '/'. - # @!attribute [rw] lexicographic_start - # @return [::String] - # Optional. Filter results to folders whose names are lexicographically equal - # to or after lexicographic_start. If lexicographic_end is also set, the - # folders listed have names between lexicographic_start (inclusive) and - # lexicographic_end (exclusive). - # @!attribute [rw] lexicographic_end - # @return [::String] - # Optional. Filter results to folders whose names are lexicographically - # before lexicographic_end. If lexicographic_start is also set, the folders - # listed have names between lexicographic_start (inclusive) and - # lexicographic_end (exclusive). - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class ListFoldersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListFolders. - # @!attribute [rw] folders - # @return [::Array<::Google::Cloud::Storage::Control::V2::Folder>] - # The list of child folders - # @!attribute [rw] next_page_token - # @return [::String] - # The continuation token, used to page through large result sets. Provide - # this value in a subsequent request to return the next page of results. - class ListFoldersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for RenameFolder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the source folder being renamed. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [rw] destination_folder_id - # @return [::String] - # Required. The destination folder ID, e.g. `foo/bar/`. - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the source - # folder's current metageneration matches the given value. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the source - # folder's current metageneration does not match the given value. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class RenameFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteFolderRecursive. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the folder being deleted, however all of its contents - # will be deleted too. Format: - # `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # Optional. Makes the operation only succeed conditional on whether the root - # folder's current metageneration matches the given value. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # Optional. Makes the operation only succeed conditional on whether the root - # folder's current metageneration does not match the given value. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class DeleteFolderRecursiveRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message contains metadata that is common to all Storage Control - # long-running operations, present in its `google.longrunning.Operation` - # messages, and accessible via `metadata.common_metadata`. - # @!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] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was last modified. - # @!attribute [r] type - # @return [::String] - # Output only. The type of operation invoked. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation. - # @!attribute [r] progress_percent - # @return [::Integer] - # Output only. The estimated progress of the operation in percentage [0, - # 100]. The value -1 means the progress is unknown. - class CommonLongRunningOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned in the metadata field of the Operation resource for - # RenameFolder operations. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] - # Generic metadata for the long running operation. - # @!attribute [rw] source_folder_id - # @return [::String] - # The path of the source folder. - # @!attribute [rw] destination_folder_id - # @return [::String] - # The path of the destination folder. - class RenameFolderMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned in the metadata field of the Operation resource for - # DeleteFolderRecursive operations. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] - # Generic metadata for the long running operation. - # @!attribute [rw] folder_id - # @return [::String] - # The path of the folder recursively deleted. - class DeleteFolderRecursiveMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The storage layout configuration of a bucket. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the StorageLayout resource. - # Format: `projects/{project}/buckets/{bucket}/storageLayout` - # @!attribute [r] location - # @return [::String] - # Output only. The location of the bucket. - # @!attribute [r] location_type - # @return [::String] - # Output only. The location type of the bucket (region, dual-region, - # multi-region, etc). - # @!attribute [r] custom_placement_config - # @return [::Google::Cloud::Storage::Control::V2::StorageLayout::CustomPlacementConfig] - # Output only. The data placement configuration for custom dual region. If - # there is no configuration, this is not a custom dual region bucket. - # @!attribute [r] hierarchical_namespace - # @return [::Google::Cloud::Storage::Control::V2::StorageLayout::HierarchicalNamespace] - # Output only. The bucket's hierarchical namespace configuration. If there is - # no configuration, the hierarchical namespace is disabled. - class StorageLayout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for Custom Dual Regions. It should specify precisely two - # eligible regions within the same Multiregion. More information on regions - # may be found [here](https://cloud.google.com/storage/docs/locations). - # @!attribute [rw] data_locations - # @return [::Array<::String>] - # List of locations to use for data placement. - class CustomPlacementConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for a bucket's hierarchical namespace feature. - # @!attribute [rw] enabled - # @return [::Boolean] - # Enables the hierarchical namespace feature. - class HierarchicalNamespace - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for GetStorageLayout. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the StorageLayout resource. - # Format: `projects/{project}/buckets/{bucket}/storageLayout` - # @!attribute [rw] prefix - # @return [::String] - # An optional prefix used for permission check. It is useful when the caller - # only has limited permissions under a specific prefix. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class GetStorageLayoutRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A managed folder. - # @!attribute [rw] name - # @return [::String] - # Identifier. The name of this managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @!attribute [r] metageneration - # @return [::Integer] - # Output only. The metadata version of this managed folder. It increases - # whenever the metadata is updated. Used for preconditions and for detecting - # changes in metadata. Managed folders don't have a generation number. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time of the managed folder. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The modification time of the managed folder. - class ManagedFolder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetManagedFolder. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration matching the value here specified. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration NOT matching the value here specified. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class GetManagedFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateManagedFolder. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the bucket this managed folder belongs to. - # @!attribute [rw] managed_folder - # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # Required. Properties of the managed folder being created. - # The bucket and managed folder names are specified in the `parent` and - # `managed_folder_id` fields. Populating these fields in `managed_folder` - # will result in an error. - # @!attribute [rw] managed_folder_id - # @return [::String] - # Required. The name of the managed folder. It uses a single `/` as delimiter - # and leading and trailing `/` are allowed. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class CreateManagedFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DeleteManagedFolder RPC request message. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration matching the value here specified. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration NOT matching the value here specified. - # @!attribute [rw] allow_non_empty - # @return [::Boolean] - # Allows deletion of a managed folder even if it is not empty. - # A managed folder is empty if it manages no child managed folders or - # objects. Caller must have permission for - # storage.managedFolders.setIamPolicy. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class DeleteManagedFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListManagedFolders. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the bucket this managed folder belongs to. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of managed folders to return in a single response. - # The service will use this parameter or 1,000 items, whichever is smaller. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A previously-returned page token representing part of the larger - # set of results to view. - # @!attribute [rw] prefix - # @return [::String] - # Optional. Filter results to match managed folders with name starting with - # this prefix. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class ListManagedFoldersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListManagedFolders. - # @!attribute [rw] managed_folders - # @return [::Array<::Google::Cloud::Storage::Control::V2::ManagedFolder>] - # The list of matching managed folders - # @!attribute [rw] next_page_token - # @return [::String] - # The continuation token, used to page through large result sets. Provide - # this value in a subsequent request to return the next page of results. - class ListManagedFoldersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned in the metadata field of the Operation resource for - # CreateAnywhereCache operations. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] - # Generic metadata for the long running operation. - # @!attribute [rw] anywhere_cache_id - # @return [::String] - # Anywhere Cache ID. - # @!attribute [rw] zone - # @return [::String] - # The zone in which the cache instance is running. For example, - # us-central1-a. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Anywhere Cache entry's TTL. A cache-level config that is applied to all new - # cache entries on admission. Default ttl value (24hrs) is applied if not - # specified in the create request. - # @!attribute [rw] admission_policy - # @return [::String] - # Anywhere Cache entry Admission Policy in kebab-case (e.g., - # "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is - # applied if not specified in the create request. - class CreateAnywhereCacheMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned in the metadata field of the Operation resource for - # UpdateAnywhereCache operation. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] - # Generic metadata for the long running operation. - # @!attribute [rw] anywhere_cache_id - # @return [::String] - # Anywhere Cache ID. - # @!attribute [rw] zone - # @return [::String] - # The zone in which the cache instance is running. For example, - # us-central1-a. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that - # is applied to all new cache entries on admission. If `ttl` is pending - # update, this field equals to the new value specified in the Update request. - # @!attribute [rw] admission_policy - # @return [::String] - # L4 Cache entry Admission Policy in kebab-case (e.g., - # "admit-on-first-miss"). If `admission_policy` is pending - # update, this field equals to the new value specified in the Update request. - class UpdateAnywhereCacheMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An Anywhere Cache Instance. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name of this AnywhereCache. - # Format: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] zone - # @return [::String] - # Immutable. The zone in which the cache instance is running. For example, - # us-central1-a. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Cache entry TTL (ranges between 1h to 7d). This is a cache-level config - # that defines how long a cache entry can live. Default ttl value (24hrs) - # is applied if not specified in the create request. TTL must be in whole - # seconds. - # @!attribute [rw] admission_policy - # @return [::String] - # Cache admission policy. Valid policies includes: - # `admit-on-first-miss` and `admit-on-second-miss`. Defaults to - # `admit-on-first-miss`. Default value is applied if not specified in the - # create request. - # @!attribute [r] state - # @return [::String] - # Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when Anywhere cache instance is allocated. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when Anywhere cache instance is last updated, including - # creation. - # @!attribute [r] pending_update - # @return [::Boolean] - # Output only. True if there is an active update operation against this cache - # instance. Subsequential update requests will be rejected if this field is - # true. Output only. - class AnywhereCache - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateAnywhereCache. - # @!attribute [rw] parent - # @return [::String] - # Required. The bucket to which this cache belongs. - # Format: `projects/{project}/buckets/{bucket}` - # @!attribute [rw] anywhere_cache - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # Required. Properties of the Anywhere Cache instance being created. - # The parent bucket name is specified in the `parent` field. Server uses the - # default value of `ttl` or `admission_policy` if not specified in - # request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class CreateAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateAnywhereCache. - # @!attribute [rw] anywhere_cache - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # Required. The Anywhere Cache instance to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated. Mutable fields of AnywhereCache - # include `ttl` and `admission_policy`. - # - # To specify ALL fields, specify a single field with the value `*`. Note: We - # recommend against doing this. If a new field is introduced at a later time, - # an older client updating with the `*` may accidentally reset the new - # field's value. - # - # Not specifying any fields is an error. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class UpdateAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DisableAnywhereCache. - # @!attribute [rw] name - # @return [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class DisableAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for PauseAnywhereCache. - # @!attribute [rw] name - # @return [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class PauseAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ResumeAnywhereCache. - # @!attribute [rw] name - # @return [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class ResumeAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetAnywhereCache. - # @!attribute [rw] name - # @return [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class GetAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListAnywhereCaches. - # @!attribute [rw] parent - # @return [::String] - # Required. The bucket to which this cache belongs. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of caches to return in a single response. - # The service will use this parameter or 1,000 items, whichever is smaller. - # @!attribute [rw] page_token - # @return [::String] - # A previously-returned page token representing part of the larger set of - # results to view. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class ListAnywhereCachesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListAnywhereCaches. - # @!attribute [rw] anywhere_caches - # @return [::Array<::Google::Cloud::Storage::Control::V2::AnywhereCache>] - # The list of items. - # @!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 ListAnywhereCachesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The `IntelligenceConfig` resource associated with your organization, folder, - # or project. - # @!attribute [rw] name - # @return [::String] - # Identifier. The name of the `IntelligenceConfig` resource associated with - # your organization, folder, or project. - # - # The name format varies based on the GCP resource hierarchy as follows: - # - # * For project: - # `projects/{project_number}/locations/global/intelligenceConfig` - # * For organization: - # `organizations/{org_id}/locations/global/intelligenceConfig` - # * For folder: `folders/{folder_id}/locations/global/intelligenceConfig` - # @!attribute [rw] edition_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EditionConfig] - # Optional. The edition configuration of the `IntelligenceConfig` resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the `IntelligenceConfig` resource is last - # updated. - # @!attribute [rw] filter - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter] - # Optional. Filter over location and bucket. - # @!attribute [r] effective_intelligence_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EffectiveIntelligenceConfig] - # Output only. The `IntelligenceConfig` resource that is applicable for the - # resource. - # @!attribute [rw] trial_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::TrialConfig] - # The trial configuration of the `IntelligenceConfig` resource. - class IntelligenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Filter over location and bucket using include or exclude semantics. - # Resources that match the include or exclude filter are exclusively included - # or excluded from the Storage Intelligence plan. - # @!attribute [rw] included_cloud_storage_locations - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageLocations] - # Bucket locations to include. - # - # Note: The following fields are mutually exclusive: `included_cloud_storage_locations`, `excluded_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] excluded_cloud_storage_locations - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageLocations] - # Bucket locations to exclude. - # - # Note: The following fields are mutually exclusive: `excluded_cloud_storage_locations`, `included_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] included_cloud_storage_buckets - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageBuckets] - # Buckets to include. - # - # Note: The following fields are mutually exclusive: `included_cloud_storage_buckets`, `excluded_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] excluded_cloud_storage_buckets - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageBuckets] - # Buckets to exclude. - # - # Note: The following fields are mutually exclusive: `excluded_cloud_storage_buckets`, `included_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Filter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Collection of bucket locations. - # @!attribute [rw] locations - # @return [::Array<::String>] - # Optional. Bucket locations. Location can be any of the Cloud Storage - # regions specified in lower case format. For example, `us-east1`, - # `us-west1`. - class CloudStorageLocations - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Collection of buckets. - # @!attribute [rw] bucket_id_regexes - # @return [::Array<::String>] - # Optional. A regex pattern for matching bucket names. Regex should - # follow the syntax specified in - # [google/re2](https://github.com/google/re2). For example, - # `^sample_.*` matches all buckets of the form - # `gs://sample_bucket-1`, `gs://sample_bucket-2`, - # `gs://sample_bucket-n` but not `gs://test_sample_bucket`. - # If you want to match a single bucket, say `gs://sample_bucket`, - # use `sample_bucket`. - class CloudStorageBuckets - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The effective `IntelligenceConfig` for the resource. - # @!attribute [r] effective_edition - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EffectiveIntelligenceConfig::EffectiveEdition] - # Output only. The `IntelligenceConfig` edition that is applicable for the - # resource. - # @!attribute [r] intelligence_config - # @return [::String] - # Output only. The `IntelligenceConfig` resource that is applied for the - # target resource. Format: - # `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig` - class EffectiveIntelligenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The effective edition of the `IntelligenceConfig` resource. - module EffectiveEdition - # This is an unknown edition of the resource. - EFFECTIVE_EDITION_UNSPECIFIED = 0 - - # No edition. - NONE = 1 - - # The `IntelligenceConfig` resource is of STANDARD edition. - STANDARD = 2 - end - end - - # The trial configuration of the `IntelligenceConfig` resource. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the trial expires. - class TrialConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The edition configuration of the `IntelligenceConfig` resource. This - # signifies the edition used for configuring the `IntelligenceConfig` - # resource and can only take the following values: - # `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and - # `TRIAL`. - module EditionConfig - # This is an unknown edition of the resource. - EDITION_CONFIG_UNSPECIFIED = 0 - - # The inherited edition from the parent and filters. This is the default - # edition when there is no `IntelligenceConfig` setup for a GCP resource. - INHERIT = 1 - - # The edition configuration is disabled for the `IntelligenceConfig` - # resource and its children. Filters are not applicable. - DISABLED = 2 - - # The `IntelligenceConfig` resource is of STANDARD edition. - STANDARD = 3 - - # The `IntelligenceConfig` resource is available in `TRIAL` edition. During - # the trial period, Cloud Storage does not charge for Storage Intelligence - # usage. You can specify the buckets to include in the trial period by - # using filters. At the end of the trial period, the `IntelligenceConfig` - # resource is upgraded to `STANDARD` edition. - TRIAL = 5 - end - end - - # Request message to update the `IntelligenceConfig` resource associated with - # your organization. - # - # **IAM Permissions**: - # - # Requires `storage.intelligenceConfigs.update` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the organization. - # @!attribute [rw] intelligence_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # Required. The `IntelligenceConfig` resource to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - class UpdateOrganizationIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to update the `IntelligenceConfig` resource associated with - # your folder. - # - # **IAM Permissions**: - # - # Requires `storage.intelligenceConfigs.update` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the folder. - # @!attribute [rw] intelligence_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # Required. The `IntelligenceConfig` resource to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - class UpdateFolderIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to update the `IntelligenceConfig` resource associated with - # your project. - # - # **IAM Permissions**: - # - # Requires `storage.intelligenceConfigs.update` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the folder. - # @!attribute [rw] intelligence_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # Required. The `IntelligenceConfig` resource to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - class UpdateProjectIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to get the `IntelligenceConfig` resource associated with your - # organization. - # - # **IAM Permissions** - # - # Requires `storage.intelligenceConfigs.get` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the organization. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your organization. - # - # Format: `organizations/{org_id}/locations/global/intelligenceConfig` - class GetOrganizationIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to get the `IntelligenceConfig` resource associated with your - # folder. - # - # **IAM Permissions** - # - # Requires `storage.intelligenceConfigs.get` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the folder. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your folder. - # - # Format: `folders/{id}/locations/global/intelligenceConfig` - class GetFolderIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to get the `IntelligenceConfig` resource associated with your - # project. - # - # **IAM Permissions**: - # - # Requires `storage.intelligenceConfigs.get` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission - # on the project. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your project. - # - # Format: `projects/{id}/locations/global/intelligenceConfig` - class GetProjectIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile deleted file mode 100644 index 2d9a5aa92db0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-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-storage-control-v2", path: "../" -else - gem "google-cloud-storage-control-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-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json b/owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json deleted file mode 100644 index 79b7fb355379..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json +++ /dev/null @@ -1,1095 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-storage-control-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.storage.control.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "storage_v2_generated_StorageControl_CreateFolder_sync", - "title": "Snippet for the create_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder.", - "file": "storage_control/create_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::CreateFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::Folder", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "CreateFolder", - "full_name": "google.storage.control.v2.StorageControl.CreateFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_DeleteFolder_sync", - "title": "Snippet for the delete_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder.", - "file": "storage_control/delete_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::DeleteFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "DeleteFolder", - "full_name": "google.storage.control.v2.StorageControl.DeleteFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetFolder_sync", - "title": "Snippet for the get_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder.", - "file": "storage_control/get_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::Folder", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetFolder", - "full_name": "google.storage.control.v2.StorageControl.GetFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_ListFolders_sync", - "title": "Snippet for the list_folders call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders.", - "file": "storage_control/list_folders.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_folders", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::ListFoldersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ListFoldersResponse", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "ListFolders", - "full_name": "google.storage.control.v2.StorageControl.ListFolders", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_RenameFolder_sync", - "title": "Snippet for the rename_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder.", - "file": "storage_control/rename_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "rename_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::RenameFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "RenameFolder", - "full_name": "google.storage.control.v2.StorageControl.RenameFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_DeleteFolderRecursive_sync", - "title": "Snippet for the delete_folder_recursive call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive.", - "file": "storage_control/delete_folder_recursive.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_folder_recursive", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "DeleteFolderRecursive", - "full_name": "google.storage.control.v2.StorageControl.DeleteFolderRecursive", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetStorageLayout_sync", - "title": "Snippet for the get_storage_layout call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout.", - "file": "storage_control/get_storage_layout.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_storage_layout", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::StorageLayout", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetStorageLayout", - "full_name": "google.storage.control.v2.StorageControl.GetStorageLayout", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_CreateManagedFolder_sync", - "title": "Snippet for the create_managed_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder.", - "file": "storage_control/create_managed_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_managed_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ManagedFolder", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "CreateManagedFolder", - "full_name": "google.storage.control.v2.StorageControl.CreateManagedFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_DeleteManagedFolder_sync", - "title": "Snippet for the delete_managed_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder.", - "file": "storage_control/delete_managed_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_managed_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "DeleteManagedFolder", - "full_name": "google.storage.control.v2.StorageControl.DeleteManagedFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetManagedFolder_sync", - "title": "Snippet for the get_managed_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder.", - "file": "storage_control/get_managed_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_managed_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ManagedFolder", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetManagedFolder", - "full_name": "google.storage.control.v2.StorageControl.GetManagedFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_ListManagedFolders_sync", - "title": "Snippet for the list_managed_folders call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders.", - "file": "storage_control/list_managed_folders.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_managed_folders", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "ListManagedFolders", - "full_name": "google.storage.control.v2.StorageControl.ListManagedFolders", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_CreateAnywhereCache_sync", - "title": "Snippet for the create_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache.", - "file": "storage_control/create_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "CreateAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.CreateAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_UpdateAnywhereCache_sync", - "title": "Snippet for the update_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache.", - "file": "storage_control/update_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "UpdateAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.UpdateAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_DisableAnywhereCache_sync", - "title": "Snippet for the disable_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache.", - "file": "storage_control/disable_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "DisableAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.DisableAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_PauseAnywhereCache_sync", - "title": "Snippet for the pause_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache.", - "file": "storage_control/pause_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "PauseAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.PauseAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_ResumeAnywhereCache_sync", - "title": "Snippet for the resume_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache.", - "file": "storage_control/resume_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "ResumeAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.ResumeAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetAnywhereCache_sync", - "title": "Snippet for the get_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache.", - "file": "storage_control/get_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.GetAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_ListAnywhereCaches_sync", - "title": "Snippet for the list_anywhere_caches call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches.", - "file": "storage_control/list_anywhere_caches.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_anywhere_caches", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "ListAnywhereCaches", - "full_name": "google.storage.control.v2.StorageControl.ListAnywhereCaches", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync", - "title": "Snippet for the get_project_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config.", - "file": "storage_control/get_project_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_project_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetProjectIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.GetProjectIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync", - "title": "Snippet for the update_project_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config.", - "file": "storage_control/update_project_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_project_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "UpdateProjectIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.UpdateProjectIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync", - "title": "Snippet for the get_folder_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config.", - "file": "storage_control/get_folder_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_folder_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetFolderIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.GetFolderIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync", - "title": "Snippet for the update_folder_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config.", - "file": "storage_control/update_folder_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_folder_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "UpdateFolderIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.UpdateFolderIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync", - "title": "Snippet for the get_organization_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config.", - "file": "storage_control/get_organization_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_organization_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetOrganizationIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.GetOrganizationIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync", - "title": "Snippet for the update_organization_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config.", - "file": "storage_control/update_organization_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_organization_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "UpdateOrganizationIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.UpdateOrganizationIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy.", - "file": "storage_control/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.storage.control.v2.StorageControl.GetIamPolicy", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy.", - "file": "storage_control/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.storage.control.v2.StorageControl.SetIamPolicy", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions.", - "file": "storage_control/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.storage.control.v2.StorageControl.TestIamPermissions", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "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-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb deleted file mode 100644 index bbd8060b1bd0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_CreateAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the create_anywhere_cache call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache. -# -def create_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new - - # Call the create_anywhere_cache method. - result = client.create_anywhere_cache request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storage_v2_generated_StorageControl_CreateAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb deleted file mode 100644 index dd92a948086e..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_CreateFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the create_folder call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder. -# -def create_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::CreateFolderRequest.new - - # Call the create_folder method. - result = client.create_folder request - - # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. - p result -end -# [END storage_v2_generated_StorageControl_CreateFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb deleted file mode 100644 index e1fb93270c88..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_CreateManagedFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the create_managed_folder call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder. -# -def create_managed_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new - - # Call the create_managed_folder method. - result = client.create_managed_folder request - - # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. - p result -end -# [END storage_v2_generated_StorageControl_CreateManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb deleted file mode 100644 index 6527be8b6351..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_DeleteFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the delete_folder call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder. -# -def delete_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new - - # Call the delete_folder method. - result = client.delete_folder request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storage_v2_generated_StorageControl_DeleteFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb deleted file mode 100644 index 5e4a473b6602..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_DeleteFolderRecursive_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the delete_folder_recursive call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive. -# -def delete_folder_recursive - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new - - # Call the delete_folder_recursive method. - result = client.delete_folder_recursive request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storage_v2_generated_StorageControl_DeleteFolderRecursive_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb deleted file mode 100644 index cc6a608ab87f..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_DeleteManagedFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the delete_managed_folder call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder. -# -def delete_managed_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new - - # Call the delete_managed_folder method. - result = client.delete_managed_folder request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storage_v2_generated_StorageControl_DeleteManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb deleted file mode 100644 index c2a2b8e4c3b7..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_DisableAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the disable_anywhere_cache call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache. -# -def disable_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new - - # Call the disable_anywhere_cache method. - result = client.disable_anywhere_cache request - - # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - p result -end -# [END storage_v2_generated_StorageControl_DisableAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb deleted file mode 100644 index e71ce4780d7a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_anywhere_cache call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache. -# -def get_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new - - # Call the get_anywhere_cache method. - result = client.get_anywhere_cache request - - # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - p result -end -# [END storage_v2_generated_StorageControl_GetAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb deleted file mode 100644 index a48c2019212e..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_folder call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder. -# -def get_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetFolderRequest.new - - # Call the get_folder method. - result = client.get_folder request - - # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. - p result -end -# [END storage_v2_generated_StorageControl_GetFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb deleted file mode 100644 index dad8ed93e7ba..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_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 storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_folder_intelligence_config call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config. -# -def get_folder_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new - - # Call the get_folder_intelligence_config method. - result = client.get_folder_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb deleted file mode 100644 index 349e334e7668..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetIamPolicy_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_iam_policy call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END storage_v2_generated_StorageControl_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb deleted file mode 100644 index 4456c65ead42..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetManagedFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_managed_folder call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder. -# -def get_managed_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new - - # Call the get_managed_folder method. - result = client.get_managed_folder request - - # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. - p result -end -# [END storage_v2_generated_StorageControl_GetManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb deleted file mode 100644 index 3843e092f909..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_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 storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_organization_intelligence_config call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config. -# -def get_organization_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new - - # Call the get_organization_intelligence_config method. - result = client.get_organization_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb deleted file mode 100644 index 63b47d76f5ce..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_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 storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_project_intelligence_config call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config. -# -def get_project_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new - - # Call the get_project_intelligence_config method. - result = client.get_project_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb deleted file mode 100644 index b032cc0443a7..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetStorageLayout_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_storage_layout call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout. -# -def get_storage_layout - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new - - # Call the get_storage_layout method. - result = client.get_storage_layout request - - # The returned object is of type Google::Cloud::Storage::Control::V2::StorageLayout. - p result -end -# [END storage_v2_generated_StorageControl_GetStorageLayout_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb deleted file mode 100644 index 125771ab1c46..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.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 storage_v2_generated_StorageControl_ListAnywhereCaches_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the list_anywhere_caches call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches. -# -def list_anywhere_caches - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new - - # Call the list_anywhere_caches method. - result = client.list_anywhere_caches request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Storage::Control::V2::AnywhereCache. - p item - end -end -# [END storage_v2_generated_StorageControl_ListAnywhereCaches_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb deleted file mode 100644 index a14428976afa..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_ListFolders_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the list_folders call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders. -# -def list_folders - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::ListFoldersRequest.new - - # Call the list_folders method. - result = client.list_folders request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Storage::Control::V2::Folder. - p item - end -end -# [END storage_v2_generated_StorageControl_ListFolders_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb deleted file mode 100644 index 199fdd2fb572..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_ListManagedFolders_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the list_managed_folders call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders. -# -def list_managed_folders - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new - - # Call the list_managed_folders method. - result = client.list_managed_folders request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Storage::Control::V2::ManagedFolder. - p item - end -end -# [END storage_v2_generated_StorageControl_ListManagedFolders_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb deleted file mode 100644 index ba92a11e170d..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_PauseAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the pause_anywhere_cache call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache. -# -def pause_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new - - # Call the pause_anywhere_cache method. - result = client.pause_anywhere_cache request - - # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - p result -end -# [END storage_v2_generated_StorageControl_PauseAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb deleted file mode 100644 index f44abdfe039b..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_RenameFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the rename_folder call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder. -# -def rename_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::RenameFolderRequest.new - - # Call the rename_folder method. - result = client.rename_folder request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storage_v2_generated_StorageControl_RenameFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb deleted file mode 100644 index 4302ff5de677..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_ResumeAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the resume_anywhere_cache call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache. -# -def resume_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new - - # Call the resume_anywhere_cache method. - result = client.resume_anywhere_cache request - - # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - p result -end -# [END storage_v2_generated_StorageControl_ResumeAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb deleted file mode 100644 index e73a4d5d1de2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_SetIamPolicy_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the set_iam_policy call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END storage_v2_generated_StorageControl_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb deleted file mode 100644 index 485086025053..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_TestIamPermissions_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the test_iam_permissions call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END storage_v2_generated_StorageControl_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb deleted file mode 100644 index 57d4f56505f4..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_UpdateAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the update_anywhere_cache call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache. -# -def update_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new - - # Call the update_anywhere_cache method. - result = client.update_anywhere_cache request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storage_v2_generated_StorageControl_UpdateAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb deleted file mode 100644 index c44d13080aa2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_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 storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the update_folder_intelligence_config call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config. -# -def update_folder_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new - - # Call the update_folder_intelligence_config method. - result = client.update_folder_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb deleted file mode 100644 index 150381470100..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_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 storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the update_organization_intelligence_config call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config. -# -def update_organization_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new - - # Call the update_organization_intelligence_config method. - result = client.update_organization_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb deleted file mode 100644 index 56d206d78ff1..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_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 storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the update_project_intelligence_config call in the StorageControl service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config. -# -def update_project_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new - - # Call the update_project_intelligence_config method. - result = client.update_project_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb deleted file mode 100644 index 39b7bd9a10d3..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_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/storage/control/v2/storage_control_pb" -require "google/storage/control/v2/storage_control_services_pb" -require "google/cloud/storage/control/v2/storage_control" - -class ::Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb deleted file mode 100644 index 77eb67a52960..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/storage/control/v2/storage_control" - -class ::Google::Cloud::Storage::Control::V2::StorageControl::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_anywhere_cache_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.anywhere_cache_path project: "value0", bucket: "value1", anywhere_cache: "value2" - assert_equal "projects/value0/buckets/value1/anywhereCaches/value2", path - end - end - - def test_bucket_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.bucket_path project: "value0", bucket: "value1" - assert_equal "projects/value0/buckets/value1", path - end - end - - def test_folder_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.folder_path project: "value0", bucket: "value1", folder: "value2" - assert_equal "projects/value0/buckets/value1/folders/value2", path - end - end - - def test_intelligence_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::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intelligence_config_path folder: "value0", location: "value1" - assert_equal "folders/value0/locations/value1/intelligenceConfig", path - - path = client.intelligence_config_path org: "value0", location: "value1" - assert_equal "organizations/value0/locations/value1/intelligenceConfig", path - - path = client.intelligence_config_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/intelligenceConfig", path - end - end - - def test_managed_folder_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.managed_folder_path project: "value0", bucket: "value1", managed_folder: "value2" - assert_equal "projects/value0/buckets/value1/managedFolders/value2", path - end - end - - def test_storage_layout_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.storage_layout_path project: "value0", bucket: "value1" - assert_equal "projects/value0/buckets/value1/storageLayout", path - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb deleted file mode 100644 index e8890b18eec3..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb +++ /dev/null @@ -1,429 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/storage/control/v2/storage_control_pb" -require "google/cloud/storage/control/v2/storage_control/rest" - - -class ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_project_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_project_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_project_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_project_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_project_intelligence_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_project_intelligence_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_project_intelligence_config ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_project_intelligence_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_project_intelligence_config(::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_project_intelligence_config_client_stub.call_count - end - end - end - - def test_update_project_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_project_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_project_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_project_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_project_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_project_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_project_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_project_intelligence_config_client_stub.call_count - end - end - end - - def test_get_folder_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_folder_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_folder_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_folder_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_folder_intelligence_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_folder_intelligence_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_folder_intelligence_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_folder_intelligence_config_client_stub.call_count - end - end - end - - def test_update_folder_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_folder_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_folder_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_folder_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_folder_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_folder_intelligence_config_client_stub.call_count - end - end - end - - def test_get_organization_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_organization_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_organization_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_organization_intelligence_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_organization_intelligence_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_organization_intelligence_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_organization_intelligence_config_client_stub.call_count - end - end - end - - def test_update_organization_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_organization_intelligence_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::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_organization_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_organization_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_organization_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_organization_intelligence_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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb deleted file mode 100644 index d85897291ac9..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb +++ /dev/null @@ -1,1853 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/storage/control/v2/storage_control_pb" -require "google/cloud/storage/control/v2/storage_control" - -class ::Google::Cloud::Storage::Control::V2::StorageControl::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_folder - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::Folder.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - folder = {} - folder_id = "hello world" - recursive = true - request_id = "hello world" - - create_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateFolderRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::Folder), request["folder"] - assert_equal "hello world", request["folder_id"] - assert_equal true, request["recursive"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_folder({ parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_folder parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_folder ::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new(parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder({ parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder(::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new(parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder_client_stub.call_rpc_count - end - end - - def test_delete_folder - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - delete_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_folder ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_folder(::Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_folder_client_stub.call_rpc_count - end - end - - def test_get_folder - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::Folder.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - get_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_folder ::Google::Cloud::Storage::Control::V2::GetFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.get_folder(::Google::Cloud::Storage::Control::V2::GetFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, get_folder_client_stub.call_rpc_count - end - end - - def test_list_folders - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ListFoldersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - prefix = "hello world" - delimiter = "hello world" - lexicographic_start = "hello world" - lexicographic_end = "hello world" - request_id = "hello world" - - list_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_folders, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::ListFoldersRequest, 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["prefix"] - assert_equal "hello world", request["delimiter"] - assert_equal "hello world", request["lexicographic_start"] - assert_equal "hello world", request["lexicographic_end"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_folders_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_folders parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_folders ::Google::Cloud::Storage::Control::V2::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_folders(::Google::Cloud::Storage::Control::V2::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_folders_client_stub.call_rpc_count - end - end - - def test_rename_folder - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - destination_folder_id = "hello world" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - rename_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rename_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::RenameFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["destination_folder_id"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rename_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rename_folder({ name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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.rename_folder name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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.rename_folder ::Google::Cloud::Storage::Control::V2::RenameFolderRequest.new(name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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.rename_folder({ name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder(::Google::Cloud::Storage::Control::V2::RenameFolderRequest.new(name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, rename_folder_client_stub.call_rpc_count - end - end - - def test_delete_folder_recursive - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - delete_folder_recursive_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_folder_recursive, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_folder_recursive_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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_folder_recursive name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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_folder_recursive ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_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_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive(::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive_client_stub.call_rpc_count - end - end - - def test_get_storage_layout - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::StorageLayout.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - prefix = "hello world" - request_id = "hello world" - - get_storage_layout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_storage_layout, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["prefix"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_storage_layout_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_storage_layout({ name: name, prefix: prefix, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_storage_layout name: name, prefix: prefix, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_storage_layout ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new(name: name, prefix: prefix, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_storage_layout({ name: name, prefix: prefix, 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.get_storage_layout(::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new(name: name, prefix: prefix, 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, get_storage_layout_client_stub.call_rpc_count - end - end - - def test_create_managed_folder - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ManagedFolder.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - managed_folder = {} - managed_folder_id = "hello world" - request_id = "hello world" - - create_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_managed_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::ManagedFolder), request["managed_folder"] - assert_equal "hello world", request["managed_folder_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_managed_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_managed_folder({ parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_managed_folder parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_managed_folder ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new(parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder({ parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder(::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new(parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder_client_stub.call_rpc_count - end - end - - def test_delete_managed_folder - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - allow_non_empty = true - request_id = "hello world" - - delete_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_managed_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal true, request["allow_non_empty"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_managed_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_managed_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_managed_folder ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_managed_folder(::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_managed_folder_client_stub.call_rpc_count - end - end - - def test_get_managed_folder - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ManagedFolder.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - get_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_managed_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_managed_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_managed_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_managed_folder ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.get_managed_folder(::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, get_managed_folder_client_stub.call_rpc_count - end - end - - def test_list_managed_folders - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - prefix = "hello world" - request_id = "hello world" - - list_managed_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_managed_folders, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, 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["prefix"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_managed_folders_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_managed_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_managed_folders parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_managed_folders ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_managed_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_managed_folders(::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_managed_folders_client_stub.call_rpc_count - end - end - - def test_create_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - anywhere_cache = {} - request_id = "hello world" - - create_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::AnywhereCache), request["anywhere_cache"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_anywhere_cache({ parent: parent, anywhere_cache: anywhere_cache, request_id: request_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_anywhere_cache parent: parent, anywhere_cache: anywhere_cache, request_id: request_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_anywhere_cache ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new(parent: parent, anywhere_cache: anywhere_cache, request_id: request_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_anywhere_cache({ parent: parent, anywhere_cache: anywhere_cache, 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_anywhere_cache(::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new(parent: parent, anywhere_cache: anywhere_cache, 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_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_update_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - anywhere_cache = {} - update_mask = {} - request_id = "hello world" - - update_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::AnywhereCache), request["anywhere_cache"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_anywhere_cache({ anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_anywhere_cache anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_anywhere_cache ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new(anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_anywhere_cache({ anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_anywhere_cache(::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new(anywhere_cache: anywhere_cache, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_disable_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - disable_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_anywhere_cache name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_anywhere_cache ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_anywhere_cache({ name: name, 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.disable_anywhere_cache(::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new(name: name, 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, disable_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_pause_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_anywhere_cache name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_anywhere_cache ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_anywhere_cache({ name: name, 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.pause_anywhere_cache(::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new(name: name, 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, pause_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_resume_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_anywhere_cache name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_anywhere_cache ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_anywhere_cache({ name: name, 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.resume_anywhere_cache(::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new(name: name, 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, resume_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_get_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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" - - get_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_anywhere_cache name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_anywhere_cache ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_anywhere_cache({ name: name, 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.get_anywhere_cache(::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new(name: name, 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, get_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_list_anywhere_caches - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - request_id = "hello world" - - list_anywhere_caches_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_anywhere_caches, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, 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["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_anywhere_caches_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_anywhere_caches({ parent: parent, page_size: page_size, page_token: page_token, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_anywhere_caches parent: parent, page_size: page_size, page_token: page_token, request_id: request_id do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_anywhere_caches ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new(parent: parent, page_size: page_size, page_token: page_token, request_id: request_id) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_anywhere_caches({ parent: parent, page_size: page_size, page_token: page_token, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_anywhere_caches(::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new(parent: parent, page_size: page_size, page_token: page_token, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_anywhere_caches_client_stub.call_rpc_count - end - end - - def test_get_project_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_project_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_project_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_project_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_project_intelligence_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_project_intelligence_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_project_intelligence_config ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_project_intelligence_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_project_intelligence_config(::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_project_intelligence_config_client_stub.call_rpc_count - end - end - - def test_update_project_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_project_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_project_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_project_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_project_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_project_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_project_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_project_intelligence_config_client_stub.call_rpc_count - end - end - - def test_get_folder_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_folder_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_folder_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_folder_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_folder_intelligence_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_folder_intelligence_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_folder_intelligence_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_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_folder_intelligence_config_client_stub.call_rpc_count - end - end - - def test_update_folder_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_folder_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_folder_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_folder_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_folder_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_folder_intelligence_config_client_stub.call_rpc_count - end - end - - def test_get_organization_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_organization_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_organization_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_organization_intelligence_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_organization_intelligence_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_organization_intelligence_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_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_organization_intelligence_config_client_stub.call_rpc_count - end - end - - def test_update_organization_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_organization_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_organization_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_organization_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_organization_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_organization_intelligence_config_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Storage::Control::V2::StorageControl::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/.gitignore b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.repo-metadata.json deleted file mode 100644 index 9e3d08bb0247..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "storagebatchoperations.googleapis.com", - "api_shortname": "storagebatchoperations", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage_batch_operations-v1/latest", - "distribution_name": "google-cloud-storage_batch_operations-v1", - "is_cloud": true, - "language": "ruby", - "name": "storagebatchoperations", - "name_pretty": "Storage Batch Operations V1 API", - "product_documentation": "https://cloud.google.com/storage/docs/batch-operations/overview", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "google-cloud-storage_batch_operations-v1 is the official client library for the Storage Batch Operations V1 API. Note that google-cloud-storage_batch_operations-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_batch_operations instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/storage/docs/batch-operations/overview", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/.rubocop.yml b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.rubocop.yml deleted file mode 100644 index 1c5b71367c84..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-storage_batch_operations-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-storage_batch_operations-v1.rb" diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/.toys.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/.yardopts b/owl-bot-staging/google-cloud-storage_batch_operations-v1/.yardopts deleted file mode 100644 index 01d2e25f2a19..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Storage Batch Operations 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-storage_batch_operations-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/AUTHENTICATION.md deleted file mode 100644 index 00a2a8e025ed..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-storage_batch_operations-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-storage_batch_operations-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/storage_batch_operations/v1" - -client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/storage_batch_operations/v1" - -::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations-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/storage_batch_operations/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/Gemfile b/owl-bot-staging/google-cloud-storage_batch_operations-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/LICENSE.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/README.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/README.md deleted file mode 100644 index 22c13bdba279..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Storage Batch Operations V1 API - -API Client library for the Storage Batch Operations V1 API - -google-cloud-storage_batch_operations-v1 is the official client library for the Storage Batch Operations V1 API. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Storage Batch Operations V1 API. Most users should consider using -the main client gem, -[google-cloud-storage_batch_operations](https://rubygems.org/gems/google-cloud-storage_batch_operations). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-storage_batch_operations-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/storagebatchoperations.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/storage_batch_operations/v1" - -client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new -request = ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new # (request fields as keyword arguments...) -response = client.list_jobs request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage_batch_operations-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/storage/docs/batch-operations/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/storage_batch_operations/v1" -require "logger" - -client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-storage_batch_operations-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-storage_batch_operations`. -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-storage_batch_operations-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-storage_batch_operations-v1/Rakefile b/owl-bot-staging/google-cloud-storage_batch_operations-v1/Rakefile deleted file mode 100644 index e412b629f993..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-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/storage_batch_operations/v1/storage_batch_operations/credentials" - ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations-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-storage_batch_operations-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-storage_batch_operations-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-storage_batch_operations-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-storage_batch_operations-v1" - header "google-cloud-storage_batch_operations-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-storage_batch_operations-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-storage_batch_operations-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-storage_batch_operations-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-storage_batch_operations-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-storage_batch_operations-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-storage_batch_operations-v1/gapic_metadata.json deleted file mode 100644 index d3fa69b3d746..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/gapic_metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.storagebatchoperations.v1", - "libraryPackage": "::Google::Cloud::StorageBatchOperations::V1", - "services": { - "StorageBatchOperations": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client", - "rpcs": { - "ListJobs": { - "methods": [ - "list_jobs" - ] - }, - "GetJob": { - "methods": [ - "get_job" - ] - }, - "CreateJob": { - "methods": [ - "create_job" - ] - }, - "DeleteJob": { - "methods": [ - "delete_job" - ] - }, - "CancelJob": { - "methods": [ - "cancel_job" - ] - }, - "ListBucketOperations": { - "methods": [ - "list_bucket_operations" - ] - }, - "GetBucketOperation": { - "methods": [ - "get_bucket_operation" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/google-cloud-storage_batch_operations-v1.gemspec b/owl-bot-staging/google-cloud-storage_batch_operations-v1/google-cloud-storage_batch_operations-v1.gemspec deleted file mode 100644 index 959a182d1abb..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/google-cloud-storage_batch_operations-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/storage_batch_operations/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-storage_batch_operations-v1" - gem.version = Google::Cloud::StorageBatchOperations::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "google-cloud-storage_batch_operations-v1 is the official client library for the Storage Batch Operations V1 API. Note that google-cloud-storage_batch_operations-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_batch_operations instead. See the readme for more details." - gem.summary = "API Client library for the Storage Batch Operations 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google-cloud-storage_batch_operations-v1.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google-cloud-storage_batch_operations-v1.rb deleted file mode 100644 index e43de71ce03a..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google-cloud-storage_batch_operations-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/storage_batch_operations/v1" diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1.rb deleted file mode 100644 index b0fd4614ed1c..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/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/storage_batch_operations/v1/storage_batch_operations" -require "google/cloud/storage_batch_operations/v1/version" - -module Google - module Cloud - module StorageBatchOperations - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/storage_batch_operations/v1" - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/storage_batch_operations/v1" - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/storage_batch_operations/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/bindings_override.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/bindings_override.rb deleted file mode 100644 index 0ff63196918e..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/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 StorageBatchOperations - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/storage_batch_operations/v1/rest" - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "StorageBatchOperations"] - parent_config = while namespace.any? - parent_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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/rest.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/rest.rb deleted file mode 100644 index 040c0e686dbe..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/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/storage_batch_operations/v1/storage_batch_operations/rest" -require "google/cloud/storage_batch_operations/v1/bindings_override" -require "google/cloud/storage_batch_operations/v1/version" - -module Google - module Cloud - module StorageBatchOperations - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/storage_batch_operations/v1/rest" - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations.rb deleted file mode 100644 index f5ab32c6e727..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations.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/storage_batch_operations/v1/version" - -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/paths" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/operations" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/client" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest" - -module Google - module Cloud - module StorageBatchOperations - module V1 - ## - # Storage Batch Operations offers a managed experience to perform batch - # operations on millions of Cloud Storage objects in a serverless fashion. With - # this service, you can automate and simplify large scale API operations - # performed on Cloud Storage objects. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/storage_batch_operations/v1/storage_batch_operations" - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest" - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - module StorageBatchOperations - end - end - end - end -end - -helper_path = ::File.join __dir__, "storage_batch_operations", "helpers.rb" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/client.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/client.rb deleted file mode 100644 index cddd49a94cd7..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/client.rb +++ /dev/null @@ -1,1150 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" -require "google/cloud/location" - -module Google - module Cloud - module StorageBatchOperations - module V1 - module StorageBatchOperations - ## - # Client for the StorageBatchOperations service. - # - # Storage Batch Operations offers a managed experience to perform batch - # operations on millions of Cloud Storage objects in a serverless fashion. With - # this service, you can automate and simplify large scale API operations - # performed on Cloud Storage objects. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storagebatchoperations.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_batch_operations_stub - - ## - # Configure the StorageBatchOperations Client class. - # - # See {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageBatchOperations clients - # ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "StorageBatchOperations", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_jobs.timeout = 60.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] - } - - default_config.rpcs.get_job.timeout = 60.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] - } - - default_config.rpcs.create_job.timeout = 60.0 - - default_config.rpcs.delete_job.timeout = 60.0 - - default_config.rpcs.cancel_job.timeout = 60.0 - default_config.rpcs.cancel_job.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageBatchOperations Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @storage_batch_operations_stub.universe_domain - end - - ## - # Create a new StorageBatchOperations client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageBatchOperations 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/storagebatchoperations/v1/storage_batch_operations_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 - - @storage_batch_operations_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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 - ) - - @storage_batch_operations_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 = @storage_batch_operations_stub.endpoint - config.universe_domain = @storage_batch_operations_stub.universe_domain - config.logger = @storage_batch_operations_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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 - @storage_batch_operations_stub.logger - end - - # Service calls - - ## - # Lists Jobs in a given project. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Format: projects/\\{project_id}/locations/global. - # @param filter [::String] - # Optional. Filters results as defined by https://google.aip.dev/160. - # @param page_size [::Integer] - # Optional. The list page size. default page size is 100. - # @param page_token [::String] - # Optional. The list page token. - # @param order_by [::String] - # Optional. Field to sort by. Supported fields are name, create_time. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::Job>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::Job>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.call_rpc :list_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_batch_operations_stub, :list_jobs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a batch job. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. `name` of the job to retrieve. - # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageBatchOperations::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.call_rpc :get_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a batch job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_job(parent: nil, job_id: nil, job: nil, request_id: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Value for parent. - # @param job_id [::String] - # Required. The optional `job_id` for this Job . If not - # specified, an id is generated. `job_id` should be no more than 128 - # characters and must include only characters available in DNS names, as - # defined by RFC-1123. - # @param job [::Google::Cloud::StorageBatchOperations::V1::Job, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID in case you need to retry your request. Requests with same - # `request_id` will be ignored for at least 60 minutes since the first - # request. 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/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.call_rpc :create_job, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 batch job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_job(name: nil, request_id: nil, force: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The `name` of the job to delete. - # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID in case you need to retry your request. Requests with same - # `request_id` will be ignored for at least 60 minutes since the first - # 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 bucket operations of the job will also - # be deleted. Highly recommended to be set to true by all clients. Users - # cannot mutate bucket operations directly, so only the jobs.delete - # permission is required to delete a job (and its child bucket operations). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.call_rpc :delete_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Cancels a batch job. - # - # @overload cancel_job(request, options = nil) - # Pass arguments to `cancel_job` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(name: nil, request_id: nil) - # Pass arguments to `cancel_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The `name` of the job to cancel. - # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID in case you need to retry your request. Requests with same - # `request_id` will be ignored for at least 60 minutes since the first - # request. 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::StorageBatchOperations::V1::CancelJobResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new - # - # # Call the cancel_job method. - # result = client.cancel_job request - # - # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::CancelJobResponse. - # p result - # - def cancel_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest - - # Converts hash and nil to 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_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.call_rpc :cancel_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists BucketOperations in a given project and job. - # - # @overload list_bucket_operations(request, options = nil) - # Pass arguments to `list_bucket_operations` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_bucket_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) - # Pass arguments to `list_bucket_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. - # @param filter [::String] - # Optional. Filters results as defined by https://google.aip.dev/160. - # @param page_size [::Integer] - # Optional. The list page size. Default page size is 100. - # @param page_token [::String] - # Optional. The list page token. - # @param order_by [::String] - # Optional. Field to sort by. Supported fields are name, create_time. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new - # - # # Call the list_bucket_operations method. - # result = client.list_bucket_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::BucketOperation. - # p item - # end - # - def list_bucket_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_bucket_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::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_bucket_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_bucket_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.call_rpc :list_bucket_operations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_batch_operations_stub, :list_bucket_operations, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a BucketOperation. - # - # @overload get_bucket_operation(request, options = nil) - # Pass arguments to `get_bucket_operation` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_bucket_operation(name: nil) - # Pass arguments to `get_bucket_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. `name` of the bucket operation to retrieve. - # Format: - # projects/\\{project_id}/locations/global/jobs/\\{job_id}/bucketOperations/\\{bucket_operation_id}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new - # - # # Call the get_bucket_operation method. - # result = client.get_bucket_operation request - # - # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::BucketOperation. - # p result - # - def get_bucket_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_bucket_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_bucket_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_bucket_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.call_rpc :get_bucket_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 - - ## - # Configuration class for the StorageBatchOperations API. - # - # This class represents the configuration for StorageBatchOperations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_jobs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storagebatchoperations.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the StorageBatchOperations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `cancel_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_job - ## - # RPC-specific configuration for `list_bucket_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_bucket_operations - ## - # RPC-specific configuration for `get_bucket_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_bucket_operation - - # @private - def initialize parent_rpcs = nil - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job - @cancel_job = ::Gapic::Config::Method.new cancel_job_config - list_bucket_operations_config = parent_rpcs.list_bucket_operations if parent_rpcs.respond_to? :list_bucket_operations - @list_bucket_operations = ::Gapic::Config::Method.new list_bucket_operations_config - get_bucket_operation_config = parent_rpcs.get_bucket_operation if parent_rpcs.respond_to? :get_bucket_operation - @get_bucket_operation = ::Gapic::Config::Method.new get_bucket_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials.rb deleted file mode 100644 index fd5b6b90611d..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/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 StorageBatchOperations - module V1 - module StorageBatchOperations - # Credentials for the StorageBatchOperations 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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/operations.rb deleted file mode 100644 index 30ceae19e2a4..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/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 StorageBatchOperations - module V1 - module StorageBatchOperations - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storagebatchoperations.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StorageBatchOperations 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 StorageBatchOperations 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::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::StorageBatchOperations::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::StorageBatchOperations::V1::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 = "storagebatchoperations.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/paths.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/paths.rb deleted file mode 100644 index 8f514eafbc0c..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/paths.rb +++ /dev/null @@ -1,111 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module StorageBatchOperations - module V1 - module StorageBatchOperations - # Path helper methods for the StorageBatchOperations API. - module Paths - ## - # Create a fully-qualified BucketOperation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/jobs/{job}/bucketOperations/{bucket_operation}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # @param bucket_operation [String] - # - # @return [::String] - def bucket_operation_path project:, location:, job:, bucket_operation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" - - "projects/#{project}/locations/#{location}/jobs/#{job}/bucketOperations/#{bucket_operation}" - 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 Job resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/jobs/{job}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # - # @return [::String] - def job_path project:, location:, job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/jobs/#{job}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest.rb deleted file mode 100644 index 777784ab05be..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/storage_batch_operations/v1/version" -require "google/cloud/storage_batch_operations/v1/bindings_override" - -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/credentials" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/paths" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/operations" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client" - -module Google - module Cloud - module StorageBatchOperations - module V1 - ## - # Storage Batch Operations offers a managed experience to perform batch - # operations on millions of Cloud Storage objects in a serverless fashion. With - # this service, you can automate and simplify large scale API operations - # performed on Cloud Storage objects. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest" - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - module StorageBatchOperations - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client.rb deleted file mode 100644 index 644478a3a8bd..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/client.rb +++ /dev/null @@ -1,1066 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module StorageBatchOperations - module V1 - module StorageBatchOperations - module Rest - ## - # REST client for the StorageBatchOperations service. - # - # Storage Batch Operations offers a managed experience to perform batch - # operations on millions of Cloud Storage objects in a serverless fashion. With - # this service, you can automate and simplify large scale API operations - # performed on Cloud Storage objects. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storagebatchoperations.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_batch_operations_stub - - ## - # Configure the StorageBatchOperations Client class. - # - # See {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageBatchOperations clients - # ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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", "StorageBatchOperations", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_jobs.timeout = 60.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] - } - - default_config.rpcs.get_job.timeout = 60.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] - } - - default_config.rpcs.create_job.timeout = 60.0 - - default_config.rpcs.delete_job.timeout = 60.0 - - default_config.rpcs.cancel_job.timeout = 60.0 - default_config.rpcs.cancel_job.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageBatchOperations Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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 - @storage_batch_operations_stub.universe_domain - end - - ## - # Create a new StorageBatchOperations REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageBatchOperations 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::StorageBatchOperations::V1::StorageBatchOperations::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 - - @storage_batch_operations_stub = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @storage_batch_operations_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 = @storage_batch_operations_stub.endpoint - config.universe_domain = @storage_batch_operations_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @storage_batch_operations_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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 - @storage_batch_operations_stub.logger - end - - # Service calls - - ## - # Lists Jobs in a given project. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Format: projects/\\{project_id}/locations/global. - # @param filter [::String] - # Optional. Filters results as defined by https://google.aip.dev/160. - # @param page_size [::Integer] - # Optional. The list page size. default page size is 100. - # @param page_token [::String] - # Optional. The list page token. - # @param order_by [::String] - # Optional. Field to sort by. Supported fields are name, create_time. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::Job>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::Job>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.list_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @storage_batch_operations_stub, :list_jobs, "jobs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a batch job. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. `name` of the job to retrieve. - # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.get_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a batch job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_job(parent: nil, job_id: nil, job: nil, request_id: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Value for parent. - # @param job_id [::String] - # Required. The optional `job_id` for this Job . If not - # specified, an id is generated. `job_id` should be no more than 128 - # characters and must include only characters available in DNS names, as - # defined by RFC-1123. - # @param job [::Google::Cloud::StorageBatchOperations::V1::Job, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID in case you need to retry your request. Requests with same - # `request_id` will be ignored for at least 60 minutes since the first - # request. 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/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.create_job request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 batch job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_job(name: nil, request_id: nil, force: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The `name` of the job to delete. - # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID in case you need to retry your request. Requests with same - # `request_id` will be ignored for at least 60 minutes since the first - # 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 bucket operations of the job will also - # be deleted. Highly recommended to be set to true by all clients. Users - # cannot mutate bucket operations directly, so only the jobs.delete - # permission is required to delete a job (and its child bucket operations). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.delete_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Cancels a batch job. - # - # @overload cancel_job(request, options = nil) - # Pass arguments to `cancel_job` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(name: nil, request_id: nil) - # Pass arguments to `cancel_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The `name` of the job to cancel. - # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID in case you need to retry your request. Requests with same - # `request_id` will be ignored for at least 60 minutes since the first - # request. 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::StorageBatchOperations::V1::CancelJobResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new - # - # # Call the cancel_job method. - # result = client.cancel_job request - # - # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::CancelJobResponse. - # p result - # - def cancel_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest - - # Converts hash and nil to an 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_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.cancel_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists BucketOperations in a given project and job. - # - # @overload list_bucket_operations(request, options = nil) - # Pass arguments to `list_bucket_operations` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_bucket_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) - # Pass arguments to `list_bucket_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. - # @param filter [::String] - # Optional. Filters results as defined by https://google.aip.dev/160. - # @param page_size [::Integer] - # Optional. The list page size. Default page size is 100. - # @param page_token [::String] - # Optional. The list page token. - # @param order_by [::String] - # Optional. Field to sort by. Supported fields are name, create_time. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new - # - # # Call the list_bucket_operations method. - # result = client.list_bucket_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::BucketOperation. - # p item - # end - # - def list_bucket_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_bucket_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::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_bucket_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_bucket_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.list_bucket_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @storage_batch_operations_stub, :list_bucket_operations, "bucket_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 a BucketOperation. - # - # @overload get_bucket_operation(request, options = nil) - # Pass arguments to `get_bucket_operation` via a request object, either of type - # {::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_bucket_operation(name: nil) - # Pass arguments to `get_bucket_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. `name` of the bucket operation to retrieve. - # Format: - # projects/\\{project_id}/locations/global/jobs/\\{job_id}/bucketOperations/\\{bucket_operation_id}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_batch_operations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new - # - # # Call the get_bucket_operation method. - # result = client.get_bucket_operation request - # - # # The returned object is of type Google::Cloud::StorageBatchOperations::V1::BucketOperation. - # p result - # - def get_bucket_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_bucket_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_bucket_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_bucket_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_batch_operations_stub.get_bucket_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 StorageBatchOperations REST API. - # - # This class represents the configuration for StorageBatchOperations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_jobs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storagebatchoperations.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 StorageBatchOperations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `cancel_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_job - ## - # RPC-specific configuration for `list_bucket_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_bucket_operations - ## - # RPC-specific configuration for `get_bucket_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_bucket_operation - - # @private - def initialize parent_rpcs = nil - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job - @cancel_job = ::Gapic::Config::Method.new cancel_job_config - list_bucket_operations_config = parent_rpcs.list_bucket_operations if parent_rpcs.respond_to? :list_bucket_operations - @list_bucket_operations = ::Gapic::Config::Method.new list_bucket_operations_config - get_bucket_operation_config = parent_rpcs.get_bucket_operation if parent_rpcs.respond_to? :get_bucket_operation - @get_bucket_operation = ::Gapic::Config::Method.new get_bucket_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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/operations.rb deleted file mode 100644 index e714b68f17a4..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/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 StorageBatchOperations - module V1 - module StorageBatchOperations - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storagebatchoperations.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StorageBatchOperations 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 StorageBatchOperations 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::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageBatchOperations::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "storagebatchoperations.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_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-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub.rb deleted file mode 100644 index 29756eab3e5e..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/storage_batch_operations/rest/service_stub.rb +++ /dev/null @@ -1,510 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" - -module Google - module Cloud - module StorageBatchOperations - module V1 - module StorageBatchOperations - module Rest - ## - # REST service stub for the StorageBatchOperations service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse] - # A result object deserialized from the server's reply - def list_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_job REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::Job] - # A result object deserialized from the server's reply - def get_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageBatchOperations::V1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_job REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_job REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_job REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse] - # A result object deserialized from the server's reply - def cancel_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_cancel_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse.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_bucket_operations REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse] - # A result object deserialized from the server's reply - def list_bucket_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_bucket_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_bucket_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_bucket_operation REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageBatchOperations::V1::BucketOperation] - # A result object deserialized from the server's reply - def get_bucket_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_bucket_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_bucket_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageBatchOperations::V1::BucketOperation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/jobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_job REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_job REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/jobs", - body: "job", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_job REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_job REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest] - # 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_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_bucket_operations REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_bucket_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/bucketOperations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_bucket_operation REST call - # - # @param request_pb [::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_bucket_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/bucketOperations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/version.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/v1/version.rb deleted file mode 100644 index bcb427ab5428..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storage_batch_operations/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 StorageBatchOperations - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_pb.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_pb.rb deleted file mode 100644 index 3171953bbff9..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_pb.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/storagebatchoperations/v1/storage_batch_operations.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\nEgoogle/cloud/storagebatchoperations/v1/storage_batch_operations.proto\x12&google.cloud.storagebatchoperations.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\x1aKgoogle/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb1\x01\n\x0fListJobsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)storagebatchoperations.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"{\n\x10ListJobsResponse\x12\x39\n\x04jobs\x18\x01 \x03(\x0b\x32+.google.cloud.storagebatchoperations.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"P\n\rGetJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storagebatchoperations.googleapis.com/Job\"\xca\x01\n\x10\x43reateJobRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)storagebatchoperations.googleapis.com/Job\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x03job\x18\x03 \x01(\x0b\x32+.google.cloud.storagebatchoperations.v1.JobB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"t\n\x10\x43\x61ncelJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storagebatchoperations.googleapis.com/Job\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x88\x01\n\x10\x44\x65leteJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storagebatchoperations.googleapis.com/Job\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x13\n\x11\x43\x61ncelJobResponse\"\xc9\x01\n\x1bListBucketOperationsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35storagebatchoperations.googleapis.com/BucketOperation\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x1cListBucketOperationsResponse\x12R\n\x11\x62ucket_operations\x18\x01 \x03(\x0b\x32\x37.google.cloud.storagebatchoperations.v1.BucketOperation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"h\n\x19GetBucketOperationRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5storagebatchoperations.googleapis.com/BucketOperation\"\x92\x02\n\x11OperationMetadata\x12\x16\n\toperation\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12=\n\x03job\x18\n \x01(\x0b\x32+.google.cloud.storagebatchoperations.v1.JobB\x03\xe0\x41\x03\x32\xd3\x0b\n\x16StorageBatchOperations\x12\xb8\x01\n\x08ListJobs\x12\x37.google.cloud.storagebatchoperations.v1.ListJobsRequest\x1a\x38.google.cloud.storagebatchoperations.v1.ListJobsResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\x12\xa5\x01\n\x06GetJob\x12\x35.google.cloud.storagebatchoperations.v1.GetJobRequest\x1a+.google.cloud.storagebatchoperations.v1.Job\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\x12\xca\x01\n\tCreateJob\x12\x38.google.cloud.storagebatchoperations.v1.CreateJobRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41\x18\n\x03Job\x12\x11OperationMetadata\xda\x41\x11parent,job,job_id\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\x12\x96\x01\n\tDeleteJob\x12\x38.google.cloud.storagebatchoperations.v1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\x12\xc3\x01\n\tCancelJob\x12\x38.google.cloud.storagebatchoperations.v1.CancelJobRequest\x1a\x39.google.cloud.storagebatchoperations.v1.CancelJobResponse\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/jobs/*}:cancel:\x01*\x12\xef\x01\n\x14ListBucketOperations\x12\x43.google.cloud.storagebatchoperations.v1.ListBucketOperationsRequest\x1a\x44.google.cloud.storagebatchoperations.v1.ListBucketOperationsResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1/{parent=projects/*/locations/*/jobs/*}/bucketOperations\x12\xdc\x01\n\x12GetBucketOperation\x12\x41.google.cloud.storagebatchoperations.v1.GetBucketOperationRequest\x1a\x37.google.cloud.storagebatchoperations.v1.BucketOperation\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1/{name=projects/*/locations/*/jobs/*/bucketOperations/*}\x1aY\xca\x41%storagebatchoperations.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xad\x02\n*com.google.cloud.storagebatchoperations.v1B\x1bStorageBatchOperationsProtoP\x01Zbcloud.google.com/go/storagebatchoperations/apiv1/storagebatchoperationspb;storagebatchoperationspb\xaa\x02&Google.Cloud.StorageBatchOperations.V1\xca\x02&Google\\Cloud\\StorageBatchOperations\\V1\xea\x02)Google::Cloud::StorageBatchOperations::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module StorageBatchOperations - module V1 - ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ListJobsRequest").msgclass - ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ListJobsResponse").msgclass - GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.GetJobRequest").msgclass - CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.CreateJobRequest").msgclass - CancelJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.CancelJobRequest").msgclass - DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.DeleteJobRequest").msgclass - CancelJobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.CancelJobResponse").msgclass - ListBucketOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ListBucketOperationsRequest").msgclass - ListBucketOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ListBucketOperationsResponse").msgclass - GetBucketOperationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.GetBucketOperationRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.OperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb.rb deleted file mode 100644 index b07d550e4557..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/storagebatchoperations/v1/storage_batch_operations.proto for package 'Google.Cloud.StorageBatchOperations.V1' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/storagebatchoperations/v1/storage_batch_operations_pb' - -module Google - module Cloud - module StorageBatchOperations - module V1 - module StorageBatchOperations - # Storage Batch Operations offers a managed experience to perform batch - # operations on millions of Cloud Storage objects in a serverless fashion. With - # this service, you can automate and simplify large scale API operations - # performed on Cloud Storage objects. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.storagebatchoperations.v1.StorageBatchOperations' - - # Lists Jobs in a given project. - rpc :ListJobs, ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest, ::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse - # Gets a batch job. - rpc :GetJob, ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest, ::Google::Cloud::StorageBatchOperations::V1::Job - # Creates a batch job. - rpc :CreateJob, ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest, ::Google::Longrunning::Operation - # Deletes a batch job. - rpc :DeleteJob, ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest, ::Google::Protobuf::Empty - # Cancels a batch job. - rpc :CancelJob, ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest, ::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse - # Lists BucketOperations in a given project and job. - rpc :ListBucketOperations, ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest, ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse - # Gets a BucketOperation. - rpc :GetBucketOperation, ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest, ::Google::Cloud::StorageBatchOperations::V1::BucketOperation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb.rb deleted file mode 100644 index 294d3c88d373..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/lib/google/cloud/storagebatchoperations/v1/storage_batch_operations_types_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/code_pb' - - -descriptor_data = "\nKgoogle/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto\x12&google.cloud.storagebatchoperations.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15google/rpc/code.proto\"\xaa\n\n\x03Job\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\x12I\n\x0b\x62ucket_list\x18\x13 \x01(\x0b\x32\x32.google.cloud.storagebatchoperations.v1.BucketListH\x00\x12P\n\x0fput_object_hold\x18\x05 \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.PutObjectHoldH\x01\x12M\n\rdelete_object\x18\x06 \x01(\x0b\x32\x34.google.cloud.storagebatchoperations.v1.DeleteObjectH\x01\x12K\n\x0cput_metadata\x18\x08 \x01(\x0b\x32\x33.google.cloud.storagebatchoperations.v1.PutMetadataH\x01\x12O\n\x0erewrite_object\x18\x14 \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.RewriteObjectH\x01\x12i\n\x1cupdate_object_custom_context\x18\x17 \x01(\x0b\x32\x41.google.cloud.storagebatchoperations.v1.UpdateObjectCustomContextH\x01\x12R\n\x0elogging_config\x18\t \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.LoggingConfigB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rschedule_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rcomplete_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x08\x63ounters\x18\r \x01(\x0b\x32\x30.google.cloud.storagebatchoperations.v1.CountersB\x03\xe0\x41\x03\x12R\n\x0f\x65rror_summaries\x18\x0e \x03(\x0b\x32\x34.google.cloud.storagebatchoperations.v1.ErrorSummaryB\x03\xe0\x41\x03\x12\x45\n\x05state\x18\x0f \x01(\x0e\x32\x31.google.cloud.storagebatchoperations.v1.Job.StateB\x03\xe0\x41\x03\x12\x14\n\x07\x64ry_run\x18\x16 \x01(\x08\x42\x03\xe0\x41\x01\x12 \n\x13is_multi_bucket_job\x18\x18 \x01(\x08\x42\x03\xe0\x41\x03\"`\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\x0c\n\x08\x43\x41NCELED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\n\n\x06QUEUED\x10\x05:m\xea\x41j\n)storagebatchoperations.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}*\x04jobs2\x03jobB\x08\n\x06sourceB\x10\n\x0etransformation\"\xcc\n\n\x0f\x42ucketOperation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x13\n\x0b\x62ucket_name\x18\x02 \x01(\t\x12I\n\x0bprefix_list\x18\x03 \x01(\x0b\x32\x32.google.cloud.storagebatchoperations.v1.PrefixListH\x00\x12\x44\n\x08manifest\x18\x04 \x01(\x0b\x32\x30.google.cloud.storagebatchoperations.v1.ManifestH\x00\x12P\n\x0fput_object_hold\x18\x0b \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.PutObjectHoldH\x01\x12M\n\rdelete_object\x18\x0c \x01(\x0b\x32\x34.google.cloud.storagebatchoperations.v1.DeleteObjectH\x01\x12K\n\x0cput_metadata\x18\r \x01(\x0b\x32\x33.google.cloud.storagebatchoperations.v1.PutMetadataH\x01\x12O\n\x0erewrite_object\x18\x0e \x01(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.RewriteObjectH\x01\x12i\n\x1cupdate_object_custom_context\x18\x0f \x01(\x0b\x32\x41.google.cloud.storagebatchoperations.v1.UpdateObjectCustomContextH\x01\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rcomplete_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x08\x63ounters\x18\x08 \x01(\x0b\x32\x30.google.cloud.storagebatchoperations.v1.CountersB\x03\xe0\x41\x03\x12R\n\x0f\x65rror_summaries\x18\t \x03(\x0b\x32\x34.google.cloud.storagebatchoperations.v1.ErrorSummaryB\x03\xe0\x41\x03\x12Q\n\x05state\x18\n \x01(\x0e\x32=.google.cloud.storagebatchoperations.v1.BucketOperation.StateB\x03\xe0\x41\x03\"`\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0c\n\x08\x43\x41NCELED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05:\xb6\x01\xea\x41\xb2\x01\n5storagebatchoperations.googleapis.com/BucketOperation\x12Vprojects/{project}/locations/{location}/jobs/{job}/bucketOperations/{bucket_operation}*\x10\x62ucketoperations2\x0f\x62ucketOperationB\x16\n\x14object_configurationB\x10\n\x0etransformation\"\xa6\x02\n\nBucketList\x12O\n\x07\x62uckets\x18\x01 \x03(\x0b\x32\x39.google.cloud.storagebatchoperations.v1.BucketList.BucketB\x03\xe0\x41\x02\x1a\xc6\x01\n\x06\x42ucket\x12\x13\n\x06\x62ucket\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12I\n\x0bprefix_list\x18\x02 \x01(\x0b\x32\x32.google.cloud.storagebatchoperations.v1.PrefixListH\x00\x12\x44\n\x08manifest\x18\x03 \x01(\x0b\x32\x30.google.cloud.storagebatchoperations.v1.ManifestH\x00\x42\x16\n\x14object_configuration\"*\n\x08Manifest\x12\x1e\n\x11manifest_location\x18\x02 \x01(\tB\x03\xe0\x41\x02\"3\n\nPrefixList\x12%\n\x18included_object_prefixes\x18\x02 \x03(\tB\x03\xe0\x41\x01\"\x8e\x02\n\rPutObjectHold\x12]\n\x0etemporary_hold\x18\x01 \x01(\x0e\x32@.google.cloud.storagebatchoperations.v1.PutObjectHold.HoldStatusB\x03\xe0\x41\x02\x12_\n\x10\x65vent_based_hold\x18\x02 \x01(\x0e\x32@.google.cloud.storagebatchoperations.v1.PutObjectHold.HoldStatusB\x03\xe0\x41\x02\"=\n\nHoldStatus\x12\x1b\n\x17HOLD_STATUS_UNSPECIFIED\x10\x00\x12\x07\n\x03SET\x10\x01\x12\t\n\x05UNSET\x10\x02\">\n\x0c\x44\x65leteObject\x12.\n!permanent_object_deletion_enabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x02\"\\\n\rRewriteObject\x12?\n\x07kms_key\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\x00\x88\x01\x01\x42\n\n\x08_kms_key\"\x93\x02\n\x0fObjectRetention\x12#\n\x11retain_until_time\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12g\n\x0eretention_mode\x18\x02 \x01(\x0e\x32\x45.google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionModeB\x03\xe0\x41\x02H\x01\x88\x01\x01\"I\n\rRetentionMode\x12\x1e\n\x1aRETENTION_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x0c\n\x08UNLOCKED\x10\x02\x42\x14\n\x12_retain_until_timeB\x11\n\x0f_retention_mode\"\xe1\x04\n\x0bPutMetadata\x12%\n\x13\x63ontent_disposition\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\"\n\x10\x63ontent_encoding\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\"\n\x10\x63ontent_language\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1e\n\x0c\x63ontent_type\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x1f\n\rcache_control\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x1d\n\x0b\x63ustom_time\x18\x06 \x01(\tB\x03\xe0\x41\x01H\x05\x88\x01\x01\x12\x65\n\x0f\x63ustom_metadata\x18\x07 \x03(\x0b\x32G.google.cloud.storagebatchoperations.v1.PutMetadata.CustomMetadataEntryB\x03\xe0\x41\x01\x12[\n\x10object_retention\x18\x08 \x01(\x0b\x32\x37.google.cloud.storagebatchoperations.v1.ObjectRetentionB\x03\xe0\x41\x01H\x06\x88\x01\x01\x1a\x35\n\x13\x43ustomMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14_content_dispositionB\x13\n\x11_content_encodingB\x13\n\x11_content_languageB\x0f\n\r_content_typeB\x10\n\x0e_cache_controlB\x0e\n\x0c_custom_timeB\x13\n\x11_object_retention\":\n\x1aObjectCustomContextPayload\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value\"\x87\x02\n\x14\x43ustomContextUpdates\x12_\n\x07updates\x18\x01 \x03(\x0b\x32I.google.cloud.storagebatchoperations.v1.CustomContextUpdates.UpdatesEntryB\x03\xe0\x41\x01\x12\x1a\n\rkeys_to_clear\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1ar\n\x0cUpdatesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12Q\n\x05value\x18\x02 \x01(\x0b\x32\x42.google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload:\x02\x38\x01\"\x9a\x01\n\x19UpdateObjectCustomContext\x12^\n\x16\x63ustom_context_updates\x18\x01 \x01(\x0b\x32<.google.cloud.storagebatchoperations.v1.CustomContextUpdatesH\x00\x12\x13\n\tclear_all\x18\x02 \x01(\x08H\x00\x42\x08\n\x06\x61\x63tion\"\xaa\x01\n\x0c\x45rrorSummary\x12)\n\nerror_code\x18\x01 \x01(\x0e\x32\x10.google.rpc.CodeB\x03\xe0\x41\x02\x12\x18\n\x0b\x65rror_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02\x12U\n\x11\x65rror_log_entries\x18\x03 \x03(\x0b\x32\x35.google.cloud.storagebatchoperations.v1.ErrorLogEntryB\x03\xe0\x41\x02\"J\n\rErrorLogEntry\x12\x1a\n\nobject_uri\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x03\x12\x1d\n\rerror_details\x18\x03 \x03(\tB\x06\xe0\x41\x01\xe0\x41\x03\"\xad\x01\n\x08\x43ounters\x12\x1f\n\x12total_object_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12#\n\x16succeeded_object_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12 \n\x13\x66\x61iled_object_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12#\n\x11total_bytes_found\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x14\n\x12_total_bytes_found\"\xf5\x02\n\rLoggingConfig\x12^\n\x0blog_actions\x18\x01 \x03(\x0e\x32\x44.google.cloud.storagebatchoperations.v1.LoggingConfig.LoggableActionB\x03\xe0\x41\x02\x12i\n\x11log_action_states\x18\x02 \x03(\x0e\x32I.google.cloud.storagebatchoperations.v1.LoggingConfig.LoggableActionStateB\x03\xe0\x41\x02\"@\n\x0eLoggableAction\x12\x1f\n\x1bLOGGABLE_ACTION_UNSPECIFIED\x10\x00\x12\r\n\tTRANSFORM\x10\x06\"W\n\x13LoggableActionState\x12%\n!LOGGABLE_ACTION_STATE_UNSPECIFIED\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\xad\x03\n*com.google.cloud.storagebatchoperations.v1B StorageBatchOperationsTypesProtoP\x01Zbcloud.google.com/go/storagebatchoperations/apiv1/storagebatchoperationspb;storagebatchoperationspb\xaa\x02&Google.Cloud.StorageBatchOperations.V1\xca\x02&Google\\Cloud\\StorageBatchOperations\\V1\xea\x02)Google::Cloud::StorageBatchOperations::V1\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module StorageBatchOperations - module V1 - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.Job").msgclass - Job::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.Job.State").enummodule - BucketOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.BucketOperation").msgclass - BucketOperation::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.BucketOperation.State").enummodule - BucketList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.BucketList").msgclass - BucketList::Bucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.BucketList.Bucket").msgclass - Manifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.Manifest").msgclass - PrefixList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.PrefixList").msgclass - PutObjectHold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.PutObjectHold").msgclass - PutObjectHold::HoldStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.PutObjectHold.HoldStatus").enummodule - DeleteObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.DeleteObject").msgclass - RewriteObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.RewriteObject").msgclass - ObjectRetention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ObjectRetention").msgclass - ObjectRetention::RetentionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionMode").enummodule - PutMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.PutMetadata").msgclass - ObjectCustomContextPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ObjectCustomContextPayload").msgclass - CustomContextUpdates = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.CustomContextUpdates").msgclass - UpdateObjectCustomContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.UpdateObjectCustomContext").msgclass - ErrorSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ErrorSummary").msgclass - ErrorLogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.ErrorLogEntry").msgclass - Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.Counters").msgclass - LoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.LoggingConfig").msgclass - LoggingConfig::LoggableAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.LoggingConfig.LoggableAction").enummodule - LoggingConfig::LoggableActionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storagebatchoperations.v1.LoggingConfig.LoggableActionState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/README.md deleted file mode 100644 index 34ba034c9ae3..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Storage Batch Operations 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-storage_batch_operations-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations.rb deleted file mode 100644 index d1886164a29b..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations.rb +++ /dev/null @@ -1,221 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module StorageBatchOperations - module V1 - # Message for request to list Jobs - # @!attribute [rw] parent - # @return [::String] - # Required. Format: projects/\\{project_id}/locations/global. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filters results as defined by https://google.aip.dev/160. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The list page size. default page size is 100. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The list page token. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Field to sort by. Supported fields are name, create_time. - class ListJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Jobs - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::Job>] - # A list of storage batch jobs. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Job - # @!attribute [rw] name - # @return [::String] - # Required. `name` of the job to retrieve. - # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . - class GetJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Job - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] job_id - # @return [::String] - # Required. The optional `job_id` for this Job . If not - # specified, an id is generated. `job_id` should be no more than 128 - # characters and must include only characters available in DNS names, as - # defined by RFC-1123. - # @!attribute [rw] job - # @return [::Google::Cloud::StorageBatchOperations::V1::Job] - # Required. The resource being created - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID in case you need to retry your request. Requests with same - # `request_id` will be ignored for at least 60 minutes since the first - # request. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - class CreateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for Job to Cancel - # @!attribute [rw] name - # @return [::String] - # Required. The `name` of the job to cancel. - # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID in case you need to retry your request. Requests with same - # `request_id` will be ignored for at least 60 minutes since the first - # request. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - class CancelJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Job - # @!attribute [rw] name - # @return [::String] - # Required. The `name` of the job to delete. - # Format: projects/\\{project_id}/locations/global/jobs/\\{job_id} . - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID in case you need to retry your request. Requests with same - # `request_id` will be ignored for at least 60 minutes since the first - # 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 bucket operations of the job will also - # be deleted. Highly recommended to be set to true by all clients. Users - # cannot mutate bucket operations directly, so only the jobs.delete - # permission is required to delete a job (and its child bucket operations). - class DeleteJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to cancel Job. - class CancelJobResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for request to list BucketOperations - # @!attribute [rw] parent - # @return [::String] - # Required. Format: projects/\\{project_id}/locations/global/jobs/\\{job_id}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filters results as defined by https://google.aip.dev/160. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The list page size. Default page size is 100. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The list page token. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Field to sort by. Supported fields are name, create_time. - class ListBucketOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing BucketOperations - # @!attribute [rw] bucket_operations - # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::BucketOperation>] - # A list of storage batch bucket operations. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListBucketOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a BucketOperation. - # @!attribute [rw] name - # @return [::String] - # Required. `name` of the bucket operation to retrieve. - # Format: - # projects/\\{project_id}/locations/global/jobs/\\{job_id}/bucketOperations/\\{bucket_operation_id}. - class GetBucketOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] operation - # @return [::String] - # Output only. The unique operation resource name. - # Format: projects/\\{project}/locations/global/operations/\\{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] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have been cancelled successfully - # have - # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} - # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to - # `[Code.CANCELLED][google.rpc.Code.CANCELLED]`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - # @!attribute [r] job - # @return [::Google::Cloud::StorageBatchOperations::V1::Job] - # Output only. The Job associated with 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-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations_types.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations_types.rb deleted file mode 100644 index a1664bfd40c2..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/cloud/storagebatchoperations/v1/storage_batch_operations_types.rb +++ /dev/null @@ -1,564 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module StorageBatchOperations - module V1 - # The Storage Batch Operations Job description. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the Job. job_id is unique - # within the project, that is either set by the customer or - # defined by the service. Format: - # projects/\\{project}/locations/global/jobs/\\{job_id} . - # For example: "projects/123456/locations/global/jobs/job01". - # @!attribute [rw] description - # @return [::String] - # Optional. A description provided by the user for the job. Its max length is - # 1024 bytes when Unicode-encoded. - # @!attribute [rw] bucket_list - # @return [::Google::Cloud::StorageBatchOperations::V1::BucketList] - # Specifies a list of buckets and their objects to be transformed. - # @!attribute [rw] put_object_hold - # @return [::Google::Cloud::StorageBatchOperations::V1::PutObjectHold] - # Changes object hold status. - # - # Note: The following fields are mutually exclusive: `put_object_hold`, `delete_object`, `put_metadata`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_object - # @return [::Google::Cloud::StorageBatchOperations::V1::DeleteObject] - # Delete objects. - # - # Note: The following fields are mutually exclusive: `delete_object`, `put_object_hold`, `put_metadata`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] put_metadata - # @return [::Google::Cloud::StorageBatchOperations::V1::PutMetadata] - # Updates object metadata. Allows updating fixed-key and custom metadata - # and fixed-key metadata i.e. Cache-Control, Content-Disposition, - # Content-Encoding, Content-Language, Content-Type, Custom-Time. - # - # Note: The following fields are mutually exclusive: `put_metadata`, `put_object_hold`, `delete_object`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] rewrite_object - # @return [::Google::Cloud::StorageBatchOperations::V1::RewriteObject] - # Rewrite the object and updates metadata like KMS key. - # - # Note: The following fields are mutually exclusive: `rewrite_object`, `put_object_hold`, `delete_object`, `put_metadata`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_object_custom_context - # @return [::Google::Cloud::StorageBatchOperations::V1::UpdateObjectCustomContext] - # Update object custom context. - # - # Note: The following fields are mutually exclusive: `update_object_custom_context`, `put_object_hold`, `delete_object`, `put_metadata`, `rewrite_object`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::StorageBatchOperations::V1::LoggingConfig] - # Optional. Logging configuration. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the job was created. - # @!attribute [r] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the job was scheduled. - # @!attribute [r] complete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the job was completed. - # @!attribute [r] counters - # @return [::Google::Cloud::StorageBatchOperations::V1::Counters] - # Output only. Information about the progress of the job. - # @!attribute [r] error_summaries - # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::ErrorSummary>] - # Output only. Summarizes errors encountered with sample error log entries. - # @!attribute [r] state - # @return [::Google::Cloud::StorageBatchOperations::V1::Job::State] - # Output only. State of the job. - # @!attribute [rw] dry_run - # @return [::Boolean] - # Optional. If true, the job will run in dry run mode, returning the total - # object count and, if the object configuration is a prefix list, the bytes - # found from source. No transformations will be performed. - # @!attribute [r] is_multi_bucket_job - # @return [::Boolean] - # Output only. If true, this Job operates on multiple buckets. Multibucket - # jobs are subject to different quota limits than single-bucket jobs. - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes state of a job. - module State - # Default value. This value is unused. - STATE_UNSPECIFIED = 0 - - # In progress. - RUNNING = 1 - - # Completed successfully. - SUCCEEDED = 2 - - # Cancelled by the user. - CANCELED = 3 - - # Terminated due to an unrecoverable failure. - FAILED = 4 - - # Queued but not yet started. - QUEUED = 5 - end - end - - # BucketOperation represents a bucket-level breakdown of a Job. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the BucketOperation. This is defined by - # the service. Format: - # projects/\\{project}/locations/global/jobs/\\{job_id}/bucketOperations/\\{bucket_operation}. - # @!attribute [rw] bucket_name - # @return [::String] - # The bucket name of the objects to be transformed in the BucketOperation. - # @!attribute [rw] prefix_list - # @return [::Google::Cloud::StorageBatchOperations::V1::PrefixList] - # Specifies objects matching a prefix set. - # - # Note: The following fields are mutually exclusive: `prefix_list`, `manifest`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] manifest - # @return [::Google::Cloud::StorageBatchOperations::V1::Manifest] - # Specifies objects in a manifest file. - # - # Note: The following fields are mutually exclusive: `manifest`, `prefix_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] put_object_hold - # @return [::Google::Cloud::StorageBatchOperations::V1::PutObjectHold] - # Changes object hold status. - # - # Note: The following fields are mutually exclusive: `put_object_hold`, `delete_object`, `put_metadata`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_object - # @return [::Google::Cloud::StorageBatchOperations::V1::DeleteObject] - # Delete objects. - # - # Note: The following fields are mutually exclusive: `delete_object`, `put_object_hold`, `put_metadata`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] put_metadata - # @return [::Google::Cloud::StorageBatchOperations::V1::PutMetadata] - # Updates object metadata. Allows updating fixed-key and custom metadata - # and fixed-key metadata i.e. Cache-Control, Content-Disposition, - # Content-Encoding, Content-Language, Content-Type, Custom-Time. - # - # Note: The following fields are mutually exclusive: `put_metadata`, `put_object_hold`, `delete_object`, `rewrite_object`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] rewrite_object - # @return [::Google::Cloud::StorageBatchOperations::V1::RewriteObject] - # Rewrite the object and updates metadata like KMS key. - # - # Note: The following fields are mutually exclusive: `rewrite_object`, `put_object_hold`, `delete_object`, `put_metadata`, `update_object_custom_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_object_custom_context - # @return [::Google::Cloud::StorageBatchOperations::V1::UpdateObjectCustomContext] - # Update object custom context. - # - # Note: The following fields are mutually exclusive: `update_object_custom_context`, `put_object_hold`, `delete_object`, `put_metadata`, `rewrite_object`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the BucketOperation was created. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the BucketOperation was started. - # @!attribute [r] complete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the BucketOperation was completed. - # @!attribute [r] counters - # @return [::Google::Cloud::StorageBatchOperations::V1::Counters] - # Output only. Information about the progress of the bucket operation. - # @!attribute [r] error_summaries - # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::ErrorSummary>] - # Output only. Summarizes errors encountered with sample error log entries. - # @!attribute [r] state - # @return [::Google::Cloud::StorageBatchOperations::V1::BucketOperation::State] - # Output only. State of the BucketOperation. - class BucketOperation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes state of the BucketOperation. - module State - # Default value. This value is unused. - STATE_UNSPECIFIED = 0 - - # Created but not yet started. - QUEUED = 1 - - # In progress. - RUNNING = 2 - - # Completed successfully. - SUCCEEDED = 3 - - # Cancelled by the user. - CANCELED = 4 - - # Terminated due to an unrecoverable failure. - FAILED = 5 - end - end - - # Describes list of buckets and their objects to be transformed. - # @!attribute [rw] buckets - # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::BucketList::Bucket>] - # Required. List of buckets and their objects to be transformed. Currently, - # only one bucket configuration is supported. If multiple buckets are - # specified, an error will be returned. - class BucketList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes configuration of a single bucket and its objects to be - # transformed. - # @!attribute [rw] bucket - # @return [::String] - # Required. Bucket name for the objects to be transformed. - # @!attribute [rw] prefix_list - # @return [::Google::Cloud::StorageBatchOperations::V1::PrefixList] - # Specifies objects matching a prefix set. - # - # Note: The following fields are mutually exclusive: `prefix_list`, `manifest`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] manifest - # @return [::Google::Cloud::StorageBatchOperations::V1::Manifest] - # Specifies objects in a manifest file. - # - # Note: The following fields are mutually exclusive: `manifest`, `prefix_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Bucket - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes list of objects to be transformed. - # @!attribute [rw] manifest_location - # @return [::String] - # Required. `manifest_location` must contain the manifest source file that is - # a CSV file in a Google Cloud Storage bucket. Each row in the file must - # include the object details i.e. BucketId and Name. Generation may - # optionally be specified. When it is not specified the live object is acted - # upon. `manifest_location` should either be 1) An absolute path to the - # object in the format of `gs://bucket_name/path/file_name.csv`. 2) An - # absolute path with a single wildcard character in the file name, for - # example `gs://bucket_name/path/file_name*.csv`. - # If manifest location is specified with a wildcard, objects in all manifest - # files matching the pattern will be acted upon. - class Manifest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes prefixes of objects to be transformed. - # @!attribute [rw] included_object_prefixes - # @return [::Array<::String>] - # Optional. Include prefixes of the objects to be transformed. - # * Supports full object name - # * Supports prefix of the object name - # * Wildcards are not supported - # * Supports empty string for all objects in a bucket. - class PrefixList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes options to update object hold. - # @!attribute [rw] temporary_hold - # @return [::Google::Cloud::StorageBatchOperations::V1::PutObjectHold::HoldStatus] - # Required. Updates object temporary holds state. When object temporary hold - # is set, object cannot be deleted or replaced. - # @!attribute [rw] event_based_hold - # @return [::Google::Cloud::StorageBatchOperations::V1::PutObjectHold::HoldStatus] - # Required. Updates object event based holds state. When object event based - # hold is set, object cannot be deleted or replaced. Resets object's time in - # the bucket for the purposes of the retention period. - class PutObjectHold - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the status of the hold. - module HoldStatus - # Default value, Object hold status will not be changed. - HOLD_STATUS_UNSPECIFIED = 0 - - # Places the hold. - SET = 1 - - # Releases the hold. - UNSET = 2 - end - end - - # Describes options to delete an object. - # @!attribute [rw] permanent_object_deletion_enabled - # @return [::Boolean] - # Required. Controls deletion behavior when versioning is enabled for the - # object's bucket. If true both live and noncurrent objects will be - # permanently deleted. Otherwise live objects in versioned buckets will - # become noncurrent and objects that were already noncurrent will be skipped. - # This setting doesn't have any impact on the Soft Delete feature. All - # objects deleted by this service can be be restored for the duration of the - # Soft Delete retention duration if enabled. If enabled and the manifest - # doesn't specify an object's generation, a GetObjectMetadata call (a Class B - # operation) will be made to determine the live object generation. - class DeleteObject - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes options for object rewrite. - # @!attribute [rw] kms_key - # @return [::String] - # Required. Resource name of the Cloud KMS key that will be used to encrypt - # the object. The Cloud KMS key must be located in same location as the - # object. Refer to - # https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key - # for additional documentation. Format: - # projects/\\{project}/locations/\\{location}/keyRings/\\{keyring}/cryptoKeys/\\{key} - # For example: - # "projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key". - # The object will be rewritten and set with the specified KMS key. - class RewriteObject - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes options for object retention update. - # @!attribute [rw] retain_until_time - # @return [::String] - # Required. The time when the object will be retained until. UNSET will clear - # the retention. Must be specified in RFC 3339 format e.g. - # YYYY-MM-DD'T'HH:MM:SS.SS'Z' or YYYY-MM-DD'T'HH:MM:SS'Z'. - # @!attribute [rw] retention_mode - # @return [::Google::Cloud::StorageBatchOperations::V1::ObjectRetention::RetentionMode] - # Required. The retention mode of the object. - class ObjectRetention - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the retention mode. - module RetentionMode - # If set and retain_until_time is empty, clears the retention. - RETENTION_MODE_UNSPECIFIED = 0 - - # Sets the retention mode to locked. - LOCKED = 1 - - # Sets the retention mode to unlocked. - UNLOCKED = 2 - end - end - - # Describes options for object metadata update. - # @!attribute [rw] content_disposition - # @return [::String] - # Optional. Updates objects Content-Disposition fixed metadata. Unset values - # will be ignored. Set empty values to clear the metadata. Refer - # https://cloud.google.com/storage/docs/metadata#content-disposition for - # additional documentation. - # @!attribute [rw] content_encoding - # @return [::String] - # Optional. Updates objects Content-Encoding fixed metadata. Unset values - # will be ignored. Set empty values to clear the metadata. Refer to - # documentation in - # https://cloud.google.com/storage/docs/metadata#content-encoding. - # @!attribute [rw] content_language - # @return [::String] - # Optional. Updates objects Content-Language fixed metadata. Refer to ISO - # 639-1 language codes for typical values of this metadata. Max length 100 - # characters. Unset values will be ignored. Set empty values to clear the - # metadata. Refer to documentation in - # https://cloud.google.com/storage/docs/metadata#content-language. - # @!attribute [rw] content_type - # @return [::String] - # Optional. Updates objects Content-Type fixed metadata. Unset values will be - # ignored. Set empty values to clear the metadata. Refer to documentation in - # https://cloud.google.com/storage/docs/metadata#content-type - # @!attribute [rw] cache_control - # @return [::String] - # Optional. Updates objects Cache-Control fixed metadata. Unset values will - # be ignored. Set empty values to clear the metadata. Additionally, the value - # for Custom-Time cannot decrease. Refer to documentation in - # https://cloud.google.com/storage/docs/metadata#caching_data. - # @!attribute [rw] custom_time - # @return [::String] - # Optional. Updates objects Custom-Time fixed metadata. Unset values will be - # ignored. Set empty values to clear the metadata. Refer to documentation in - # https://cloud.google.com/storage/docs/metadata#custom-time. - # @!attribute [rw] custom_metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Updates objects custom metadata. Adds or sets individual custom - # metadata key value pairs on objects. Keys that are set with empty custom - # metadata values will have its value cleared. Existing custom metadata not - # specified with this flag is not changed. Refer to documentation in - # https://cloud.google.com/storage/docs/metadata#custom-metadata - # @!attribute [rw] object_retention - # @return [::Google::Cloud::StorageBatchOperations::V1::ObjectRetention] - # Optional. Updates objects retention lock configuration. Unset values will - # be ignored. Set empty values to clear the retention for the object with - # existing `Unlocked` retention mode. Object with existing `Locked` retention - # mode cannot be cleared or reduce retain_until_time. Refer to documentation - # in https://cloud.google.com/storage/docs/object-lock - class PutMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class CustomMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the payload of a user defined object custom context. - # @!attribute [rw] value - # @return [::String] - # The value of the object custom context. - # If set, `value` must NOT be an empty string since it is a required field in - # custom context. If unset, `value` will be ignored and no changes will be - # made to the `value` field of the custom context payload. - class ObjectCustomContextPayload - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes a collection of updates to apply to custom contexts identified - # by key. - # @!attribute [rw] updates - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::StorageBatchOperations::V1::ObjectCustomContextPayload}] - # Optional. Insert or update the existing custom contexts. - # @!attribute [rw] keys_to_clear - # @return [::Array<::String>] - # Optional. Custom contexts to clear by key. - # A key cannot be present in both `updates` and `keys_to_clear`. - class CustomContextUpdates - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::StorageBatchOperations::V1::ObjectCustomContextPayload] - class UpdatesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes options to update object custom contexts. - # @!attribute [rw] custom_context_updates - # @return [::Google::Cloud::StorageBatchOperations::V1::CustomContextUpdates] - # A collection of updates to apply to specific custom contexts. - # Use this to add, update or delete individual contexts by key. - # - # Note: The following fields are mutually exclusive: `custom_context_updates`, `clear_all`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] clear_all - # @return [::Boolean] - # If set, must be set to true and all existing object custom contexts will - # be deleted. - # - # Note: The following fields are mutually exclusive: `clear_all`, `custom_context_updates`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class UpdateObjectCustomContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A summary of errors by error code, plus a count and sample error log - # entries. - # @!attribute [rw] error_code - # @return [::Google::Rpc::Code] - # Required. The canonical error code. - # @!attribute [rw] error_count - # @return [::Integer] - # Required. Number of errors encountered per `error_code`. - # @!attribute [rw] error_log_entries - # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::ErrorLogEntry>] - # Required. Sample error logs. - class ErrorSummary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An entry describing an error that has occurred. - # @!attribute [r] object_uri - # @return [::String] - # Required. Output only. Object URL. e.g. gs://my_bucket/object.txt - # @!attribute [r] error_details - # @return [::Array<::String>] - # Optional. Output only. At most 5 error log entries are recorded for a given - # error code for a job. - class ErrorLogEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes details about the progress of the job. - # @!attribute [r] total_object_count - # @return [::Integer] - # Output only. Number of objects listed. - # @!attribute [r] succeeded_object_count - # @return [::Integer] - # Output only. Number of objects completed. - # @!attribute [r] failed_object_count - # @return [::Integer] - # Output only. Number of objects failed. - # @!attribute [r] total_bytes_found - # @return [::Integer] - # Output only. Number of bytes found from source. This field is only - # populated for jobs with a prefix list object configuration. - class Counters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the Cloud Logging behavior. - # @!attribute [rw] log_actions - # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::LoggingConfig::LoggableAction>] - # Required. Specifies the actions to be logged. - # @!attribute [rw] log_action_states - # @return [::Array<::Google::Cloud::StorageBatchOperations::V1::LoggingConfig::LoggableActionState>] - # Required. States in which Action are logged.If empty, no logs are - # generated. - class LoggingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Loggable actions types. - module LoggableAction - # Illegal value, to avoid allowing a default. - LOGGABLE_ACTION_UNSPECIFIED = 0 - - # The corresponding transform action in this job. - TRANSFORM = 6 - end - - # Loggable action states filter. - module LoggableActionState - # Illegal value, to avoid allowing a default. - LOGGABLE_ACTION_STATE_UNSPECIFIED = 0 - - # `LoggableAction` completed successfully. `SUCCEEDED` actions are - # logged as [INFO][google.logging.type.LogSeverity.INFO]. - SUCCEEDED = 1 - - # `LoggableAction` terminated in an error state. `FAILED` actions - # are logged as [ERROR][google.logging.type.LogSeverity.ERROR]. - FAILED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/proto_docs/google/rpc/code.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/code.rb deleted file mode 100644 index 8cf36e815510..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/code.rb +++ /dev/null @@ -1,185 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The canonical error codes for gRPC APIs. - # - # - # Sometimes multiple error codes may apply. Services should return - # the most specific error code that applies. For example, prefer - # `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. - # Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. - module Code - # Not an error; returned on success. - # - # HTTP Mapping: 200 OK - OK = 0 - - # The operation was cancelled, typically by the caller. - # - # HTTP Mapping: 499 Client Closed Request - CANCELLED = 1 - - # Unknown error. For example, this error may be returned when - # a `Status` value received from another address space belongs to - # an error space that is not known in this address space. Also - # errors raised by APIs that do not return enough error information - # may be converted to this error. - # - # HTTP Mapping: 500 Internal Server Error - UNKNOWN = 2 - - # The client specified an invalid argument. Note that this differs - # from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments - # that are problematic regardless of the state of the system - # (e.g., a malformed file name). - # - # HTTP Mapping: 400 Bad Request - INVALID_ARGUMENT = 3 - - # The deadline expired before the operation could complete. For operations - # that change the state of the system, this error may be returned - # even if the operation has completed successfully. For example, a - # successful response from a server could have been delayed long - # enough for the deadline to expire. - # - # HTTP Mapping: 504 Gateway Timeout - DEADLINE_EXCEEDED = 4 - - # Some requested entity (e.g., file or directory) was not found. - # - # Note to server developers: if a request is denied for an entire class - # of users, such as gradual feature rollout or undocumented allowlist, - # `NOT_FOUND` may be used. If a request is denied for some users within - # a class of users, such as user-based access control, `PERMISSION_DENIED` - # must be used. - # - # HTTP Mapping: 404 Not Found - NOT_FOUND = 5 - - # The entity that a client attempted to create (e.g., file or directory) - # already exists. - # - # HTTP Mapping: 409 Conflict - ALREADY_EXISTS = 6 - - # The caller does not have permission to execute the specified - # operation. `PERMISSION_DENIED` must not be used for rejections - # caused by exhausting some resource (use `RESOURCE_EXHAUSTED` - # instead for those errors). `PERMISSION_DENIED` must not be - # used if the caller can not be identified (use `UNAUTHENTICATED` - # instead for those errors). This error code does not imply the - # request is valid or the requested entity exists or satisfies - # other pre-conditions. - # - # HTTP Mapping: 403 Forbidden - PERMISSION_DENIED = 7 - - # The request does not have valid authentication credentials for the - # operation. - # - # HTTP Mapping: 401 Unauthorized - UNAUTHENTICATED = 16 - - # Some resource has been exhausted, perhaps a per-user quota, or - # perhaps the entire file system is out of space. - # - # HTTP Mapping: 429 Too Many Requests - RESOURCE_EXHAUSTED = 8 - - # The operation was rejected because the system is not in a state - # required for the operation's execution. For example, the directory - # to be deleted is non-empty, an rmdir operation is applied to - # a non-directory, etc. - # - # Service implementors can use the following guidelines to decide - # between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: - # (a) Use `UNAVAILABLE` if the client can retry just the failing call. - # (b) Use `ABORTED` if the client should retry at a higher level. For - # example, when a client-specified test-and-set fails, indicating the - # client should restart a read-modify-write sequence. - # (c) Use `FAILED_PRECONDITION` if the client should not retry until - # the system state has been explicitly fixed. For example, if an "rmdir" - # fails because the directory is non-empty, `FAILED_PRECONDITION` - # should be returned since the client should not retry unless - # the files are deleted from the directory. - # - # HTTP Mapping: 400 Bad Request - FAILED_PRECONDITION = 9 - - # The operation was aborted, typically due to a concurrency issue such as - # a sequencer check failure or transaction abort. - # - # See the guidelines above for deciding between `FAILED_PRECONDITION`, - # `ABORTED`, and `UNAVAILABLE`. - # - # HTTP Mapping: 409 Conflict - ABORTED = 10 - - # The operation was attempted past the valid range. E.g., seeking or - # reading past end-of-file. - # - # Unlike `INVALID_ARGUMENT`, this error indicates a problem that may - # be fixed if the system state changes. For example, a 32-bit file - # system will generate `INVALID_ARGUMENT` if asked to read at an - # offset that is not in the range [0,2^32-1], but it will generate - # `OUT_OF_RANGE` if asked to read from an offset past the current - # file size. - # - # There is a fair bit of overlap between `FAILED_PRECONDITION` and - # `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific - # error) when it applies so that callers who are iterating through - # a space can easily look for an `OUT_OF_RANGE` error to detect when - # they are done. - # - # HTTP Mapping: 400 Bad Request - OUT_OF_RANGE = 11 - - # The operation is not implemented or is not supported/enabled in this - # service. - # - # HTTP Mapping: 501 Not Implemented - UNIMPLEMENTED = 12 - - # Internal errors. This means that some invariants expected by the - # underlying system have been broken. This error code is reserved - # for serious errors. - # - # HTTP Mapping: 500 Internal Server Error - INTERNAL = 13 - - # The service is currently unavailable. This is most likely a - # transient condition, which can be corrected by retrying with - # a backoff. Note that it is not always safe to retry - # non-idempotent operations. - # - # See the guidelines above for deciding between `FAILED_PRECONDITION`, - # `ABORTED`, and `UNAVAILABLE`. - # - # HTTP Mapping: 503 Service Unavailable - UNAVAILABLE = 14 - - # Unrecoverable data loss or corruption. - # - # HTTP Mapping: 500 Internal Server Error - DATA_LOSS = 15 - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index 3c630675d70b..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/Gemfile deleted file mode 100644 index a750851dbe31..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-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-storage_batch_operations-v1", path: "../" -else - gem "google-cloud-storage_batch_operations-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-storage_batch_operations-v1/snippets/snippet_metadata_google.cloud.storagebatchoperations.v1.json b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/snippet_metadata_google.cloud.storagebatchoperations.v1.json deleted file mode 100644 index abb4b821bbd5..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/snippet_metadata_google.cloud.storagebatchoperations.v1.json +++ /dev/null @@ -1,295 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-storage_batch_operations-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.storagebatchoperations.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_ListJobs_sync", - "title": "Snippet for the list_jobs call in the StorageBatchOperations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_jobs.", - "file": "storage_batch_operations/list_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_jobs", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse", - "client": { - "short_name": "StorageBatchOperations::Client", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" - }, - "method": { - "short_name": "ListJobs", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.ListJobs", - "service": { - "short_name": "StorageBatchOperations", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_GetJob_sync", - "title": "Snippet for the get_job call in the StorageBatchOperations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_job.", - "file": "storage_batch_operations/get_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_job", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageBatchOperations::V1::GetJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageBatchOperations::V1::Job", - "client": { - "short_name": "StorageBatchOperations::Client", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" - }, - "method": { - "short_name": "GetJob", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.GetJob", - "service": { - "short_name": "StorageBatchOperations", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_CreateJob_sync", - "title": "Snippet for the create_job call in the StorageBatchOperations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#create_job.", - "file": "storage_batch_operations/create_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_job", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#create_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageBatchOperations::Client", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" - }, - "method": { - "short_name": "CreateJob", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.CreateJob", - "service": { - "short_name": "StorageBatchOperations", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_DeleteJob_sync", - "title": "Snippet for the delete_job call in the StorageBatchOperations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#delete_job.", - "file": "storage_batch_operations/delete_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_job", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#delete_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageBatchOperations::Client", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" - }, - "method": { - "short_name": "DeleteJob", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.DeleteJob", - "service": { - "short_name": "StorageBatchOperations", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_CancelJob_sync", - "title": "Snippet for the cancel_job call in the StorageBatchOperations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#cancel_job.", - "file": "storage_batch_operations/cancel_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "cancel_job", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#cancel_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse", - "client": { - "short_name": "StorageBatchOperations::Client", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" - }, - "method": { - "short_name": "CancelJob", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.CancelJob", - "service": { - "short_name": "StorageBatchOperations", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_ListBucketOperations_sync", - "title": "Snippet for the list_bucket_operations call in the StorageBatchOperations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_bucket_operations.", - "file": "storage_batch_operations/list_bucket_operations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_bucket_operations", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_bucket_operations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse", - "client": { - "short_name": "StorageBatchOperations::Client", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" - }, - "method": { - "short_name": "ListBucketOperations", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.ListBucketOperations", - "service": { - "short_name": "StorageBatchOperations", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagebatchoperations_v1_generated_StorageBatchOperations_GetBucketOperation_sync", - "title": "Snippet for the get_bucket_operation call in the StorageBatchOperations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_bucket_operation.", - "file": "storage_batch_operations/get_bucket_operation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_bucket_operation", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_bucket_operation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageBatchOperations::V1::BucketOperation", - "client": { - "short_name": "StorageBatchOperations::Client", - "full_name": "::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client" - }, - "method": { - "short_name": "GetBucketOperation", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations.GetBucketOperation", - "service": { - "short_name": "StorageBatchOperations", - "full_name": "google.cloud.storagebatchoperations.v1.StorageBatchOperations" - } - } - }, - "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-storage_batch_operations-v1/snippets/storage_batch_operations/cancel_job.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/cancel_job.rb deleted file mode 100644 index 59df23ff21d3..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/cancel_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagebatchoperations_v1_generated_StorageBatchOperations_CancelJob_sync] -require "google/cloud/storage_batch_operations/v1" - -## -# Snippet for the cancel_job call in the StorageBatchOperations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#cancel_job. -# -def cancel_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new - - # Call the cancel_job method. - result = client.cancel_job request - - # The returned object is of type Google::Cloud::StorageBatchOperations::V1::CancelJobResponse. - p result -end -# [END storagebatchoperations_v1_generated_StorageBatchOperations_CancelJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/create_job.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/create_job.rb deleted file mode 100644 index 8ae0dfd2ef7b..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/create_job.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagebatchoperations_v1_generated_StorageBatchOperations_CreateJob_sync] -require "google/cloud/storage_batch_operations/v1" - -## -# Snippet for the create_job call in the StorageBatchOperations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#create_job. -# -def create_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new - - # Call the create_job method. - result = client.create_job request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storagebatchoperations_v1_generated_StorageBatchOperations_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/delete_job.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/delete_job.rb deleted file mode 100644 index 1693866aa9ec..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/delete_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagebatchoperations_v1_generated_StorageBatchOperations_DeleteJob_sync] -require "google/cloud/storage_batch_operations/v1" - -## -# Snippet for the delete_job call in the StorageBatchOperations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#delete_job. -# -def delete_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new - - # Call the delete_job method. - result = client.delete_job request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storagebatchoperations_v1_generated_StorageBatchOperations_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_bucket_operation.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_bucket_operation.rb deleted file mode 100644 index 8619cc1d2684..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_bucket_operation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagebatchoperations_v1_generated_StorageBatchOperations_GetBucketOperation_sync] -require "google/cloud/storage_batch_operations/v1" - -## -# Snippet for the get_bucket_operation call in the StorageBatchOperations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_bucket_operation. -# -def get_bucket_operation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new - - # Call the get_bucket_operation method. - result = client.get_bucket_operation request - - # The returned object is of type Google::Cloud::StorageBatchOperations::V1::BucketOperation. - p result -end -# [END storagebatchoperations_v1_generated_StorageBatchOperations_GetBucketOperation_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_job.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_job.rb deleted file mode 100644 index 6be0ef372c60..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/get_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagebatchoperations_v1_generated_StorageBatchOperations_GetJob_sync] -require "google/cloud/storage_batch_operations/v1" - -## -# Snippet for the get_job call in the StorageBatchOperations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#get_job. -# -def get_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new - - # Call the get_job method. - result = client.get_job request - - # The returned object is of type Google::Cloud::StorageBatchOperations::V1::Job. - p result -end -# [END storagebatchoperations_v1_generated_StorageBatchOperations_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_bucket_operations.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_bucket_operations.rb deleted file mode 100644 index cdc367423363..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_bucket_operations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagebatchoperations_v1_generated_StorageBatchOperations_ListBucketOperations_sync] -require "google/cloud/storage_batch_operations/v1" - -## -# Snippet for the list_bucket_operations call in the StorageBatchOperations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_bucket_operations. -# -def list_bucket_operations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new - - # Call the list_bucket_operations method. - result = client.list_bucket_operations request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::BucketOperation. - p item - end -end -# [END storagebatchoperations_v1_generated_StorageBatchOperations_ListBucketOperations_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_jobs.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_jobs.rb deleted file mode 100644 index 391dddfed522..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/snippets/storage_batch_operations/list_jobs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagebatchoperations_v1_generated_StorageBatchOperations_ListJobs_sync] -require "google/cloud/storage_batch_operations/v1" - -## -# Snippet for the list_jobs call in the StorageBatchOperations service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client#list_jobs. -# -def list_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new - - # Call the list_jobs method. - result = client.list_jobs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::StorageBatchOperations::V1::Job. - p item - end -end -# [END storagebatchoperations_v1_generated_StorageBatchOperations_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_operations_test.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_operations_test.rb deleted file mode 100644 index 4b98b5f03f30..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_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/storagebatchoperations/v1/storage_batch_operations_pb" -require "google/cloud/storagebatchoperations/v1/storage_batch_operations_services_pb" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations" - -class ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_paths_test.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_paths_test.rb deleted file mode 100644 index 1ed6c8547c61..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_paths_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/storage_batch_operations/v1/storage_batch_operations" - -class ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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_bucket_operation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.bucket_operation_path project: "value0", location: "value1", job: "value2", bucket_operation: "value3" - assert_equal "projects/value0/locations/value1/jobs/value2/bucketOperations/value3", 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::StorageBatchOperations::V1::StorageBatchOperations::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_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.job_path project: "value0", location: "value1", job: "value2" - assert_equal "projects/value0/locations/value1/jobs/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_rest_test.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_rest_test.rb deleted file mode 100644 index 826a0a156efa..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_rest_test.rb +++ /dev/null @@ -1,491 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations/rest" - - -class ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_jobs - # Create test objects. - client_result = ::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - order_by = "hello world" - - list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_jobs parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_count - end - end - end - - def test_get_job - # Create test objects. - client_result = ::Google::Cloud::StorageBatchOperations::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_job ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_count - end - end - end - - def test_create_job - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job_id = "hello world" - job = {} - request_id = "hello world" - - create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_job parent: parent, job_id: job_id, job: job, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_job ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_count - end - end - end - - def test_delete_job - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - force = true - - delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_job({ name: name, request_id: request_id, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_job name: name, request_id: request_id, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_job ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.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_job({ 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_job(::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.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_job_client_stub.call_count - end - end - end - - def test_cancel_job - # Create test objects. - client_result = ::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse.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" - - cancel_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_cancel_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, cancel_job_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.cancel_job({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.cancel_job name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.cancel_job ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.cancel_job({ 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.cancel_job(::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.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, cancel_job_client_stub.call_count - end - end - end - - def test_list_bucket_operations - # Create test objects. - client_result = ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - order_by = "hello world" - - list_bucket_operations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_list_bucket_operations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_bucket_operations_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_bucket_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_bucket_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_bucket_operations ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_bucket_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_bucket_operations(::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_bucket_operations_client_stub.call_count - end - end - end - - def test_get_bucket_operation - # Create test objects. - client_result = ::Google::Cloud::StorageBatchOperations::V1::BucketOperation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_bucket_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::ServiceStub.stub :transcode_get_bucket_operation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_bucket_operation_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_bucket_operation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_bucket_operation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_bucket_operation ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_bucket_operation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_bucket_operation(::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_bucket_operation_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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_test.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_test.rb deleted file mode 100644 index b8e234640b36..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/google/cloud/storage_batch_operations/v1/storage_batch_operations_test.rb +++ /dev/null @@ -1,567 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/storagebatchoperations/v1/storage_batch_operations_pb" -require "google/cloud/storage_batch_operations/v1/storage_batch_operations" - -class ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageBatchOperations::V1::ListJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - order_by = "hello world" - - list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_jobs, name - assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs ::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs(::Google::Cloud::StorageBatchOperations::V1::ListJobsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_jobs_client_stub.call_rpc_count - end - end - - def test_get_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageBatchOperations::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_job, name - assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_job ::Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::StorageBatchOperations::V1::GetJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_rpc_count - end - end - - def test_create_job - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job_id = "hello world" - job = {} - request_id = "hello world" - - create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_job, name - assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["job_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageBatchOperations::V1::Job), request["job"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_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_job parent: parent, job_id: job_id, job: job, request_id: request_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_job ::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_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_job({ parent: parent, job_id: job_id, job: job, 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_job(::Google::Cloud::StorageBatchOperations::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, 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_job_client_stub.call_rpc_count - end - end - - def test_delete_job - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - force = true - - delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_job, name - assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest, 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_job_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_job({ name: name, request_id: request_id, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_job name: name, request_id: request_id, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_job ::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new(name: name, request_id: request_id, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_job({ name: name, request_id: request_id, force: force }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::StorageBatchOperations::V1::DeleteJobRequest.new(name: name, request_id: request_id, force: force), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_rpc_count - end - end - - def test_cancel_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageBatchOperations::V1::CancelJobResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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" - - cancel_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_job, name - assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_job_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_job({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_job name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_job ::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_job({ name: name, 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.cancel_job(::Google::Cloud::StorageBatchOperations::V1::CancelJobRequest.new(name: name, 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, cancel_job_client_stub.call_rpc_count - end - end - - def test_list_bucket_operations - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - order_by = "hello world" - - list_bucket_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_bucket_operations, name - assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_bucket_operations_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_bucket_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations ::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations(::Google::Cloud::StorageBatchOperations::V1::ListBucketOperationsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, 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_bucket_operations_client_stub.call_rpc_count - end - end - - def test_get_bucket_operation - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageBatchOperations::V1::BucketOperation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_bucket_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_bucket_operation, name - assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_bucket_operation_client_stub do - # Create client - client = ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_bucket_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_bucket_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_bucket_operation ::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_bucket_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_bucket_operation(::Google::Cloud::StorageBatchOperations::V1::GetBucketOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_bucket_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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::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::StorageBatchOperations::V1::StorageBatchOperations::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::StorageBatchOperations::V1::StorageBatchOperations::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/helper.rb b/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-storage_batch_operations-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/.gitignore b/owl-bot-staging/google-cloud-storage_insights-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-storage_insights-v1/.repo-metadata.json deleted file mode 100644 index be4fdfc8fe3d..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "storageinsights.googleapis.com", - "api_shortname": "storageinsights", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage_insights-v1/latest", - "distribution_name": "google-cloud-storage_insights-v1", - "is_cloud": true, - "language": "ruby", - "name": "storageinsights", - "name_pretty": "Storage Insights V1 API", - "product_documentation": "https://cloud.google.com/storage/docs/insights/storage-insights", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Provides insights capability on Google Cloud Storage. Note that google-cloud-storage_insights-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_insights instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/storage/docs/insights/storage-insights", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/.rubocop.yml b/owl-bot-staging/google-cloud-storage_insights-v1/.rubocop.yml deleted file mode 100644 index 15ce9706de62..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-storage_insights-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-storage_insights-v1.rb" diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/.toys.rb b/owl-bot-staging/google-cloud-storage_insights-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/.yardopts b/owl-bot-staging/google-cloud-storage_insights-v1/.yardopts deleted file mode 100644 index af463cd7b3be..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Storage Insights 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-storage_insights-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage_insights-v1/AUTHENTICATION.md deleted file mode 100644 index dc813e50a150..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-storage_insights-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-storage_insights-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/storage_insights/v1" - -client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/storage_insights/v1" - -::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::StorageInsights::V1::StorageInsights::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-storage_insights-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/storage_insights/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::StorageInsights::V1::StorageInsights::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-storage_insights-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-storage_insights-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/Gemfile b/owl-bot-staging/google-cloud-storage_insights-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/LICENSE.md b/owl-bot-staging/google-cloud-storage_insights-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/README.md b/owl-bot-staging/google-cloud-storage_insights-v1/README.md deleted file mode 100644 index 5145f323ce2a..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Storage Insights V1 API - -Provides insights capability on Google Cloud Storage. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Storage Insights V1 API. Most users should consider using -the main client gem, -[google-cloud-storage_insights](https://rubygems.org/gems/google-cloud-storage_insights). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-storage_insights-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/storageinsights.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/storage_insights/v1" - -client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new -request = ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new # (request fields as keyword arguments...) -response = client.list_report_configs request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage_insights-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/storage/docs/insights/storage-insights) -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/storage_insights/v1" -require "logger" - -client = ::Google::Cloud::StorageInsights::V1::StorageInsights::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-storage_insights`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-storage_insights-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-storage_insights`. -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-storage_insights-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-storage_insights-v1/Rakefile b/owl-bot-staging/google-cloud-storage_insights-v1/Rakefile deleted file mode 100644 index 44388c6b0350..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-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/storage_insights/v1/storage_insights/credentials" - ::Google::Cloud::StorageInsights::V1::StorageInsights::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-storage_insights-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-storage_insights-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-storage_insights-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-storage_insights-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-storage_insights-v1" - header "google-cloud-storage_insights-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-storage_insights-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-storage_insights-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-storage_insights-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-storage_insights-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-storage_insights-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-storage_insights-v1/gapic_metadata.json deleted file mode 100644 index 33156113a928..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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.storageinsights.v1", - "libraryPackage": "::Google::Cloud::StorageInsights::V1", - "services": { - "StorageInsights": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client", - "rpcs": { - "ListReportConfigs": { - "methods": [ - "list_report_configs" - ] - }, - "GetReportConfig": { - "methods": [ - "get_report_config" - ] - }, - "CreateReportConfig": { - "methods": [ - "create_report_config" - ] - }, - "UpdateReportConfig": { - "methods": [ - "update_report_config" - ] - }, - "DeleteReportConfig": { - "methods": [ - "delete_report_config" - ] - }, - "ListReportDetails": { - "methods": [ - "list_report_details" - ] - }, - "GetReportDetail": { - "methods": [ - "get_report_detail" - ] - }, - "ListDatasetConfigs": { - "methods": [ - "list_dataset_configs" - ] - }, - "GetDatasetConfig": { - "methods": [ - "get_dataset_config" - ] - }, - "CreateDatasetConfig": { - "methods": [ - "create_dataset_config" - ] - }, - "UpdateDatasetConfig": { - "methods": [ - "update_dataset_config" - ] - }, - "DeleteDatasetConfig": { - "methods": [ - "delete_dataset_config" - ] - }, - "LinkDataset": { - "methods": [ - "link_dataset" - ] - }, - "UnlinkDataset": { - "methods": [ - "unlink_dataset" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/google-cloud-storage_insights-v1.gemspec b/owl-bot-staging/google-cloud-storage_insights-v1/google-cloud-storage_insights-v1.gemspec deleted file mode 100644 index bfc74cade13c..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/google-cloud-storage_insights-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/storage_insights/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-storage_insights-v1" - gem.version = Google::Cloud::StorageInsights::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Provides insights capability on Google Cloud Storage. Note that google-cloud-storage_insights-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_insights instead. See the readme for more details." - gem.summary = "Provides insights capability on Google Cloud Storage." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google-cloud-storage_insights-v1.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google-cloud-storage_insights-v1.rb deleted file mode 100644 index 2f17e838e1a5..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google-cloud-storage_insights-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/storage_insights/v1" diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1.rb deleted file mode 100644 index 87dcbc42f811..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/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/storage_insights/v1/storage_insights" -require "google/cloud/storage_insights/v1/version" - -module Google - module Cloud - module StorageInsights - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/storage_insights/v1" - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/storage_insights/v1" - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/storage_insights/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/bindings_override.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/bindings_override.rb deleted file mode 100644 index 5dd6cc378f61..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/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 StorageInsights - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/storage_insights/v1/rest" - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "StorageInsights"] - parent_config = while namespace.any? - parent_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-storage_insights-v1/lib/google/cloud/storage_insights/v1/rest.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/rest.rb deleted file mode 100644 index 61082da8e33e..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/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/storage_insights/v1/storage_insights/rest" -require "google/cloud/storage_insights/v1/bindings_override" -require "google/cloud/storage_insights/v1/version" - -module Google - module Cloud - module StorageInsights - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/storage_insights/v1/rest" - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights.rb deleted file mode 100644 index 8a65f7fc66d5..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights.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/storage_insights/v1/version" - -require "google/cloud/storage_insights/v1/storage_insights/credentials" -require "google/cloud/storage_insights/v1/storage_insights/paths" -require "google/cloud/storage_insights/v1/storage_insights/operations" -require "google/cloud/storage_insights/v1/storage_insights/client" -require "google/cloud/storage_insights/v1/storage_insights/rest" - -module Google - module Cloud - module StorageInsights - module V1 - ## - # Service describing handlers for resources - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/storage_insights/v1/storage_insights" - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/storage_insights/v1/storage_insights/rest" - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - module StorageInsights - end - end - end - end -end - -helper_path = ::File.join __dir__, "storage_insights", "helpers.rb" -require "google/cloud/storage_insights/v1/storage_insights/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb deleted file mode 100644 index 161b7d011b3c..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb +++ /dev/null @@ -1,1944 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/storageinsights/v1/storageinsights_pb" -require "google/cloud/location" - -module Google - module Cloud - module StorageInsights - module V1 - module StorageInsights - ## - # Client for the StorageInsights service. - # - # Service describing handlers for resources - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_insights_stub - - ## - # Configure the StorageInsights Client class. - # - # See {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageInsights clients - # ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "StorageInsights", "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.rpcs.list_report_configs.timeout = 60.0 - default_config.rpcs.list_report_configs.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_report_config.timeout = 60.0 - default_config.rpcs.get_report_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_report_details.timeout = 60.0 - default_config.rpcs.list_report_details.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_report_detail.timeout = 60.0 - default_config.rpcs.get_report_detail.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_dataset_configs.timeout = 60.0 - default_config.rpcs.list_dataset_configs.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_dataset_config.timeout = 60.0 - default_config.rpcs.create_dataset_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_dataset_config.timeout = 60.0 - default_config.rpcs.update_dataset_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_dataset_config.timeout = 60.0 - default_config.rpcs.delete_dataset_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.link_dataset.timeout = 60.0 - default_config.rpcs.link_dataset.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.unlink_dataset.timeout = 60.0 - default_config.rpcs.unlink_dataset.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageInsights Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @storage_insights_stub.universe_domain - end - - ## - # Create a new StorageInsights client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageInsights 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/storageinsights/v1/storageinsights_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 - - @storage_insights_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::StorageInsights::V1::StorageInsights::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 - ) - - @storage_insights_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 = @storage_insights_stub.endpoint - config.universe_domain = @storage_insights_stub.universe_domain - config.logger = @storage_insights_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::StorageInsights::V1::StorageInsights::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 - @storage_insights_stub.logger - end - - # Service calls - - ## - # Lists ReportConfigs in a given project and location. - # - # @overload list_report_configs(request, options = nil) - # Pass arguments to `list_report_configs` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_report_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_report_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent value for ListReportConfigsRequest - # @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::StorageInsights::V1::ReportConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new - # - # # Call the list_report_configs method. - # result = client.list_report_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportConfig. - # p item - # end - # - def list_report_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_report_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_report_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_report_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :list_report_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_report_configs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single ReportConfig. - # - # @overload get_report_config(request, options = nil) - # Pass arguments to `get_report_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::GetReportConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_report_config(name: nil) - # Pass arguments to `get_report_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageInsights::V1::ReportConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new - # - # # Call the get_report_config method. - # result = client.get_report_config request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. - # p result - # - def get_report_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_report_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_report_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_report_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :get_report_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new ReportConfig in a given project and location. - # - # @overload create_report_config(request, options = nil) - # Pass arguments to `create_report_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_report_config(parent: nil, report_config: nil, request_id: nil) - # Pass arguments to `create_report_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Value for parent. - # @param report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageInsights::V1::ReportConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new - # - # # Call the create_report_config method. - # result = client.create_report_config request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. - # p result - # - def create_report_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest - - # Converts hash and nil to 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_report_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_report_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_report_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :create_report_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the parameters of a single ReportConfig. - # - # @overload update_report_config(request, options = nil) - # Pass arguments to `update_report_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_report_config(update_mask: nil, report_config: nil, request_id: nil) - # Pass arguments to `update_report_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # ReportConfig 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 report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::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 [::Google::Cloud::StorageInsights::V1::ReportConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new - # - # # Call the update_report_config method. - # result = client.update_report_config request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. - # p result - # - def update_report_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest - - # Converts hash and nil to 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_report_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.report_config&.name - header_params["report_config.name"] = request.report_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_report_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_report_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :update_report_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single ReportConfig. - # - # @overload delete_report_config(request, options = nil) - # Pass arguments to `delete_report_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_report_config(name: nil, force: nil, request_id: nil) - # Pass arguments to `delete_report_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource - # @param force [::Boolean] - # Optional. If set, all ReportDetails for this ReportConfig will be deleted. - # @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 [::Google::Protobuf::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/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new - # - # # Call the delete_report_config method. - # result = client.delete_report_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_report_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_report_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_report_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_report_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :delete_report_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists ReportDetails in a given project and location. - # - # @overload list_report_details(request, options = nil) - # Pass arguments to `list_report_details` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_report_details(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_report_details` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 ListReportDetailsRequest - # @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::StorageInsights::V1::ReportDetail>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.new - # - # # Call the list_report_details method. - # result = client.list_report_details request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportDetail. - # p item - # end - # - def list_report_details request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_report_details.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_report_details.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_report_details.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :list_report_details, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_report_details, request, response, 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 ReportDetail. - # - # @overload get_report_detail(request, options = nil) - # Pass arguments to `get_report_detail` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::GetReportDetailRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_report_detail(name: nil) - # Pass arguments to `get_report_detail` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or 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::StorageInsights::V1::ReportDetail] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportDetail] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new - # - # # Call the get_report_detail method. - # result = client.get_report_detail request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportDetail. - # p result - # - def get_report_detail request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_report_detail.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_report_detail.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_report_detail.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :get_report_detail, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the dataset configurations in a given project for a given location. - # - # @overload list_dataset_configs(request, options = nil) - # Pass arguments to `list_dataset_configs` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_dataset_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_dataset_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent value for ListDatasetConfigsRequest - # @param page_size [::Integer] - # Requested page size. Server might return fewer items than requested. - # If unspecified, server picks 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::StorageInsights::V1::DatasetConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.new - # - # # Call the list_dataset_configs method. - # result = client.list_dataset_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageInsights::V1::DatasetConfig. - # p item - # end - # - def list_dataset_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_dataset_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_dataset_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_dataset_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :list_dataset_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_dataset_configs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the dataset configuration in a given project for a given location. - # - # @overload get_dataset_config(request, options = nil) - # Pass arguments to `get_dataset_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_dataset_config(name: nil) - # Pass arguments to `get_dataset_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageInsights::V1::DatasetConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new - # - # # Call the get_dataset_config method. - # result = client.get_dataset_config request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::DatasetConfig. - # p result - # - def get_dataset_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_dataset_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_dataset_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_dataset_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :get_dataset_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a dataset configuration in a given project for a given location. - # - # @overload create_dataset_config(request, options = nil) - # Pass arguments to `create_dataset_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_dataset_config(parent: nil, dataset_config_id: nil, dataset_config: nil, request_id: nil) - # Pass arguments to `create_dataset_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Value for parent. - # @param dataset_config_id [::String] - # Required. ID of the requesting object. - # If auto-generating ID is enabled on the server-side, remove this field and - # `dataset_config_id` from the method_signature of Create RPC - # Note: The value should not contain any hyphens. - # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. A unique identifier for your request. - # Specify the request ID if you need to retry the request. - # If you retry the request with the same ID within 60 minutes, the server - # ignores the request if it has already completed the original request. - # - # For example, if your initial request times out and you retry the request - # using the same request ID, the server recognizes the original request and - # does not process the new request. - # - # The request ID must be a valid UUID and cannot be a zero UUID - # (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/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new - # - # # Call the create_dataset_config method. - # result = client.create_dataset_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_dataset_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest - - # Converts hash and nil to 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_dataset_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_dataset_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_dataset_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :create_dataset_config, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a dataset configuration in a given project for a given location. - # - # @overload update_dataset_config(request, options = nil) - # Pass arguments to `update_dataset_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_dataset_config(update_mask: nil, dataset_config: nil, request_id: nil) - # Pass arguments to `update_dataset_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `DatasetConfig` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field is overwritten if it is in the mask. If the - # user does not provide a mask then it returns an "Invalid Argument" error. - # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash] - # Required. The resource being updated - # @param request_id [::String] - # Optional. A unique identifier for your request. - # Specify the request ID if you need to retry the request. - # If you retry the request with the same ID within 60 minutes, the server - # ignores the request if it has already completed the original request. - # - # For example, if your initial request times out and you retry the request - # using the same request ID, the server recognizes the original request and - # does not process the new request. - # - # The request ID must be a valid UUID and cannot be a zero UUID - # (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/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new - # - # # Call the update_dataset_config method. - # result = client.update_dataset_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_dataset_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest - - # Converts hash and nil to 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_dataset_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.dataset_config&.name - header_params["dataset_config.name"] = request.dataset_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_dataset_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_dataset_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :update_dataset_config, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 dataset configuration in a given project for a given location. - # - # @overload delete_dataset_config(request, options = nil) - # Pass arguments to `delete_dataset_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_dataset_config(name: nil, request_id: nil) - # Pass arguments to `delete_dataset_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource - # @param request_id [::String] - # Optional. A unique identifier for your request. - # Specify the request ID if you need to retry the request. - # If you retry the request with the same ID within 60 minutes, the server - # ignores the request if it has already completed the original request. - # - # For example, if your initial request times out and you retry the request - # using the same request ID, the server recognizes the original request and - # does not process the new request. - # - # The request ID must be a valid UUID and cannot be a zero UUID - # (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/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.new - # - # # Call the delete_dataset_config method. - # result = client.delete_dataset_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_dataset_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_dataset_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_dataset_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_dataset_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :delete_dataset_config, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Links a dataset to BigQuery in a given project for a given location. - # - # @overload link_dataset(request, options = nil) - # Pass arguments to `link_dataset` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::LinkDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload link_dataset(name: nil) - # Pass arguments to `link_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or 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 [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new - # - # # Call the link_dataset method. - # result = client.link_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def link_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.link_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.link_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.link_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :link_dataset, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Unlinks a dataset from BigQuery in a given project - # for a given location. - # - # @overload unlink_dataset(request, options = nil) - # Pass arguments to `unlink_dataset` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload unlink_dataset(name: nil) - # Pass arguments to `unlink_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or 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 [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new - # - # # Call the unlink_dataset method. - # result = client.unlink_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def unlink_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.unlink_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.unlink_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.unlink_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.call_rpc :unlink_dataset, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 StorageInsights API. - # - # This class represents the configuration for StorageInsights, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_report_configs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_report_configs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_report_configs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storageinsights.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the StorageInsights API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_report_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_report_configs - ## - # RPC-specific configuration for `get_report_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_report_config - ## - # RPC-specific configuration for `create_report_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_report_config - ## - # RPC-specific configuration for `update_report_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_report_config - ## - # RPC-specific configuration for `delete_report_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_report_config - ## - # RPC-specific configuration for `list_report_details` - # @return [::Gapic::Config::Method] - # - attr_reader :list_report_details - ## - # RPC-specific configuration for `get_report_detail` - # @return [::Gapic::Config::Method] - # - attr_reader :get_report_detail - ## - # RPC-specific configuration for `list_dataset_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_dataset_configs - ## - # RPC-specific configuration for `get_dataset_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dataset_config - ## - # RPC-specific configuration for `create_dataset_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_dataset_config - ## - # RPC-specific configuration for `update_dataset_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dataset_config - ## - # RPC-specific configuration for `delete_dataset_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_dataset_config - ## - # RPC-specific configuration for `link_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :link_dataset - ## - # RPC-specific configuration for `unlink_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :unlink_dataset - - # @private - def initialize parent_rpcs = nil - list_report_configs_config = parent_rpcs.list_report_configs if parent_rpcs.respond_to? :list_report_configs - @list_report_configs = ::Gapic::Config::Method.new list_report_configs_config - get_report_config_config = parent_rpcs.get_report_config if parent_rpcs.respond_to? :get_report_config - @get_report_config = ::Gapic::Config::Method.new get_report_config_config - create_report_config_config = parent_rpcs.create_report_config if parent_rpcs.respond_to? :create_report_config - @create_report_config = ::Gapic::Config::Method.new create_report_config_config - update_report_config_config = parent_rpcs.update_report_config if parent_rpcs.respond_to? :update_report_config - @update_report_config = ::Gapic::Config::Method.new update_report_config_config - delete_report_config_config = parent_rpcs.delete_report_config if parent_rpcs.respond_to? :delete_report_config - @delete_report_config = ::Gapic::Config::Method.new delete_report_config_config - list_report_details_config = parent_rpcs.list_report_details if parent_rpcs.respond_to? :list_report_details - @list_report_details = ::Gapic::Config::Method.new list_report_details_config - get_report_detail_config = parent_rpcs.get_report_detail if parent_rpcs.respond_to? :get_report_detail - @get_report_detail = ::Gapic::Config::Method.new get_report_detail_config - list_dataset_configs_config = parent_rpcs.list_dataset_configs if parent_rpcs.respond_to? :list_dataset_configs - @list_dataset_configs = ::Gapic::Config::Method.new list_dataset_configs_config - get_dataset_config_config = parent_rpcs.get_dataset_config if parent_rpcs.respond_to? :get_dataset_config - @get_dataset_config = ::Gapic::Config::Method.new get_dataset_config_config - create_dataset_config_config = parent_rpcs.create_dataset_config if parent_rpcs.respond_to? :create_dataset_config - @create_dataset_config = ::Gapic::Config::Method.new create_dataset_config_config - update_dataset_config_config = parent_rpcs.update_dataset_config if parent_rpcs.respond_to? :update_dataset_config - @update_dataset_config = ::Gapic::Config::Method.new update_dataset_config_config - delete_dataset_config_config = parent_rpcs.delete_dataset_config if parent_rpcs.respond_to? :delete_dataset_config - @delete_dataset_config = ::Gapic::Config::Method.new delete_dataset_config_config - link_dataset_config = parent_rpcs.link_dataset if parent_rpcs.respond_to? :link_dataset - @link_dataset = ::Gapic::Config::Method.new link_dataset_config - unlink_dataset_config = parent_rpcs.unlink_dataset if parent_rpcs.respond_to? :unlink_dataset - @unlink_dataset = ::Gapic::Config::Method.new unlink_dataset_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/credentials.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/credentials.rb deleted file mode 100644 index d7025fc54fe4..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/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 StorageInsights - module V1 - module StorageInsights - # Credentials for the StorageInsights 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-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/operations.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/operations.rb deleted file mode 100644 index 518179ea2ee4..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/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 StorageInsights - module V1 - module StorageInsights - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StorageInsights 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 StorageInsights 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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::StorageInsights::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::StorageInsights::V1::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 = "storageinsights.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb deleted file mode 100644 index 09f4fba414ac..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module StorageInsights - module V1 - module StorageInsights - # Path helper methods for the StorageInsights API. - module Paths - ## - # Create a fully-qualified DatasetConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/datasetConfigs/{dataset_config}` - # - # @param project [String] - # @param location [String] - # @param dataset_config [String] - # - # @return [::String] - def dataset_config_path project:, location:, dataset_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/datasetConfigs/#{dataset_config}" - 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 ReportConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/reportConfigs/{report_config}` - # - # @param project [String] - # @param location [String] - # @param report_config [String] - # - # @return [::String] - def report_config_path project:, location:, report_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/reportConfigs/#{report_config}" - end - - ## - # Create a fully-qualified ReportDetail resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/reportConfigs/{report_config}/reportDetails/{report_detail}` - # - # @param project [String] - # @param location [String] - # @param report_config [String] - # @param report_detail [String] - # - # @return [::String] - def report_detail_path project:, location:, report_config:, report_detail: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "report_config cannot contain /" if report_config.to_s.include? "/" - - "projects/#{project}/locations/#{location}/reportConfigs/#{report_config}/reportDetails/#{report_detail}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest.rb deleted file mode 100644 index 4c9b09b0be65..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/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/storage_insights/v1/version" -require "google/cloud/storage_insights/v1/bindings_override" - -require "google/cloud/storage_insights/v1/storage_insights/credentials" -require "google/cloud/storage_insights/v1/storage_insights/paths" -require "google/cloud/storage_insights/v1/storage_insights/rest/operations" -require "google/cloud/storage_insights/v1/storage_insights/rest/client" - -module Google - module Cloud - module StorageInsights - module V1 - ## - # Service describing handlers for resources - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/storage_insights/v1/storage_insights/rest" - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - module StorageInsights - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/storage_insights/v1/storage_insights/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb deleted file mode 100644 index 55cb5cb8a28d..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb +++ /dev/null @@ -1,1811 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/storageinsights/v1/storageinsights_pb" -require "google/cloud/storage_insights/v1/storage_insights/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module StorageInsights - module V1 - module StorageInsights - module Rest - ## - # REST client for the StorageInsights service. - # - # Service describing handlers for resources - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_insights_stub - - ## - # Configure the StorageInsights Client class. - # - # See {::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageInsights clients - # ::Google::Cloud::StorageInsights::V1::StorageInsights::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", "StorageInsights", "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.rpcs.list_report_configs.timeout = 60.0 - default_config.rpcs.list_report_configs.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_report_config.timeout = 60.0 - default_config.rpcs.get_report_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_report_details.timeout = 60.0 - default_config.rpcs.list_report_details.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_report_detail.timeout = 60.0 - default_config.rpcs.get_report_detail.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_dataset_configs.timeout = 60.0 - default_config.rpcs.list_dataset_configs.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_dataset_config.timeout = 60.0 - default_config.rpcs.create_dataset_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_dataset_config.timeout = 60.0 - default_config.rpcs.update_dataset_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_dataset_config.timeout = 60.0 - default_config.rpcs.delete_dataset_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.link_dataset.timeout = 60.0 - default_config.rpcs.link_dataset.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.unlink_dataset.timeout = 60.0 - default_config.rpcs.unlink_dataset.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageInsights Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::StorageInsights::V1::StorageInsights::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 - @storage_insights_stub.universe_domain - end - - ## - # Create a new StorageInsights REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageInsights 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::StorageInsights::V1::StorageInsights::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 - - @storage_insights_stub = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @storage_insights_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 = @storage_insights_stub.endpoint - config.universe_domain = @storage_insights_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @storage_insights_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::StorageInsights::V1::StorageInsights::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 - @storage_insights_stub.logger - end - - # Service calls - - ## - # Lists ReportConfigs in a given project and location. - # - # @overload list_report_configs(request, options = nil) - # Pass arguments to `list_report_configs` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_report_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_report_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent value for ListReportConfigsRequest - # @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::StorageInsights::V1::ReportConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new - # - # # Call the list_report_configs method. - # result = client.list_report_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportConfig. - # p item - # end - # - def list_report_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_report_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_report_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_report_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.list_report_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_report_configs, "report_configs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single ReportConfig. - # - # @overload get_report_config(request, options = nil) - # Pass arguments to `get_report_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::GetReportConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_report_config(name: nil) - # Pass arguments to `get_report_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new - # - # # Call the get_report_config method. - # result = client.get_report_config request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. - # p result - # - def get_report_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_report_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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_report_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_report_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.get_report_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new ReportConfig in a given project and location. - # - # @overload create_report_config(request, options = nil) - # Pass arguments to `create_report_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_report_config(parent: nil, report_config: nil, request_id: nil) - # Pass arguments to `create_report_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Value for parent. - # @param report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new - # - # # Call the create_report_config method. - # result = client.create_report_config request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. - # p result - # - def create_report_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest - - # Converts hash and nil to an 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_report_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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_report_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_report_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.create_report_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the parameters of a single ReportConfig. - # - # @overload update_report_config(request, options = nil) - # Pass arguments to `update_report_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_report_config(update_mask: nil, report_config: nil, request_id: nil) - # Pass arguments to `update_report_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # ReportConfig 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 report_config [::Google::Cloud::StorageInsights::V1::ReportConfig, ::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 [::Google::Cloud::StorageInsights::V1::ReportConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new - # - # # Call the update_report_config method. - # result = client.update_report_config request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. - # p result - # - def update_report_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest - - # Converts hash and nil to an 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_report_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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_report_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_report_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.update_report_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single ReportConfig. - # - # @overload delete_report_config(request, options = nil) - # Pass arguments to `delete_report_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_report_config(name: nil, force: nil, request_id: nil) - # Pass arguments to `delete_report_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource - # @param force [::Boolean] - # Optional. If set, all ReportDetails for this ReportConfig will be deleted. - # @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 [::Google::Protobuf::Empty] - # @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/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new - # - # # Call the delete_report_config method. - # result = client.delete_report_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_report_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_report_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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_report_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_report_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.delete_report_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists ReportDetails in a given project and location. - # - # @overload list_report_details(request, options = nil) - # Pass arguments to `list_report_details` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_report_details(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_report_details` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 ListReportDetailsRequest - # @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::StorageInsights::V1::ReportDetail>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.new - # - # # Call the list_report_details method. - # result = client.list_report_details request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportDetail. - # p item - # end - # - def list_report_details request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_report_details.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_report_details.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_report_details.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.list_report_details request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_report_details, "report_details", request, result, 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 ReportDetail. - # - # @overload get_report_detail(request, options = nil) - # Pass arguments to `get_report_detail` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::GetReportDetailRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_report_detail(name: nil) - # Pass arguments to `get_report_detail` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or 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::StorageInsights::V1::ReportDetail] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportDetail] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new - # - # # Call the get_report_detail method. - # result = client.get_report_detail request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::ReportDetail. - # p result - # - def get_report_detail request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_report_detail.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_report_detail.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_report_detail.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.get_report_detail request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the dataset configurations in a given project for a given location. - # - # @overload list_dataset_configs(request, options = nil) - # Pass arguments to `list_dataset_configs` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_dataset_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_dataset_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent value for ListDatasetConfigsRequest - # @param page_size [::Integer] - # Requested page size. Server might return fewer items than requested. - # If unspecified, server picks 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::StorageInsights::V1::DatasetConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.new - # - # # Call the list_dataset_configs method. - # result = client.list_dataset_configs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageInsights::V1::DatasetConfig. - # p item - # end - # - def list_dataset_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_dataset_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_dataset_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_dataset_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.list_dataset_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_dataset_configs, "dataset_configs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the dataset configuration in a given project for a given location. - # - # @overload get_dataset_config(request, options = nil) - # Pass arguments to `get_dataset_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_dataset_config(name: nil) - # Pass arguments to `get_dataset_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::DatasetConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new - # - # # Call the get_dataset_config method. - # result = client.get_dataset_config request - # - # # The returned object is of type Google::Cloud::StorageInsights::V1::DatasetConfig. - # p result - # - def get_dataset_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_dataset_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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_dataset_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_dataset_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.get_dataset_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a dataset configuration in a given project for a given location. - # - # @overload create_dataset_config(request, options = nil) - # Pass arguments to `create_dataset_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_dataset_config(parent: nil, dataset_config_id: nil, dataset_config: nil, request_id: nil) - # Pass arguments to `create_dataset_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Value for parent. - # @param dataset_config_id [::String] - # Required. ID of the requesting object. - # If auto-generating ID is enabled on the server-side, remove this field and - # `dataset_config_id` from the method_signature of Create RPC - # Note: The value should not contain any hyphens. - # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. A unique identifier for your request. - # Specify the request ID if you need to retry the request. - # If you retry the request with the same ID within 60 minutes, the server - # ignores the request if it has already completed the original request. - # - # For example, if your initial request times out and you retry the request - # using the same request ID, the server recognizes the original request and - # does not process the new request. - # - # The request ID must be a valid UUID and cannot be a zero UUID - # (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/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new - # - # # Call the create_dataset_config method. - # result = client.create_dataset_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_dataset_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest - - # Converts hash and nil to an 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_dataset_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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_dataset_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_dataset_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.create_dataset_config request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 dataset configuration in a given project for a given location. - # - # @overload update_dataset_config(request, options = nil) - # Pass arguments to `update_dataset_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_dataset_config(update_mask: nil, dataset_config: nil, request_id: nil) - # Pass arguments to `update_dataset_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `DatasetConfig` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field is overwritten if it is in the mask. If the - # user does not provide a mask then it returns an "Invalid Argument" error. - # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash] - # Required. The resource being updated - # @param request_id [::String] - # Optional. A unique identifier for your request. - # Specify the request ID if you need to retry the request. - # If you retry the request with the same ID within 60 minutes, the server - # ignores the request if it has already completed the original request. - # - # For example, if your initial request times out and you retry the request - # using the same request ID, the server recognizes the original request and - # does not process the new request. - # - # The request ID must be a valid UUID and cannot be a zero UUID - # (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/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new - # - # # Call the update_dataset_config method. - # result = client.update_dataset_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_dataset_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest - - # Converts hash and nil to an 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_dataset_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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_dataset_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_dataset_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.update_dataset_config request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 dataset configuration in a given project for a given location. - # - # @overload delete_dataset_config(request, options = nil) - # Pass arguments to `delete_dataset_config` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_dataset_config(name: nil, request_id: nil) - # Pass arguments to `delete_dataset_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource - # @param request_id [::String] - # Optional. A unique identifier for your request. - # Specify the request ID if you need to retry the request. - # If you retry the request with the same ID within 60 minutes, the server - # ignores the request if it has already completed the original request. - # - # For example, if your initial request times out and you retry the request - # using the same request ID, the server recognizes the original request and - # does not process the new request. - # - # The request ID must be a valid UUID and cannot be a zero UUID - # (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/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.new - # - # # Call the delete_dataset_config method. - # result = client.delete_dataset_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_dataset_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_dataset_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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_dataset_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_dataset_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.delete_dataset_config request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Links a dataset to BigQuery in a given project for a given location. - # - # @overload link_dataset(request, options = nil) - # Pass arguments to `link_dataset` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::LinkDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload link_dataset(name: nil) - # Pass arguments to `link_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or 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 [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new - # - # # Call the link_dataset method. - # result = client.link_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def link_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.link_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.link_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.link_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.link_dataset request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Unlinks a dataset from BigQuery in a given project - # for a given location. - # - # @overload unlink_dataset(request, options = nil) - # Pass arguments to `unlink_dataset` via a request object, either of type - # {::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload unlink_dataset(name: nil) - # Pass arguments to `unlink_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or 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 [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_insights/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new - # - # # Call the unlink_dataset method. - # result = client.unlink_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def unlink_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.unlink_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.unlink_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.unlink_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_insights_stub.unlink_dataset request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 StorageInsights REST API. - # - # This class represents the configuration for StorageInsights REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_report_configs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_report_configs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_report_configs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storageinsights.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 StorageInsights API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_report_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_report_configs - ## - # RPC-specific configuration for `get_report_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_report_config - ## - # RPC-specific configuration for `create_report_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_report_config - ## - # RPC-specific configuration for `update_report_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_report_config - ## - # RPC-specific configuration for `delete_report_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_report_config - ## - # RPC-specific configuration for `list_report_details` - # @return [::Gapic::Config::Method] - # - attr_reader :list_report_details - ## - # RPC-specific configuration for `get_report_detail` - # @return [::Gapic::Config::Method] - # - attr_reader :get_report_detail - ## - # RPC-specific configuration for `list_dataset_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_dataset_configs - ## - # RPC-specific configuration for `get_dataset_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dataset_config - ## - # RPC-specific configuration for `create_dataset_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_dataset_config - ## - # RPC-specific configuration for `update_dataset_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dataset_config - ## - # RPC-specific configuration for `delete_dataset_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_dataset_config - ## - # RPC-specific configuration for `link_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :link_dataset - ## - # RPC-specific configuration for `unlink_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :unlink_dataset - - # @private - def initialize parent_rpcs = nil - list_report_configs_config = parent_rpcs.list_report_configs if parent_rpcs.respond_to? :list_report_configs - @list_report_configs = ::Gapic::Config::Method.new list_report_configs_config - get_report_config_config = parent_rpcs.get_report_config if parent_rpcs.respond_to? :get_report_config - @get_report_config = ::Gapic::Config::Method.new get_report_config_config - create_report_config_config = parent_rpcs.create_report_config if parent_rpcs.respond_to? :create_report_config - @create_report_config = ::Gapic::Config::Method.new create_report_config_config - update_report_config_config = parent_rpcs.update_report_config if parent_rpcs.respond_to? :update_report_config - @update_report_config = ::Gapic::Config::Method.new update_report_config_config - delete_report_config_config = parent_rpcs.delete_report_config if parent_rpcs.respond_to? :delete_report_config - @delete_report_config = ::Gapic::Config::Method.new delete_report_config_config - list_report_details_config = parent_rpcs.list_report_details if parent_rpcs.respond_to? :list_report_details - @list_report_details = ::Gapic::Config::Method.new list_report_details_config - get_report_detail_config = parent_rpcs.get_report_detail if parent_rpcs.respond_to? :get_report_detail - @get_report_detail = ::Gapic::Config::Method.new get_report_detail_config - list_dataset_configs_config = parent_rpcs.list_dataset_configs if parent_rpcs.respond_to? :list_dataset_configs - @list_dataset_configs = ::Gapic::Config::Method.new list_dataset_configs_config - get_dataset_config_config = parent_rpcs.get_dataset_config if parent_rpcs.respond_to? :get_dataset_config - @get_dataset_config = ::Gapic::Config::Method.new get_dataset_config_config - create_dataset_config_config = parent_rpcs.create_dataset_config if parent_rpcs.respond_to? :create_dataset_config - @create_dataset_config = ::Gapic::Config::Method.new create_dataset_config_config - update_dataset_config_config = parent_rpcs.update_dataset_config if parent_rpcs.respond_to? :update_dataset_config - @update_dataset_config = ::Gapic::Config::Method.new update_dataset_config_config - delete_dataset_config_config = parent_rpcs.delete_dataset_config if parent_rpcs.respond_to? :delete_dataset_config - @delete_dataset_config = ::Gapic::Config::Method.new delete_dataset_config_config - link_dataset_config = parent_rpcs.link_dataset if parent_rpcs.respond_to? :link_dataset - @link_dataset = ::Gapic::Config::Method.new link_dataset_config - unlink_dataset_config = parent_rpcs.unlink_dataset if parent_rpcs.respond_to? :unlink_dataset - @unlink_dataset = ::Gapic::Config::Method.new unlink_dataset_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/operations.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/operations.rb deleted file mode 100644 index 641ca5a6525f..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/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 StorageInsights - module V1 - module StorageInsights - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storageinsights.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StorageInsights 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 StorageInsights 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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageInsights::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "storageinsights.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_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-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb deleted file mode 100644 index 2e360ee0386f..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb +++ /dev/null @@ -1,941 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/storageinsights/v1/storageinsights_pb" - -module Google - module Cloud - module StorageInsights - module V1 - module StorageInsights - module Rest - ## - # REST service stub for the StorageInsights 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_report_configs REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse] - # A result object deserialized from the server's reply - def list_report_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_report_configs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_report_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_report_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::GetReportConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # A result object deserialized from the server's reply - def get_report_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_report_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_report_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageInsights::V1::ReportConfig.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_report_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # A result object deserialized from the server's reply - def create_report_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_report_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_report_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageInsights::V1::ReportConfig.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_report_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # A result object deserialized from the server's reply - def update_report_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_report_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_report_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageInsights::V1::ReportConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_report_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_report_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_report_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_report_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_report_details REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse] - # A result object deserialized from the server's reply - def list_report_details request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_report_details_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_report_details", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_report_detail REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::GetReportDetailRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::ReportDetail] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ReportDetail] - # A result object deserialized from the server's reply - def get_report_detail request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_report_detail_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_report_detail", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageInsights::V1::ReportDetail.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_dataset_configs REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse] - # A result object deserialized from the server's reply - def list_dataset_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_dataset_configs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_dataset_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_dataset_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageInsights::V1::DatasetConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] - # A result object deserialized from the server's reply - def get_dataset_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_dataset_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_dataset_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageInsights::V1::DatasetConfig.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_dataset_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_dataset_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_dataset_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_dataset_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_dataset_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_dataset_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_dataset_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_dataset_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_dataset_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_dataset_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_dataset_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_dataset_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the link_dataset REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def link_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_link_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "link_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the unlink_dataset REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def unlink_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_unlink_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "unlink_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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_report_configs REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_report_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/reportConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_report_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::GetReportConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_report_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_report_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest] - # 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_report_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/reportConfigs", - body: "report_config", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_report_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest] - # 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_report_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{report_config.name}", - body: "report_config", - matches: [ - ["report_config.name", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_report_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_report_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_report_details REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_report_details_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/reportDetails", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_report_detail REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::GetReportDetailRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_report_detail_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reportConfigs/[^/]+/reportDetails/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_dataset_configs REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_dataset_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/datasetConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_dataset_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_dataset_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_dataset_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest] - # 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_dataset_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/datasetConfigs", - body: "dataset_config", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_dataset_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest] - # 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_dataset_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{dataset_config.name}", - body: "dataset_config", - matches: [ - ["dataset_config.name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_dataset_config REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_dataset_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the link_dataset REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_link_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:linkDataset", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the unlink_dataset REST call - # - # @param request_pb [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_unlink_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:unlinkDataset", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasetConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/version.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/version.rb deleted file mode 100644 index db245c92063b..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/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 StorageInsights - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb deleted file mode 100644 index 5281c25b3f44..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/storageinsights/v1/storageinsights.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/type/date_pb' -require 'google/type/datetime_pb' - - -descriptor_data = "\n5google/cloud/storageinsights/v1/storageinsights.proto\x12\x1fgoogle.cloud.storageinsights.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\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/date.proto\x1a\x1agoogle/type/datetime.proto\"\xa8\x01\n\x18ListReportConfigsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+storageinsights.googleapis.com/ReportConfig\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\"\x90\x01\n\x19ListReportConfigsResponse\x12\x45\n\x0ereport_configs\x18\x01 \x03(\x0b\x32-.google.cloud.storageinsights.v1.ReportConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"[\n\x16GetReportConfigRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+storageinsights.googleapis.com/ReportConfig\"\xc4\x01\n\x19\x43reateReportConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+storageinsights.googleapis.com/ReportConfig\x12I\n\rreport_config\x18\x03 \x01(\x0b\x32-.google.cloud.storageinsights.v1.ReportConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb5\x01\n\x19UpdateReportConfigRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12I\n\rreport_config\x18\x02 \x01(\x0b\x32-.google.cloud.storageinsights.v1.ReportConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x8b\x01\n\x19\x44\x65leteReportConfigRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+storageinsights.googleapis.com/ReportConfig\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xe3\x04\n\x0cReportDetail\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\rsnapshot_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x12report_path_prefix\x18\x08 \x01(\t\x12\x14\n\x0cshards_count\x18\t \x01(\x03\x12\"\n\x06status\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\x12I\n\x06labels\x18\x05 \x03(\x0b\x32\x39.google.cloud.storageinsights.v1.ReportDetail.LabelsEntry\x12.\n\x0ftarget_datetime\x18\x06 \x01(\x0b\x32\x15.google.type.DateTime\x12M\n\x0ereport_metrics\x18\x07 \x01(\x0b\x32\x35.google.cloud.storageinsights.v1.ReportDetail.Metrics\x1a*\n\x07Metrics\x12\x1f\n\x17processed_records_count\x18\x01 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x96\x01\xea\x41\x92\x01\n+storageinsights.googleapis.com/ReportDetail\x12\x63projects/{project}/locations/{location}/reportConfigs/{report_config}/reportDetails/{report_detail}\"\xa8\x01\n\x18ListReportDetailsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+storageinsights.googleapis.com/ReportDetail\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\"\x90\x01\n\x19ListReportDetailsResponse\x12\x45\n\x0ereport_details\x18\x01 \x03(\x0b\x32-.google.cloud.storageinsights.v1.ReportDetail\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"[\n\x16GetReportDetailRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+storageinsights.googleapis.com/ReportDetail\"\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\"\xed\x01\n\x10\x46requencyOptions\x12N\n\tfrequency\x18\x01 \x01(\x0e\x32;.google.cloud.storageinsights.v1.FrequencyOptions.Frequency\x12%\n\nstart_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12#\n\x08\x65nd_date\x18\x03 \x01(\x0b\x32\x11.google.type.Date\"=\n\tFrequency\x12\x19\n\x15\x46REQUENCY_UNSPECIFIED\x10\x00\x12\t\n\x05\x44\x41ILY\x10\x01\x12\n\n\x06WEEKLY\x10\x02\"R\n\nCSVOptions\x12\x18\n\x10record_separator\x18\x01 \x01(\t\x12\x11\n\tdelimiter\x18\x02 \x01(\t\x12\x17\n\x0fheader_required\x18\x03 \x01(\x08\"\x10\n\x0eParquetOptions\"%\n\x13\x43loudStorageFilters\x12\x0e\n\x06\x62ucket\x18\x01 \x01(\t\"J\n\x1e\x43loudStorageDestinationOptions\x12\x0e\n\x06\x62ucket\x18\x01 \x01(\t\x12\x18\n\x10\x64\x65stination_path\x18\x02 \x01(\t\"\x90\x02\n\x1bObjectMetadataReportOptions\x12\x17\n\x0fmetadata_fields\x18\x01 \x03(\t\x12O\n\x0fstorage_filters\x18\x02 \x01(\x0b\x32\x34.google.cloud.storageinsights.v1.CloudStorageFiltersH\x00\x12\x66\n\x1bstorage_destination_options\x18\x03 \x01(\x0b\x32?.google.cloud.storageinsights.v1.CloudStorageDestinationOptionsH\x01\x42\x08\n\x06\x66ilterB\x15\n\x13\x64\x65stination_options\"\xf7\x05\n\x0cReportConfig\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\x12L\n\x11\x66requency_options\x18\x05 \x01(\x0b\x32\x31.google.cloud.storageinsights.v1.FrequencyOptions\x12\x42\n\x0b\x63sv_options\x18\x06 \x01(\x0b\x32+.google.cloud.storageinsights.v1.CSVOptionsH\x00\x12J\n\x0fparquet_options\x18\x07 \x01(\x0b\x32/.google.cloud.storageinsights.v1.ParquetOptionsH\x00\x12\x66\n\x1eobject_metadata_report_options\x18\x08 \x01(\x0b\x32<.google.cloud.storageinsights.v1.ObjectMetadataReportOptionsH\x01\x12I\n\x06labels\x18\n \x03(\x0b\x32\x39.google.cloud.storageinsights.v1.ReportConfig.LabelsEntry\x12\x14\n\x0c\x64isplay_name\x18\x0b \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:w\xea\x41t\n+storageinsights.googleapis.com/ReportConfig\x12\x45projects/{project}/locations/{location}/reportConfigs/{report_config}B\x0f\n\rreport_formatB\r\n\x0breport_kind\"\xcf\x01\n\x08Identity\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x44\n\x04type\x18\x02 \x01(\x0e\x32\x36.google.cloud.storageinsights.v1.Identity.IdentityType\"j\n\x0cIdentityType\x12\x1d\n\x19IDENTITY_TYPE_UNSPECIFIED\x10\x00\x12\x1c\n\x18IDENTITY_TYPE_PER_CONFIG\x10\x01\x12\x1d\n\x19IDENTITY_TYPE_PER_PROJECT\x10\x02\"\x9d\x1b\n\rDatasetConfig\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\x12J\n\x06labels\x18\x04 \x03(\x0b\x32:.google.cloud.storageinsights.v1.DatasetConfig.LabelsEntry\x12\x10\n\x03uid\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12 \n\x13organization_number\x18\x16 \x01(\x03\x42\x03\xe0\x41\x01\x12X\n\x0fsource_projects\x18\x07 \x01(\x0b\x32=.google.cloud.storageinsights.v1.DatasetConfig.SourceProjectsH\x00\x12V\n\x0esource_folders\x18\x18 \x01(\x0b\x32<.google.cloud.storageinsights.v1.DatasetConfig.SourceFoldersH\x00\x12\x1c\n\x12organization_scope\x18\x19 \x01(\x08H\x00\x12(\n\x19\x63loud_storage_object_path\x18\x15 \x01(\tB\x03\xe0\x41\x04H\x00\x12o\n\x1finclude_cloud_storage_locations\x18\x08 \x01(\x0b\x32\x44.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageLocationsH\x01\x12o\n\x1f\x65xclude_cloud_storage_locations\x18\t \x01(\x0b\x32\x44.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageLocationsH\x01\x12k\n\x1dinclude_cloud_storage_buckets\x18\n \x01(\x0b\x32\x42.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBucketsH\x02\x12k\n\x1d\x65xclude_cloud_storage_buckets\x18\x0b \x01(\x0b\x32\x42.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBucketsH\x02\x12%\n\x1dinclude_newly_created_buckets\x18\x0c \x01(\x08\x12+\n\x1cskip_verification_and_ingest\x18\x13 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12\x1d\n\x15retention_period_days\x18\x0e \x01(\x05\x12\x41\n\x04link\x18\x0f \x01(\x0b\x32\x33.google.cloud.storageinsights.v1.DatasetConfig.Link\x12;\n\x08identity\x18\x10 \x01(\x0b\x32).google.cloud.storageinsights.v1.Identity\x12\'\n\x06status\x18\x11 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12]\n\x14\x64\x61taset_config_state\x18\x12 \x01(\x0e\x32:.google.cloud.storageinsights.v1.DatasetConfig.ConfigStateB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x14 \x01(\tB\x03\xe0\x41\x01\x1a)\n\x0eSourceProjects\x12\x17\n\x0fproject_numbers\x18\x01 \x03(\x03\x1a,\n\rSourceFolders\x12\x1b\n\x0e\x66older_numbers\x18\x01 \x03(\x03\x42\x03\xe0\x41\x01\x1a*\n\x15\x43loudStorageLocations\x12\x11\n\tlocations\x18\x01 \x03(\t\x1a\xef\x01\n\x13\x43loudStorageBuckets\x12t\n\x15\x63loud_storage_buckets\x18\x01 \x03(\x0b\x32U.google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBuckets.CloudStorageBucket\x1a\x62\n\x12\x43loudStorageBucket\x12\x15\n\x0b\x62ucket_name\x18\x01 \x01(\tH\x00\x12\x1d\n\x13\x62ucket_prefix_regex\x18\x02 \x01(\tH\x00\x42\x16\n\x14\x63loud_storage_bucket\x1a\x31\n\x04Link\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06linked\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x1a\xc3\x02\n\x0c\x42ucketErrors\x12\x1c\n\x0fvalidated_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12$\n\x17permission_denied_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12)\n\x1cpermission_denied_bucket_ids\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x30\n!non_management_hub_entitled_count\x18\x05 \x01(\x03\x42\x05\x18\x01\xe0\x41\x01\x12!\n\x14internal_error_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\x12\x34\n\'non_storage_intelligence_entitled_count\x18\x07 \x01(\x03\x42\x03\xe0\x41\x01\x12\x39\n,non_storage_intelligence_entitled_bucket_ids\x18\x08 \x03(\tB\x03\xe0\x41\x01\x1a\xdf\x05\n\rProjectErrors\x12!\n\x0fvalidated_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12)\n\x17outside_org_error_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12(\n\x1boutside_org_project_numbers\x18\x03 \x03(\x03\x42\x03\xe0\x41\x01\x12;\n\'non_management_hub_entitled_error_count\x18\x07 \x01(\x03\x42\x05\x18\x01\xe0\x41\x01H\x03\x88\x01\x01\x12:\n+non_management_hub_entitled_project_numbers\x18\x08 \x03(\x03\x42\x05\x18\x01\xe0\x41\x01\x12?\n-non_storage_intelligence_entitled_error_count\x18\t \x01(\x03\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12>\n1non_storage_intelligence_entitled_project_numbers\x18\n \x03(\x03\x42\x03\xe0\x41\x01\x12&\n\x14internal_error_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12,\n\x1d\x64\x65stination_project_org_error\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x12;\n,destination_project_check_has_internal_error\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x42\"\n destination_project_check_resultB\x12\n\x10_validated_countB\x1a\n\x18_outside_org_error_countB*\n(_non_management_hub_entitled_error_countB0\n._non_storage_intelligence_entitled_error_countB\x17\n\x15_internal_error_count\x1a\xd5\x01\n\x1fValidationErrorsBeforeIngestion\x12W\n\rbucket_errors\x18\x01 \x01(\x0b\x32;.google.cloud.storageinsights.v1.DatasetConfig.BucketErrorsB\x03\xe0\x41\x01\x12Y\n\x0eproject_errors\x18\x02 \x01(\x0b\x32<.google.cloud.storageinsights.v1.DatasetConfig.ProjectErrorsB\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\"\xa6\x01\n\x0b\x43onfigState\x12\x1c\n\x18\x43ONFIG_STATE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x43ONFIG_STATE_ACTIVE\x10\x01\x12)\n%CONFIG_STATE_VERIFICATION_IN_PROGRESS\x10\x02\x12\x18\n\x14\x43ONFIG_STATE_CREATED\x10\x03\x12\x1b\n\x17\x43ONFIG_STATE_PROCESSING\x10\x04:z\xea\x41w\n,storageinsights.googleapis.com/DatasetConfig\x12Gprojects/{project}/locations/{location}/datasetConfigs/{dataset_config}B\x10\n\x0esource_optionsB\x19\n\x17\x63loud_storage_locationsB\x17\n\x15\x63loud_storage_buckets\"\xaa\x01\n\x19ListDatasetConfigsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,storageinsights.googleapis.com/DatasetConfig\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\"\x93\x01\n\x1aListDatasetConfigsResponse\x12G\n\x0f\x64\x61taset_configs\x18\x01 \x03(\x0b\x32..google.cloud.storageinsights.v1.DatasetConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"]\n\x17GetDatasetConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,storageinsights.googleapis.com/DatasetConfig\"\xe8\x01\n\x1a\x43reateDatasetConfigRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,storageinsights.googleapis.com/DatasetConfig\x12\x1e\n\x11\x64\x61taset_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\x0e\x64\x61taset_config\x18\x03 \x01(\x0b\x32..google.cloud.storageinsights.v1.DatasetConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb8\x01\n\x1aUpdateDatasetConfigRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12K\n\x0e\x64\x61taset_config\x18\x02 \x01(\x0b\x32..google.cloud.storageinsights.v1.DatasetConfigB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"y\n\x1a\x44\x65leteDatasetConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,storageinsights.googleapis.com/DatasetConfig\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"X\n\x12LinkDatasetRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,storageinsights.googleapis.com/DatasetConfig\"\x15\n\x13LinkDatasetResponse\"Z\n\x14UnlinkDatasetRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,storageinsights.googleapis.com/DatasetConfig\"U\n\x10LocationMetadata\x12\x1f\n\x17report_config_available\x18\x01 \x01(\x08\x12 \n\x18\x64\x61taset_config_available\x18\x02 \x01(\x08\x32\x90\x19\n\x0fStorageInsights\x12\xce\x01\n\x11ListReportConfigs\x12\x39.google.cloud.storageinsights.v1.ListReportConfigsRequest\x1a:.google.cloud.storageinsights.v1.ListReportConfigsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=projects/*/locations/*}/reportConfigs\x12\xbb\x01\n\x0fGetReportConfig\x12\x37.google.cloud.storageinsights.v1.GetReportConfigRequest\x1a-.google.cloud.storageinsights.v1.ReportConfig\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=projects/*/locations/*/reportConfigs/*}\x12\xe0\x01\n\x12\x43reateReportConfig\x12:.google.cloud.storageinsights.v1.CreateReportConfigRequest\x1a-.google.cloud.storageinsights.v1.ReportConfig\"_\xda\x41\x14parent,report_config\x82\xd3\xe4\x93\x02\x42\"1/v1/{parent=projects/*/locations/*}/reportConfigs:\rreport_config\x12\xf3\x01\n\x12UpdateReportConfig\x12:.google.cloud.storageinsights.v1.UpdateReportConfigRequest\x1a-.google.cloud.storageinsights.v1.ReportConfig\"r\xda\x41\x19report_config,update_mask\x82\xd3\xe4\x93\x02P2?/v1/{report_config.name=projects/*/locations/*/reportConfigs/*}:\rreport_config\x12\xaa\x01\n\x12\x44\x65leteReportConfig\x12:.google.cloud.storageinsights.v1.DeleteReportConfigRequest\x1a\x16.google.protobuf.Empty\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1/{name=projects/*/locations/*/reportConfigs/*}\x12\xde\x01\n\x11ListReportDetails\x12\x39.google.cloud.storageinsights.v1.ListReportDetailsRequest\x1a:.google.cloud.storageinsights.v1.ListReportDetailsResponse\"R\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{parent=projects/*/locations/*/reportConfigs/*}/reportDetails\x12\xcb\x01\n\x0fGetReportDetail\x12\x37.google.cloud.storageinsights.v1.GetReportDetailRequest\x1a-.google.cloud.storageinsights.v1.ReportDetail\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{name=projects/*/locations/*/reportConfigs/*/reportDetails/*}\x12\xd2\x01\n\x12ListDatasetConfigs\x12:.google.cloud.storageinsights.v1.ListDatasetConfigsRequest\x1a;.google.cloud.storageinsights.v1.ListDatasetConfigsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/datasetConfigs\x12\xbf\x01\n\x10GetDatasetConfig\x12\x38.google.cloud.storageinsights.v1.GetDatasetConfigRequest\x1a..google.cloud.storageinsights.v1.DatasetConfig\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/datasetConfigs/*}\x12\x8d\x02\n\x13\x43reateDatasetConfig\x12;.google.cloud.storageinsights.v1.CreateDatasetConfigRequest\x1a\x1d.google.longrunning.Operation\"\x99\x01\xca\x41\"\n\rDatasetConfig\x12\x11OperationMetadata\xda\x41\'parent,dataset_config,dataset_config_id\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/datasetConfigs:\x0e\x64\x61taset_config\x12\x8f\x02\n\x13UpdateDatasetConfig\x12;.google.cloud.storageinsights.v1.UpdateDatasetConfigRequest\x1a\x1d.google.longrunning.Operation\"\x9b\x01\xca\x41\"\n\rDatasetConfig\x12\x11OperationMetadata\xda\x41\x1a\x64\x61taset_config,update_mask\x82\xd3\xe4\x93\x02S2A/v1/{dataset_config.name=projects/*/locations/*/datasetConfigs/*}:\x0e\x64\x61taset_config\x12\xe1\x01\n\x13\x44\x65leteDatasetConfig\x12;.google.cloud.storageinsights.v1.DeleteDatasetConfigRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v1/{name=projects/*/locations/*/datasetConfigs/*}\x12\xde\x01\n\x0bLinkDataset\x12\x33.google.cloud.storageinsights.v1.LinkDatasetRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41(\n\x13LinkDatasetResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/locations/*/datasetConfigs/*}:linkDataset:\x01*\x12\xe6\x01\n\rUnlinkDataset\x12\x35.google.cloud.storageinsights.v1.UnlinkDatasetRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\"@/v1/{name=projects/*/locations/*/datasetConfigs/*}:unlinkDataset:\x01*\x1aR\xca\x41\x1estorageinsights.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe8\x01\n#com.google.cloud.storageinsights.v1B\x07V1ProtoP\x01ZMcloud.google.com/go/storageinsights/apiv1/storageinsightspb;storageinsightspb\xaa\x02\x1fGoogle.Cloud.StorageInsights.V1\xca\x02\x1fGoogle\\Cloud\\StorageInsights\\V1\xea\x02\"Google::Cloud::StorageInsights::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module StorageInsights - module V1 - ListReportConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListReportConfigsRequest").msgclass - ListReportConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListReportConfigsResponse").msgclass - GetReportConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.GetReportConfigRequest").msgclass - CreateReportConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CreateReportConfigRequest").msgclass - UpdateReportConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.UpdateReportConfigRequest").msgclass - DeleteReportConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DeleteReportConfigRequest").msgclass - ReportDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ReportDetail").msgclass - ReportDetail::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ReportDetail.Metrics").msgclass - ListReportDetailsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListReportDetailsRequest").msgclass - ListReportDetailsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListReportDetailsResponse").msgclass - GetReportDetailRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.GetReportDetailRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.OperationMetadata").msgclass - FrequencyOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.FrequencyOptions").msgclass - FrequencyOptions::Frequency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.FrequencyOptions.Frequency").enummodule - CSVOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CSVOptions").msgclass - ParquetOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ParquetOptions").msgclass - CloudStorageFilters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CloudStorageFilters").msgclass - CloudStorageDestinationOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CloudStorageDestinationOptions").msgclass - ObjectMetadataReportOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ObjectMetadataReportOptions").msgclass - ReportConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ReportConfig").msgclass - Identity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.Identity").msgclass - Identity::IdentityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.Identity.IdentityType").enummodule - DatasetConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig").msgclass - DatasetConfig::SourceProjects = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.SourceProjects").msgclass - DatasetConfig::SourceFolders = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.SourceFolders").msgclass - DatasetConfig::CloudStorageLocations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.CloudStorageLocations").msgclass - DatasetConfig::CloudStorageBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBuckets").msgclass - DatasetConfig::CloudStorageBuckets::CloudStorageBucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.CloudStorageBuckets.CloudStorageBucket").msgclass - DatasetConfig::Link = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.Link").msgclass - DatasetConfig::BucketErrors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.BucketErrors").msgclass - DatasetConfig::ProjectErrors = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.ProjectErrors").msgclass - DatasetConfig::ValidationErrorsBeforeIngestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.ValidationErrorsBeforeIngestion").msgclass - DatasetConfig::ConfigState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DatasetConfig.ConfigState").enummodule - ListDatasetConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListDatasetConfigsRequest").msgclass - ListDatasetConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.ListDatasetConfigsResponse").msgclass - GetDatasetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.GetDatasetConfigRequest").msgclass - CreateDatasetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.CreateDatasetConfigRequest").msgclass - UpdateDatasetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.UpdateDatasetConfigRequest").msgclass - DeleteDatasetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.DeleteDatasetConfigRequest").msgclass - LinkDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.LinkDatasetRequest").msgclass - LinkDatasetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.LinkDatasetResponse").msgclass - UnlinkDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.UnlinkDatasetRequest").msgclass - LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.storageinsights.v1.LocationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb b/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb deleted file mode 100644 index 6b36d9b1d713..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb +++ /dev/null @@ -1,72 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/storageinsights/v1/storageinsights.proto for package 'Google.Cloud.StorageInsights.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/storageinsights/v1/storageinsights_pb' - -module Google - module Cloud - module StorageInsights - module V1 - module StorageInsights - # 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.storageinsights.v1.StorageInsights' - - # Lists ReportConfigs in a given project and location. - rpc :ListReportConfigs, ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, ::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse - # Gets details of a single ReportConfig. - rpc :GetReportConfig, ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, ::Google::Cloud::StorageInsights::V1::ReportConfig - # Creates a new ReportConfig in a given project and location. - rpc :CreateReportConfig, ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, ::Google::Cloud::StorageInsights::V1::ReportConfig - # Updates the parameters of a single ReportConfig. - rpc :UpdateReportConfig, ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, ::Google::Cloud::StorageInsights::V1::ReportConfig - # Deletes a single ReportConfig. - rpc :DeleteReportConfig, ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, ::Google::Protobuf::Empty - # Lists ReportDetails in a given project and location. - rpc :ListReportDetails, ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, ::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse - # Gets details of a single ReportDetail. - rpc :GetReportDetail, ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, ::Google::Cloud::StorageInsights::V1::ReportDetail - # Lists the dataset configurations in a given project for a given location. - rpc :ListDatasetConfigs, ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse - # Gets the dataset configuration in a given project for a given location. - rpc :GetDatasetConfig, ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, ::Google::Cloud::StorageInsights::V1::DatasetConfig - # Creates a dataset configuration in a given project for a given location. - rpc :CreateDatasetConfig, ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, ::Google::Longrunning::Operation - # Updates a dataset configuration in a given project for a given location. - rpc :UpdateDatasetConfig, ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, ::Google::Longrunning::Operation - # Deletes a dataset configuration in a given project for a given location. - rpc :DeleteDatasetConfig, ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, ::Google::Longrunning::Operation - # Links a dataset to BigQuery in a given project for a given location. - rpc :LinkDataset, ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, ::Google::Longrunning::Operation - # Unlinks a dataset from BigQuery in a given project - # for a given location. - rpc :UnlinkDataset, ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/README.md deleted file mode 100644 index 9bdfaa290d57..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Storage Insights 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-storage_insights-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb deleted file mode 100644 index 523cad53f1b0..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb +++ /dev/null @@ -1,930 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module StorageInsights - module V1 - # Request message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_configs `ListReportConfigs`} - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListReportConfigsRequest - # @!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 ListReportConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing ReportConfigs - # @!attribute [rw] report_configs - # @return [::Array<::Google::Cloud::StorageInsights::V1::ReportConfig>] - # The list of ReportConfig - # @!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 ListReportConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a ReportConfig - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - class GetReportConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a ReportConfig - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] report_config - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # Required. The resource being created - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateReportConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a ReportConfig - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # ReportConfig 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] report_config - # @return [::Google::Cloud::StorageInsights::V1::ReportConfig] - # 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 UpdateReportConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a ReportConfig - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - # @!attribute [rw] force - # @return [::Boolean] - # Optional. If set, all ReportDetails for this ReportConfig will be deleted. - # @!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 DeleteReportConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing ReportDetail object. ReportDetail represents metadata of - # generated reports for a ReportConfig. - # Next ID: 10 - # @!attribute [rw] name - # @return [::String] - # Name of resource. It will be of form - # projects//locations//reportConfigs//reportDetails/. - # @!attribute [rw] snapshot_time - # @return [::Google::Protobuf::Timestamp] - # The snapshot time. - # All the report data is referenced at this point of time. - # @!attribute [rw] report_path_prefix - # @return [::String] - # Prefix of the object name of each report's shard. This will have full - # prefix except the "extension" and "shard_id". - # For example, if the `destination_path` is - # `{{report-config-id}}/dt={{datetime}}`, the shard object name would be - # `gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv` - # and the value of `report_path_prefix` field would be - # `gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_`. - # @!attribute [rw] shards_count - # @return [::Integer] - # Total shards generated for the report. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Status of the ReportDetail. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [rw] target_datetime - # @return [::Google::Type::DateTime] - # The date for which report is generated. The time part of target_datetime - # will be zero till we support multiple reports per day. - # @!attribute [rw] report_metrics - # @return [::Google::Cloud::StorageInsights::V1::ReportDetail::Metrics] - # Metrics of the report. - class ReportDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Different metrics associated with the generated report. - # @!attribute [rw] processed_records_count - # @return [::Integer] - # Count of Cloud Storage objects which are part of the report. - class Metrics - 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 - - # Message for requesting list of ReportDetails - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListReportDetailsRequest - # @!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 ListReportDetailsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing ReportDetails - # @!attribute [rw] report_details - # @return [::Array<::Google::Cloud::StorageInsights::V1::ReportDetail>] - # The list of ReportDetail - # @!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 ListReportDetailsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a ReportDetail - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - class GetReportDetailRequest - 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 - - # ReportConfig Resource: - # - # Options to setup frequency of report generation. - # @!attribute [rw] frequency - # @return [::Google::Cloud::StorageInsights::V1::FrequencyOptions::Frequency] - # Frequency of report generation. - # @!attribute [rw] start_date - # @return [::Google::Type::Date] - # The date from which report generation should start. - # UTC time zone. - # @!attribute [rw] end_date - # @return [::Google::Type::Date] - # The date on which report generation should stop (Inclusive). - # UTC time zone. - class FrequencyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This ENUM specifies possible frequencies of report generation. - module Frequency - # Unspecified. - FREQUENCY_UNSPECIFIED = 0 - - # Report will be generated daily. - DAILY = 1 - - # Report will be generated weekly. - WEEKLY = 2 - end - end - - # Options to configure CSV formatted reports. - # @!attribute [rw] record_separator - # @return [::String] - # Record separator characters in CSV. - # @!attribute [rw] delimiter - # @return [::String] - # Delimiter characters in CSV. - # @!attribute [rw] header_required - # @return [::Boolean] - # If set, will include a header row in the CSV report. - class CSVOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options to configure Parquet formatted reports. - class ParquetOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options to filter data on storage systems. - # Next ID: 2 - # @!attribute [rw] bucket - # @return [::String] - # Bucket for which the report will be generated. - class CloudStorageFilters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options to store reports in storage systems. - # Next ID: 3 - # @!attribute [rw] bucket - # @return [::String] - # Destination bucket. - # @!attribute [rw] destination_path - # @return [::String] - # Destination path is the path in the bucket where the report should be - # generated. - class CloudStorageDestinationOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Report specification for exporting object metadata. - # Next ID: 4 - # @!attribute [rw] metadata_fields - # @return [::Array<::String>] - # Metadata fields to be included in the report. - # @!attribute [rw] storage_filters - # @return [::Google::Cloud::StorageInsights::V1::CloudStorageFilters] - # Cloud Storage as the storage system. - # @!attribute [rw] storage_destination_options - # @return [::Google::Cloud::StorageInsights::V1::CloudStorageDestinationOptions] - # Cloud Storage as the storage system. - class ObjectMetadataReportOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing ReportConfig object. ReportConfig is the configuration to - # generate reports. - # See - # https://cloud.google.com/storage/docs/insights/using-inventory-reports#create-config-rest - # for more details on how to set various fields. - # Next ID: 12 - # @!attribute [rw] name - # @return [::String] - # name of resource. It will be of form - # projects//locations//reportConfigs/. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Create time stamp - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Update time stamp - # @!attribute [rw] frequency_options - # @return [::Google::Cloud::StorageInsights::V1::FrequencyOptions] - # The frequency of report generation. - # @!attribute [rw] csv_options - # @return [::Google::Cloud::StorageInsights::V1::CSVOptions] - # Options for CSV formatted reports. - # - # Note: The following fields are mutually exclusive: `csv_options`, `parquet_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parquet_options - # @return [::Google::Cloud::StorageInsights::V1::ParquetOptions] - # Options for Parquet formatted reports. - # - # Note: The following fields are mutually exclusive: `parquet_options`, `csv_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] object_metadata_report_options - # @return [::Google::Cloud::StorageInsights::V1::ObjectMetadataReportOptions] - # Report for exporting object metadata. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [rw] display_name - # @return [::String] - # User provided display name which can be empty and limited to 256 characters - # that is editable. - class ReportConfig - 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 - - # Identity lets the user provide the type of identity to use, and outputs - # the identity string that can be used for IAM policy changes. - # @!attribute [r] name - # @return [::String] - # Output only. Name of the identity. - # @!attribute [rw] type - # @return [::Google::Cloud::StorageInsights::V1::Identity::IdentityType] - # Type of identity to use for the datasetConfig. - class Identity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of service account to use for the dataset configuration. - module IdentityType - # Default is unspecified and should not be used. - IDENTITY_TYPE_UNSPECIFIED = 0 - - # Google managed service account per resource. - IDENTITY_TYPE_PER_CONFIG = 1 - - # Google managed service account per project. - IDENTITY_TYPE_PER_PROJECT = 2 - end - end - - # Message describing the dataset configuration properties. For more - # information, see [Dataset configuration - # properties](https://cloud.google.com/storage/docs/insights/datasets#dataset-config). - # @!attribute [rw] name - # @return [::String] - # Identifier. name of resource - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The UTC time at which the dataset configuration was created. - # This is auto-populated. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The UTC time at which the dataset configuration was last - # updated. This is auto-populated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [r] uid - # @return [::String] - # Output only. System generated unique identifier for the resource. - # @!attribute [rw] organization_number - # @return [::Integer] - # Optional. Organization resource ID that the source projects should belong - # to. Projects that do not belong to the provided organization are not - # considered when creating the dataset. - # @!attribute [rw] source_projects - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::SourceProjects] - # Defines the options for providing source projects for the dataset. - # - # Note: The following fields are mutually exclusive: `source_projects`, `source_folders`, `organization_scope`, `cloud_storage_object_path`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] source_folders - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::SourceFolders] - # Defines the options for providing source folders for the dataset. - # - # Note: The following fields are mutually exclusive: `source_folders`, `source_projects`, `organization_scope`, `cloud_storage_object_path`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] organization_scope - # @return [::Boolean] - # Defines the options for providing a source organization for the dataset. - # - # Note: The following fields are mutually exclusive: `organization_scope`, `source_projects`, `source_folders`, `cloud_storage_object_path`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] cloud_storage_object_path - # @return [::String] - # Input only. Cloud Storage object path containing a list of - # project or folder numbers to include in the dataset; - # it cannot contain a mix of project and folders. - # - # The object must be a text file where each line has one of the following - # entries: - # - # - Project number, formatted as `projects/{project_number}`, for example, - # `projects/1234567890`. - # - Folder identifier, formatted as `folders/{folder_number}`, for example, - # `folders/9876543210`. - # Path must be in the format `gs://{bucket_name}/{object_name}`. - # - # Note: The following fields are mutually exclusive: `cloud_storage_object_path`, `source_projects`, `source_folders`, `organization_scope`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] include_cloud_storage_locations - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageLocations] - # Note: The following fields are mutually exclusive: `include_cloud_storage_locations`, `exclude_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclude_cloud_storage_locations - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageLocations] - # Note: The following fields are mutually exclusive: `exclude_cloud_storage_locations`, `include_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] include_cloud_storage_buckets - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageBuckets] - # Note: The following fields are mutually exclusive: `include_cloud_storage_buckets`, `exclude_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclude_cloud_storage_buckets - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageBuckets] - # Note: The following fields are mutually exclusive: `exclude_cloud_storage_buckets`, `include_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] include_newly_created_buckets - # @return [::Boolean] - # If set to `true`, the request includes all the newly created buckets in the - # dataset that meet the inclusion and exclusion rules. - # @!attribute [rw] skip_verification_and_ingest - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. If set to `false`, then all the permission checks must be - # successful before the system can start ingesting data. This field can only - # be updated before the system ingests data for the first time. Any attempt - # to modify the field after data ingestion starts results in an error. - # @!attribute [rw] retention_period_days - # @return [::Integer] - # Number of days of history that must be retained. - # @!attribute [rw] link - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::Link] - # Details of the linked dataset. - # @!attribute [rw] identity - # @return [::Google::Cloud::StorageInsights::V1::Identity] - # Identity used by this `datasetConfig`. - # @!attribute [r] status - # @return [::Google::Rpc::Status] - # Output only. Status of the `datasetConfig`. - # @!attribute [r] dataset_config_state - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::ConfigState] - # Output only. State of the `datasetConfig`. - # @!attribute [rw] description - # @return [::String] - # Optional. A user-provided description for the dataset configuration. - # - # Maximum length: 256 characters. - class DatasetConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Collection of project numbers - # @!attribute [rw] project_numbers - # @return [::Array<::Integer>] - class SourceProjects - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies a set of folders to include in the dataset - # @!attribute [rw] folder_numbers - # @return [::Array<::Integer>] - # Optional. The list of folder numbers to include in the dataset. - class SourceFolders - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Collection of Cloud Storage locations. - # @!attribute [rw] locations - # @return [::Array<::String>] - class CloudStorageLocations - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Collection of Cloud Storage buckets. - # @!attribute [rw] cloud_storage_buckets - # @return [::Array<::Google::Cloud::StorageInsights::V1::DatasetConfig::CloudStorageBuckets::CloudStorageBucket>] - class CloudStorageBuckets - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines the bucket by its name or a regex pattern to match buckets. - # @!attribute [rw] bucket_name - # @return [::String] - # Cloud Storage bucket name. - # - # Note: The following fields are mutually exclusive: `bucket_name`, `bucket_prefix_regex`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bucket_prefix_regex - # @return [::String] - # A regex pattern for bucket names matching the regex. Regex should - # follow the syntax specified in `google/re2` on GitHub. - # - # Note: The following fields are mutually exclusive: `bucket_prefix_regex`, `bucket_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class CloudStorageBucket - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Defines the details about the linked dataset. - # @!attribute [r] dataset - # @return [::String] - # Output only. Dataset name for linked dataset. - # @!attribute [r] linked - # @return [::Boolean] - # Output only. State of the linked dataset. - class Link - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides a summary of the bucket level error statistics. - # @!attribute [rw] validated_count - # @return [::Integer] - # Optional. Count of successfully validated buckets. - # @!attribute [rw] permission_denied_count - # @return [::Integer] - # Optional. Count of buckets with permission denied errors. - # @!attribute [rw] permission_denied_bucket_ids - # @return [::Array<::String>] - # Optional. Subset of bucket names that have permission denied. - # @!attribute [rw] non_management_hub_entitled_count - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Optional. Count of buckets that are not subscribed to Storage - # Intelligence. - # @!attribute [rw] internal_error_count - # @return [::Integer] - # Optional. Number of buckets that encountered internal errors during the - # validation process. These buckets are automatically retried in subsequent - # validation attempts. - # @!attribute [rw] non_storage_intelligence_entitled_count - # @return [::Integer] - # Optional. Count of buckets that are not subscribed to Storage - # Intelligence. - # @!attribute [rw] non_storage_intelligence_entitled_bucket_ids - # @return [::Array<::String>] - # Optional. Subset of bucket names that are not subscribed to Storage - # Intelligence. - class BucketErrors - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides a summary of the project level error statistics. - # @!attribute [rw] validated_count - # @return [::Integer] - # Optional. Count of successfully validated projects. - # @!attribute [rw] outside_org_error_count - # @return [::Integer] - # Optional. Count of projects which are not in the same organization. - # @!attribute [rw] outside_org_project_numbers - # @return [::Array<::Integer>] - # Optional. Subset of project numbers which are not in the same - # organization. - # @!attribute [rw] non_management_hub_entitled_error_count - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # Optional. Count of projects that are not subscribed to Storage - # Intelligence. - # @!attribute [rw] non_management_hub_entitled_project_numbers - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Integer>] - # Optional. Subset of project numbers that are not subscribed to Storage - # Intelligence. - # @!attribute [rw] non_storage_intelligence_entitled_error_count - # @return [::Integer] - # Optional. Count of projects that are not subscribed to Storage - # Intelligence. - # @!attribute [rw] non_storage_intelligence_entitled_project_numbers - # @return [::Array<::Integer>] - # Optional. Subset of project numbers that are not subscribed to Storage - # Intelligence. - # @!attribute [rw] internal_error_count - # @return [::Integer] - # Optional. Number of projects that encountered internal errors during - # validation and are automatically retried. - # @!attribute [rw] destination_project_org_error - # @return [::Boolean] - # Optional. Indicates if the destination project resides within the same - # organization as the source project. - # - # Note: The following fields are mutually exclusive: `destination_project_org_error`, `destination_project_check_has_internal_error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] destination_project_check_has_internal_error - # @return [::Boolean] - # Optional. Indicates whether the destination project check failed due to - # an internal error. If `true`, the system automatically retries the - # check. - # - # Note: The following fields are mutually exclusive: `destination_project_check_has_internal_error`, `destination_project_org_error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ProjectErrors - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Summary of validation errors that occurred during the verification phase. - # @!attribute [rw] bucket_errors - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::BucketErrors] - # Optional. Provides a summary of the bucket level error stats. - # @!attribute [rw] project_errors - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig::ProjectErrors] - # Optional. Provides a summary of the project level error stats. - class ValidationErrorsBeforeIngestion - 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 - - # State of the configuration. - module ConfigState - # Unspecified state. - CONFIG_STATE_UNSPECIFIED = 0 - - # Active configuration indicates that the configuration is - # actively ingesting data. - CONFIG_STATE_ACTIVE = 1 - - # In this state, the configuration is being verified for various - # permissions. - CONFIG_STATE_VERIFICATION_IN_PROGRESS = 2 - - # Configuration is created and further processing needs to happen. - CONFIG_STATE_CREATED = 3 - - # Configuration is under processing - CONFIG_STATE_PROCESSING = 4 - end - end - - # Request message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs `ListDatasetConfigs`} - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListDatasetConfigsRequest - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server might return fewer items than requested. - # If unspecified, server picks 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 ListDatasetConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs `ListDatasetConfigs`} - # @!attribute [rw] dataset_configs - # @return [::Array<::Google::Cloud::StorageInsights::V1::DatasetConfig>] - # The list of `DatasetConfigs` - # @!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 ListDatasetConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_dataset_config `GetDatasetConfig`} - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - class GetDatasetConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_dataset_config `CreateDatasetConfig`} - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] dataset_config_id - # @return [::String] - # Required. ID of the requesting object. - # If auto-generating ID is enabled on the server-side, remove this field and - # `dataset_config_id` from the method_signature of Create RPC - # Note: The value should not contain any hyphens. - # @!attribute [rw] dataset_config - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] - # Required. The resource being created - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for your request. - # Specify the request ID if you need to retry the request. - # If you retry the request with the same ID within 60 minutes, the server - # ignores the request if it has already completed the original request. - # - # For example, if your initial request times out and you retry the request - # using the same request ID, the server recognizes the original request and - # does not process the new request. - # - # The request ID must be a valid UUID and cannot be a zero UUID - # (00000000-0000-0000-0000-000000000000). - class CreateDatasetConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_dataset_config `UpdateDatasetConfig`} - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `DatasetConfig` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field is overwritten if it is in the mask. If the - # user does not provide a mask then it returns an "Invalid Argument" error. - # @!attribute [rw] dataset_config - # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig] - # Required. The resource being updated - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for your request. - # Specify the request ID if you need to retry the request. - # If you retry the request with the same ID within 60 minutes, the server - # ignores the request if it has already completed the original request. - # - # For example, if your initial request times out and you retry the request - # using the same request ID, the server recognizes the original request and - # does not process the new request. - # - # The request ID must be a valid UUID and cannot be a zero UUID - # (00000000-0000-0000-0000-000000000000). - class UpdateDatasetConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_dataset_config `DeleteDatasetConfig`} - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for your request. - # Specify the request ID if you need to retry the request. - # If you retry the request with the same ID within 60 minutes, the server - # ignores the request if it has already completed the original request. - # - # For example, if your initial request times out and you retry the request - # using the same request ID, the server recognizes the original request and - # does not process the new request. - # - # The request ID must be a valid UUID and cannot be a zero UUID - # (00000000-0000-0000-0000-000000000000). - class DeleteDatasetConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset `LinkDataset`} - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - class LinkDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset `LinkDataset`} - class LinkDatasetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::StorageInsights::V1::StorageInsights::Client#unlink_dataset `UnlinkDataset`} - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - class UnlinkDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata that helps discover which resources are available in a location. - # @!attribute [rw] report_config_available - # @return [::Boolean] - # If true, `storageinsights.googleapis.com/ReportConfig` resource is - # available at the location. - # @!attribute [rw] dataset_config_available - # @return [::Boolean] - # If true, `storageinsights.googleapis.com/DatasetConfig` resource is - # available at the location. - class LocationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/date.rb deleted file mode 100644 index 1d0a9780457f..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/date.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a whole or partial calendar date, such as a birthday. The time of - # day and time zone are either specified elsewhere or are insignificant. The - # date is relative to the Gregorian Calendar. This can represent one of the - # following: - # - # * A full date, with non-zero year, month, and day values - # * A month and day value, with a zero year, such as an anniversary - # * A year on its own, with zero month and day values - # * A year and month value, with a zero day, such as a credit card expiration - # date - # - # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] year - # @return [::Integer] - # Year of the date. Must be from 1 to 9999, or 0 to specify a date without - # a year. - # @!attribute [rw] month - # @return [::Integer] - # Month of a year. Must be from 1 to 12, or 0 to specify a year without a - # month and day. - # @!attribute [rw] day - # @return [::Integer] - # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 - # to specify a year by itself or a year and month where the day isn't - # significant. - class Date - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/datetime.rb deleted file mode 100644 index d15ba7af54e4..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/proto_docs/google/type/datetime.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents civil time (or occasionally physical time). - # - # This type can represent a civil time in one of a few possible ways: - # - # * When utc_offset is set and time_zone is unset: a civil time on a calendar - # day with a particular offset from UTC. - # * When time_zone is set and utc_offset is unset: a civil time on a calendar - # day in a particular time zone. - # * When neither time_zone nor utc_offset is set: a civil time on a calendar - # day in local time. - # - # The date is relative to the Proleptic Gregorian Calendar. - # - # If year is 0, the DateTime is considered not to have a specific year. month - # and day must have valid, non-zero values. - # - # This type may also be used to represent a physical time if all the date and - # time fields are set and either case of the `time_offset` oneof is set. - # Consider using `Timestamp` message for physical time instead. If your use - # case also would like to store the user's timezone, that can be done in - # another field. - # - # This type is more flexible than some applications may want. Make sure to - # document and validate your application's limitations. - # @!attribute [rw] year - # @return [::Integer] - # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a - # datetime without a year. - # @!attribute [rw] month - # @return [::Integer] - # Required. Month of year. Must be from 1 to 12. - # @!attribute [rw] day - # @return [::Integer] - # Required. Day of month. Must be from 1 to 31 and valid for the year and - # month. - # @!attribute [rw] hours - # @return [::Integer] - # Required. 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] - # Required. Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Required. 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] - # Required. Fractions of seconds in nanoseconds. Must be from 0 to - # 999,999,999. - # @!attribute [rw] utc_offset - # @return [::Google::Protobuf::Duration] - # UTC offset. Must be whole seconds, between -18 hours and +18 hours. - # For example, a UTC offset of -4:00 would be represented as - # { seconds: -14400 }. - # - # Note: The following fields are mutually exclusive: `utc_offset`, `time_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] time_zone - # @return [::Google::Type::TimeZone] - # Time zone. - # - # Note: The following fields are mutually exclusive: `time_zone`, `utc_offset`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class DateTime - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a time zone from the - # [IANA Time Zone Database](https://www.iana.org/time-zones). - # @!attribute [rw] id - # @return [::String] - # IANA Time Zone Database time zone, e.g. "America/New_York". - # @!attribute [rw] version - # @return [::String] - # Optional. IANA Time Zone Database version number, e.g. "2019a". - class TimeZone - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/Gemfile deleted file mode 100644 index 47a364cb06ed..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-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-storage_insights-v1", path: "../" -else - gem "google-cloud-storage_insights-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-storage_insights-v1/snippets/snippet_metadata_google.cloud.storageinsights.v1.json b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/snippet_metadata_google.cloud.storageinsights.v1.json deleted file mode 100644 index 4ab1f1cc7f7f..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/snippet_metadata_google.cloud.storageinsights.v1.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-storage_insights-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.storageinsights.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "storageinsights_v1_generated_StorageInsights_ListReportConfigs_sync", - "title": "Snippet for the list_report_configs call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_configs.", - "file": "storage_insights/list_report_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_report_configs", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "ListReportConfigs", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.ListReportConfigs", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_GetReportConfig_sync", - "title": "Snippet for the get_report_config call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_config.", - "file": "storage_insights/get_report_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_report_config", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::GetReportConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageInsights::V1::ReportConfig", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "GetReportConfig", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.GetReportConfig", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_CreateReportConfig_sync", - "title": "Snippet for the create_report_config call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_report_config.", - "file": "storage_insights/create_report_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_report_config", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_report_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageInsights::V1::ReportConfig", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "CreateReportConfig", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.CreateReportConfig", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_UpdateReportConfig_sync", - "title": "Snippet for the update_report_config call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_report_config.", - "file": "storage_insights/update_report_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_report_config", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_report_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageInsights::V1::ReportConfig", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "UpdateReportConfig", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.UpdateReportConfig", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_DeleteReportConfig_sync", - "title": "Snippet for the delete_report_config call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_report_config.", - "file": "storage_insights/delete_report_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_report_config", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_report_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "DeleteReportConfig", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.DeleteReportConfig", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_ListReportDetails_sync", - "title": "Snippet for the list_report_details call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_details.", - "file": "storage_insights/list_report_details.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_report_details", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_details", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "ListReportDetails", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.ListReportDetails", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_GetReportDetail_sync", - "title": "Snippet for the get_report_detail call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_detail.", - "file": "storage_insights/get_report_detail.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_report_detail", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_detail", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::GetReportDetailRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageInsights::V1::ReportDetail", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "GetReportDetail", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.GetReportDetail", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_ListDatasetConfigs_sync", - "title": "Snippet for the list_dataset_configs call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs.", - "file": "storage_insights/list_dataset_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_dataset_configs", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "ListDatasetConfigs", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.ListDatasetConfigs", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_GetDatasetConfig_sync", - "title": "Snippet for the get_dataset_config call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_dataset_config.", - "file": "storage_insights/get_dataset_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_dataset_config", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_dataset_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageInsights::V1::DatasetConfig", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "GetDatasetConfig", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.GetDatasetConfig", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_CreateDatasetConfig_sync", - "title": "Snippet for the create_dataset_config call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_dataset_config.", - "file": "storage_insights/create_dataset_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_dataset_config", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_dataset_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "CreateDatasetConfig", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.CreateDatasetConfig", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_UpdateDatasetConfig_sync", - "title": "Snippet for the update_dataset_config call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_dataset_config.", - "file": "storage_insights/update_dataset_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_dataset_config", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_dataset_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "UpdateDatasetConfig", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.UpdateDatasetConfig", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_DeleteDatasetConfig_sync", - "title": "Snippet for the delete_dataset_config call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_dataset_config.", - "file": "storage_insights/delete_dataset_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_dataset_config", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_dataset_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "DeleteDatasetConfig", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.DeleteDatasetConfig", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_LinkDataset_sync", - "title": "Snippet for the link_dataset call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset.", - "file": "storage_insights/link_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "link_dataset", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::LinkDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "LinkDataset", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.LinkDataset", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storageinsights_v1_generated_StorageInsights_UnlinkDataset_sync", - "title": "Snippet for the unlink_dataset call in the StorageInsights service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageInsights::V1::StorageInsights::Client#unlink_dataset.", - "file": "storage_insights/unlink_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "unlink_dataset", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client#unlink_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageInsights::Client", - "full_name": "::Google::Cloud::StorageInsights::V1::StorageInsights::Client" - }, - "method": { - "short_name": "UnlinkDataset", - "full_name": "google.cloud.storageinsights.v1.StorageInsights.UnlinkDataset", - "service": { - "short_name": "StorageInsights", - "full_name": "google.cloud.storageinsights.v1.StorageInsights" - } - } - }, - "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-storage_insights-v1/snippets/storage_insights/create_dataset_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_dataset_config.rb deleted file mode 100644 index 7cd9ac123ca3..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_dataset_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storageinsights_v1_generated_StorageInsights_CreateDatasetConfig_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the create_dataset_config call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_dataset_config. -# -def create_dataset_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new - - # Call the create_dataset_config method. - result = client.create_dataset_config request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storageinsights_v1_generated_StorageInsights_CreateDatasetConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_report_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_report_config.rb deleted file mode 100644 index c8c6c0d174ec..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/create_report_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 storageinsights_v1_generated_StorageInsights_CreateReportConfig_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the create_report_config call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#create_report_config. -# -def create_report_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new - - # Call the create_report_config method. - result = client.create_report_config request - - # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. - p result -end -# [END storageinsights_v1_generated_StorageInsights_CreateReportConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_dataset_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_dataset_config.rb deleted file mode 100644 index d9579acbf677..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_dataset_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storageinsights_v1_generated_StorageInsights_DeleteDatasetConfig_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the delete_dataset_config call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_dataset_config. -# -def delete_dataset_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.new - - # Call the delete_dataset_config method. - result = client.delete_dataset_config request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storageinsights_v1_generated_StorageInsights_DeleteDatasetConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_report_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_report_config.rb deleted file mode 100644 index 58805a1019b5..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/delete_report_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 storageinsights_v1_generated_StorageInsights_DeleteReportConfig_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the delete_report_config call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#delete_report_config. -# -def delete_report_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new - - # Call the delete_report_config method. - result = client.delete_report_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storageinsights_v1_generated_StorageInsights_DeleteReportConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_dataset_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_dataset_config.rb deleted file mode 100644 index e053a3ec3083..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_dataset_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 storageinsights_v1_generated_StorageInsights_GetDatasetConfig_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the get_dataset_config call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_dataset_config. -# -def get_dataset_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new - - # Call the get_dataset_config method. - result = client.get_dataset_config request - - # The returned object is of type Google::Cloud::StorageInsights::V1::DatasetConfig. - p result -end -# [END storageinsights_v1_generated_StorageInsights_GetDatasetConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_config.rb deleted file mode 100644 index 74591709f31a..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_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 storageinsights_v1_generated_StorageInsights_GetReportConfig_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the get_report_config call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_config. -# -def get_report_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new - - # Call the get_report_config method. - result = client.get_report_config request - - # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. - p result -end -# [END storageinsights_v1_generated_StorageInsights_GetReportConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_detail.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_detail.rb deleted file mode 100644 index 04b01526bb8d..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/get_report_detail.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storageinsights_v1_generated_StorageInsights_GetReportDetail_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the get_report_detail call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#get_report_detail. -# -def get_report_detail - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new - - # Call the get_report_detail method. - result = client.get_report_detail request - - # The returned object is of type Google::Cloud::StorageInsights::V1::ReportDetail. - p result -end -# [END storageinsights_v1_generated_StorageInsights_GetReportDetail_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/link_dataset.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/link_dataset.rb deleted file mode 100644 index b57ffa2d799c..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/link_dataset.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storageinsights_v1_generated_StorageInsights_LinkDataset_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the link_dataset call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#link_dataset. -# -def link_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new - - # Call the link_dataset method. - result = client.link_dataset request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storageinsights_v1_generated_StorageInsights_LinkDataset_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_dataset_configs.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_dataset_configs.rb deleted file mode 100644 index a430968a524a..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_dataset_configs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storageinsights_v1_generated_StorageInsights_ListDatasetConfigs_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the list_dataset_configs call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_dataset_configs. -# -def list_dataset_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.new - - # Call the list_dataset_configs method. - result = client.list_dataset_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::StorageInsights::V1::DatasetConfig. - p item - end -end -# [END storageinsights_v1_generated_StorageInsights_ListDatasetConfigs_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_configs.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_configs.rb deleted file mode 100644 index d43b7dc08ed1..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_configs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storageinsights_v1_generated_StorageInsights_ListReportConfigs_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the list_report_configs call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_configs. -# -def list_report_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new - - # Call the list_report_configs method. - result = client.list_report_configs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportConfig. - p item - end -end -# [END storageinsights_v1_generated_StorageInsights_ListReportConfigs_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_details.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_details.rb deleted file mode 100644 index 7377d5cb45d0..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/list_report_details.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 storageinsights_v1_generated_StorageInsights_ListReportDetails_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the list_report_details call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#list_report_details. -# -def list_report_details - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.new - - # Call the list_report_details method. - result = client.list_report_details request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::StorageInsights::V1::ReportDetail. - p item - end -end -# [END storageinsights_v1_generated_StorageInsights_ListReportDetails_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/unlink_dataset.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/unlink_dataset.rb deleted file mode 100644 index e9a3e2500962..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/unlink_dataset.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storageinsights_v1_generated_StorageInsights_UnlinkDataset_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the unlink_dataset call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#unlink_dataset. -# -def unlink_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new - - # Call the unlink_dataset method. - result = client.unlink_dataset request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storageinsights_v1_generated_StorageInsights_UnlinkDataset_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_dataset_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_dataset_config.rb deleted file mode 100644 index 3a60645b50bc..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_dataset_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storageinsights_v1_generated_StorageInsights_UpdateDatasetConfig_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the update_dataset_config call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_dataset_config. -# -def update_dataset_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new - - # Call the update_dataset_config method. - result = client.update_dataset_config request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storageinsights_v1_generated_StorageInsights_UpdateDatasetConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_report_config.rb b/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_report_config.rb deleted file mode 100644 index a7924d487517..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/snippets/storage_insights/update_report_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 storageinsights_v1_generated_StorageInsights_UpdateReportConfig_sync] -require "google/cloud/storage_insights/v1" - -## -# Snippet for the update_report_config call in the StorageInsights service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageInsights::V1::StorageInsights::Client#update_report_config. -# -def update_report_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new - - # Call the update_report_config method. - result = client.update_report_config request - - # The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig. - p result -end -# [END storageinsights_v1_generated_StorageInsights_UpdateReportConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_operations_test.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_operations_test.rb deleted file mode 100644 index 951ff810d844..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_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/storageinsights/v1/storageinsights_pb" -require "google/cloud/storageinsights/v1/storageinsights_services_pb" -require "google/cloud/storage_insights/v1/storage_insights" - -class ::Google::Cloud::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb deleted file mode 100644 index a11e979ff863..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/storage_insights/v1/storage_insights" - -class ::Google::Cloud::StorageInsights::V1::StorageInsights::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_dataset_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::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dataset_config_path project: "value0", location: "value1", dataset_config: "value2" - assert_equal "projects/value0/locations/value1/datasetConfigs/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::StorageInsights::V1::StorageInsights::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_report_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::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.report_config_path project: "value0", location: "value1", report_config: "value2" - assert_equal "projects/value0/locations/value1/reportConfigs/value2", path - end - end - - def test_report_detail_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.report_detail_path project: "value0", location: "value1", report_config: "value2", report_detail: "value3" - assert_equal "projects/value0/locations/value1/reportConfigs/value2/reportDetails/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb deleted file mode 100644 index 5d74730e0c70..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb +++ /dev/null @@ -1,879 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/storageinsights/v1/storageinsights_pb" -require "google/cloud/storage_insights/v1/storage_insights/rest" - - -class ::Google::Cloud::StorageInsights::V1::StorageInsights::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_report_configs - # Create test objects. - client_result = ::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse.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_report_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_list_report_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_report_configs_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_report_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_report_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_report_configs ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.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_report_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_report_configs(::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.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_report_configs_client_stub.call_count - end - end - end - - def test_get_report_config - # Create test objects. - client_result = ::Google::Cloud::StorageInsights::V1::ReportConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_report_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_get_report_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_report_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_report_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_report_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_report_config ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_report_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_report_config(::Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_report_config_client_stub.call_count - end - end - end - - def test_create_report_config - # Create test objects. - client_result = ::Google::Cloud::StorageInsights::V1::ReportConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - report_config = {} - request_id = "hello world" - - create_report_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_create_report_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_report_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_report_config({ parent: parent, report_config: report_config, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_report_config parent: parent, report_config: report_config, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_report_config ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new(parent: parent, report_config: report_config, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_report_config({ parent: parent, report_config: report_config, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_report_config(::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new(parent: parent, report_config: report_config, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_report_config_client_stub.call_count - end - end - end - - def test_update_report_config - # Create test objects. - client_result = ::Google::Cloud::StorageInsights::V1::ReportConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - update_mask = {} - report_config = {} - request_id = "hello world" - - update_report_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_update_report_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_report_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_report_config({ update_mask: update_mask, report_config: report_config, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_report_config update_mask: update_mask, report_config: report_config, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_report_config ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new(update_mask: update_mask, report_config: report_config, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_report_config({ update_mask: update_mask, report_config: report_config, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_report_config(::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new(update_mask: update_mask, report_config: report_config, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_report_config_client_stub.call_count - end - end - end - - def test_delete_report_config - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - force = true - request_id = "hello world" - - delete_report_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_delete_report_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_report_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_report_config({ name: name, force: force, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_report_config name: name, force: force, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_report_config ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new(name: name, force: force, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_report_config({ name: name, force: force, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_report_config(::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new(name: name, force: force, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_report_config_client_stub.call_count - end - end - end - - def test_list_report_details - # Create test objects. - client_result = ::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse.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_report_details_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_list_report_details_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_report_details_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_report_details({ 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_report_details 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_report_details ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.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_report_details({ 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_report_details(::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.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_report_details_client_stub.call_count - end - end - end - - def test_get_report_detail - # Create test objects. - client_result = ::Google::Cloud::StorageInsights::V1::ReportDetail.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_report_detail_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_get_report_detail_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_report_detail_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_report_detail({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_report_detail name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_report_detail ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_report_detail({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_report_detail(::Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_report_detail_client_stub.call_count - end - end - end - - def test_list_dataset_configs - # Create test objects. - client_result = ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse.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_dataset_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_list_dataset_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_dataset_configs_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_dataset_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_dataset_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_dataset_configs ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.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_dataset_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_dataset_configs(::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.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_dataset_configs_client_stub.call_count - end - end - end - - def test_get_dataset_config - # Create test objects. - client_result = ::Google::Cloud::StorageInsights::V1::DatasetConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_dataset_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_get_dataset_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_dataset_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_dataset_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_dataset_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_dataset_config ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_dataset_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_dataset_config(::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_dataset_config_client_stub.call_count - end - end - end - - def test_create_dataset_config - # Create test objects. - 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" - dataset_config_id = "hello world" - dataset_config = {} - request_id = "hello world" - - create_dataset_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_create_dataset_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_dataset_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_dataset_config({ parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_dataset_config parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_dataset_config ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new(parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_dataset_config({ parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_dataset_config(::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new(parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_dataset_config_client_stub.call_count - end - end - end - - def test_update_dataset_config - # Create test objects. - 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 = {} - dataset_config = {} - request_id = "hello world" - - update_dataset_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_update_dataset_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_dataset_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_dataset_config({ update_mask: update_mask, dataset_config: dataset_config, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_dataset_config update_mask: update_mask, dataset_config: dataset_config, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_dataset_config ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new(update_mask: update_mask, dataset_config: dataset_config, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_dataset_config({ update_mask: update_mask, dataset_config: dataset_config, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_dataset_config(::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new(update_mask: update_mask, dataset_config: dataset_config, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_dataset_config_client_stub.call_count - end - end - end - - def test_delete_dataset_config - # Create test objects. - 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_dataset_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::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_delete_dataset_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_dataset_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_dataset_config({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_dataset_config name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_dataset_config ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.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_dataset_config({ 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_dataset_config(::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.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_dataset_config_client_stub.call_count - end - end - end - - def test_link_dataset - # Create test objects. - 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" - - link_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_link_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, link_dataset_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.link_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.link_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.link_dataset ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.link_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.link_dataset(::Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, link_dataset_client_stub.call_count - end - end - end - - def test_unlink_dataset - # Create test objects. - 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" - - unlink_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.stub :transcode_unlink_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, unlink_dataset_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.unlink_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.unlink_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.unlink_dataset ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.unlink_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.unlink_dataset(::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, unlink_dataset_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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb deleted file mode 100644 index e3460b7a30bf..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_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/storageinsights/v1/storageinsights_pb" -require "google/cloud/storage_insights/v1/storage_insights" - -class ::Google::Cloud::StorageInsights::V1::StorageInsights::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_report_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageInsights::V1::ListReportConfigsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_report_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_report_configs, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, 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_report_configs_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_report_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_report_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_report_configs ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.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_report_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_report_configs(::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.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_report_configs_client_stub.call_rpc_count - end - end - - def test_get_report_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageInsights::V1::ReportConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_report_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_report_config, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_report_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_report_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_report_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_report_config ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_report_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_report_config(::Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_report_config_client_stub.call_rpc_count - end - end - - def test_create_report_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageInsights::V1::ReportConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - report_config = {} - request_id = "hello world" - - create_report_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_report_config, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageInsights::V1::ReportConfig), request["report_config"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_report_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_report_config({ parent: parent, report_config: report_config, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_report_config parent: parent, report_config: report_config, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_report_config ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new(parent: parent, report_config: report_config, 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_report_config({ parent: parent, report_config: report_config, 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_report_config(::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new(parent: parent, report_config: report_config, 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_report_config_client_stub.call_rpc_count - end - end - - def test_update_report_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageInsights::V1::ReportConfig.new - grpc_operation = GRPC::ActiveCall::Operation.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 = {} - report_config = {} - request_id = "hello world" - - update_report_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_report_config, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageInsights::V1::ReportConfig), request["report_config"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_report_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_report_config({ update_mask: update_mask, report_config: report_config, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_report_config update_mask: update_mask, report_config: report_config, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_report_config ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new(update_mask: update_mask, report_config: report_config, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_report_config({ update_mask: update_mask, report_config: report_config, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_report_config(::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new(update_mask: update_mask, report_config: report_config, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_report_config_client_stub.call_rpc_count - end - end - - def test_delete_report_config - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - force = true - request_id = "hello world" - - delete_report_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_report_config, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["force"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_report_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_report_config({ name: name, force: force, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_report_config name: name, force: force, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_report_config ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new(name: name, force: force, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_report_config({ name: name, force: force, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_report_config(::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new(name: name, force: force, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_report_config_client_stub.call_rpc_count - end - end - - def test_list_report_details - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageInsights::V1::ListReportDetailsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_report_details_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_report_details, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, 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_report_details_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_report_details({ 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_report_details 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_report_details ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.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_report_details({ 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_report_details(::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.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_report_details_client_stub.call_rpc_count - end - end - - def test_get_report_detail - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageInsights::V1::ReportDetail.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_report_detail_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_report_detail, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_report_detail_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_report_detail({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_report_detail name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_report_detail ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_report_detail({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_report_detail(::Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_report_detail_client_stub.call_rpc_count - end - end - - def test_list_dataset_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_dataset_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_dataset_configs, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, 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_dataset_configs_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_dataset_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_dataset_configs parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_dataset_configs ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.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_dataset_configs({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_dataset_configs(::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.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_dataset_configs_client_stub.call_rpc_count - end - end - - def test_get_dataset_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageInsights::V1::DatasetConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_dataset_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_dataset_config, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_dataset_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_dataset_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_dataset_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_dataset_config ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_dataset_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_dataset_config(::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_dataset_config_client_stub.call_rpc_count - end - end - - def test_create_dataset_config - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - dataset_config_id = "hello world" - dataset_config = {} - request_id = "hello world" - - create_dataset_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_dataset_config, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["dataset_config_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageInsights::V1::DatasetConfig), request["dataset_config"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_dataset_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_dataset_config({ parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_dataset_config parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_dataset_config ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new(parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_dataset_config({ parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_dataset_config(::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new(parent: parent, dataset_config_id: dataset_config_id, dataset_config: dataset_config, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_dataset_config_client_stub.call_rpc_count - end - end - - def test_update_dataset_config - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.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 = {} - dataset_config = {} - request_id = "hello world" - - update_dataset_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_dataset_config, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageInsights::V1::DatasetConfig), request["dataset_config"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_dataset_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_dataset_config({ update_mask: update_mask, dataset_config: dataset_config, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_dataset_config update_mask: update_mask, dataset_config: dataset_config, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_dataset_config ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new(update_mask: update_mask, dataset_config: dataset_config, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_dataset_config({ update_mask: update_mask, dataset_config: dataset_config, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_dataset_config(::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new(update_mask: update_mask, dataset_config: dataset_config, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_dataset_config_client_stub.call_rpc_count - end - end - - def test_delete_dataset_config - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_dataset_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_dataset_config, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_dataset_config_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_dataset_config({ 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_dataset_config 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_dataset_config ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.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_dataset_config({ 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_dataset_config(::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.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_dataset_config_client_stub.call_rpc_count - end - end - - def test_link_dataset - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - link_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :link_dataset, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, link_dataset_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.link_dataset({ name: 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.link_dataset name: 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.link_dataset ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest.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.link_dataset({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.link_dataset(::Google::Cloud::StorageInsights::V1::LinkDatasetRequest.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, link_dataset_client_stub.call_rpc_count - end - end - - def test_unlink_dataset - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - unlink_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :unlink_dataset, name - assert_kind_of ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, unlink_dataset_client_stub do - # Create client - client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.unlink_dataset({ name: 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.unlink_dataset name: 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.unlink_dataset ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.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.unlink_dataset({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.unlink_dataset(::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.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, unlink_dataset_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::StorageInsights::V1::StorageInsights::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::StorageInsights::V1::StorageInsights::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::StorageInsights::V1::StorageInsights::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-storage_insights-v1/test/helper.rb b/owl-bot-staging/google-cloud-storage_insights-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-storage_insights-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/.gitignore b/owl-bot-staging/google-cloud-storage_transfer-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-storage_transfer-v1/.repo-metadata.json deleted file mode 100644 index 7e07d441e56a..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "storagetransfer.googleapis.com", - "api_shortname": "storagetransfer", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage_transfer-v1/latest", - "distribution_name": "google-cloud-storage_transfer-v1", - "is_cloud": true, - "language": "ruby", - "name": "storagetransfer", - "name_pretty": "Storage Transfer Service V1 API", - "product_documentation": "https://cloud.google.com/storage-transfer-service/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Storage Transfer Service allows you to quickly import online data into Cloud Storage. You can also set up a repeating schedule for transferring data, as well as transfer data within Cloud Storage, from one bucket to another. Note that google-cloud-storage_transfer-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_transfer instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/storage-transfer-service/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/.rubocop.yml b/owl-bot-staging/google-cloud-storage_transfer-v1/.rubocop.yml deleted file mode 100644 index 9372f2dc47b5..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-storage_transfer-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-storage_transfer-v1.rb" diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/.toys.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/.yardopts b/owl-bot-staging/google-cloud-storage_transfer-v1/.yardopts deleted file mode 100644 index 7089b8062b51..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Storage Transfer Service V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage_transfer-v1/AUTHENTICATION.md deleted file mode 100644 index bbd40b1c7b37..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-storage_transfer-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-storage_transfer-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/storage_transfer/v1" - -client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/storage_transfer/v1" - -::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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-storage_transfer-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/storage_transfer/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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-storage_transfer-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-storage_transfer-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/Gemfile b/owl-bot-staging/google-cloud-storage_transfer-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/LICENSE.md b/owl-bot-staging/google-cloud-storage_transfer-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/README.md b/owl-bot-staging/google-cloud-storage_transfer-v1/README.md deleted file mode 100644 index 1a9aacfea26b..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Storage Transfer Service V1 API - -Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets. - -Storage Transfer Service allows you to quickly import online data into Cloud Storage. You can also set up a repeating schedule for transferring data, as well as transfer data within Cloud Storage, from one bucket to another. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Storage Transfer Service V1 API. Most users should consider using -the main client gem, -[google-cloud-storage_transfer](https://rubygems.org/gems/google-cloud-storage_transfer). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-storage_transfer-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/storagetransfer.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/storage_transfer/v1" - -client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -request = ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new # (request fields as keyword arguments...) -response = client.get_google_service_account request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage_transfer-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/storage-transfer-service/) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/storage_transfer/v1" -require "logger" - -client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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-storage_transfer`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-storage_transfer-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-storage_transfer`. -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-storage_transfer-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-storage_transfer-v1/Rakefile b/owl-bot-staging/google-cloud-storage_transfer-v1/Rakefile deleted file mode 100644 index 2dae212edd97..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-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/storage_transfer/v1/storage_transfer_service/credentials" - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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-storage_transfer-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-storage_transfer-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-storage_transfer-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-storage_transfer-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-storage_transfer-v1" - header "google-cloud-storage_transfer-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-storage_transfer-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-storage_transfer-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-storage_transfer-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-storage_transfer-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-storage_transfer-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-storage_transfer-v1/gapic_metadata.json deleted file mode 100644 index 7b82525e8f4b..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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.storagetransfer.v1", - "libraryPackage": "::Google::Cloud::StorageTransfer::V1", - "services": { - "StorageTransferService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client", - "rpcs": { - "GetGoogleServiceAccount": { - "methods": [ - "get_google_service_account" - ] - }, - "CreateTransferJob": { - "methods": [ - "create_transfer_job" - ] - }, - "UpdateTransferJob": { - "methods": [ - "update_transfer_job" - ] - }, - "GetTransferJob": { - "methods": [ - "get_transfer_job" - ] - }, - "ListTransferJobs": { - "methods": [ - "list_transfer_jobs" - ] - }, - "PauseTransferOperation": { - "methods": [ - "pause_transfer_operation" - ] - }, - "ResumeTransferOperation": { - "methods": [ - "resume_transfer_operation" - ] - }, - "RunTransferJob": { - "methods": [ - "run_transfer_job" - ] - }, - "DeleteTransferJob": { - "methods": [ - "delete_transfer_job" - ] - }, - "CreateAgentPool": { - "methods": [ - "create_agent_pool" - ] - }, - "UpdateAgentPool": { - "methods": [ - "update_agent_pool" - ] - }, - "GetAgentPool": { - "methods": [ - "get_agent_pool" - ] - }, - "ListAgentPools": { - "methods": [ - "list_agent_pools" - ] - }, - "DeleteAgentPool": { - "methods": [ - "delete_agent_pool" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/google-cloud-storage_transfer-v1.gemspec b/owl-bot-staging/google-cloud-storage_transfer-v1/google-cloud-storage_transfer-v1.gemspec deleted file mode 100644 index 63a9a0925bda..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/google-cloud-storage_transfer-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/storage_transfer/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-storage_transfer-v1" - gem.version = Google::Cloud::StorageTransfer::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Storage Transfer Service allows you to quickly import online data into Cloud Storage. You can also set up a repeating schedule for transferring data, as well as transfer data within Cloud Storage, from one bucket to another. Note that google-cloud-storage_transfer-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage_transfer instead. See the readme for more details." - gem.summary = "Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google-cloud-storage_transfer-v1.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google-cloud-storage_transfer-v1.rb deleted file mode 100644 index 8d192d1af8ef..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google-cloud-storage_transfer-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/storage_transfer/v1" diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1.rb deleted file mode 100644 index 1efd00697fd6..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/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/storage_transfer/v1/storage_transfer_service" -require "google/cloud/storage_transfer/v1/version" - -module Google - module Cloud - module StorageTransfer - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/storage_transfer/v1" - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/storage_transfer/v1" - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/storage_transfer/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/rest.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/rest.rb deleted file mode 100644 index 011f181029a2..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/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/storage_transfer/v1/storage_transfer_service/rest" -require "google/cloud/storage_transfer/v1/version" - -module Google - module Cloud - module StorageTransfer - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/storage_transfer/v1/rest" - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service.rb deleted file mode 100644 index 77477cb89a2b..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/storage_transfer/v1/version" - -require "google/cloud/storage_transfer/v1/storage_transfer_service/credentials" -require "google/cloud/storage_transfer/v1/storage_transfer_service/paths" -require "google/cloud/storage_transfer/v1/storage_transfer_service/operations" -require "google/cloud/storage_transfer/v1/storage_transfer_service/client" -require "google/cloud/storage_transfer/v1/storage_transfer_service/rest" - -module Google - module Cloud - module StorageTransfer - module V1 - ## - # Storage Transfer Service and its protos. - # Transfers data between between Google Cloud Storage buckets or from a data - # source external to Google to a Cloud Storage bucket. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/storage_transfer/v1/storage_transfer_service" - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/storage_transfer/v1/storage_transfer_service/rest" - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - module StorageTransferService - end - end - end - end -end - -helper_path = ::File.join __dir__, "storage_transfer_service", "helpers.rb" -require "google/cloud/storage_transfer/v1/storage_transfer_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/client.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/client.rb deleted file mode 100644 index 6bea975696d7..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/client.rb +++ /dev/null @@ -1,1832 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/storagetransfer/v1/transfer_pb" - -module Google - module Cloud - module StorageTransfer - module V1 - module StorageTransferService - ## - # Client for the StorageTransferService service. - # - # Storage Transfer Service and its protos. - # Transfers data between between Google Cloud Storage buckets or from a data - # source external to Google to a Cloud Storage bucket. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storagetransfer.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_transfer_service_stub - - ## - # Configure the StorageTransferService Client class. - # - # See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageTransferService clients - # ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "StorageTransfer", "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: 2, retry_codes: [14] - } - - default_config.rpcs.create_transfer_job.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageTransferService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @storage_transfer_service_stub.universe_domain - end - - ## - # Create a new StorageTransferService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageTransferService 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/storagetransfer/v1/transfer_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 - - @storage_transfer_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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 - ) - - @storage_transfer_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::StorageTransfer::V1::StorageTransferService::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @storage_transfer_service_stub.logger - end - - # Service calls - - ## - # Returns the Google service account that is used by Storage Transfer - # Service to access buckets in the project where transfers - # run or in other projects. Each Google service account is associated - # with one Google Cloud project. Users - # should add this service account to the Google Cloud Storage bucket - # ACLs to grant access to Storage Transfer Service. This service - # account is created and owned by Storage Transfer Service and can - # only be used by Storage Transfer Service. - # - # @overload get_google_service_account(request, options = nil) - # Pass arguments to `get_google_service_account` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_google_service_account(project_id: nil) - # Pass arguments to `get_google_service_account` via keyword arguments. Note that at - # least one keyword argument is 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_id [::String] - # Required. The ID of the Google Cloud project that the Google service - # account is associated with. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new - # - # # Call the get_google_service_account method. - # result = client.get_google_service_account request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::GoogleServiceAccount. - # p result - # - def get_google_service_account request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_google_service_account.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-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_id - header_params["project_id"] = request.project_id - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_google_service_account.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_google_service_account.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :get_google_service_account, request, 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 transfer job that runs periodically. - # - # @overload create_transfer_job(request, options = nil) - # Pass arguments to `create_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_transfer_job(transfer_job: nil) - # Pass arguments to `create_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash] - # Required. The job to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageTransfer::V1::TransferJob] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new - # - # # Call the create_transfer_job method. - # result = client.create_transfer_job request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. - # p result - # - def create_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest - - # Converts hash and nil to 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_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_transfer_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :create_transfer_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a transfer job. Updating a job's transfer spec does not affect - # transfer operations that are running already. - # - # **Note:** The job's {::Google::Cloud::StorageTransfer::V1::TransferJob#status status} - # field can be modified using this RPC (for example, to set a job's status to - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}, or - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED}). - # - # @overload update_transfer_job(request, options = nil) - # Pass arguments to `update_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_transfer_job(job_name: nil, project_id: nil, transfer_job: nil, update_transfer_job_field_mask: nil) - # Pass arguments to `update_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job_name [::String] - # Required. The name of job to update. - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the - # job. - # @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash] - # Required. The job to update. `transferJob` is expected to specify one or - # more of five fields: - # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and - # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. An - # `UpdateTransferJobRequest` that specifies other fields are rejected with - # the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. Updating a - # job status to - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} requires - # `storagetransfer.jobs.delete` permission. - # @param update_transfer_job_field_mask [::Google::Protobuf::FieldMask, ::Hash] - # The field mask of the fields in `transferJob` that are to be updated in - # this request. Fields in `transferJob` that can be updated are: - # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and - # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. To update the - # `transfer_spec` of the job, a complete transfer specification must be - # provided. An incomplete specification missing any required fields is - # rejected with the error - # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageTransfer::V1::TransferJob] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new - # - # # Call the update_transfer_job method. - # result = client.update_transfer_job request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. - # p result - # - def update_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest - - # Converts hash and nil to 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_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.job_name - header_params["job_name"] = request.job_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_transfer_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :update_transfer_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a transfer job. - # - # @overload get_transfer_job(request, options = nil) - # Pass arguments to `get_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_transfer_job(job_name: nil, project_id: nil) - # Pass arguments to `get_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job_name [::String] - # Required. The job to get. - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the - # job. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageTransfer::V1::TransferJob] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new - # - # # Call the get_transfer_job method. - # result = client.get_transfer_job request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. - # p result - # - def get_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.job_name - header_params["job_name"] = request.job_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_transfer_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :get_transfer_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists transfer jobs. - # - # @overload list_transfer_jobs(request, options = nil) - # Pass arguments to `list_transfer_jobs` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_transfer_jobs(filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_transfer_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param filter [::String] - # Required. A list of query parameters specified as JSON text in the form of: - # - # ``` - # { - # "projectId":"my_project_id", - # "jobNames":["jobid1","jobid2",...], - # "jobStatuses":["status1","status2",...], - # "dataBackend":"QUERY_REPLICATION_CONFIGS", - # "sourceBucket":"source-bucket-name", - # "sinkBucket":"sink-bucket-name", - # } - # ``` - # - # The JSON formatting in the example is for display only; provide the - # query parameters without spaces or line breaks. - # - # * `projectId` is required. - # * Since `jobNames` and `jobStatuses` support multiple values, their values - # must be specified with array notation. `jobNames` and `jobStatuses` are - # optional. Valid values are case-insensitive: - # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED} - # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED} - # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} - # * Specify `"dataBackend":"QUERY_REPLICATION_CONFIGS"` to return a list of - # cross-bucket replication jobs. - # * Limit the results to jobs from a particular bucket with `sourceBucket` - # and/or to a particular bucket with `sinkBucket`. - # @param page_size [::Integer] - # The list page size. The max allowed value is 256. - # @param page_token [::String] - # The list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new - # - # # Call the list_transfer_jobs method. - # result = client.list_transfer_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageTransfer::V1::TransferJob. - # p item - # end - # - def list_transfer_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_transfer_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_transfer_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_transfer_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :list_transfer_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_transfer_service_stub, :list_transfer_jobs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses a transfer operation. - # - # @overload pause_transfer_operation(request, options = nil) - # Pass arguments to `pause_transfer_operation` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transfer_operation(name: nil) - # Pass arguments to `pause_transfer_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 transfer operation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new - # - # # Call the pause_transfer_operation method. - # result = client.pause_transfer_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def pause_transfer_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest - - # Converts hash and nil to 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_transfer_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_transfer_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_transfer_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :pause_transfer_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 - - ## - # Resumes a transfer operation that is paused. - # - # @overload resume_transfer_operation(request, options = nil) - # Pass arguments to `resume_transfer_operation` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transfer_operation(name: nil) - # Pass arguments to `resume_transfer_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 transfer operation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new - # - # # Call the resume_transfer_operation method. - # result = client.resume_transfer_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def resume_transfer_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest - - # Converts hash and nil to 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_transfer_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_transfer_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_transfer_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :resume_transfer_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 a new operation for the specified transfer job. - # A `TransferJob` has a maximum of one active `TransferOperation`. If this - # method is called while a `TransferOperation` is active, an error is - # returned. - # - # @overload run_transfer_job(request, options = nil) - # Pass arguments to `run_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_transfer_job(job_name: nil, project_id: nil) - # Pass arguments to `run_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job_name [::String] - # Required. The name of the transfer job. - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the transfer - # job. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new - # - # # Call the run_transfer_job method. - # result = client.run_transfer_job request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def run_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.run_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.job_name - header_params["job_name"] = request.job_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.run_transfer_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :run_transfer_job, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 transfer job. Deleting a transfer job sets its status to - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}. - # - # @overload delete_transfer_job(request, options = nil) - # Pass arguments to `delete_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_transfer_job(job_name: nil, project_id: nil) - # Pass arguments to `delete_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job_name [::String] - # Required. The job to delete. - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the - # job. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new - # - # # Call the delete_transfer_job method. - # result = client.delete_transfer_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.job_name - header_params["job_name"] = request.job_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_transfer_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :delete_transfer_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an agent pool resource. - # - # @overload create_agent_pool(request, options = nil) - # Pass arguments to `create_agent_pool` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_agent_pool(project_id: nil, agent_pool: nil, agent_pool_id: nil) - # Pass arguments to `create_agent_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the - # agent pool. - # @param agent_pool [::Google::Cloud::StorageTransfer::V1::AgentPool, ::Hash] - # Required. The agent pool to create. - # @param agent_pool_id [::String] - # Required. The ID of the agent pool to create. - # - # The `agent_pool_id` must meet the following requirements: - # - # * Length of 128 characters or less. - # * Not start with the string `goog`. - # * Start with a lowercase ASCII character, followed by: - # * Zero or more: lowercase Latin alphabet characters, numerals, - # hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). - # * One or more numerals or lowercase ASCII characters. - # - # As expressed by the regular expression: - # `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageTransfer::V1::AgentPool] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new - # - # # Call the create_agent_pool method. - # result = client.create_agent_pool request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. - # p result - # - def create_agent_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest - - # Converts hash and nil to 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_agent_pool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-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_id - header_params["project_id"] = request.project_id - end - - request_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_agent_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_agent_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :create_agent_pool, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing agent pool resource. - # - # @overload update_agent_pool(request, options = nil) - # Pass arguments to `update_agent_pool` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_agent_pool(agent_pool: nil, update_mask: nil) - # Pass arguments to `update_agent_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param agent_pool [::Google::Cloud::StorageTransfer::V1::AgentPool, ::Hash] - # Required. The agent pool to update. `agent_pool` is expected to specify - # following fields: - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#name name} - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} - # An `UpdateAgentPoolRequest` with any other fields is rejected - # with the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The [field mask] - # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) - # of the fields in `agentPool` to update in this request. - # The following `agentPool` fields can be updated: - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageTransfer::V1::AgentPool] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new - # - # # Call the update_agent_pool method. - # result = client.update_agent_pool request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. - # p result - # - def update_agent_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest - - # Converts hash and nil to 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_agent_pool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.agent_pool&.name - header_params["agent_pool.name"] = request.agent_pool.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_agent_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_agent_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :update_agent_pool, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an agent pool. - # - # @overload get_agent_pool(request, options = nil) - # Pass arguments to `get_agent_pool` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_agent_pool(name: nil) - # Pass arguments to `get_agent_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the agent pool to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::StorageTransfer::V1::AgentPool] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new - # - # # Call the get_agent_pool method. - # result = client.get_agent_pool request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. - # p result - # - def get_agent_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_agent_pool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_agent_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_agent_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :get_agent_pool, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists agent pools. - # - # @overload list_agent_pools(request, options = nil) - # Pass arguments to `list_agent_pools` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_agent_pools(project_id: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_agent_pools` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the job. - # @param filter [::String] - # An optional list of query parameters specified as JSON text in the - # form of: - # - # `{"agentPoolNames":["agentpool1","agentpool2",...]}` - # - # Since `agentPoolNames` support multiple values, its values must be - # specified with array notation. When the filter is either empty or not - # provided, the list returns all agent pools for the project. - # @param page_size [::Integer] - # The list page size. The max allowed value is `256`. - # @param page_token [::String] - # The list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new - # - # # Call the list_agent_pools method. - # result = client.list_agent_pools request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageTransfer::V1::AgentPool. - # p item - # end - # - def list_agent_pools request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_agent_pools.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-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_id - header_params["project_id"] = request.project_id - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_agent_pools.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_agent_pools.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :list_agent_pools, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_transfer_service_stub, :list_agent_pools, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an agent pool. - # - # @overload delete_agent_pool(request, options = nil) - # Pass arguments to `delete_agent_pool` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_agent_pool(name: nil) - # Pass arguments to `delete_agent_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the agent pool to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new - # - # # Call the delete_agent_pool method. - # result = client.delete_agent_pool request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_agent_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_agent_pool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_agent_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_agent_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.call_rpc :delete_agent_pool, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the StorageTransferService API. - # - # This class represents the configuration for StorageTransferService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_google_service_account to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_google_service_account.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_google_service_account.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::StorageTransfer::V1::StorageTransferService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storagetransfer.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the StorageTransferService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_google_service_account` - # @return [::Gapic::Config::Method] - # - attr_reader :get_google_service_account - ## - # RPC-specific configuration for `create_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_transfer_job - ## - # RPC-specific configuration for `update_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_transfer_job - ## - # RPC-specific configuration for `get_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_transfer_job - ## - # RPC-specific configuration for `list_transfer_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_transfer_jobs - ## - # RPC-specific configuration for `pause_transfer_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_transfer_operation - ## - # RPC-specific configuration for `resume_transfer_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_transfer_operation - ## - # RPC-specific configuration for `run_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_transfer_job - ## - # RPC-specific configuration for `delete_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_transfer_job - ## - # RPC-specific configuration for `create_agent_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :create_agent_pool - ## - # RPC-specific configuration for `update_agent_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :update_agent_pool - ## - # RPC-specific configuration for `get_agent_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :get_agent_pool - ## - # RPC-specific configuration for `list_agent_pools` - # @return [::Gapic::Config::Method] - # - attr_reader :list_agent_pools - ## - # RPC-specific configuration for `delete_agent_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_agent_pool - - # @private - def initialize parent_rpcs = nil - get_google_service_account_config = parent_rpcs.get_google_service_account if parent_rpcs.respond_to? :get_google_service_account - @get_google_service_account = ::Gapic::Config::Method.new get_google_service_account_config - create_transfer_job_config = parent_rpcs.create_transfer_job if parent_rpcs.respond_to? :create_transfer_job - @create_transfer_job = ::Gapic::Config::Method.new create_transfer_job_config - update_transfer_job_config = parent_rpcs.update_transfer_job if parent_rpcs.respond_to? :update_transfer_job - @update_transfer_job = ::Gapic::Config::Method.new update_transfer_job_config - get_transfer_job_config = parent_rpcs.get_transfer_job if parent_rpcs.respond_to? :get_transfer_job - @get_transfer_job = ::Gapic::Config::Method.new get_transfer_job_config - list_transfer_jobs_config = parent_rpcs.list_transfer_jobs if parent_rpcs.respond_to? :list_transfer_jobs - @list_transfer_jobs = ::Gapic::Config::Method.new list_transfer_jobs_config - pause_transfer_operation_config = parent_rpcs.pause_transfer_operation if parent_rpcs.respond_to? :pause_transfer_operation - @pause_transfer_operation = ::Gapic::Config::Method.new pause_transfer_operation_config - resume_transfer_operation_config = parent_rpcs.resume_transfer_operation if parent_rpcs.respond_to? :resume_transfer_operation - @resume_transfer_operation = ::Gapic::Config::Method.new resume_transfer_operation_config - run_transfer_job_config = parent_rpcs.run_transfer_job if parent_rpcs.respond_to? :run_transfer_job - @run_transfer_job = ::Gapic::Config::Method.new run_transfer_job_config - delete_transfer_job_config = parent_rpcs.delete_transfer_job if parent_rpcs.respond_to? :delete_transfer_job - @delete_transfer_job = ::Gapic::Config::Method.new delete_transfer_job_config - create_agent_pool_config = parent_rpcs.create_agent_pool if parent_rpcs.respond_to? :create_agent_pool - @create_agent_pool = ::Gapic::Config::Method.new create_agent_pool_config - update_agent_pool_config = parent_rpcs.update_agent_pool if parent_rpcs.respond_to? :update_agent_pool - @update_agent_pool = ::Gapic::Config::Method.new update_agent_pool_config - get_agent_pool_config = parent_rpcs.get_agent_pool if parent_rpcs.respond_to? :get_agent_pool - @get_agent_pool = ::Gapic::Config::Method.new get_agent_pool_config - list_agent_pools_config = parent_rpcs.list_agent_pools if parent_rpcs.respond_to? :list_agent_pools - @list_agent_pools = ::Gapic::Config::Method.new list_agent_pools_config - delete_agent_pool_config = parent_rpcs.delete_agent_pool if parent_rpcs.respond_to? :delete_agent_pool - @delete_agent_pool = ::Gapic::Config::Method.new delete_agent_pool_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/credentials.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/credentials.rb deleted file mode 100644 index 483f0600c63e..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/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 StorageTransfer - module V1 - module StorageTransferService - # Credentials for the StorageTransferService 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-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/operations.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/operations.rb deleted file mode 100644 index 0b3f97869c7f..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_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 StorageTransfer - module V1 - module StorageTransferService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storagetransfer.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StorageTransferService 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 StorageTransferService 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::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::StorageTransfer::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::StorageTransfer::V1::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 = "storagetransfer.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/paths.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/paths.rb deleted file mode 100644 index 1d20532cf22e..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/paths.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module StorageTransfer - module V1 - module StorageTransferService - # Path helper methods for the StorageTransferService API. - module Paths - ## - # Create a fully-qualified agentPools resource string. - # - # The resource will be in the following format: - # - # `projects/{project_id}/agentPools/{agent_pool_id}` - # - # @param project_id [String] - # @param agent_pool_id [String] - # - # @return [::String] - def agent_pools_path project_id:, agent_pool_id: - raise ::ArgumentError, "project_id cannot contain /" if project_id.to_s.include? "/" - - "projects/#{project_id}/agentPools/#{agent_pool_id}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest.rb deleted file mode 100644 index cb60b590943e..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/storage_transfer/v1/version" - -require "google/cloud/storage_transfer/v1/storage_transfer_service/credentials" -require "google/cloud/storage_transfer/v1/storage_transfer_service/paths" -require "google/cloud/storage_transfer/v1/storage_transfer_service/rest/operations" -require "google/cloud/storage_transfer/v1/storage_transfer_service/rest/client" - -module Google - module Cloud - module StorageTransfer - module V1 - ## - # Storage Transfer Service and its protos. - # Transfers data between between Google Cloud Storage buckets or from a data - # source external to Google to a Cloud Storage bucket. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/storage_transfer/v1/storage_transfer_service/rest" - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - module StorageTransferService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/storage_transfer/v1/storage_transfer_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/client.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/client.rb deleted file mode 100644 index db426430410d..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/client.rb +++ /dev/null @@ -1,1707 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/storagetransfer/v1/transfer_pb" -require "google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub" - -module Google - module Cloud - module StorageTransfer - module V1 - module StorageTransferService - module Rest - ## - # REST client for the StorageTransferService service. - # - # Storage Transfer Service and its protos. - # Transfers data between between Google Cloud Storage buckets or from a data - # source external to Google to a Cloud Storage bucket. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storagetransfer.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_transfer_service_stub - - ## - # Configure the StorageTransferService Client class. - # - # See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageTransferService clients - # ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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", "StorageTransfer", "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: 2, retry_codes: [14] - } - - default_config.rpcs.create_transfer_job.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageTransferService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::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 - @storage_transfer_service_stub.universe_domain - end - - ## - # Create a new StorageTransferService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageTransferService 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::StorageTransfer::V1::StorageTransferService::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 - - @storage_transfer_service_stub = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @storage_transfer_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::StorageTransfer::V1::StorageTransferService::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @storage_transfer_service_stub.logger - end - - # Service calls - - ## - # Returns the Google service account that is used by Storage Transfer - # Service to access buckets in the project where transfers - # run or in other projects. Each Google service account is associated - # with one Google Cloud project. Users - # should add this service account to the Google Cloud Storage bucket - # ACLs to grant access to Storage Transfer Service. This service - # account is created and owned by Storage Transfer Service and can - # only be used by Storage Transfer Service. - # - # @overload get_google_service_account(request, options = nil) - # Pass arguments to `get_google_service_account` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_google_service_account(project_id: nil) - # Pass arguments to `get_google_service_account` via keyword arguments. Note that at - # least one keyword argument is 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_id [::String] - # Required. The ID of the Google Cloud project that the Google service - # account is associated with. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new - # - # # Call the get_google_service_account method. - # result = client.get_google_service_account request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::GoogleServiceAccount. - # p result - # - def get_google_service_account request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_google_service_account.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_google_service_account.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_google_service_account.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.get_google_service_account request, 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 transfer job that runs periodically. - # - # @overload create_transfer_job(request, options = nil) - # Pass arguments to `create_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_transfer_job(transfer_job: nil) - # Pass arguments to `create_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash] - # Required. The job to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new - # - # # Call the create_transfer_job method. - # result = client.create_transfer_job request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. - # p result - # - def create_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest - - # Converts hash and nil to an 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_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_transfer_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.create_transfer_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a transfer job. Updating a job's transfer spec does not affect - # transfer operations that are running already. - # - # **Note:** The job's {::Google::Cloud::StorageTransfer::V1::TransferJob#status status} - # field can be modified using this RPC (for example, to set a job's status to - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}, or - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED}). - # - # @overload update_transfer_job(request, options = nil) - # Pass arguments to `update_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_transfer_job(job_name: nil, project_id: nil, transfer_job: nil, update_transfer_job_field_mask: nil) - # Pass arguments to `update_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job_name [::String] - # Required. The name of job to update. - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the - # job. - # @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash] - # Required. The job to update. `transferJob` is expected to specify one or - # more of five fields: - # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and - # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. An - # `UpdateTransferJobRequest` that specifies other fields are rejected with - # the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. Updating a - # job status to - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} requires - # `storagetransfer.jobs.delete` permission. - # @param update_transfer_job_field_mask [::Google::Protobuf::FieldMask, ::Hash] - # The field mask of the fields in `transferJob` that are to be updated in - # this request. Fields in `transferJob` that can be updated are: - # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and - # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. To update the - # `transfer_spec` of the job, a complete transfer specification must be - # provided. An incomplete specification missing any required fields is - # rejected with the error - # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new - # - # # Call the update_transfer_job method. - # result = client.update_transfer_job request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. - # p result - # - def update_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest - - # Converts hash and nil to an 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_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_transfer_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.update_transfer_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a transfer job. - # - # @overload get_transfer_job(request, options = nil) - # Pass arguments to `get_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_transfer_job(job_name: nil, project_id: nil) - # Pass arguments to `get_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job_name [::String] - # Required. The job to get. - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the - # job. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new - # - # # Call the get_transfer_job method. - # result = client.get_transfer_job request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. - # p result - # - def get_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_transfer_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.get_transfer_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists transfer jobs. - # - # @overload list_transfer_jobs(request, options = nil) - # Pass arguments to `list_transfer_jobs` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_transfer_jobs(filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_transfer_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param filter [::String] - # Required. A list of query parameters specified as JSON text in the form of: - # - # ``` - # { - # "projectId":"my_project_id", - # "jobNames":["jobid1","jobid2",...], - # "jobStatuses":["status1","status2",...], - # "dataBackend":"QUERY_REPLICATION_CONFIGS", - # "sourceBucket":"source-bucket-name", - # "sinkBucket":"sink-bucket-name", - # } - # ``` - # - # The JSON formatting in the example is for display only; provide the - # query parameters without spaces or line breaks. - # - # * `projectId` is required. - # * Since `jobNames` and `jobStatuses` support multiple values, their values - # must be specified with array notation. `jobNames` and `jobStatuses` are - # optional. Valid values are case-insensitive: - # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED} - # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED} - # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} - # * Specify `"dataBackend":"QUERY_REPLICATION_CONFIGS"` to return a list of - # cross-bucket replication jobs. - # * Limit the results to jobs from a particular bucket with `sourceBucket` - # and/or to a particular bucket with `sinkBucket`. - # @param page_size [::Integer] - # The list page size. The max allowed value is 256. - # @param page_token [::String] - # The list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new - # - # # Call the list_transfer_jobs method. - # result = client.list_transfer_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageTransfer::V1::TransferJob. - # p item - # end - # - def list_transfer_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_transfer_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_transfer_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_transfer_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.list_transfer_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @storage_transfer_service_stub, :list_transfer_jobs, "transfer_jobs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses a transfer operation. - # - # @overload pause_transfer_operation(request, options = nil) - # Pass arguments to `pause_transfer_operation` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transfer_operation(name: nil) - # Pass arguments to `pause_transfer_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 transfer operation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new - # - # # Call the pause_transfer_operation method. - # result = client.pause_transfer_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def pause_transfer_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest - - # Converts hash and nil to an 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_transfer_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_transfer_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_transfer_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.pause_transfer_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 - - ## - # Resumes a transfer operation that is paused. - # - # @overload resume_transfer_operation(request, options = nil) - # Pass arguments to `resume_transfer_operation` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_transfer_operation(name: nil) - # Pass arguments to `resume_transfer_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 transfer operation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new - # - # # Call the resume_transfer_operation method. - # result = client.resume_transfer_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def resume_transfer_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest - - # Converts hash and nil to an 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_transfer_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_transfer_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_transfer_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.resume_transfer_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 a new operation for the specified transfer job. - # A `TransferJob` has a maximum of one active `TransferOperation`. If this - # method is called while a `TransferOperation` is active, an error is - # returned. - # - # @overload run_transfer_job(request, options = nil) - # Pass arguments to `run_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_transfer_job(job_name: nil, project_id: nil) - # Pass arguments to `run_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job_name [::String] - # Required. The name of the transfer job. - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the transfer - # job. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new - # - # # Call the run_transfer_job method. - # result = client.run_transfer_job request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def run_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.run_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.run_transfer_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.run_transfer_job request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 transfer job. Deleting a transfer job sets its status to - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}. - # - # @overload delete_transfer_job(request, options = nil) - # Pass arguments to `delete_transfer_job` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_transfer_job(job_name: nil, project_id: nil) - # Pass arguments to `delete_transfer_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job_name [::String] - # Required. The job to delete. - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the - # job. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new - # - # # Call the delete_transfer_job method. - # result = client.delete_transfer_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_transfer_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_transfer_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_transfer_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_transfer_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.delete_transfer_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an agent pool resource. - # - # @overload create_agent_pool(request, options = nil) - # Pass arguments to `create_agent_pool` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_agent_pool(project_id: nil, agent_pool: nil, agent_pool_id: nil) - # Pass arguments to `create_agent_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the - # agent pool. - # @param agent_pool [::Google::Cloud::StorageTransfer::V1::AgentPool, ::Hash] - # Required. The agent pool to create. - # @param agent_pool_id [::String] - # Required. The ID of the agent pool to create. - # - # The `agent_pool_id` must meet the following requirements: - # - # * Length of 128 characters or less. - # * Not start with the string `goog`. - # * Start with a lowercase ASCII character, followed by: - # * Zero or more: lowercase Latin alphabet characters, numerals, - # hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). - # * One or more numerals or lowercase ASCII characters. - # - # As expressed by the regular expression: - # `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new - # - # # Call the create_agent_pool method. - # result = client.create_agent_pool request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. - # p result - # - def create_agent_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest - - # Converts hash and nil to an 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_agent_pool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agent_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_agent_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.create_agent_pool request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing agent pool resource. - # - # @overload update_agent_pool(request, options = nil) - # Pass arguments to `update_agent_pool` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_agent_pool(agent_pool: nil, update_mask: nil) - # Pass arguments to `update_agent_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param agent_pool [::Google::Cloud::StorageTransfer::V1::AgentPool, ::Hash] - # Required. The agent pool to update. `agent_pool` is expected to specify - # following fields: - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#name name} - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} - # An `UpdateAgentPoolRequest` with any other fields is rejected - # with the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The [field mask] - # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) - # of the fields in `agentPool` to update in this request. - # The following `agentPool` fields can be updated: - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new - # - # # Call the update_agent_pool method. - # result = client.update_agent_pool request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. - # p result - # - def update_agent_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest - - # Converts hash and nil to an 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_agent_pool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agent_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_agent_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.update_agent_pool request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an agent pool. - # - # @overload get_agent_pool(request, options = nil) - # Pass arguments to `get_agent_pool` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_agent_pool(name: nil) - # Pass arguments to `get_agent_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the agent pool to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new - # - # # Call the get_agent_pool method. - # result = client.get_agent_pool request - # - # # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. - # p result - # - def get_agent_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_agent_pool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_agent_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_agent_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.get_agent_pool request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists agent pools. - # - # @overload list_agent_pools(request, options = nil) - # Pass arguments to `list_agent_pools` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_agent_pools(project_id: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_agent_pools` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud project that owns the job. - # @param filter [::String] - # An optional list of query parameters specified as JSON text in the - # form of: - # - # `{"agentPoolNames":["agentpool1","agentpool2",...]}` - # - # Since `agentPoolNames` support multiple values, its values must be - # specified with array notation. When the filter is either empty or not - # provided, the list returns all agent pools for the project. - # @param page_size [::Integer] - # The list page size. The max allowed value is `256`. - # @param page_token [::String] - # The list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new - # - # # Call the list_agent_pools method. - # result = client.list_agent_pools request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::StorageTransfer::V1::AgentPool. - # p item - # end - # - def list_agent_pools request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_agent_pools.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_agent_pools.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_agent_pools.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.list_agent_pools request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @storage_transfer_service_stub, :list_agent_pools, "agent_pools", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an agent pool. - # - # @overload delete_agent_pool(request, options = nil) - # Pass arguments to `delete_agent_pool` via a request object, either of type - # {::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_agent_pool(name: nil) - # Pass arguments to `delete_agent_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the agent pool to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage_transfer/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new - # - # # Call the delete_agent_pool method. - # result = client.delete_agent_pool request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_agent_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_agent_pool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_agent_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_agent_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_transfer_service_stub.delete_agent_pool request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the StorageTransferService REST API. - # - # This class represents the configuration for StorageTransferService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_google_service_account to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_google_service_account.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_google_service_account.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storagetransfer.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the StorageTransferService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_google_service_account` - # @return [::Gapic::Config::Method] - # - attr_reader :get_google_service_account - ## - # RPC-specific configuration for `create_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_transfer_job - ## - # RPC-specific configuration for `update_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_transfer_job - ## - # RPC-specific configuration for `get_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_transfer_job - ## - # RPC-specific configuration for `list_transfer_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_transfer_jobs - ## - # RPC-specific configuration for `pause_transfer_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_transfer_operation - ## - # RPC-specific configuration for `resume_transfer_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_transfer_operation - ## - # RPC-specific configuration for `run_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_transfer_job - ## - # RPC-specific configuration for `delete_transfer_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_transfer_job - ## - # RPC-specific configuration for `create_agent_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :create_agent_pool - ## - # RPC-specific configuration for `update_agent_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :update_agent_pool - ## - # RPC-specific configuration for `get_agent_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :get_agent_pool - ## - # RPC-specific configuration for `list_agent_pools` - # @return [::Gapic::Config::Method] - # - attr_reader :list_agent_pools - ## - # RPC-specific configuration for `delete_agent_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_agent_pool - - # @private - def initialize parent_rpcs = nil - get_google_service_account_config = parent_rpcs.get_google_service_account if parent_rpcs.respond_to? :get_google_service_account - @get_google_service_account = ::Gapic::Config::Method.new get_google_service_account_config - create_transfer_job_config = parent_rpcs.create_transfer_job if parent_rpcs.respond_to? :create_transfer_job - @create_transfer_job = ::Gapic::Config::Method.new create_transfer_job_config - update_transfer_job_config = parent_rpcs.update_transfer_job if parent_rpcs.respond_to? :update_transfer_job - @update_transfer_job = ::Gapic::Config::Method.new update_transfer_job_config - get_transfer_job_config = parent_rpcs.get_transfer_job if parent_rpcs.respond_to? :get_transfer_job - @get_transfer_job = ::Gapic::Config::Method.new get_transfer_job_config - list_transfer_jobs_config = parent_rpcs.list_transfer_jobs if parent_rpcs.respond_to? :list_transfer_jobs - @list_transfer_jobs = ::Gapic::Config::Method.new list_transfer_jobs_config - pause_transfer_operation_config = parent_rpcs.pause_transfer_operation if parent_rpcs.respond_to? :pause_transfer_operation - @pause_transfer_operation = ::Gapic::Config::Method.new pause_transfer_operation_config - resume_transfer_operation_config = parent_rpcs.resume_transfer_operation if parent_rpcs.respond_to? :resume_transfer_operation - @resume_transfer_operation = ::Gapic::Config::Method.new resume_transfer_operation_config - run_transfer_job_config = parent_rpcs.run_transfer_job if parent_rpcs.respond_to? :run_transfer_job - @run_transfer_job = ::Gapic::Config::Method.new run_transfer_job_config - delete_transfer_job_config = parent_rpcs.delete_transfer_job if parent_rpcs.respond_to? :delete_transfer_job - @delete_transfer_job = ::Gapic::Config::Method.new delete_transfer_job_config - create_agent_pool_config = parent_rpcs.create_agent_pool if parent_rpcs.respond_to? :create_agent_pool - @create_agent_pool = ::Gapic::Config::Method.new create_agent_pool_config - update_agent_pool_config = parent_rpcs.update_agent_pool if parent_rpcs.respond_to? :update_agent_pool - @update_agent_pool = ::Gapic::Config::Method.new update_agent_pool_config - get_agent_pool_config = parent_rpcs.get_agent_pool if parent_rpcs.respond_to? :get_agent_pool - @get_agent_pool = ::Gapic::Config::Method.new get_agent_pool_config - list_agent_pools_config = parent_rpcs.list_agent_pools if parent_rpcs.respond_to? :list_agent_pools - @list_agent_pools = ::Gapic::Config::Method.new list_agent_pools_config - delete_agent_pool_config = parent_rpcs.delete_agent_pool if parent_rpcs.respond_to? :delete_agent_pool - @delete_agent_pool = ::Gapic::Config::Method.new delete_agent_pool_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/operations.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/operations.rb deleted file mode 100644 index 6c56fc513acf..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/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 StorageTransfer - module V1 - module StorageTransferService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storagetransfer.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StorageTransferService 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 StorageTransferService 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::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::StorageTransfer::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "storagetransfer.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^transferOperations/?$}, 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{^transferOperations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^transferOperations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb deleted file mode 100644 index f64c18316bd2..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb +++ /dev/null @@ -1,938 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/storagetransfer/v1/transfer_pb" - -module Google - module Cloud - module StorageTransfer - module V1 - module StorageTransferService - module Rest - ## - # REST service stub for the StorageTransferService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_google_service_account REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount] - # A result object deserialized from the server's reply - def get_google_service_account request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_google_service_account_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_google_service_account", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount.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_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # A result object deserialized from the server's reply - def create_transfer_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_transfer_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_transfer_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageTransfer::V1::TransferJob.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_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # A result object deserialized from the server's reply - def update_transfer_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_transfer_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_transfer_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageTransfer::V1::TransferJob.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::TransferJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # A result object deserialized from the server's reply - def get_transfer_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_transfer_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_transfer_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageTransfer::V1::TransferJob.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_transfer_jobs REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse] - # A result object deserialized from the server's reply - def list_transfer_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_transfer_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_transfer_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse.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_transfer_operation REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def pause_transfer_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_transfer_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_transfer_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 resume_transfer_operation REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def resume_transfer_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_transfer_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_transfer_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 run_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def run_transfer_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_transfer_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "run_transfer_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_transfer_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_transfer_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_transfer_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_agent_pool REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # A result object deserialized from the server's reply - def create_agent_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_agent_pool_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_agent_pool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageTransfer::V1::AgentPool.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_agent_pool REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # A result object deserialized from the server's reply - def update_agent_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_agent_pool_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_agent_pool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageTransfer::V1::AgentPool.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_agent_pool REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::AgentPool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # A result object deserialized from the server's reply - def get_agent_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_agent_pool_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_agent_pool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageTransfer::V1::AgentPool.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_agent_pools REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse] - # A result object deserialized from the server's reply - def list_agent_pools request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_agent_pools_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_agent_pools", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_agent_pool REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_agent_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_agent_pool_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_agent_pool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 get_google_service_account REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_google_service_account_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/googleServiceAccounts/{project_id}", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest] - # 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_transfer_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/transferJobs", - body: "transfer_job", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest] - # 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_transfer_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{job_name}", - body: "*", - matches: [ - ["job_name", %r{^transferJobs(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_transfer_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{job_name}", - matches: [ - ["job_name", %r{^transferJobs(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_transfer_jobs REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_transfer_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/transferJobs", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_transfer_operation REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest] - # 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_transfer_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:pause", - body: "*", - matches: [ - ["name", %r{^transferOperations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_transfer_operation REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest] - # 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_transfer_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:resume", - body: "*", - matches: [ - ["name", %r{^transferOperations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_transfer_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{job_name}:run", - body: "*", - matches: [ - ["job_name", %r{^transferJobs(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_transfer_job REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_transfer_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{job_name}", - matches: [ - ["job_name", %r{^transferJobs(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_agent_pool REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest] - # 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_agent_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}/agentPools", - body: "agent_pool", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_agent_pool REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest] - # 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_agent_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{agent_pool.name}", - body: "agent_pool", - matches: [ - ["agent_pool.name", %r{^projects/[^/]+/agentPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_agent_pool REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_agent_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agentPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_agent_pools REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_agent_pools_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/projects/{project_id}/agentPools", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_agent_pool REST call - # - # @param request_pb [::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_agent_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agentPools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/version.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/version.rb deleted file mode 100644 index 1de61ccd8b91..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/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 StorageTransfer - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_pb.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_pb.rb deleted file mode 100644 index 3f2865fa0d61..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/storagetransfer/v1/transfer.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/storagetransfer/v1/transfer_types_pb' - - -descriptor_data = "\n(google/storagetransfer/v1/transfer.proto\x12\x19google.storagetransfer.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.google/storagetransfer/v1/transfer_types.proto\"9\n\x1eGetGoogleServiceAccountRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\"]\n\x18\x43reateTransferJobRequest\x12\x41\n\x0ctransfer_job\x18\x01 \x01(\x0b\x32&.google.storagetransfer.v1.TransferJobB\x03\xe0\x41\x02\"\xd1\x01\n\x18UpdateTransferJobRequest\x12\x15\n\x08job_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nproject_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0ctransfer_job\x18\x03 \x01(\x0b\x32&.google.storagetransfer.v1.TransferJobB\x03\xe0\x41\x02\x12\x42\n\x1eupdate_transfer_job_field_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x15GetTransferJobRequest\x12\x15\n\x08job_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nproject_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"J\n\x18\x44\x65leteTransferJobRequest\x12\x15\n\x08job_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nproject_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"U\n\x17ListTransferJobsRequest\x12\x13\n\x06\x66ilter\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"r\n\x18ListTransferJobsResponse\x12=\n\rtransfer_jobs\x18\x01 \x03(\x0b\x32&.google.storagetransfer.v1.TransferJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"2\n\x1dPauseTransferOperationRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"3\n\x1eResumeTransferOperationRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"G\n\x15RunTransferJobRequest\x12\x15\n\x08job_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nproject_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x8c\x01\n\x16\x43reateAgentPoolRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\nagent_pool\x18\x02 \x01(\x0b\x32$.google.storagetransfer.v1.AgentPoolB\x03\xe0\x41\x02\x12\x1a\n\ragent_pool_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x88\x01\n\x16UpdateAgentPoolRequest\x12=\n\nagent_pool\x18\x01 \x01(\x0b\x32$.google.storagetransfer.v1.AgentPoolB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"(\n\x13GetAgentPoolRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"+\n\x16\x44\x65leteAgentPoolRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"g\n\x15ListAgentPoolsRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"l\n\x16ListAgentPoolsResponse\x12\x39\n\x0b\x61gent_pools\x18\x01 \x03(\x0b\x32$.google.storagetransfer.v1.AgentPool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x91\x13\n\x16StorageTransferService\x12\xb5\x01\n\x17GetGoogleServiceAccount\x12\x39.google.storagetransfer.v1.GetGoogleServiceAccountRequest\x1a/.google.storagetransfer.v1.GoogleServiceAccount\".\x82\xd3\xe4\x93\x02(\x12&/v1/googleServiceAccounts/{project_id}\x12\x98\x01\n\x11\x43reateTransferJob\x12\x33.google.storagetransfer.v1.CreateTransferJobRequest\x1a&.google.storagetransfer.v1.TransferJob\"&\x82\xd3\xe4\x93\x02 \"\x10/v1/transferJobs:\x0ctransfer_job\x12\x9b\x01\n\x11UpdateTransferJob\x12\x33.google.storagetransfer.v1.UpdateTransferJobRequest\x1a&.google.storagetransfer.v1.TransferJob\")\x82\xd3\xe4\x93\x02#2\x1e/v1/{job_name=transferJobs/**}:\x01*\x12\x92\x01\n\x0eGetTransferJob\x12\x30.google.storagetransfer.v1.GetTransferJobRequest\x1a&.google.storagetransfer.v1.TransferJob\"&\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{job_name=transferJobs/**}\x12\x95\x01\n\x10ListTransferJobs\x12\x32.google.storagetransfer.v1.ListTransferJobsRequest\x1a\x33.google.storagetransfer.v1.ListTransferJobsResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/transferJobs\x12\x9d\x01\n\x16PauseTransferOperation\x12\x38.google.storagetransfer.v1.PauseTransferOperationRequest\x1a\x16.google.protobuf.Empty\"1\x82\xd3\xe4\x93\x02+\"&/v1/{name=transferOperations/**}:pause:\x01*\x12\xa0\x01\n\x17ResumeTransferOperation\x12\x39.google.storagetransfer.v1.ResumeTransferOperationRequest\x1a\x16.google.protobuf.Empty\"2\x82\xd3\xe4\x93\x02,\"\'/v1/{name=transferOperations/**}:resume:\x01*\x12\xbd\x01\n\x0eRunTransferJob\x12\x30.google.storagetransfer.v1.RunTransferJobRequest\x1a\x1d.google.longrunning.Operation\"Z\xca\x41*\n\x15google.protobuf.Empty\x12\x11TransferOperation\x82\xd3\xe4\x93\x02\'\"\"/v1/{job_name=transferJobs/**}:run:\x01*\x12\x88\x01\n\x11\x44\x65leteTransferJob\x12\x33.google.storagetransfer.v1.DeleteTransferJobRequest\x1a\x16.google.protobuf.Empty\"&\x82\xd3\xe4\x93\x02 *\x1e/v1/{job_name=transferJobs/**}\x12\xcc\x01\n\x0f\x43reateAgentPool\x12\x31.google.storagetransfer.v1.CreateAgentPoolRequest\x1a$.google.storagetransfer.v1.AgentPool\"`\xda\x41#project_id,agent_pool,agent_pool_id\x82\xd3\xe4\x93\x02\x34\"&/v1/projects/{project_id=*}/agentPools:\nagent_pool\x12\xc6\x01\n\x0fUpdateAgentPool\x12\x31.google.storagetransfer.v1.UpdateAgentPoolRequest\x1a$.google.storagetransfer.v1.AgentPool\"Z\xda\x41\x16\x61gent_pool,update_mask\x82\xd3\xe4\x93\x02;2-/v1/{agent_pool.name=projects/*/agentPools/*}:\nagent_pool\x12\x97\x01\n\x0cGetAgentPool\x12..google.storagetransfer.v1.GetAgentPoolRequest\x1a$.google.storagetransfer.v1.AgentPool\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$\x12\"/v1/{name=projects/*/agentPools/*}\x12\xb2\x01\n\x0eListAgentPools\x12\x30.google.storagetransfer.v1.ListAgentPoolsRequest\x1a\x31.google.storagetransfer.v1.ListAgentPoolsResponse\";\xda\x41\nproject_id\x82\xd3\xe4\x93\x02(\x12&/v1/projects/{project_id=*}/agentPools\x12\x8f\x01\n\x0f\x44\x65leteAgentPool\x12\x31.google.storagetransfer.v1.DeleteAgentPoolRequest\x1a\x16.google.protobuf.Empty\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$*\"/v1/{name=projects/*/agentPools/*}\x1aR\xca\x41\x1estoragetransfer.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xec\x01\n#com.google.storagetransfer.v1.protoB\rTransferProtoZMcloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpb\xaa\x02\x1fGoogle.Cloud.StorageTransfer.V1\xca\x02\x1fGoogle\\Cloud\\StorageTransfer\\V1\xea\x02\"Google::Cloud::StorageTransfer::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module StorageTransfer - module V1 - GetGoogleServiceAccountRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GetGoogleServiceAccountRequest").msgclass - CreateTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.CreateTransferJobRequest").msgclass - UpdateTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.UpdateTransferJobRequest").msgclass - GetTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GetTransferJobRequest").msgclass - DeleteTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.DeleteTransferJobRequest").msgclass - ListTransferJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ListTransferJobsRequest").msgclass - ListTransferJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ListTransferJobsResponse").msgclass - PauseTransferOperationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.PauseTransferOperationRequest").msgclass - ResumeTransferOperationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ResumeTransferOperationRequest").msgclass - RunTransferJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.RunTransferJobRequest").msgclass - CreateAgentPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.CreateAgentPoolRequest").msgclass - UpdateAgentPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.UpdateAgentPoolRequest").msgclass - GetAgentPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GetAgentPoolRequest").msgclass - DeleteAgentPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.DeleteAgentPoolRequest").msgclass - ListAgentPoolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ListAgentPoolsRequest").msgclass - ListAgentPoolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ListAgentPoolsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_services_pb.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_services_pb.rb deleted file mode 100644 index 25ee4b7f2d98..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_services_pb.rb +++ /dev/null @@ -1,91 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/storagetransfer/v1/transfer.proto for package 'Google.Cloud.StorageTransfer.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/storagetransfer/v1/transfer_pb' - -module Google - module Cloud - module StorageTransfer - module V1 - module StorageTransferService - # Storage Transfer Service and its protos. - # Transfers data between between Google Cloud Storage buckets or from a data - # source external to Google to a Cloud Storage bucket. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.storagetransfer.v1.StorageTransferService' - - # Returns the Google service account that is used by Storage Transfer - # Service to access buckets in the project where transfers - # run or in other projects. Each Google service account is associated - # with one Google Cloud project. Users - # should add this service account to the Google Cloud Storage bucket - # ACLs to grant access to Storage Transfer Service. This service - # account is created and owned by Storage Transfer Service and can - # only be used by Storage Transfer Service. - rpc :GetGoogleServiceAccount, ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount - # Creates a transfer job that runs periodically. - rpc :CreateTransferJob, ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, ::Google::Cloud::StorageTransfer::V1::TransferJob - # Updates a transfer job. Updating a job's transfer spec does not affect - # transfer operations that are running already. - # - # **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] - # field can be modified using this RPC (for example, to set a job's status to - # [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], - # [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or - # [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]). - rpc :UpdateTransferJob, ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, ::Google::Cloud::StorageTransfer::V1::TransferJob - # Gets a transfer job. - rpc :GetTransferJob, ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, ::Google::Cloud::StorageTransfer::V1::TransferJob - # Lists transfer jobs. - rpc :ListTransferJobs, ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, ::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse - # Pauses a transfer operation. - rpc :PauseTransferOperation, ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, ::Google::Protobuf::Empty - # Resumes a transfer operation that is paused. - rpc :ResumeTransferOperation, ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, ::Google::Protobuf::Empty - # Starts a new operation for the specified transfer job. - # A `TransferJob` has a maximum of one active `TransferOperation`. If this - # method is called while a `TransferOperation` is active, an error is - # returned. - rpc :RunTransferJob, ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, ::Google::Longrunning::Operation - # Deletes a transfer job. Deleting a transfer job sets its status to - # [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. - rpc :DeleteTransferJob, ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest, ::Google::Protobuf::Empty - # Creates an agent pool resource. - rpc :CreateAgentPool, ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest, ::Google::Cloud::StorageTransfer::V1::AgentPool - # Updates an existing agent pool resource. - rpc :UpdateAgentPool, ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest, ::Google::Cloud::StorageTransfer::V1::AgentPool - # Gets an agent pool. - rpc :GetAgentPool, ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest, ::Google::Cloud::StorageTransfer::V1::AgentPool - # Lists agent pools. - rpc :ListAgentPools, ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest, ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse - # Deletes an agent pool. - rpc :DeleteAgentPool, ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_types_pb.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_types_pb.rb deleted file mode 100644 index 9dd1ba638947..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/lib/google/storagetransfer/v1/transfer_types_pb.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/storagetransfer/v1/transfer_types.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/code_pb' -require 'google/type/date_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n.google/storagetransfer/v1/transfer_types.proto\x12\x19google.storagetransfer.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15google/rpc/code.proto\x1a\x16google/type/date.proto\x1a\x1bgoogle/type/timeofday.proto\"A\n\x14GoogleServiceAccount\x12\x15\n\raccount_email\x18\x01 \x01(\t\x12\x12\n\nsubject_id\x18\x02 \x01(\t\"J\n\x0c\x41wsAccessKey\x12\x1a\n\raccess_key_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11secret_access_key\x18\x02 \x01(\tB\x03\xe0\x41\x02\"*\n\x10\x41zureCredentials\x12\x16\n\tsas_token\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xd3\x02\n\x10ObjectConditions\x12K\n(min_time_elapsed_since_last_modification\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12K\n(max_time_elapsed_since_last_modification\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10include_prefixes\x18\x03 \x03(\t\x12\x18\n\x10\x65xclude_prefixes\x18\x04 \x03(\t\x12\x37\n\x13last_modified_since\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14last_modified_before\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Z\n\x07GcsData\x12\x18\n\x0b\x62ucket_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04path\x18\x03 \x01(\t\x12\'\n\x1fmanaged_folder_transfer_enabled\x18\x04 \x01(\x08\"\x82\x02\n\tAwsS3Data\x12\x18\n\x0b\x62ucket_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x0e\x61ws_access_key\x18\x02 \x01(\x0b\x32\'.google.storagetransfer.v1.AwsAccessKeyB\x03\xe0\x41\x04\x12\x0c\n\x04path\x18\x03 \x01(\t\x12\x10\n\x08role_arn\x18\x04 \x01(\t\x12\x1e\n\x11\x63loudfront_domain\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x63redentials_secret\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12!\n\x17managed_private_network\x18\x08 \x01(\x08H\x00\x42\x11\n\x0fprivate_network\"\x87\x03\n\x14\x41zureBlobStorageData\x12\x1c\n\x0fstorage_account\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12N\n\x11\x61zure_credentials\x18\x02 \x01(\x0b\x32+.google.storagetransfer.v1.AzureCredentialsB\x06\xe0\x41\x02\xe0\x41\x04\x12\x16\n\tcontainer\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04path\x18\x05 \x01(\t\x12\x1f\n\x12\x63redentials_secret\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12o\n\x19\x66\x65\x64\x65rated_identity_config\x18\x08 \x01(\x0b\x32G.google.storagetransfer.v1.AzureBlobStorageData.FederatedIdentityConfigB\x03\xe0\x41\x01\x1aI\n\x17\x46\x65\x64\x65ratedIdentityConfig\x12\x16\n\tclient_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\ttenant_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"!\n\x08HttpData\x12\x15\n\x08list_url\x18\x01 \x01(\tB\x03\xe0\x41\x02\")\n\x0fPosixFilesystem\x12\x16\n\x0eroot_directory\x18\x01 \x01(\t\"\x18\n\x08HdfsData\x12\x0c\n\x04path\x18\x01 \x01(\t\"\xbd\x01\n\x13\x41wsS3CompatibleData\x12\x18\n\x0b\x62ucket_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\x15\n\x08\x65ndpoint\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06region\x18\x05 \x01(\t\x12\x46\n\x0bs3_metadata\x18\x04 \x01(\x0b\x32/.google.storagetransfer.v1.S3CompatibleMetadataH\x00\x42\x0f\n\rdata_provider\"\xf6\x05\n\x14S3CompatibleMetadata\x12O\n\x0b\x61uth_method\x18\x01 \x01(\x0e\x32:.google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod\x12S\n\rrequest_model\x18\x02 \x01(\x0e\x32<.google.storagetransfer.v1.S3CompatibleMetadata.RequestModel\x12Q\n\x08protocol\x18\x03 \x01(\x0e\x32?.google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol\x12I\n\x08list_api\x18\x04 \x01(\x0e\x32\x37.google.storagetransfer.v1.S3CompatibleMetadata.ListApi\"m\n\nAuthMethod\x12\x1b\n\x17\x41UTH_METHOD_UNSPECIFIED\x10\x00\x12 \n\x1c\x41UTH_METHOD_AWS_SIGNATURE_V4\x10\x01\x12 \n\x1c\x41UTH_METHOD_AWS_SIGNATURE_V2\x10\x02\"s\n\x0cRequestModel\x12\x1d\n\x19REQUEST_MODEL_UNSPECIFIED\x10\x00\x12&\n\"REQUEST_MODEL_VIRTUAL_HOSTED_STYLE\x10\x01\x12\x1c\n\x18REQUEST_MODEL_PATH_STYLE\x10\x02\"j\n\x0fNetworkProtocol\x12 \n\x1cNETWORK_PROTOCOL_UNSPECIFIED\x10\x00\x12\x1a\n\x16NETWORK_PROTOCOL_HTTPS\x10\x01\x12\x19\n\x15NETWORK_PROTOCOL_HTTP\x10\x02\"J\n\x07ListApi\x12\x18\n\x14LIST_API_UNSPECIFIED\x10\x00\x12\x13\n\x0fLIST_OBJECTS_V2\x10\x01\x12\x10\n\x0cLIST_OBJECTS\x10\x02\"\x93\x03\n\tAgentPool\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12>\n\x05state\x18\x04 \x01(\x0e\x32*.google.storagetransfer.v1.AgentPool.StateB\x03\xe0\x41\x03\x12L\n\x0f\x62\x61ndwidth_limit\x18\x05 \x01(\x0b\x32\x33.google.storagetransfer.v1.AgentPool.BandwidthLimit\x1a$\n\x0e\x42\x61ndwidthLimit\x12\x12\n\nlimit_mbps\x18\x01 \x01(\x03\"G\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07\x43REATED\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03:`\xea\x41]\n)storagetransfer.googleapis.com/agentPools\x12\x30projects/{project_id}/agentPools/{agent_pool_id}\"\x8e\x03\n\x0fTransferOptions\x12\x32\n*overwrite_objects_already_existing_in_sink\x18\x01 \x01(\x08\x12%\n\x1d\x64\x65lete_objects_unique_in_sink\x18\x02 \x01(\x08\x12\x31\n)delete_objects_from_source_after_transfer\x18\x03 \x01(\x08\x12P\n\x0eoverwrite_when\x18\x04 \x01(\x0e\x32\x38.google.storagetransfer.v1.TransferOptions.OverwriteWhen\x12\x44\n\x10metadata_options\x18\x05 \x01(\x0b\x32*.google.storagetransfer.v1.MetadataOptions\"U\n\rOverwriteWhen\x12\x1e\n\x1aOVERWRITE_WHEN_UNSPECIFIED\x10\x00\x12\r\n\tDIFFERENT\x10\x01\x12\t\n\x05NEVER\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"\xb0\x08\n\x0cTransferSpec\x12;\n\rgcs_data_sink\x18\x04 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x00\x12\x45\n\x0fposix_data_sink\x18\r \x01(\x0b\x32*.google.storagetransfer.v1.PosixFilesystemH\x00\x12=\n\x0fgcs_data_source\x18\x01 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x01\x12\x42\n\x12\x61ws_s3_data_source\x18\x02 \x01(\x0b\x32$.google.storagetransfer.v1.AwsS3DataH\x01\x12?\n\x10http_data_source\x18\x03 \x01(\x0b\x32#.google.storagetransfer.v1.HttpDataH\x01\x12G\n\x11posix_data_source\x18\x0e \x01(\x0b\x32*.google.storagetransfer.v1.PosixFilesystemH\x01\x12Y\n\x1e\x61zure_blob_storage_data_source\x18\x08 \x01(\x0b\x32/.google.storagetransfer.v1.AzureBlobStorageDataH\x01\x12W\n\x1d\x61ws_s3_compatible_data_source\x18\x13 \x01(\x0b\x32..google.storagetransfer.v1.AwsS3CompatibleDataH\x01\x12?\n\x10hdfs_data_source\x18\x14 \x01(\x0b\x32#.google.storagetransfer.v1.HdfsDataH\x01\x12L\n\x1egcs_intermediate_data_location\x18\x10 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x02\x12\x46\n\x11object_conditions\x18\x05 \x01(\x0b\x32+.google.storagetransfer.v1.ObjectConditions\x12\x44\n\x10transfer_options\x18\x06 \x01(\x0b\x32*.google.storagetransfer.v1.TransferOptions\x12\x46\n\x11transfer_manifest\x18\x0f \x01(\x0b\x32+.google.storagetransfer.v1.TransferManifest\x12\x1e\n\x16source_agent_pool_name\x18\x11 \x01(\t\x12\x1c\n\x14sink_agent_pool_name\x18\x12 \x01(\tB\x0b\n\tdata_sinkB\r\n\x0b\x64\x61ta_sourceB\x1c\n\x1aintermediate_data_location\"\xb7\x02\n\x0fReplicationSpec\x12=\n\x0fgcs_data_source\x18\x01 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x00\x12;\n\rgcs_data_sink\x18\x02 \x01(\x0b\x32\".google.storagetransfer.v1.GcsDataH\x01\x12\x46\n\x11object_conditions\x18\x03 \x01(\x0b\x32+.google.storagetransfer.v1.ObjectConditions\x12\x44\n\x10transfer_options\x18\x04 \x01(\x0b\x32*.google.storagetransfer.v1.TransferOptionsB\r\n\x0b\x64\x61ta_sourceB\x0b\n\tdata_sink\"\xf1\x0b\n\x0fMetadataOptions\x12\x43\n\x07symlink\x18\x01 \x01(\x0e\x32\x32.google.storagetransfer.v1.MetadataOptions.Symlink\x12=\n\x04mode\x18\x02 \x01(\x0e\x32/.google.storagetransfer.v1.MetadataOptions.Mode\x12;\n\x03gid\x18\x03 \x01(\x0e\x32..google.storagetransfer.v1.MetadataOptions.GID\x12;\n\x03uid\x18\x04 \x01(\x0e\x32..google.storagetransfer.v1.MetadataOptions.UID\x12;\n\x03\x61\x63l\x18\x05 \x01(\x0e\x32..google.storagetransfer.v1.MetadataOptions.Acl\x12N\n\rstorage_class\x18\x06 \x01(\x0e\x32\x37.google.storagetransfer.v1.MetadataOptions.StorageClass\x12P\n\x0etemporary_hold\x18\x07 \x01(\x0e\x32\x38.google.storagetransfer.v1.MetadataOptions.TemporaryHold\x12\x42\n\x07kms_key\x18\x08 \x01(\x0e\x32\x31.google.storagetransfer.v1.MetadataOptions.KmsKey\x12L\n\x0ctime_created\x18\t \x01(\x0e\x32\x36.google.storagetransfer.v1.MetadataOptions.TimeCreated\"J\n\x07Symlink\x12\x17\n\x13SYMLINK_UNSPECIFIED\x10\x00\x12\x10\n\x0cSYMLINK_SKIP\x10\x01\x12\x14\n\x10SYMLINK_PRESERVE\x10\x02\">\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\r\n\tMODE_SKIP\x10\x01\x12\x11\n\rMODE_PRESERVE\x10\x02\"8\n\x03GID\x12\x13\n\x0fGID_UNSPECIFIED\x10\x00\x12\x0c\n\x08GID_SKIP\x10\x01\x12\x0e\n\nGID_NUMBER\x10\x02\"8\n\x03UID\x12\x13\n\x0fUID_UNSPECIFIED\x10\x00\x12\x0c\n\x08UID_SKIP\x10\x01\x12\x0e\n\nUID_NUMBER\x10\x02\"P\n\x03\x41\x63l\x12\x13\n\x0f\x41\x43L_UNSPECIFIED\x10\x00\x12\"\n\x1e\x41\x43L_DESTINATION_BUCKET_DEFAULT\x10\x01\x12\x10\n\x0c\x41\x43L_PRESERVE\x10\x02\"\xe6\x01\n\x0cStorageClass\x12\x1d\n\x19STORAGE_CLASS_UNSPECIFIED\x10\x00\x12,\n(STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT\x10\x01\x12\x1a\n\x16STORAGE_CLASS_PRESERVE\x10\x02\x12\x1a\n\x16STORAGE_CLASS_STANDARD\x10\x03\x12\x1a\n\x16STORAGE_CLASS_NEARLINE\x10\x04\x12\x1a\n\x16STORAGE_CLASS_COLDLINE\x10\x05\x12\x19\n\x15STORAGE_CLASS_ARCHIVE\x10\x06\"e\n\rTemporaryHold\x12\x1e\n\x1aTEMPORARY_HOLD_UNSPECIFIED\x10\x00\x12\x17\n\x13TEMPORARY_HOLD_SKIP\x10\x01\x12\x1b\n\x17TEMPORARY_HOLD_PRESERVE\x10\x02\"_\n\x06KmsKey\x12\x17\n\x13KMS_KEY_UNSPECIFIED\x10\x00\x12&\n\"KMS_KEY_DESTINATION_BUCKET_DEFAULT\x10\x01\x12\x14\n\x10KMS_KEY_PRESERVE\x10\x02\"l\n\x0bTimeCreated\x12\x1c\n\x18TIME_CREATED_UNSPECIFIED\x10\x00\x12\x15\n\x11TIME_CREATED_SKIP\x10\x01\x12(\n$TIME_CREATED_PRESERVE_AS_CUSTOM_TIME\x10\x02\"$\n\x10TransferManifest\x12\x10\n\x08location\x18\x01 \x01(\t\"\x85\x02\n\x08Schedule\x12\x33\n\x13schedule_start_date\x18\x01 \x01(\x0b\x32\x11.google.type.DateB\x03\xe0\x41\x02\x12,\n\x11schedule_end_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12\x31\n\x11start_time_of_day\x18\x03 \x01(\x0b\x32\x16.google.type.TimeOfDay\x12/\n\x0f\x65nd_time_of_day\x18\x04 \x01(\x0b\x32\x16.google.type.TimeOfDay\x12\x32\n\x0frepeat_interval\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\"\x9f\x01\n\x0b\x45ventStream\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12;\n\x17\x65vent_stream_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12@\n\x1c\x65vent_stream_expiration_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc4\x06\n\x0bTransferJob\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x12\n\nproject_id\x18\x03 \x01(\t\x12\x1c\n\x0fservice_account\x18\x12 \x01(\tB\x03\xe0\x41\x01\x12>\n\rtransfer_spec\x18\x04 \x01(\x0b\x32\'.google.storagetransfer.v1.TransferSpec\x12\x44\n\x10replication_spec\x18\x11 \x01(\x0b\x32*.google.storagetransfer.v1.ReplicationSpec\x12J\n\x13notification_config\x18\x0b \x01(\x0b\x32-.google.storagetransfer.v1.NotificationConfig\x12@\n\x0elogging_config\x18\x0e \x01(\x0b\x32(.google.storagetransfer.v1.LoggingConfig\x12\x35\n\x08schedule\x18\x05 \x01(\x0b\x32#.google.storagetransfer.v1.Schedule\x12<\n\x0c\x65vent_stream\x18\x0f \x01(\x0b\x32&.google.storagetransfer.v1.EventStream\x12=\n\x06status\x18\x06 \x01(\x0e\x32-.google.storagetransfer.v1.TransferJob.Status\x12\x36\n\rcreation_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x16last_modification_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rdeletion_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1d\n\x15latest_operation_name\x18\x0c \x01(\t\"H\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0b\n\x07\x44\x45LETED\x10\x03\"8\n\rErrorLogEntry\x12\x10\n\x03url\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rerror_details\x18\x03 \x03(\t\"\x98\x01\n\x0c\x45rrorSummary\x12)\n\nerror_code\x18\x01 \x01(\x0e\x32\x10.google.rpc.CodeB\x03\xe0\x41\x02\x12\x18\n\x0b\x65rror_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02\x12\x43\n\x11\x65rror_log_entries\x18\x03 \x03(\x0b\x32(.google.storagetransfer.v1.ErrorLogEntry\"\xc3\x06\n\x10TransferCounters\x12!\n\x19objects_found_from_source\x18\x01 \x01(\x03\x12\x1f\n\x17\x62ytes_found_from_source\x18\x02 \x01(\x03\x12$\n\x1cobjects_found_only_from_sink\x18\x03 \x01(\x03\x12\"\n\x1a\x62ytes_found_only_from_sink\x18\x04 \x01(\x03\x12+\n#objects_from_source_skipped_by_sync\x18\x05 \x01(\x03\x12)\n!bytes_from_source_skipped_by_sync\x18\x06 \x01(\x03\x12\x1e\n\x16objects_copied_to_sink\x18\x07 \x01(\x03\x12\x1c\n\x14\x62ytes_copied_to_sink\x18\x08 \x01(\x03\x12#\n\x1bobjects_deleted_from_source\x18\t \x01(\x03\x12!\n\x19\x62ytes_deleted_from_source\x18\n \x01(\x03\x12!\n\x19objects_deleted_from_sink\x18\x0b \x01(\x03\x12\x1f\n\x17\x62ytes_deleted_from_sink\x18\x0c \x01(\x03\x12\"\n\x1aobjects_from_source_failed\x18\r \x01(\x03\x12 \n\x18\x62ytes_from_source_failed\x18\x0e \x01(\x03\x12*\n\"objects_failed_to_delete_from_sink\x18\x0f \x01(\x03\x12(\n bytes_failed_to_delete_from_sink\x18\x10 \x01(\x03\x12%\n\x1d\x64irectories_found_from_source\x18\x11 \x01(\x03\x12.\n&directories_failed_to_list_from_source\x18\x12 \x01(\x03\x12\x33\n+directories_successfully_listed_from_source\x18\x13 \x01(\x03\x12\'\n\x1fintermediate_objects_cleaned_up\x18\x16 \x01(\x03\x12.\n&intermediate_objects_failed_cleaned_up\x18\x17 \x01(\x03\"\xa5\x03\n\x12NotificationConfig\x12\x19\n\x0cpubsub_topic\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\x0b\x65vent_types\x18\x02 \x03(\x0e\x32\x37.google.storagetransfer.v1.NotificationConfig.EventType\x12X\n\x0epayload_format\x18\x03 \x01(\x0e\x32;.google.storagetransfer.v1.NotificationConfig.PayloadFormatB\x03\xe0\x41\x02\"\x86\x01\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aTRANSFER_OPERATION_SUCCESS\x10\x01\x12\x1d\n\x19TRANSFER_OPERATION_FAILED\x10\x02\x12\x1e\n\x1aTRANSFER_OPERATION_ABORTED\x10\x03\"C\n\rPayloadFormat\x12\x1e\n\x1aPAYLOAD_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x08\n\x04JSON\x10\x02\"\x98\x03\n\rLoggingConfig\x12L\n\x0blog_actions\x18\x01 \x03(\x0e\x32\x37.google.storagetransfer.v1.LoggingConfig.LoggableAction\x12W\n\x11log_action_states\x18\x02 \x03(\x0e\x32<.google.storagetransfer.v1.LoggingConfig.LoggableActionState\x12\'\n\x1f\x65nable_onprem_gcs_transfer_logs\x18\x03 \x01(\x08\"Q\n\x0eLoggableAction\x12\x1f\n\x1bLOGGABLE_ACTION_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46IND\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02\x12\x08\n\x04\x43OPY\x10\x03\"d\n\x13LoggableActionState\x12%\n!LOGGABLE_ACTION_STATE_UNSPECIFIED\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\x0b\n\x07SKIPPED\x10\x03\"\xc4\x05\n\x11TransferOperation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12>\n\rtransfer_spec\x18\x03 \x01(\x0b\x32\'.google.storagetransfer.v1.TransferSpec\x12J\n\x13notification_config\x18\n \x01(\x0b\x32-.google.storagetransfer.v1.NotificationConfig\x12@\n\x0elogging_config\x18\x0c \x01(\x0b\x32(.google.storagetransfer.v1.LoggingConfig\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x06status\x18\x06 \x01(\x0e\x32\x33.google.storagetransfer.v1.TransferOperation.Status\x12=\n\x08\x63ounters\x18\x07 \x01(\x0b\x32+.google.storagetransfer.v1.TransferCounters\x12\x41\n\x10\x65rror_breakdowns\x18\x08 \x03(\x0b\x32\'.google.storagetransfer.v1.ErrorSummary\x12\x19\n\x11transfer_job_name\x18\t \x01(\t\"\x7f\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0b\n\x07SUCCESS\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0b\n\x07\x41\x42ORTED\x10\x05\x12\n\n\x06QUEUED\x10\x06\x12\x0e\n\nSUSPENDING\x10\x07\x42\xec\x01\n#com.google.storagetransfer.v1.protoB\rTransferTypesZMcloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpb\xaa\x02\x1fGoogle.Cloud.StorageTransfer.V1\xca\x02\x1fGoogle\\Cloud\\StorageTransfer\\V1\xea\x02\"Google::Cloud::StorageTransfer::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module StorageTransfer - module V1 - GoogleServiceAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GoogleServiceAccount").msgclass - AwsAccessKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AwsAccessKey").msgclass - AzureCredentials = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AzureCredentials").msgclass - ObjectConditions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ObjectConditions").msgclass - GcsData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.GcsData").msgclass - AwsS3Data = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AwsS3Data").msgclass - AzureBlobStorageData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AzureBlobStorageData").msgclass - AzureBlobStorageData::FederatedIdentityConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AzureBlobStorageData.FederatedIdentityConfig").msgclass - HttpData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.HttpData").msgclass - PosixFilesystem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.PosixFilesystem").msgclass - HdfsData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.HdfsData").msgclass - AwsS3CompatibleData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AwsS3CompatibleData").msgclass - S3CompatibleMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata").msgclass - S3CompatibleMetadata::AuthMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod").enummodule - S3CompatibleMetadata::RequestModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata.RequestModel").enummodule - S3CompatibleMetadata::NetworkProtocol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol").enummodule - S3CompatibleMetadata::ListApi = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.S3CompatibleMetadata.ListApi").enummodule - AgentPool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AgentPool").msgclass - AgentPool::BandwidthLimit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AgentPool.BandwidthLimit").msgclass - AgentPool::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.AgentPool.State").enummodule - TransferOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferOptions").msgclass - TransferOptions::OverwriteWhen = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferOptions.OverwriteWhen").enummodule - TransferSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferSpec").msgclass - ReplicationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ReplicationSpec").msgclass - MetadataOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions").msgclass - MetadataOptions::Symlink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.Symlink").enummodule - MetadataOptions::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.Mode").enummodule - MetadataOptions::GID = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.GID").enummodule - MetadataOptions::UID = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.UID").enummodule - MetadataOptions::Acl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.Acl").enummodule - MetadataOptions::StorageClass = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.StorageClass").enummodule - MetadataOptions::TemporaryHold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.TemporaryHold").enummodule - MetadataOptions::KmsKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.KmsKey").enummodule - MetadataOptions::TimeCreated = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.MetadataOptions.TimeCreated").enummodule - TransferManifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferManifest").msgclass - Schedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.Schedule").msgclass - EventStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.EventStream").msgclass - TransferJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferJob").msgclass - TransferJob::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferJob.Status").enummodule - ErrorLogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ErrorLogEntry").msgclass - ErrorSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.ErrorSummary").msgclass - TransferCounters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferCounters").msgclass - NotificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.NotificationConfig").msgclass - NotificationConfig::EventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.NotificationConfig.EventType").enummodule - NotificationConfig::PayloadFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.NotificationConfig.PayloadFormat").enummodule - LoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.LoggingConfig").msgclass - LoggingConfig::LoggableAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.LoggingConfig.LoggableAction").enummodule - LoggingConfig::LoggableActionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.LoggingConfig.LoggableActionState").enummodule - TransferOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferOperation").msgclass - TransferOperation::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storagetransfer.v1.TransferOperation.Status").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/README.md deleted file mode 100644 index 59ffa00d6020..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Storage Transfer Service V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/rpc/code.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/code.rb deleted file mode 100644 index 8cf36e815510..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/code.rb +++ /dev/null @@ -1,185 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The canonical error codes for gRPC APIs. - # - # - # Sometimes multiple error codes may apply. Services should return - # the most specific error code that applies. For example, prefer - # `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. - # Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. - module Code - # Not an error; returned on success. - # - # HTTP Mapping: 200 OK - OK = 0 - - # The operation was cancelled, typically by the caller. - # - # HTTP Mapping: 499 Client Closed Request - CANCELLED = 1 - - # Unknown error. For example, this error may be returned when - # a `Status` value received from another address space belongs to - # an error space that is not known in this address space. Also - # errors raised by APIs that do not return enough error information - # may be converted to this error. - # - # HTTP Mapping: 500 Internal Server Error - UNKNOWN = 2 - - # The client specified an invalid argument. Note that this differs - # from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments - # that are problematic regardless of the state of the system - # (e.g., a malformed file name). - # - # HTTP Mapping: 400 Bad Request - INVALID_ARGUMENT = 3 - - # The deadline expired before the operation could complete. For operations - # that change the state of the system, this error may be returned - # even if the operation has completed successfully. For example, a - # successful response from a server could have been delayed long - # enough for the deadline to expire. - # - # HTTP Mapping: 504 Gateway Timeout - DEADLINE_EXCEEDED = 4 - - # Some requested entity (e.g., file or directory) was not found. - # - # Note to server developers: if a request is denied for an entire class - # of users, such as gradual feature rollout or undocumented allowlist, - # `NOT_FOUND` may be used. If a request is denied for some users within - # a class of users, such as user-based access control, `PERMISSION_DENIED` - # must be used. - # - # HTTP Mapping: 404 Not Found - NOT_FOUND = 5 - - # The entity that a client attempted to create (e.g., file or directory) - # already exists. - # - # HTTP Mapping: 409 Conflict - ALREADY_EXISTS = 6 - - # The caller does not have permission to execute the specified - # operation. `PERMISSION_DENIED` must not be used for rejections - # caused by exhausting some resource (use `RESOURCE_EXHAUSTED` - # instead for those errors). `PERMISSION_DENIED` must not be - # used if the caller can not be identified (use `UNAUTHENTICATED` - # instead for those errors). This error code does not imply the - # request is valid or the requested entity exists or satisfies - # other pre-conditions. - # - # HTTP Mapping: 403 Forbidden - PERMISSION_DENIED = 7 - - # The request does not have valid authentication credentials for the - # operation. - # - # HTTP Mapping: 401 Unauthorized - UNAUTHENTICATED = 16 - - # Some resource has been exhausted, perhaps a per-user quota, or - # perhaps the entire file system is out of space. - # - # HTTP Mapping: 429 Too Many Requests - RESOURCE_EXHAUSTED = 8 - - # The operation was rejected because the system is not in a state - # required for the operation's execution. For example, the directory - # to be deleted is non-empty, an rmdir operation is applied to - # a non-directory, etc. - # - # Service implementors can use the following guidelines to decide - # between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: - # (a) Use `UNAVAILABLE` if the client can retry just the failing call. - # (b) Use `ABORTED` if the client should retry at a higher level. For - # example, when a client-specified test-and-set fails, indicating the - # client should restart a read-modify-write sequence. - # (c) Use `FAILED_PRECONDITION` if the client should not retry until - # the system state has been explicitly fixed. For example, if an "rmdir" - # fails because the directory is non-empty, `FAILED_PRECONDITION` - # should be returned since the client should not retry unless - # the files are deleted from the directory. - # - # HTTP Mapping: 400 Bad Request - FAILED_PRECONDITION = 9 - - # The operation was aborted, typically due to a concurrency issue such as - # a sequencer check failure or transaction abort. - # - # See the guidelines above for deciding between `FAILED_PRECONDITION`, - # `ABORTED`, and `UNAVAILABLE`. - # - # HTTP Mapping: 409 Conflict - ABORTED = 10 - - # The operation was attempted past the valid range. E.g., seeking or - # reading past end-of-file. - # - # Unlike `INVALID_ARGUMENT`, this error indicates a problem that may - # be fixed if the system state changes. For example, a 32-bit file - # system will generate `INVALID_ARGUMENT` if asked to read at an - # offset that is not in the range [0,2^32-1], but it will generate - # `OUT_OF_RANGE` if asked to read from an offset past the current - # file size. - # - # There is a fair bit of overlap between `FAILED_PRECONDITION` and - # `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific - # error) when it applies so that callers who are iterating through - # a space can easily look for an `OUT_OF_RANGE` error to detect when - # they are done. - # - # HTTP Mapping: 400 Bad Request - OUT_OF_RANGE = 11 - - # The operation is not implemented or is not supported/enabled in this - # service. - # - # HTTP Mapping: 501 Not Implemented - UNIMPLEMENTED = 12 - - # Internal errors. This means that some invariants expected by the - # underlying system have been broken. This error code is reserved - # for serious errors. - # - # HTTP Mapping: 500 Internal Server Error - INTERNAL = 13 - - # The service is currently unavailable. This is most likely a - # transient condition, which can be corrected by retrying with - # a backoff. Note that it is not always safe to retry - # non-idempotent operations. - # - # See the guidelines above for deciding between `FAILED_PRECONDITION`, - # `ABORTED`, and `UNAVAILABLE`. - # - # HTTP Mapping: 503 Service Unavailable - UNAVAILABLE = 14 - - # Unrecoverable data loss or corruption. - # - # HTTP Mapping: 500 Internal Server Error - DATA_LOSS = 15 - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index 3c630675d70b..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer.rb deleted file mode 100644 index 5cd832360c85..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer.rb +++ /dev/null @@ -1,307 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module StorageTransfer - module V1 - # Request passed to GetGoogleServiceAccount. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud project that the Google service - # account is associated with. - class GetGoogleServiceAccountRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request passed to CreateTransferJob. - # @!attribute [rw] transfer_job - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # Required. The job to create. - class CreateTransferJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request passed to UpdateTransferJob. - # @!attribute [rw] job_name - # @return [::String] - # Required. The name of job to update. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud project that owns the - # job. - # @!attribute [rw] transfer_job - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob] - # Required. The job to update. `transferJob` is expected to specify one or - # more of five fields: - # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and - # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. An - # `UpdateTransferJobRequest` that specifies other fields are rejected with - # the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. Updating a - # job status to - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} requires - # `storagetransfer.jobs.delete` permission. - # @!attribute [rw] update_transfer_job_field_mask - # @return [::Google::Protobuf::FieldMask] - # The field mask of the fields in `transferJob` that are to be updated in - # this request. Fields in `transferJob` that can be updated are: - # {::Google::Cloud::StorageTransfer::V1::TransferJob#description description}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config}, - # {::Google::Cloud::StorageTransfer::V1::TransferJob#logging_config logging_config}, and - # {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. To update the - # `transfer_spec` of the job, a complete transfer specification must be - # provided. An incomplete specification missing any required fields is - # rejected with the error - # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. - class UpdateTransferJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request passed to GetTransferJob. - # @!attribute [rw] job_name - # @return [::String] - # Required. The job to get. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud project that owns the - # job. - class GetTransferJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request passed to DeleteTransferJob. - # @!attribute [rw] job_name - # @return [::String] - # Required. The job to delete. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud project that owns the - # job. - class DeleteTransferJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `projectId`, `jobNames`, and `jobStatuses` are query parameters that can - # be specified when listing transfer jobs. - # @!attribute [rw] filter - # @return [::String] - # Required. A list of query parameters specified as JSON text in the form of: - # - # ``` - # { - # "projectId":"my_project_id", - # "jobNames":["jobid1","jobid2",...], - # "jobStatuses":["status1","status2",...], - # "dataBackend":"QUERY_REPLICATION_CONFIGS", - # "sourceBucket":"source-bucket-name", - # "sinkBucket":"sink-bucket-name", - # } - # ``` - # - # The JSON formatting in the example is for display only; provide the - # query parameters without spaces or line breaks. - # - # * `projectId` is required. - # * Since `jobNames` and `jobStatuses` support multiple values, their values - # must be specified with array notation. `jobNames` and `jobStatuses` are - # optional. Valid values are case-insensitive: - # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED} - # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED} - # * {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} - # * Specify `"dataBackend":"QUERY_REPLICATION_CONFIGS"` to return a list of - # cross-bucket replication jobs. - # * Limit the results to jobs from a particular bucket with `sourceBucket` - # and/or to a particular bucket with `sinkBucket`. - # @!attribute [rw] page_size - # @return [::Integer] - # The list page size. The max allowed value is 256. - # @!attribute [rw] page_token - # @return [::String] - # The list page token. - class ListTransferJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response from ListTransferJobs. - # @!attribute [rw] transfer_jobs - # @return [::Array<::Google::Cloud::StorageTransfer::V1::TransferJob>] - # A list of transfer jobs. - # @!attribute [rw] next_page_token - # @return [::String] - # The list next page token. - class ListTransferJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request passed to PauseTransferOperation. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the transfer operation. - class PauseTransferOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request passed to ResumeTransferOperation. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the transfer operation. - class ResumeTransferOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request passed to RunTransferJob. - # @!attribute [rw] job_name - # @return [::String] - # Required. The name of the transfer job. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud project that owns the transfer - # job. - class RunTransferJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the request passed to CreateAgentPool. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud project that owns the - # agent pool. - # @!attribute [rw] agent_pool - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # Required. The agent pool to create. - # @!attribute [rw] agent_pool_id - # @return [::String] - # Required. The ID of the agent pool to create. - # - # The `agent_pool_id` must meet the following requirements: - # - # * Length of 128 characters or less. - # * Not start with the string `goog`. - # * Start with a lowercase ASCII character, followed by: - # * Zero or more: lowercase Latin alphabet characters, numerals, - # hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). - # * One or more numerals or lowercase ASCII characters. - # - # As expressed by the regular expression: - # `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. - class CreateAgentPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the request passed to UpdateAgentPool. - # @!attribute [rw] agent_pool - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool] - # Required. The agent pool to update. `agent_pool` is expected to specify - # following fields: - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#name name} - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} - # An `UpdateAgentPoolRequest` with any other fields is rejected - # with the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The [field mask] - # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) - # of the fields in `agentPool` to update in this request. - # The following `agentPool` fields can be updated: - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#display_name display_name} - # - # * {::Google::Cloud::StorageTransfer::V1::AgentPool#bandwidth_limit bandwidth_limit} - class UpdateAgentPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the request passed to GetAgentPool. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the agent pool to get. - class GetAgentPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the request passed to DeleteAgentPool. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the agent pool to delete. - class DeleteAgentPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request passed to ListAgentPools. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud project that owns the job. - # @!attribute [rw] filter - # @return [::String] - # An optional list of query parameters specified as JSON text in the - # form of: - # - # `{"agentPoolNames":["agentpool1","agentpool2",...]}` - # - # Since `agentPoolNames` support multiple values, its values must be - # specified with array notation. When the filter is either empty or not - # provided, the list returns all agent pools for the project. - # @!attribute [rw] page_size - # @return [::Integer] - # The list page size. The max allowed value is `256`. - # @!attribute [rw] page_token - # @return [::String] - # The list page token. - class ListAgentPoolsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response from ListAgentPools. - # @!attribute [rw] agent_pools - # @return [::Array<::Google::Cloud::StorageTransfer::V1::AgentPool>] - # A list of agent pools. - # @!attribute [rw] next_page_token - # @return [::String] - # The list next page token. - class ListAgentPoolsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer_types.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer_types.rb deleted file mode 100644 index de6dd48638d9..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/storagetransfer/v1/transfer_types.rb +++ /dev/null @@ -1,1534 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module StorageTransfer - module V1 - # Google service account - # @!attribute [rw] account_email - # @return [::String] - # Email address of the service account. - # @!attribute [rw] subject_id - # @return [::String] - # Unique identifier for the service account. - class GoogleServiceAccount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AWS access key (see - # [AWS Security - # Credentials](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). - # - # For information on our data retention policy for user credentials, see - # [User credentials](/storage-transfer/docs/data-retention#user-credentials). - # @!attribute [rw] access_key_id - # @return [::String] - # Required. AWS access key ID. - # @!attribute [rw] secret_access_key - # @return [::String] - # Required. AWS secret access key. This field is not returned in RPC - # responses. - class AwsAccessKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Azure credentials - # - # For information on our data retention policy for user credentials, see - # [User credentials](/storage-transfer/docs/data-retention#user-credentials). - # @!attribute [rw] sas_token - # @return [::String] - # Required. Azure shared access signature (SAS). - # - # For more information about SAS, see - # [Grant limited access to Azure Storage resources using shared access - # signatures - # (SAS)](https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview). - class AzureCredentials - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Conditions that determine which objects are transferred. Applies only - # to Cloud Data Sources such as S3, Azure, and Cloud Storage. - # - # The "last modification time" refers to the time of the - # last change to the object's content or metadata — specifically, this is - # the `updated` property of Cloud Storage objects, the `LastModified` field - # of S3 objects, and the `Last-Modified` header of Azure blobs. - # - # For S3 objects, the `LastModified` value is the time the object begins - # uploading. If the object meets your "last modification time" criteria, - # but has not finished uploading, the object is not transferred. See - # [Transfer from Amazon S3 to Cloud - # Storage](https://cloud.google.com/storage-transfer/docs/create-transfers/agentless/s3#transfer_options) - # for more information. - # - # Transfers with a {::Google::Cloud::StorageTransfer::V1::PosixFilesystem PosixFilesystem} - # source or destination don't support `ObjectConditions`. - # @!attribute [rw] min_time_elapsed_since_last_modification - # @return [::Google::Protobuf::Duration] - # Ensures that objects are not transferred until a specific minimum time - # has elapsed after the "last modification time". When a - # {::Google::Cloud::StorageTransfer::V1::TransferOperation TransferOperation} begins, - # objects with a "last modification time" are transferred only if the elapsed - # time between the - # {::Google::Cloud::StorageTransfer::V1::TransferOperation#start_time start_time} of the - # `TransferOperation` and the "last modification time" of the object is equal - # to or greater than the value of min_time_elapsed_since_last_modification`. - # Objects that do not have a "last modification time" are also transferred. - # @!attribute [rw] max_time_elapsed_since_last_modification - # @return [::Google::Protobuf::Duration] - # Ensures that objects are not transferred if a specific maximum time - # has elapsed since the "last modification time". - # When a {::Google::Cloud::StorageTransfer::V1::TransferOperation TransferOperation} - # begins, objects with a "last modification time" are transferred only if the - # elapsed time between the - # {::Google::Cloud::StorageTransfer::V1::TransferOperation#start_time start_time} of the - # `TransferOperation`and the "last modification time" of the object - # is less than the value of max_time_elapsed_since_last_modification`. - # Objects that do not have a "last modification time" are also transferred. - # @!attribute [rw] include_prefixes - # @return [::Array<::String>] - # If you specify `include_prefixes`, Storage Transfer Service uses the items - # in the `include_prefixes` array to determine which objects to include in a - # transfer. Objects must start with one of the matching `include_prefixes` - # for inclusion in the transfer. If - # {::Google::Cloud::StorageTransfer::V1::ObjectConditions#exclude_prefixes exclude_prefixes} - # is specified, objects must not start with any of the `exclude_prefixes` - # specified for inclusion in the transfer. - # - # The following are requirements of `include_prefixes`: - # - # * Each include-prefix can contain any sequence of Unicode characters, to - # a max length of 1024 bytes when UTF8-encoded, and must not contain - # Carriage Return or Line Feed characters. Wildcard matching and regular - # expression matching are not supported. - # - # * Each include-prefix must omit the leading slash. For example, to - # include the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, - # specify the include-prefix as `logs/y=2015/requests.gz`. - # - # * None of the include-prefix values can be empty, if specified. - # - # * Each include-prefix must include a distinct portion of the object - # namespace. No include-prefix may be a prefix of another - # include-prefix. - # - # The max size of `include_prefixes` is 1000. - # - # For more information, see [Filtering objects from - # transfers](/storage-transfer/docs/filtering-objects-from-transfers). - # @!attribute [rw] exclude_prefixes - # @return [::Array<::String>] - # If you specify `exclude_prefixes`, Storage Transfer Service uses the items - # in the `exclude_prefixes` array to determine which objects to exclude from - # a transfer. Objects must not start with one of the matching - # `exclude_prefixes` for inclusion in a transfer. - # - # The following are requirements of `exclude_prefixes`: - # - # * Each exclude-prefix can contain any sequence of Unicode characters, to - # a max length of 1024 bytes when UTF8-encoded, and must not contain - # Carriage Return or Line Feed characters. Wildcard matching and regular - # expression matching are not supported. - # - # * Each exclude-prefix must omit the leading slash. For example, to - # exclude the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, - # specify the exclude-prefix as `logs/y=2015/requests.gz`. - # - # * None of the exclude-prefix values can be empty, if specified. - # - # * Each exclude-prefix must exclude a distinct portion of the object - # namespace. No exclude-prefix may be a prefix of another - # exclude-prefix. - # - # * If - # {::Google::Cloud::StorageTransfer::V1::ObjectConditions#include_prefixes include_prefixes} - # is specified, then each exclude-prefix must start with the value of a - # path explicitly included by `include_prefixes`. - # - # The max size of `exclude_prefixes` is 1000. - # - # For more information, see [Filtering objects from - # transfers](/storage-transfer/docs/filtering-objects-from-transfers). - # @!attribute [rw] last_modified_since - # @return [::Google::Protobuf::Timestamp] - # If specified, only objects with a "last modification time" on or after - # this timestamp and objects that don't have a "last modification time" are - # transferred. - # - # The `last_modified_since` and `last_modified_before` fields can be used - # together for chunked data processing. For example, consider a script that - # processes each day's worth of data at a time. For that you'd set each - # of the fields as follows: - # - # * `last_modified_since` to the start of the day - # - # * `last_modified_before` to the end of the day - # @!attribute [rw] last_modified_before - # @return [::Google::Protobuf::Timestamp] - # If specified, only objects with a "last modification time" before this - # timestamp and objects that don't have a "last modification time" are - # transferred. - class ObjectConditions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # In a GcsData resource, an object's name is the Cloud Storage object's - # name and its "last modification time" refers to the object's `updated` - # property of Cloud Storage objects, which changes when the content or the - # metadata of the object is updated. - # @!attribute [rw] bucket_name - # @return [::String] - # Required. Cloud Storage bucket name. Must meet - # [Bucket Name Requirements](/storage/docs/naming#requirements). - # @!attribute [rw] path - # @return [::String] - # Root path to transfer objects. - # - # Must be an empty string or full path name that ends with a '/'. This field - # is treated as an object prefix. As such, it should generally not begin with - # a '/'. - # - # The root path value must meet - # [Object Name Requirements](/storage/docs/naming#objectnames). - # @!attribute [rw] managed_folder_transfer_enabled - # @return [::Boolean] - # Preview. Enables the transfer of managed folders between Cloud Storage - # buckets. Set this option on the gcs_data_source. - # - # If set to true: - # - # - Managed folders in the source bucket are transferred to the - # destination bucket. - # - Managed folders in the destination bucket are overwritten. Other - # OVERWRITE options are not supported. - # - # See - # [Transfer Cloud Storage managed - # folders](/storage-transfer/docs/managed-folders). - class GcsData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An AwsS3Data resource can be a data source, but not a data sink. - # In an AwsS3Data resource, an object's name is the S3 object's key name. - # @!attribute [rw] bucket_name - # @return [::String] - # Required. S3 Bucket name (see - # [Creating a - # bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). - # @!attribute [rw] aws_access_key - # @return [::Google::Cloud::StorageTransfer::V1::AwsAccessKey] - # Input only. AWS access key used to sign the API requests to the AWS S3 - # bucket. Permissions on the bucket must be granted to the access ID of the - # AWS access key. - # - # For information on our data retention policy for user credentials, see - # [User credentials](/storage-transfer/docs/data-retention#user-credentials). - # @!attribute [rw] path - # @return [::String] - # Root path to transfer objects. - # - # Must be an empty string or full path name that ends with a '/'. This field - # is treated as an object prefix. As such, it should generally not begin with - # a '/'. - # @!attribute [rw] role_arn - # @return [::String] - # The Amazon Resource Name (ARN) of the role to support temporary - # credentials via `AssumeRoleWithWebIdentity`. For more information about - # ARNs, see [IAM - # ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns). - # - # When a role ARN is provided, Transfer Service fetches temporary - # credentials for the session using a `AssumeRoleWithWebIdentity` call for - # the provided role using the - # {::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount GoogleServiceAccount} for - # this project. - # @!attribute [rw] cloudfront_domain - # @return [::String] - # Optional. The CloudFront distribution domain name pointing to this bucket, - # to use when fetching. - # - # See - # [Transfer from S3 via - # CloudFront](https://cloud.google.com/storage-transfer/docs/s3-cloudfront) - # for more information. - # - # Format: `https://{id}.cloudfront.net` or any valid custom domain. Must - # begin with `https://`. - # @!attribute [rw] credentials_secret - # @return [::String] - # Optional. The Resource name of a secret in Secret Manager. - # - # AWS credentials must be stored in Secret Manager in JSON format: - # - # { - # "access_key_id": "ACCESS_KEY_ID", - # "secret_access_key": "SECRET_ACCESS_KEY" - # } - # - # {::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount GoogleServiceAccount} must - # be granted `roles/secretmanager.secretAccessor` for the resource. - # - # See [Configure access to a source: Amazon S3] - # (https://cloud.google.com/storage-transfer/docs/source-amazon-s3#secret_manager) - # for more information. - # - # If `credentials_secret` is specified, do not specify - # {::Google::Cloud::StorageTransfer::V1::AwsS3Data#role_arn role_arn} or - # {::Google::Cloud::StorageTransfer::V1::AwsS3Data#aws_access_key aws_access_key}. - # - # Format: `projects/{project_number}/secrets/{secret_name}` - # @!attribute [rw] managed_private_network - # @return [::Boolean] - # Egress bytes over a Google-managed private network. - # This network is shared between other users of Storage Transfer Service. - class AwsS3Data - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An AzureBlobStorageData resource can be a data source, but not a data sink. - # An AzureBlobStorageData resource represents one Azure container. The storage - # account determines the [Azure - # endpoint](https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account#storage-account-endpoints). - # In an AzureBlobStorageData resource, a blobs's name is the [Azure Blob - # Storage blob's key - # name](https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#blob-names). - # @!attribute [rw] storage_account - # @return [::String] - # Required. The name of the Azure Storage account. - # @!attribute [rw] azure_credentials - # @return [::Google::Cloud::StorageTransfer::V1::AzureCredentials] - # Required. Input only. Credentials used to authenticate API requests to - # Azure. - # - # For information on our data retention policy for user credentials, see - # [User credentials](/storage-transfer/docs/data-retention#user-credentials). - # @!attribute [rw] container - # @return [::String] - # Required. The container to transfer from the Azure Storage account. - # @!attribute [rw] path - # @return [::String] - # Root path to transfer objects. - # - # Must be an empty string or full path name that ends with a '/'. This field - # is treated as an object prefix. As such, it should generally not begin with - # a '/'. - # @!attribute [rw] credentials_secret - # @return [::String] - # Optional. The Resource name of a secret in Secret Manager. - # - # The Azure SAS token must be stored in Secret Manager in JSON format: - # - # { - # "sas_token" : "SAS_TOKEN" - # } - # - # {::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount GoogleServiceAccount} must - # be granted `roles/secretmanager.secretAccessor` for the resource. - # - # See [Configure access to a source: Microsoft Azure Blob Storage] - # (https://cloud.google.com/storage-transfer/docs/source-microsoft-azure#secret_manager) - # for more information. - # - # If `credentials_secret` is specified, do not specify - # {::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData#azure_credentials azure_credentials}. - # - # Format: `projects/{project_number}/secrets/{secret_name}` - # @!attribute [rw] federated_identity_config - # @return [::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData::FederatedIdentityConfig] - # Optional. Federated identity config of a user registered Azure application. - # - # If `federated_identity_config` is specified, do not specify - # {::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData#azure_credentials azure_credentials} - # or - # {::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData#credentials_secret credentials_secret}. - class AzureBlobStorageData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The identity of an Azure application through which Storage Transfer Service - # can authenticate requests using Azure workload identity federation. - # - # Storage Transfer Service can issue requests to Azure Storage through - # registered Azure applications, eliminating the need to pass credentials to - # Storage Transfer Service directly. - # - # To configure federated identity, see - # [Configure access to Microsoft Azure - # Storage](https://cloud.google.com/storage-transfer/docs/source-microsoft-azure#option_3_authenticate_using_federated_identity). - # @!attribute [rw] client_id - # @return [::String] - # Required. The client (application) ID of the application with federated - # credentials. - # @!attribute [rw] tenant_id - # @return [::String] - # Required. The tenant (directory) ID of the application with federated - # credentials. - class FederatedIdentityConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # An HttpData resource specifies a list of objects on the web to be - # transferred over HTTP. The information of the objects to be transferred is - # contained in a file referenced by a URL. The first line in the file must be - # `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent - # lines specify the information of the list of objects, one object per list - # entry. Each entry has the following tab-delimited fields: - # - # * **HTTP URL** — The location of the object. - # - # * **Length** — The size of the object in bytes. - # - # * **MD5** — The base64-encoded MD5 hash of the object. - # - # For an example of a valid TSV file, see - # [Transferring data from - # URLs](https://cloud.google.com/storage-transfer/docs/create-url-list). - # - # When transferring data based on a URL list, keep the following in mind: - # - # * When an object located at `http(s)://hostname:port/` is - # transferred to a data sink, the name of the object at the data sink is - # `/`. - # - # * If the specified size of an object does not match the actual size of the - # object fetched, the object is not transferred. - # - # * If the specified MD5 does not match the MD5 computed from the transferred - # bytes, the object transfer fails. - # - # * Ensure that each URL you specify is publicly accessible. For - # example, in Cloud Storage you can - # [share an object publicly] - # (/storage/docs/cloud-console#_sharingdata) and get a link to it. - # - # * Storage Transfer Service obeys `robots.txt` rules and requires the source - # HTTP server to support `Range` requests and to return a `Content-Length` - # header in each response. - # - # * {::Google::Cloud::StorageTransfer::V1::ObjectConditions ObjectConditions} have no - # effect when filtering objects to transfer. - # @!attribute [rw] list_url - # @return [::String] - # Required. The URL that points to the file that stores the object list - # entries. This file must allow public access. The URL is either an - # HTTP/HTTPS address (e.g. `https://example.com/urllist.tsv`) or a Cloud - # Storage path (e.g. `gs://my-bucket/urllist.tsv`). - class HttpData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A POSIX filesystem resource. - # @!attribute [rw] root_directory - # @return [::String] - # Root directory path to the filesystem. - class PosixFilesystem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An HdfsData resource specifies a path within an HDFS entity (e.g. a cluster). - # All cluster-specific settings, such as namenodes and ports, are configured on - # the transfer agents servicing requests, so HdfsData only contains the root - # path to the data in our transfer. - # @!attribute [rw] path - # @return [::String] - # Root path to transfer files. - class HdfsData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An AwsS3CompatibleData resource. - # @!attribute [rw] bucket_name - # @return [::String] - # Required. Specifies the name of the bucket. - # @!attribute [rw] path - # @return [::String] - # Specifies the root path to transfer objects. - # - # Must be an empty string or full path name that ends with a '/'. This - # field is treated as an object prefix. As such, it should generally not - # begin with a '/'. - # @!attribute [rw] endpoint - # @return [::String] - # Required. Specifies the endpoint of the storage service. - # @!attribute [rw] region - # @return [::String] - # Specifies the region to sign requests with. This can be left blank if - # requests should be signed with an empty region. - # @!attribute [rw] s3_metadata - # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata] - # A S3 compatible metadata. - class AwsS3CompatibleData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # S3CompatibleMetadata contains the metadata fields that apply to the basic - # types of S3-compatible data providers. - # @!attribute [rw] auth_method - # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata::AuthMethod] - # Specifies the authentication and authorization method used by the storage - # service. When not specified, Transfer Service will attempt to determine - # right auth method to use. - # @!attribute [rw] request_model - # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata::RequestModel] - # Specifies the API request model used to call the storage service. When not - # specified, the default value of RequestModel - # REQUEST_MODEL_VIRTUAL_HOSTED_STYLE is used. - # @!attribute [rw] protocol - # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata::NetworkProtocol] - # Specifies the network protocol of the agent. When not specified, the - # default value of NetworkProtocol NETWORK_PROTOCOL_HTTPS is used. - # @!attribute [rw] list_api - # @return [::Google::Cloud::StorageTransfer::V1::S3CompatibleMetadata::ListApi] - # The Listing API to use for discovering objects. When not specified, - # Transfer Service will attempt to determine the right API to use. - class S3CompatibleMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The authentication and authorization method used by the storage service. - module AuthMethod - # AuthMethod is not specified. - AUTH_METHOD_UNSPECIFIED = 0 - - # Auth requests with AWS SigV4. - AUTH_METHOD_AWS_SIGNATURE_V4 = 1 - - # Auth requests with AWS SigV2. - AUTH_METHOD_AWS_SIGNATURE_V2 = 2 - end - - # The request model of the API. - module RequestModel - # RequestModel is not specified. - REQUEST_MODEL_UNSPECIFIED = 0 - - # Perform requests using Virtual Hosted Style. - # Example: https://bucket-name.s3.region.amazonaws.com/key-name - REQUEST_MODEL_VIRTUAL_HOSTED_STYLE = 1 - - # Perform requests using Path Style. - # Example: https://s3.region.amazonaws.com/bucket-name/key-name - REQUEST_MODEL_PATH_STYLE = 2 - end - - # The agent network protocol to access the storage service. - module NetworkProtocol - # NetworkProtocol is not specified. - NETWORK_PROTOCOL_UNSPECIFIED = 0 - - # Perform requests using HTTPS. - NETWORK_PROTOCOL_HTTPS = 1 - - # Not recommended: This sends data in clear-text. This is only - # appropriate within a closed network or for publicly available data. - # Perform requests using HTTP. - NETWORK_PROTOCOL_HTTP = 2 - end - - # The Listing API to use for discovering objects. - module ListApi - # ListApi is not specified. - LIST_API_UNSPECIFIED = 0 - - # Perform listing using ListObjectsV2 API. - LIST_OBJECTS_V2 = 1 - - # Legacy ListObjects API. - LIST_OBJECTS = 2 - end - end - - # Represents an agent pool. - # @!attribute [rw] name - # @return [::String] - # Required. Specifies a unique string that identifies the agent pool. - # - # Format: `projects/{project_id}/agentPools/{agent_pool_id}` - # @!attribute [rw] display_name - # @return [::String] - # Specifies the client-specified AgentPool description. - # @!attribute [r] state - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool::State] - # Output only. Specifies the state of the AgentPool. - # @!attribute [rw] bandwidth_limit - # @return [::Google::Cloud::StorageTransfer::V1::AgentPool::BandwidthLimit] - # Specifies the bandwidth limit details. If this field is unspecified, the - # default value is set as 'No Limit'. - class AgentPool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies a bandwidth limit for an agent pool. - # @!attribute [rw] limit_mbps - # @return [::Integer] - # Bandwidth rate in megabytes per second, distributed across all the agents - # in the pool. - class BandwidthLimit - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of an AgentPool. - module State - # Default value. This value is unused. - STATE_UNSPECIFIED = 0 - - # This is an initialization state. During this stage, resources are - # allocated for the AgentPool. - CREATING = 1 - - # Determines that the AgentPool is created for use. At this state, Agents - # can join the AgentPool and participate in the transfer jobs in that pool. - CREATED = 2 - - # Determines that the AgentPool deletion has been initiated, and all the - # resources are scheduled to be cleaned up and freed. - DELETING = 3 - end - end - - # TransferOptions define the actions to be performed on objects in a transfer. - # @!attribute [rw] overwrite_objects_already_existing_in_sink - # @return [::Boolean] - # When to overwrite objects that already exist in the sink. The default is - # that only objects that are different from the source are overwritten. If - # true, all objects in the sink whose name matches an object in the source - # are overwritten with the source object. - # @!attribute [rw] delete_objects_unique_in_sink - # @return [::Boolean] - # Whether objects that exist only in the sink should be deleted. - # - # **Note:** This option and - # {::Google::Cloud::StorageTransfer::V1::TransferOptions#delete_objects_from_source_after_transfer delete_objects_from_source_after_transfer} - # are mutually exclusive. - # @!attribute [rw] delete_objects_from_source_after_transfer - # @return [::Boolean] - # Whether objects should be deleted from the source after they are - # transferred to the sink. - # - # **Note:** This option and - # {::Google::Cloud::StorageTransfer::V1::TransferOptions#delete_objects_unique_in_sink delete_objects_unique_in_sink} - # are mutually exclusive. - # @!attribute [rw] overwrite_when - # @return [::Google::Cloud::StorageTransfer::V1::TransferOptions::OverwriteWhen] - # When to overwrite objects that already exist in the sink. If not set, - # overwrite behavior is determined by - # {::Google::Cloud::StorageTransfer::V1::TransferOptions#overwrite_objects_already_existing_in_sink overwrite_objects_already_existing_in_sink}. - # @!attribute [rw] metadata_options - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions] - # Represents the selected metadata options for a transfer job. - class TransferOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies when to overwrite an object in the sink when an object with - # matching name is found in the source. - module OverwriteWhen - # Overwrite behavior is unspecified. - OVERWRITE_WHEN_UNSPECIFIED = 0 - - # Overwrites destination objects with the source objects, only if the - # objects have the same name but different HTTP ETags or checksum values. - DIFFERENT = 1 - - # Never overwrites a destination object if a source object has the - # same name. In this case, the source object is not transferred. - NEVER = 2 - - # Always overwrite the destination object with the source object, even if - # the HTTP Etags or checksum values are the same. - ALWAYS = 3 - end - end - - # Configuration for running a transfer. - # @!attribute [rw] gcs_data_sink - # @return [::Google::Cloud::StorageTransfer::V1::GcsData] - # A Cloud Storage data sink. - # - # Note: The following fields are mutually exclusive: `gcs_data_sink`, `posix_data_sink`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] posix_data_sink - # @return [::Google::Cloud::StorageTransfer::V1::PosixFilesystem] - # A POSIX Filesystem data sink. - # - # Note: The following fields are mutually exclusive: `posix_data_sink`, `gcs_data_sink`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_data_source - # @return [::Google::Cloud::StorageTransfer::V1::GcsData] - # A Cloud Storage data source. - # - # Note: The following fields are mutually exclusive: `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] aws_s3_data_source - # @return [::Google::Cloud::StorageTransfer::V1::AwsS3Data] - # An AWS S3 data source. - # - # Note: The following fields are mutually exclusive: `aws_s3_data_source`, `gcs_data_source`, `http_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] http_data_source - # @return [::Google::Cloud::StorageTransfer::V1::HttpData] - # An HTTP URL data source. - # - # Note: The following fields are mutually exclusive: `http_data_source`, `gcs_data_source`, `aws_s3_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] posix_data_source - # @return [::Google::Cloud::StorageTransfer::V1::PosixFilesystem] - # A POSIX Filesystem data source. - # - # Note: The following fields are mutually exclusive: `posix_data_source`, `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] azure_blob_storage_data_source - # @return [::Google::Cloud::StorageTransfer::V1::AzureBlobStorageData] - # An Azure Blob Storage data source. - # - # Note: The following fields are mutually exclusive: `azure_blob_storage_data_source`, `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `posix_data_source`, `aws_s3_compatible_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] aws_s3_compatible_data_source - # @return [::Google::Cloud::StorageTransfer::V1::AwsS3CompatibleData] - # An AWS S3 compatible data source. - # - # Note: The following fields are mutually exclusive: `aws_s3_compatible_data_source`, `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `hdfs_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] hdfs_data_source - # @return [::Google::Cloud::StorageTransfer::V1::HdfsData] - # An HDFS cluster data source. - # - # Note: The following fields are mutually exclusive: `hdfs_data_source`, `gcs_data_source`, `aws_s3_data_source`, `http_data_source`, `posix_data_source`, `azure_blob_storage_data_source`, `aws_s3_compatible_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_intermediate_data_location - # @return [::Google::Cloud::StorageTransfer::V1::GcsData] - # For transfers between file systems, specifies a Cloud Storage bucket - # to be used as an intermediate location through which to transfer data. - # - # See [Transfer data between file - # systems](https://cloud.google.com/storage-transfer/docs/file-to-file) for - # more information. - # @!attribute [rw] object_conditions - # @return [::Google::Cloud::StorageTransfer::V1::ObjectConditions] - # Only objects that satisfy these object conditions are included in the set - # of data source and data sink objects. Object conditions based on - # objects' "last modification time" do not exclude objects in a data sink. - # @!attribute [rw] transfer_options - # @return [::Google::Cloud::StorageTransfer::V1::TransferOptions] - # If the option - # {::Google::Cloud::StorageTransfer::V1::TransferOptions#delete_objects_unique_in_sink delete_objects_unique_in_sink} - # is `true` and time-based object conditions such as 'last modification time' - # are specified, the request fails with an - # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} error. - # @!attribute [rw] transfer_manifest - # @return [::Google::Cloud::StorageTransfer::V1::TransferManifest] - # A manifest file provides a list of objects to be transferred from the data - # source. This field points to the location of the manifest file. - # Otherwise, the entire source bucket is used. ObjectConditions still apply. - # @!attribute [rw] source_agent_pool_name - # @return [::String] - # Specifies the agent pool name associated with the posix data source. When - # unspecified, the default name is used. - # @!attribute [rw] sink_agent_pool_name - # @return [::String] - # Specifies the agent pool name associated with the posix data sink. When - # unspecified, the default name is used. - class TransferSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the configuration for a cross-bucket replication job. Cross-bucket - # replication copies new or updated objects from a source Cloud Storage bucket - # to a destination Cloud Storage bucket. Existing objects in the source bucket - # are not copied by a new cross-bucket replication job. - # @!attribute [rw] gcs_data_source - # @return [::Google::Cloud::StorageTransfer::V1::GcsData] - # The Cloud Storage bucket from which to replicate objects. - # @!attribute [rw] gcs_data_sink - # @return [::Google::Cloud::StorageTransfer::V1::GcsData] - # The Cloud Storage bucket to which to replicate objects. - # @!attribute [rw] object_conditions - # @return [::Google::Cloud::StorageTransfer::V1::ObjectConditions] - # Object conditions that determine which objects are transferred. For - # replication jobs, only `include_prefixes` and `exclude_prefixes` are - # supported. - # @!attribute [rw] transfer_options - # @return [::Google::Cloud::StorageTransfer::V1::TransferOptions] - # Specifies the metadata options to be applied during replication. - # Delete options are not supported. If a delete option is specified, the - # request fails with an {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} - # error. - class ReplicationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the metadata options for running a transfer. - # @!attribute [rw] symlink - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::Symlink] - # Specifies how symlinks should be handled by the transfer. By default, - # symlinks are not preserved. Only applicable to transfers involving - # POSIX file systems, and ignored for other transfers. - # @!attribute [rw] mode - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::Mode] - # Specifies how each file's mode attribute should be handled by the transfer. - # By default, mode is not preserved. Only applicable to transfers involving - # POSIX file systems, and ignored for other transfers. - # @!attribute [rw] gid - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::GID] - # Specifies how each file's POSIX group ID (GID) attribute should be handled - # by the transfer. By default, GID is not preserved. Only applicable to - # transfers involving POSIX file systems, and ignored for other transfers. - # @!attribute [rw] uid - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::UID] - # Specifies how each file's POSIX user ID (UID) attribute should be handled - # by the transfer. By default, UID is not preserved. Only applicable to - # transfers involving POSIX file systems, and ignored for other transfers. - # @!attribute [rw] acl - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::Acl] - # Specifies how each object's ACLs should be preserved for transfers between - # Google Cloud Storage buckets. If unspecified, the default behavior is the - # same as ACL_DESTINATION_BUCKET_DEFAULT. - # @!attribute [rw] storage_class - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::StorageClass] - # Specifies the storage class to set on objects being transferred to Google - # Cloud Storage buckets. If unspecified, the default behavior is the same as - # {::Google::Cloud::StorageTransfer::V1::MetadataOptions::StorageClass::STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT}. - # @!attribute [rw] temporary_hold - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::TemporaryHold] - # Specifies how each object's temporary hold status should be preserved for - # transfers between Google Cloud Storage buckets. If unspecified, the - # default behavior is the same as - # {::Google::Cloud::StorageTransfer::V1::MetadataOptions::TemporaryHold::TEMPORARY_HOLD_PRESERVE TEMPORARY_HOLD_PRESERVE}. - # @!attribute [rw] kms_key - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::KmsKey] - # Specifies how each object's Cloud KMS customer-managed encryption key - # (CMEK) is preserved for transfers between Google Cloud Storage buckets. If - # unspecified, the default behavior is the same as - # {::Google::Cloud::StorageTransfer::V1::MetadataOptions::KmsKey::KMS_KEY_DESTINATION_BUCKET_DEFAULT KMS_KEY_DESTINATION_BUCKET_DEFAULT}. - # @!attribute [rw] time_created - # @return [::Google::Cloud::StorageTransfer::V1::MetadataOptions::TimeCreated] - # Specifies how each object's `timeCreated` metadata is preserved for - # transfers. If unspecified, the default behavior is the same as - # {::Google::Cloud::StorageTransfer::V1::MetadataOptions::TimeCreated::TIME_CREATED_SKIP TIME_CREATED_SKIP}. - # This behavior is supported for transfers to Cloud Storage buckets from - # Cloud Storage, Amazon S3, S3-compatible storage, and Azure sources. - class MetadataOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Whether symlinks should be skipped or preserved during a transfer job. - module Symlink - # Symlink behavior is unspecified. - SYMLINK_UNSPECIFIED = 0 - - # Do not preserve symlinks during a transfer job. - SYMLINK_SKIP = 1 - - # Preserve symlinks during a transfer job. - SYMLINK_PRESERVE = 2 - end - - # Options for handling file mode attribute. - module Mode - # Mode behavior is unspecified. - MODE_UNSPECIFIED = 0 - - # Do not preserve mode during a transfer job. - MODE_SKIP = 1 - - # Preserve mode during a transfer job. - MODE_PRESERVE = 2 - end - - # Options for handling file GID attribute. - module GID - # GID behavior is unspecified. - GID_UNSPECIFIED = 0 - - # Do not preserve GID during a transfer job. - GID_SKIP = 1 - - # Preserve GID during a transfer job. - GID_NUMBER = 2 - end - - # Options for handling file UID attribute. - module UID - # UID behavior is unspecified. - UID_UNSPECIFIED = 0 - - # Do not preserve UID during a transfer job. - UID_SKIP = 1 - - # Preserve UID during a transfer job. - UID_NUMBER = 2 - end - - # Options for handling Cloud Storage object ACLs. - module Acl - # ACL behavior is unspecified. - ACL_UNSPECIFIED = 0 - - # Use the destination bucket's default object ACLS, if applicable. - ACL_DESTINATION_BUCKET_DEFAULT = 1 - - # Preserve the object's original ACLs. This requires the service account - # to have `storage.objects.getIamPolicy` permission for the source object. - # [Uniform bucket-level - # access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) - # must not be enabled on either the source or destination buckets. - ACL_PRESERVE = 2 - end - - # Options for handling Google Cloud Storage object storage class. - module StorageClass - # Storage class behavior is unspecified. - STORAGE_CLASS_UNSPECIFIED = 0 - - # Use the destination bucket's default storage class. - STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT = 1 - - # Preserve the object's original storage class. This is only supported for - # transfers from Google Cloud Storage buckets. REGIONAL and MULTI_REGIONAL - # storage classes will be mapped to STANDARD to ensure they can be written - # to the destination bucket. - STORAGE_CLASS_PRESERVE = 2 - - # Set the storage class to STANDARD. - STORAGE_CLASS_STANDARD = 3 - - # Set the storage class to NEARLINE. - STORAGE_CLASS_NEARLINE = 4 - - # Set the storage class to COLDLINE. - STORAGE_CLASS_COLDLINE = 5 - - # Set the storage class to ARCHIVE. - STORAGE_CLASS_ARCHIVE = 6 - end - - # Options for handling temporary holds for Google Cloud Storage objects. - module TemporaryHold - # Temporary hold behavior is unspecified. - TEMPORARY_HOLD_UNSPECIFIED = 0 - - # Do not set a temporary hold on the destination object. - TEMPORARY_HOLD_SKIP = 1 - - # Preserve the object's original temporary hold status. - TEMPORARY_HOLD_PRESERVE = 2 - end - - # Options for handling the KmsKey setting for Google Cloud Storage objects. - module KmsKey - # KmsKey behavior is unspecified. - KMS_KEY_UNSPECIFIED = 0 - - # Use the destination bucket's default encryption settings. - KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1 - - # Preserve the object's original Cloud KMS customer-managed encryption key - # (CMEK) if present. Objects that do not use a Cloud KMS encryption key - # will be encrypted using the destination bucket's encryption settings. - KMS_KEY_PRESERVE = 2 - end - - # Options for handling `timeCreated` metadata for Google Cloud Storage - # objects. - module TimeCreated - # TimeCreated behavior is unspecified. - TIME_CREATED_UNSPECIFIED = 0 - - # Do not preserve the `timeCreated` metadata from the source object. - TIME_CREATED_SKIP = 1 - - # Preserves the source object's `timeCreated` or `lastModified` metadata in - # the `customTime` field in the destination object. Note that any value - # stored in the source object's `customTime` field will not be propagated - # to the destination object. - TIME_CREATED_PRESERVE_AS_CUSTOM_TIME = 2 - end - end - - # Specifies where the manifest is located. - # @!attribute [rw] location - # @return [::String] - # Specifies the path to the manifest in Cloud Storage. The Google-managed - # service account for the transfer must have `storage.objects.get` - # permission for this object. An example path is - # `gs://bucket_name/path/manifest.csv`. - class TransferManifest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Transfers can be scheduled to recur or to run just once. - # @!attribute [rw] schedule_start_date - # @return [::Google::Type::Date] - # Required. The start date of a transfer. Date boundaries are determined - # relative to UTC time. If `schedule_start_date` and - # {::Google::Cloud::StorageTransfer::V1::Schedule#start_time_of_day start_time_of_day} - # are in the past relative to the job's creation time, the transfer starts - # the day after you schedule the transfer request. - # - # **Note:** When starting jobs at or near midnight UTC it is possible that - # a job starts later than expected. For example, if you send an outbound - # request on June 1 one millisecond prior to midnight UTC and the Storage - # Transfer Service server receives the request on June 2, then it creates - # a TransferJob with `schedule_start_date` set to June 2 and a - # `start_time_of_day` set to midnight UTC. The first scheduled - # {::Google::Cloud::StorageTransfer::V1::TransferOperation TransferOperation} takes - # place on June 3 at midnight UTC. - # @!attribute [rw] schedule_end_date - # @return [::Google::Type::Date] - # The last day a transfer runs. Date boundaries are determined relative to - # UTC time. A job runs once per 24 hours within the following guidelines: - # - # * If `schedule_end_date` and - # {::Google::Cloud::StorageTransfer::V1::Schedule#schedule_start_date schedule_start_date} - # are the same and in - # the future relative to UTC, the transfer is executed only one time. - # * If `schedule_end_date` is later than `schedule_start_date` and - # `schedule_end_date` is in the future relative to UTC, the job runs each - # day at - # {::Google::Cloud::StorageTransfer::V1::Schedule#start_time_of_day start_time_of_day} - # through `schedule_end_date`. - # @!attribute [rw] start_time_of_day - # @return [::Google::Type::TimeOfDay] - # The time in UTC that a transfer job is scheduled to run. Transfers may - # start later than this time. - # - # If `start_time_of_day` is not specified: - # - # * One-time transfers run immediately. - # * Recurring transfers run immediately, and each day at midnight UTC, - # through - # {::Google::Cloud::StorageTransfer::V1::Schedule#schedule_end_date schedule_end_date}. - # - # If `start_time_of_day` is specified: - # - # * One-time transfers run at the specified time. - # * Recurring transfers run at the specified time each day, through - # `schedule_end_date`. - # @!attribute [rw] end_time_of_day - # @return [::Google::Type::TimeOfDay] - # The time in UTC that no further transfer operations are scheduled. Combined - # with - # {::Google::Cloud::StorageTransfer::V1::Schedule#schedule_end_date schedule_end_date}, - # `end_time_of_day` specifies the end date and time for starting new transfer - # operations. This field must be greater than or equal to the timestamp - # corresponding to the combination of - # {::Google::Cloud::StorageTransfer::V1::Schedule#schedule_start_date schedule_start_date} - # and - # {::Google::Cloud::StorageTransfer::V1::Schedule#start_time_of_day start_time_of_day}, - # and is subject to the following: - # - # * If `end_time_of_day` is not set and `schedule_end_date` is set, then - # a default value of `23:59:59` is used for `end_time_of_day`. - # - # * If `end_time_of_day` is set and `schedule_end_date` is not set, then - # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} is returned. - # @!attribute [rw] repeat_interval - # @return [::Google::Protobuf::Duration] - # Interval between the start of each scheduled TransferOperation. If - # unspecified, the default value is 24 hours. This value may not be less than - # 1 hour. - class Schedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the Event-driven transfer options. Event-driven transfers listen to - # an event stream to transfer updated files. - # @!attribute [rw] name - # @return [::String] - # Required. Specifies a unique name of the resource such as AWS SQS - # ARN in the form 'arn:aws:sqs:region:account_id:queue_name', - # or Pub/Sub subscription resource name in the form - # 'projects/\\{project}/subscriptions/\\{sub}'. - # @!attribute [rw] event_stream_start_time - # @return [::Google::Protobuf::Timestamp] - # Specifies the date and time that Storage Transfer Service starts - # listening for events from this stream. If no start time is specified or - # start time is in the past, Storage Transfer Service starts listening - # immediately. - # @!attribute [rw] event_stream_expiration_time - # @return [::Google::Protobuf::Timestamp] - # Specifies the data and time at which Storage Transfer Service stops - # listening for events from this stream. After this time, any transfers in - # progress will complete, but no new transfers are initiated. - class EventStream - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This resource represents the configuration of a transfer job that runs - # periodically. - # @!attribute [rw] name - # @return [::String] - # A unique name (within the transfer project) assigned when the job is - # created. If this field is empty in a CreateTransferJobRequest, Storage - # Transfer Service assigns a unique name. Otherwise, the specified name - # is used as the unique name for this job. - # - # If the specified name is in use by a job, the creation request fails with - # an {::Google::Rpc::Code::ALREADY_EXISTS ALREADY_EXISTS} error. - # - # This name must start with `"transferJobs/"` prefix and end with a letter or - # a number, and should be no more than 128 characters. For transfers - # involving PosixFilesystem, this name must start with `transferJobs/OPI` - # specifically. For all other transfer types, this name must not start with - # `transferJobs/OPI`. - # - # Non-PosixFilesystem example: - # `"transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$"` - # - # PosixFilesystem example: - # `"transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$"` - # - # Applications must not rely on the enforcement of naming requirements - # involving OPI. - # - # Invalid job names fail with an - # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} error. - # @!attribute [rw] description - # @return [::String] - # A description provided by the user for the job. Its max length is 1024 - # bytes when Unicode-encoded. - # @!attribute [rw] project_id - # @return [::String] - # The ID of the Google Cloud project that owns the job. - # @!attribute [rw] service_account - # @return [::String] - # Optional. The user-managed service account to which to delegate service - # agent permissions. You can grant Cloud Storage bucket permissions to this - # service account instead of to the Transfer Service service agent. - # - # Format is - # `projects/-/serviceAccounts/ACCOUNT_EMAIL_OR_UNIQUEID` - # - # Either the service account email - # (`SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com`) or the unique - # ID (`123456789012345678901`) are accepted in the string. The `-` - # wildcard character is required; replacing it with a project ID is invalid. - # - # See - # https://cloud.google.com//storage-transfer/docs/delegate-service-agent-permissions - # for required permissions. - # @!attribute [rw] transfer_spec - # @return [::Google::Cloud::StorageTransfer::V1::TransferSpec] - # Transfer specification. - # @!attribute [rw] replication_spec - # @return [::Google::Cloud::StorageTransfer::V1::ReplicationSpec] - # Replication specification. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::StorageTransfer::V1::NotificationConfig] - # Notification configuration. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::StorageTransfer::V1::LoggingConfig] - # Logging configuration. - # @!attribute [rw] schedule - # @return [::Google::Cloud::StorageTransfer::V1::Schedule] - # Specifies schedule for the transfer job. - # This is an optional field. When the field is not set, the job never - # executes a transfer, unless you invoke RunTransferJob or update the job to - # have a non-empty schedule. - # @!attribute [rw] event_stream - # @return [::Google::Cloud::StorageTransfer::V1::EventStream] - # Specifies the event stream for the transfer job for event-driven transfers. - # When EventStream is specified, the Schedule fields are ignored. - # @!attribute [rw] status - # @return [::Google::Cloud::StorageTransfer::V1::TransferJob::Status] - # Status of the job. This value MUST be specified for - # `CreateTransferJobRequests`. - # - # **Note:** The effect of the new job status takes place during a subsequent - # job run. For example, if you change the job status from - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED} to - # {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}, and an - # operation spawned by the transfer is running, the status change would not - # affect the current operation. - # @!attribute [r] creation_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the transfer job was created. - # @!attribute [r] last_modification_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the transfer job was last modified. - # @!attribute [r] deletion_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the transfer job was deleted. - # @!attribute [rw] latest_operation_name - # @return [::String] - # The name of the most recently started TransferOperation of this JobConfig. - # Present if a TransferOperation has been created for this JobConfig. - class TransferJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of the transfer job. - module Status - # Zero is an illegal value. - STATUS_UNSPECIFIED = 0 - - # New transfers are performed based on the schedule. - ENABLED = 1 - - # New transfers are not scheduled. - DISABLED = 2 - - # This is a soft delete state. After a transfer job is set to this - # state, the job and all the transfer executions are subject to - # garbage collection. Transfer jobs become eligible for garbage collection - # 30 days after their status is set to `DELETED`. - DELETED = 3 - end - end - - # An entry describing an error that has occurred. - # @!attribute [rw] url - # @return [::String] - # Required. A URL that refers to the target (a data source, a data sink, - # or an object) with which the error is associated. - # @!attribute [rw] error_details - # @return [::Array<::String>] - # A list of messages that carry the error details. - class ErrorLogEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A summary of errors by error code, plus a count and sample error log - # entries. - # @!attribute [rw] error_code - # @return [::Google::Rpc::Code] - # Required. - # @!attribute [rw] error_count - # @return [::Integer] - # Required. Count of this type of error. - # @!attribute [rw] error_log_entries - # @return [::Array<::Google::Cloud::StorageTransfer::V1::ErrorLogEntry>] - # Error samples. - # - # At most 5 error log entries are recorded for a given - # error code for a single transfer operation. - class ErrorSummary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A collection of counters that report the progress of a transfer operation. - # @!attribute [rw] objects_found_from_source - # @return [::Integer] - # Objects found in the data source that are scheduled to be transferred, - # excluding any that are filtered based on object conditions or skipped due - # to sync. - # @!attribute [rw] bytes_found_from_source - # @return [::Integer] - # Bytes found in the data source that are scheduled to be transferred, - # excluding any that are filtered based on object conditions or skipped due - # to sync. - # @!attribute [rw] objects_found_only_from_sink - # @return [::Integer] - # Objects found only in the data sink that are scheduled to be deleted. - # @!attribute [rw] bytes_found_only_from_sink - # @return [::Integer] - # Bytes found only in the data sink that are scheduled to be deleted. - # @!attribute [rw] objects_from_source_skipped_by_sync - # @return [::Integer] - # Objects in the data source that are not transferred because they already - # exist in the data sink. - # @!attribute [rw] bytes_from_source_skipped_by_sync - # @return [::Integer] - # Bytes in the data source that are not transferred because they already - # exist in the data sink. - # @!attribute [rw] objects_copied_to_sink - # @return [::Integer] - # Objects that are copied to the data sink. - # @!attribute [rw] bytes_copied_to_sink - # @return [::Integer] - # Bytes that are copied to the data sink. - # @!attribute [rw] objects_deleted_from_source - # @return [::Integer] - # Objects that are deleted from the data source. - # @!attribute [rw] bytes_deleted_from_source - # @return [::Integer] - # Bytes that are deleted from the data source. - # @!attribute [rw] objects_deleted_from_sink - # @return [::Integer] - # Objects that are deleted from the data sink. - # @!attribute [rw] bytes_deleted_from_sink - # @return [::Integer] - # Bytes that are deleted from the data sink. - # @!attribute [rw] objects_from_source_failed - # @return [::Integer] - # Objects in the data source that failed to be transferred or that failed - # to be deleted after being transferred. - # @!attribute [rw] bytes_from_source_failed - # @return [::Integer] - # Bytes in the data source that failed to be transferred or that failed to - # be deleted after being transferred. - # @!attribute [rw] objects_failed_to_delete_from_sink - # @return [::Integer] - # Objects that failed to be deleted from the data sink. - # @!attribute [rw] bytes_failed_to_delete_from_sink - # @return [::Integer] - # Bytes that failed to be deleted from the data sink. - # @!attribute [rw] directories_found_from_source - # @return [::Integer] - # For transfers involving PosixFilesystem only. - # - # Number of directories found while listing. For example, if the root - # directory of the transfer is `base/` and there are two other directories, - # `a/` and `b/` under this directory, the count after listing `base/`, - # `base/a/` and `base/b/` is 3. - # @!attribute [rw] directories_failed_to_list_from_source - # @return [::Integer] - # For transfers involving PosixFilesystem only. - # - # Number of listing failures for each directory found at the source. - # Potential failures when listing a directory include permission failure or - # block failure. If listing a directory fails, no files in the directory are - # transferred. - # @!attribute [rw] directories_successfully_listed_from_source - # @return [::Integer] - # For transfers involving PosixFilesystem only. - # - # Number of successful listings for each directory found at the source. - # @!attribute [rw] intermediate_objects_cleaned_up - # @return [::Integer] - # Number of successfully cleaned up intermediate objects. - # @!attribute [rw] intermediate_objects_failed_cleaned_up - # @return [::Integer] - # Number of intermediate objects failed cleaned up. - class TransferCounters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specification to configure notifications published to Pub/Sub. - # Notifications are published to the customer-provided topic using the - # following `PubsubMessage.attributes`: - # - # * `"eventType"`: one of the - # {::Google::Cloud::StorageTransfer::V1::NotificationConfig::EventType EventType} values - # * `"payloadFormat"`: one of the - # {::Google::Cloud::StorageTransfer::V1::NotificationConfig::PayloadFormat PayloadFormat} - # values - # * `"projectId"`: the - # {::Google::Cloud::StorageTransfer::V1::TransferOperation#project_id project_id} of the - # `TransferOperation` - # * `"transferJobName"`: the - # {::Google::Cloud::StorageTransfer::V1::TransferOperation#transfer_job_name transfer_job_name} - # of the `TransferOperation` - # * `"transferOperationName"`: the - # {::Google::Cloud::StorageTransfer::V1::TransferOperation#name name} of the - # `TransferOperation` - # - # The `PubsubMessage.data` contains a - # {::Google::Cloud::StorageTransfer::V1::TransferOperation TransferOperation} resource - # formatted according to the specified `PayloadFormat`. - # @!attribute [rw] pubsub_topic - # @return [::String] - # Required. The `Topic.name` of the Pub/Sub topic to which to publish - # notifications. Must be of the format: `projects/{project}/topics/{topic}`. - # Not matching this format results in an - # {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT} error. - # @!attribute [rw] event_types - # @return [::Array<::Google::Cloud::StorageTransfer::V1::NotificationConfig::EventType>] - # Event types for which a notification is desired. If empty, send - # notifications for all event types. - # @!attribute [rw] payload_format - # @return [::Google::Cloud::StorageTransfer::V1::NotificationConfig::PayloadFormat] - # Required. The desired format of the notification message payloads. - class NotificationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum for specifying event types for which notifications are to be - # published. - # - # Additional event types may be added in the future. Clients should either - # safely ignore unrecognized event types or explicitly specify which event - # types they are prepared to accept. - module EventType - # Illegal value, to avoid allowing a default. - EVENT_TYPE_UNSPECIFIED = 0 - - # `TransferOperation` completed with status - # {::Google::Cloud::StorageTransfer::V1::TransferOperation::Status::SUCCESS SUCCESS}. - TRANSFER_OPERATION_SUCCESS = 1 - - # `TransferOperation` completed with status - # {::Google::Cloud::StorageTransfer::V1::TransferOperation::Status::FAILED FAILED}. - TRANSFER_OPERATION_FAILED = 2 - - # `TransferOperation` completed with status - # {::Google::Cloud::StorageTransfer::V1::TransferOperation::Status::ABORTED ABORTED}. - TRANSFER_OPERATION_ABORTED = 3 - end - - # Enum for specifying the format of a notification message's payload. - module PayloadFormat - # Illegal value, to avoid allowing a default. - PAYLOAD_FORMAT_UNSPECIFIED = 0 - - # No payload is included with the notification. - NONE = 1 - - # `TransferOperation` is [formatted as a JSON - # response](https://developers.google.com/protocol-buffers/docs/proto3#json), - # in application/json. - JSON = 2 - end - end - - # Specifies the logging behavior for transfer operations. - # - # Logs can be sent to Cloud Logging for all transfer types. See - # [Read transfer - # logs](https://cloud.google.com/storage-transfer/docs/read-transfer-logs) for - # details. - # @!attribute [rw] log_actions - # @return [::Array<::Google::Cloud::StorageTransfer::V1::LoggingConfig::LoggableAction>] - # Specifies the actions to be logged. If empty, no logs are generated. - # @!attribute [rw] log_action_states - # @return [::Array<::Google::Cloud::StorageTransfer::V1::LoggingConfig::LoggableActionState>] - # States in which `log_actions` are logged. If empty, no logs are generated. - # @!attribute [rw] enable_onprem_gcs_transfer_logs - # @return [::Boolean] - # For PosixFilesystem transfers, enables - # [file system transfer - # logs](https://cloud.google.com/storage-transfer/docs/on-prem-transfer-log-format) - # instead of, or in addition to, Cloud Logging. - # - # This option ignores [LoggableAction] and [LoggableActionState]. If these - # are set, Cloud Logging will also be enabled for this transfer. - class LoggingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Loggable actions. - module LoggableAction - # Default value. This value is unused. - LOGGABLE_ACTION_UNSPECIFIED = 0 - - # Listing objects in a bucket. - FIND = 1 - - # Deleting objects at the source or the destination. - DELETE = 2 - - # Copying objects to the destination. - COPY = 3 - end - - # Loggable action states. - module LoggableActionState - # Default value. This value is unused. - LOGGABLE_ACTION_STATE_UNSPECIFIED = 0 - - # `LoggableAction` completed successfully. `SUCCEEDED` actions are - # logged as [INFO][google.logging.type.LogSeverity.INFO]. - SUCCEEDED = 1 - - # `LoggableAction` terminated in an error state. `FAILED` actions are - # logged as [ERROR][google.logging.type.LogSeverity.ERROR]. - FAILED = 2 - - # The `COPY` action was skipped for this file. Only supported for - # agent-based transfers. `SKIPPED` actions are - # logged as [INFO][google.logging.type.LogSeverity.INFO]. - SKIPPED = 3 - end - end - - # A description of the execution of a transfer. - # @!attribute [rw] name - # @return [::String] - # A globally unique ID assigned by the system. - # @!attribute [rw] project_id - # @return [::String] - # The ID of the Google Cloud project that owns the operation. - # @!attribute [rw] transfer_spec - # @return [::Google::Cloud::StorageTransfer::V1::TransferSpec] - # Transfer specification. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::StorageTransfer::V1::NotificationConfig] - # Notification configuration. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::StorageTransfer::V1::LoggingConfig] - # Cloud Logging configuration. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start time of this transfer execution. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End time of this transfer execution. - # @!attribute [rw] status - # @return [::Google::Cloud::StorageTransfer::V1::TransferOperation::Status] - # Status of the transfer operation. - # @!attribute [rw] counters - # @return [::Google::Cloud::StorageTransfer::V1::TransferCounters] - # Information about the progress of the transfer operation. - # @!attribute [rw] error_breakdowns - # @return [::Array<::Google::Cloud::StorageTransfer::V1::ErrorSummary>] - # Summarizes errors encountered with sample error log entries. - # @!attribute [rw] transfer_job_name - # @return [::String] - # The name of the transfer job that triggers this transfer operation. - class TransferOperation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of a TransferOperation. - module Status - # Zero is an illegal value. - STATUS_UNSPECIFIED = 0 - - # In progress. - IN_PROGRESS = 1 - - # Paused. - PAUSED = 2 - - # Completed successfully. - SUCCESS = 3 - - # Terminated due to an unrecoverable failure. - FAILED = 4 - - # Aborted by the user. - ABORTED = 5 - - # Temporarily delayed by the system. No user action is required. - QUEUED = 6 - - # The operation is suspending and draining the ongoing work to completion. - SUSPENDING = 7 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/date.rb deleted file mode 100644 index 14ec426522d9..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/date.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a whole or partial calendar date, such as a birthday. The time of - # day and time zone are either specified elsewhere or are insignificant. The - # date is relative to the Gregorian Calendar. This can represent one of the - # following: - # - # * A full date, with non-zero year, month, and day values - # * A month and day value, with a zero year, such as an anniversary - # * A year on its own, with zero month and day values - # * A year and month value, with a zero day, such as a credit card expiration - # date - # - # Related types are {::Google::Type::TimeOfDay google.type.TimeOfDay} and - # `google.protobuf.Timestamp`. - # @!attribute [rw] year - # @return [::Integer] - # Year of the date. Must be from 1 to 9999, or 0 to specify a date without - # a year. - # @!attribute [rw] month - # @return [::Integer] - # Month of a year. Must be from 1 to 12, or 0 to specify a year without a - # month and day. - # @!attribute [rw] day - # @return [::Integer] - # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 - # to specify a year by itself or a year and month where the day isn't - # significant. - class Date - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/proto_docs/google/type/timeofday.rb deleted file mode 100644 index b0c888c8c14a..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/Gemfile deleted file mode 100644 index 4586300ebeee..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-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-storage_transfer-v1", path: "../" -else - gem "google-cloud-storage_transfer-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-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json deleted file mode 100644 index 371b234ad0e3..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-storage_transfer-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.storagetransfer.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_sync", - "title": "Snippet for the get_google_service_account call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_google_service_account.", - "file": "storage_transfer_service/get_google_service_account.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_google_service_account", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_google_service_account", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "GetGoogleServiceAccount", - "full_name": "google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccount", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_sync", - "title": "Snippet for the create_transfer_job call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_transfer_job.", - "file": "storage_transfer_service/create_transfer_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_transfer_job", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_transfer_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageTransfer::V1::TransferJob", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "CreateTransferJob", - "full_name": "google.storagetransfer.v1.StorageTransferService.CreateTransferJob", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_sync", - "title": "Snippet for the update_transfer_job call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_transfer_job.", - "file": "storage_transfer_service/update_transfer_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_transfer_job", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_transfer_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageTransfer::V1::TransferJob", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "UpdateTransferJob", - "full_name": "google.storagetransfer.v1.StorageTransferService.UpdateTransferJob", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_GetTransferJob_sync", - "title": "Snippet for the get_transfer_job call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_transfer_job.", - "file": "storage_transfer_service/get_transfer_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_transfer_job", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_transfer_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageTransfer::V1::TransferJob", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "GetTransferJob", - "full_name": "google.storagetransfer.v1.StorageTransferService.GetTransferJob", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_sync", - "title": "Snippet for the list_transfer_jobs call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_transfer_jobs.", - "file": "storage_transfer_service/list_transfer_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_transfer_jobs", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_transfer_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "ListTransferJobs", - "full_name": "google.storagetransfer.v1.StorageTransferService.ListTransferJobs", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_sync", - "title": "Snippet for the pause_transfer_operation call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#pause_transfer_operation.", - "file": "storage_transfer_service/pause_transfer_operation.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_transfer_operation", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#pause_transfer_operation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "PauseTransferOperation", - "full_name": "google.storagetransfer.v1.StorageTransferService.PauseTransferOperation", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_sync", - "title": "Snippet for the resume_transfer_operation call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#resume_transfer_operation.", - "file": "storage_transfer_service/resume_transfer_operation.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_transfer_operation", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#resume_transfer_operation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "ResumeTransferOperation", - "full_name": "google.storagetransfer.v1.StorageTransferService.ResumeTransferOperation", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_RunTransferJob_sync", - "title": "Snippet for the run_transfer_job call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#run_transfer_job.", - "file": "storage_transfer_service/run_transfer_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_transfer_job", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#run_transfer_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "RunTransferJob", - "full_name": "google.storagetransfer.v1.StorageTransferService.RunTransferJob", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_sync", - "title": "Snippet for the delete_transfer_job call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_transfer_job.", - "file": "storage_transfer_service/delete_transfer_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_transfer_job", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_transfer_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "DeleteTransferJob", - "full_name": "google.storagetransfer.v1.StorageTransferService.DeleteTransferJob", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_sync", - "title": "Snippet for the create_agent_pool call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_agent_pool.", - "file": "storage_transfer_service/create_agent_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_agent_pool", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_agent_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageTransfer::V1::AgentPool", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "CreateAgentPool", - "full_name": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_sync", - "title": "Snippet for the update_agent_pool call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_agent_pool.", - "file": "storage_transfer_service/update_agent_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_agent_pool", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_agent_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageTransfer::V1::AgentPool", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "UpdateAgentPool", - "full_name": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_GetAgentPool_sync", - "title": "Snippet for the get_agent_pool call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_agent_pool.", - "file": "storage_transfer_service/get_agent_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_agent_pool", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_agent_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageTransfer::V1::AgentPool", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "GetAgentPool", - "full_name": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_ListAgentPools_sync", - "title": "Snippet for the list_agent_pools call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_agent_pools.", - "file": "storage_transfer_service/list_agent_pools.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_agent_pools", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_agent_pools", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "ListAgentPools", - "full_name": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_sync", - "title": "Snippet for the delete_agent_pool call in the StorageTransferService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_agent_pool.", - "file": "storage_transfer_service/delete_agent_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_agent_pool", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_agent_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageTransferService::Client", - "full_name": "::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client" - }, - "method": { - "short_name": "DeleteAgentPool", - "full_name": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", - "service": { - "short_name": "StorageTransferService", - "full_name": "google.storagetransfer.v1.StorageTransferService" - } - } - }, - "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-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb deleted file mode 100644 index a718fbde6964..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the create_agent_pool call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_agent_pool. -# -def create_agent_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new - - # Call the create_agent_pool method. - result = client.create_agent_pool request - - # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb deleted file mode 100644 index be68bb1fbb6f..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the create_transfer_job call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_transfer_job. -# -def create_transfer_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new - - # Call the create_transfer_job method. - result = client.create_transfer_job request - - # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb deleted file mode 100644 index 511403d58f9d..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the delete_agent_pool call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_agent_pool. -# -def delete_agent_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new - - # Call the delete_agent_pool method. - result = client.delete_agent_pool request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb deleted file mode 100644 index 1eb7926153c4..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the delete_transfer_job call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_transfer_job. -# -def delete_transfer_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new - - # Call the delete_transfer_job method. - result = client.delete_transfer_job request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb deleted file mode 100644 index cb60143fa519..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_GetAgentPool_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the get_agent_pool call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_agent_pool. -# -def get_agent_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new - - # Call the get_agent_pool method. - result = client.get_agent_pool request - - # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_GetAgentPool_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb deleted file mode 100644 index 692ef121dfc3..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the get_google_service_account call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_google_service_account. -# -def get_google_service_account - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new - - # Call the get_google_service_account method. - result = client.get_google_service_account request - - # The returned object is of type Google::Cloud::StorageTransfer::V1::GoogleServiceAccount. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb deleted file mode 100644 index ef2d71f7e2e1..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_GetTransferJob_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the get_transfer_job call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_transfer_job. -# -def get_transfer_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new - - # Call the get_transfer_job method. - result = client.get_transfer_job request - - # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_GetTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb deleted file mode 100644 index 0714d9ecbc44..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_ListAgentPools_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the list_agent_pools call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_agent_pools. -# -def list_agent_pools - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new - - # Call the list_agent_pools method. - result = client.list_agent_pools request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::StorageTransfer::V1::AgentPool. - p item - end -end -# [END storagetransfer_v1_generated_StorageTransferService_ListAgentPools_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb deleted file mode 100644 index d6ed5c46c7dd..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the list_transfer_jobs call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_transfer_jobs. -# -def list_transfer_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new - - # Call the list_transfer_jobs method. - result = client.list_transfer_jobs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::StorageTransfer::V1::TransferJob. - p item - end -end -# [END storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb deleted file mode 100644 index ef2b482e14c3..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the pause_transfer_operation call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#pause_transfer_operation. -# -def pause_transfer_operation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new - - # Call the pause_transfer_operation method. - result = client.pause_transfer_operation request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb deleted file mode 100644 index 53c764c67766..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the resume_transfer_operation call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#resume_transfer_operation. -# -def resume_transfer_operation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new - - # Call the resume_transfer_operation method. - result = client.resume_transfer_operation request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb deleted file mode 100644 index 7e8443bfd8b6..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_RunTransferJob_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the run_transfer_job call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#run_transfer_job. -# -def run_transfer_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new - - # Call the run_transfer_job method. - result = client.run_transfer_job request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END storagetransfer_v1_generated_StorageTransferService_RunTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb deleted file mode 100644 index 3b33a6568070..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the update_agent_pool call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_agent_pool. -# -def update_agent_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new - - # Call the update_agent_pool method. - result = client.update_agent_pool request - - # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb deleted file mode 100644 index 1cf11d53d478..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_sync] -require "google/cloud/storage_transfer/v1" - -## -# Snippet for the update_transfer_job call in the StorageTransferService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_transfer_job. -# -def update_transfer_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new - - # Call the update_transfer_job method. - result = client.update_transfer_job request - - # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. - p result -end -# [END storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_sync] diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb deleted file mode 100644 index 42e52c1a7b8b..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_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/storagetransfer/v1/transfer_pb" -require "google/storagetransfer/v1/transfer_services_pb" -require "google/cloud/storage_transfer/v1/storage_transfer_service" - -class ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb deleted file mode 100644 index fbad881f657f..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_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/storage_transfer/v1/storage_transfer_service" - -class ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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_agent_pools_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_pools_path project_id: "value0", agent_pool_id: "value1" - assert_equal "projects/value0/agentPools/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb deleted file mode 100644 index 46ab1ebfdbd7..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb +++ /dev/null @@ -1,869 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/storagetransfer/v1/transfer_pb" -require "google/cloud/storage_transfer/v1/storage_transfer_service/rest" - - -class ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_google_service_account - # Create test objects. - client_result = ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - - get_google_service_account_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_get_google_service_account_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_google_service_account_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_google_service_account({ project_id: project_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_google_service_account project_id: project_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_google_service_account ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new(project_id: project_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_google_service_account({ project_id: project_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_google_service_account(::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new(project_id: project_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_google_service_account_client_stub.call_count - end - end - end - - def test_create_transfer_job - # Create test objects. - client_result = ::Google::Cloud::StorageTransfer::V1::TransferJob.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - transfer_job = {} - - create_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_create_transfer_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_transfer_job({ transfer_job: transfer_job }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_transfer_job transfer_job: transfer_job do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_transfer_job ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new(transfer_job: transfer_job) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_transfer_job({ transfer_job: transfer_job }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_transfer_job(::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new(transfer_job: transfer_job), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_transfer_job_client_stub.call_count - end - end - end - - def test_update_transfer_job - # Create test objects. - client_result = ::Google::Cloud::StorageTransfer::V1::TransferJob.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job_name = "hello world" - project_id = "hello world" - transfer_job = {} - update_transfer_job_field_mask = {} - - update_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_update_transfer_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_transfer_job({ job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_transfer_job job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_transfer_job ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new(job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_transfer_job({ job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_transfer_job(::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new(job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_transfer_job_client_stub.call_count - end - end - end - - def test_get_transfer_job - # Create test objects. - client_result = ::Google::Cloud::StorageTransfer::V1::TransferJob.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job_name = "hello world" - project_id = "hello world" - - get_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_get_transfer_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_transfer_job({ job_name: job_name, project_id: project_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_transfer_job job_name: job_name, project_id: project_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_transfer_job ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new(job_name: job_name, project_id: project_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_transfer_job({ job_name: job_name, project_id: project_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_transfer_job(::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new(job_name: job_name, project_id: project_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_transfer_job_client_stub.call_count - end - end - end - - def test_list_transfer_jobs - # Create test objects. - client_result = ::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_transfer_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_list_transfer_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_transfer_jobs_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_transfer_jobs({ 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.list_transfer_jobs 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.list_transfer_jobs ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new(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.list_transfer_jobs({ 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.list_transfer_jobs(::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new(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, list_transfer_jobs_client_stub.call_count - end - end - end - - def test_pause_transfer_operation - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_transfer_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_pause_transfer_operation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_transfer_operation_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_transfer_operation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_transfer_operation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_transfer_operation ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_transfer_operation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.pause_transfer_operation(::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, pause_transfer_operation_client_stub.call_count - end - end - end - - def test_resume_transfer_operation - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_transfer_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_resume_transfer_operation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_transfer_operation_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_transfer_operation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_transfer_operation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_transfer_operation ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_transfer_operation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resume_transfer_operation(::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resume_transfer_operation_client_stub.call_count - end - end - end - - def test_run_transfer_job - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job_name = "hello world" - project_id = "hello world" - - run_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_run_transfer_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_transfer_job({ job_name: job_name, project_id: project_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_transfer_job job_name: job_name, project_id: project_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_transfer_job ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new(job_name: job_name, project_id: project_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_transfer_job({ job_name: job_name, project_id: project_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_transfer_job(::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new(job_name: job_name, project_id: project_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_transfer_job_client_stub.call_count - end - end - end - - def test_delete_transfer_job - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job_name = "hello world" - project_id = "hello world" - - delete_transfer_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_delete_transfer_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_transfer_job({ job_name: job_name, project_id: project_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_transfer_job job_name: job_name, project_id: project_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_transfer_job ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new(job_name: job_name, project_id: project_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_transfer_job({ job_name: job_name, project_id: project_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_transfer_job(::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new(job_name: job_name, project_id: project_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_transfer_job_client_stub.call_count - end - end - end - - def test_create_agent_pool - # Create test objects. - client_result = ::Google::Cloud::StorageTransfer::V1::AgentPool.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - agent_pool = {} - agent_pool_id = "hello world" - - create_agent_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_create_agent_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_agent_pool_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_agent_pool({ project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_agent_pool project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_agent_pool ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new(project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_agent_pool({ project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_agent_pool(::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new(project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_agent_pool_client_stub.call_count - end - end - end - - def test_update_agent_pool - # Create test objects. - client_result = ::Google::Cloud::StorageTransfer::V1::AgentPool.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - agent_pool = {} - update_mask = {} - - update_agent_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_update_agent_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_agent_pool_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_agent_pool({ agent_pool: agent_pool, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_agent_pool agent_pool: agent_pool, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_agent_pool ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new(agent_pool: agent_pool, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_agent_pool({ agent_pool: agent_pool, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_agent_pool(::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new(agent_pool: agent_pool, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_agent_pool_client_stub.call_count - end - end - end - - def test_get_agent_pool - # Create test objects. - client_result = ::Google::Cloud::StorageTransfer::V1::AgentPool.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_agent_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_get_agent_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_agent_pool_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_agent_pool({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_agent_pool name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_agent_pool ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_agent_pool({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_agent_pool(::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_agent_pool_client_stub.call_count - end - end - end - - def test_list_agent_pools - # Create test objects. - client_result = ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_agent_pools_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_list_agent_pools_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_agent_pools_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_agent_pools({ project_id: project_id, 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.list_agent_pools project_id: project_id, 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.list_agent_pools ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new(project_id: project_id, 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.list_agent_pools({ project_id: project_id, 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.list_agent_pools(::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new(project_id: project_id, 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, list_agent_pools_client_stub.call_count - end - end - end - - def test_delete_agent_pool - # 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_agent_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::ServiceStub.stub :transcode_delete_agent_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_agent_pool_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_agent_pool({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_agent_pool name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_agent_pool ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_agent_pool({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_agent_pool(::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_agent_pool_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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb deleted file mode 100644 index 90e08871647b..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb +++ /dev/null @@ -1,973 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/storagetransfer/v1/transfer_pb" -require "google/cloud/storage_transfer/v1/storage_transfer_service" - -class ::Google::Cloud::StorageTransfer::V1::StorageTransferService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_google_service_account - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount.new - grpc_operation = GRPC::ActiveCall::Operation.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_id = "hello world" - - get_google_service_account_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_google_service_account, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, request - assert_equal "hello world", request["project_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_google_service_account_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_google_service_account({ project_id: project_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_google_service_account project_id: project_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_google_service_account ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new(project_id: project_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_google_service_account({ project_id: project_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_google_service_account(::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new(project_id: project_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_google_service_account_client_stub.call_rpc_count - end - end - - def test_create_transfer_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageTransfer::V1::TransferJob.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - transfer_job = {} - - create_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_transfer_job, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageTransfer::V1::TransferJob), request["transfer_job"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_transfer_job({ transfer_job: transfer_job }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_transfer_job transfer_job: transfer_job do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_transfer_job ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new(transfer_job: transfer_job) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_transfer_job({ transfer_job: transfer_job }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_transfer_job(::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new(transfer_job: transfer_job), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_transfer_job_client_stub.call_rpc_count - end - end - - def test_update_transfer_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageTransfer::V1::TransferJob.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - job_name = "hello world" - project_id = "hello world" - transfer_job = {} - update_transfer_job_field_mask = {} - - update_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_transfer_job, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, request - assert_equal "hello world", request["job_name"] - assert_equal "hello world", request["project_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageTransfer::V1::TransferJob), request["transfer_job"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_transfer_job_field_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_transfer_job({ job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_transfer_job job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_transfer_job ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new(job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_transfer_job({ job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_transfer_job(::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new(job_name: job_name, project_id: project_id, transfer_job: transfer_job, update_transfer_job_field_mask: update_transfer_job_field_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_transfer_job_client_stub.call_rpc_count - end - end - - def test_get_transfer_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageTransfer::V1::TransferJob.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - job_name = "hello world" - project_id = "hello world" - - get_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_transfer_job, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, request - assert_equal "hello world", request["job_name"] - assert_equal "hello world", request["project_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_transfer_job({ job_name: job_name, project_id: project_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_transfer_job job_name: job_name, project_id: project_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_transfer_job ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new(job_name: job_name, project_id: project_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_transfer_job({ job_name: job_name, project_id: project_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_transfer_job(::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new(job_name: job_name, project_id: project_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_transfer_job_client_stub.call_rpc_count - end - end - - def test_list_transfer_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageTransfer::V1::ListTransferJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_transfer_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_transfer_jobs, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, request - 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, list_transfer_jobs_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_transfer_jobs({ 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.list_transfer_jobs 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.list_transfer_jobs ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new(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.list_transfer_jobs({ 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.list_transfer_jobs(::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new(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, list_transfer_jobs_client_stub.call_rpc_count - end - end - - def test_pause_transfer_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" - - pause_transfer_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_transfer_operation, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_transfer_operation_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_transfer_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_transfer_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_transfer_operation ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_transfer_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.pause_transfer_operation(::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, pause_transfer_operation_client_stub.call_rpc_count - end - end - - def test_resume_transfer_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" - - resume_transfer_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_transfer_operation, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_transfer_operation_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_transfer_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_transfer_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_transfer_operation ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_transfer_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.resume_transfer_operation(::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, resume_transfer_operation_client_stub.call_rpc_count - end - end - - def test_run_transfer_job - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - job_name = "hello world" - project_id = "hello world" - - run_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_transfer_job, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, request - assert_equal "hello world", request["job_name"] - assert_equal "hello world", request["project_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_transfer_job({ job_name: job_name, project_id: project_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.run_transfer_job job_name: job_name, project_id: project_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.run_transfer_job ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new(job_name: job_name, project_id: project_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.run_transfer_job({ job_name: job_name, project_id: project_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.run_transfer_job(::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new(job_name: job_name, project_id: project_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, run_transfer_job_client_stub.call_rpc_count - end - end - - def test_delete_transfer_job - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - job_name = "hello world" - project_id = "hello world" - - delete_transfer_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_transfer_job, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest, request - assert_equal "hello world", request["job_name"] - assert_equal "hello world", request["project_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_transfer_job_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_transfer_job({ job_name: job_name, project_id: project_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_transfer_job job_name: job_name, project_id: project_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_transfer_job ::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new(job_name: job_name, project_id: project_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_transfer_job({ job_name: job_name, project_id: project_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_transfer_job(::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new(job_name: job_name, project_id: project_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_transfer_job_client_stub.call_rpc_count - end - end - - def test_create_agent_pool - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageTransfer::V1::AgentPool.new - grpc_operation = GRPC::ActiveCall::Operation.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_id = "hello world" - agent_pool = {} - agent_pool_id = "hello world" - - create_agent_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_agent_pool, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest, request - assert_equal "hello world", request["project_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageTransfer::V1::AgentPool), request["agent_pool"] - assert_equal "hello world", request["agent_pool_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_agent_pool_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_agent_pool({ project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_agent_pool project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_agent_pool ::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new(project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_agent_pool({ project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_agent_pool(::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new(project_id: project_id, agent_pool: agent_pool, agent_pool_id: agent_pool_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_agent_pool_client_stub.call_rpc_count - end - end - - def test_update_agent_pool - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageTransfer::V1::AgentPool.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - agent_pool = {} - update_mask = {} - - update_agent_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_agent_pool, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::StorageTransfer::V1::AgentPool), request["agent_pool"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_agent_pool_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_agent_pool({ agent_pool: agent_pool, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_agent_pool agent_pool: agent_pool, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_agent_pool ::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new(agent_pool: agent_pool, 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_agent_pool({ agent_pool: agent_pool, 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_agent_pool(::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new(agent_pool: agent_pool, 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_agent_pool_client_stub.call_rpc_count - end - end - - def test_get_agent_pool - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageTransfer::V1::AgentPool.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_agent_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_agent_pool, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_agent_pool_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_agent_pool({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_agent_pool name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_agent_pool ::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_agent_pool({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_agent_pool(::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_agent_pool_client_stub.call_rpc_count - end - end - - def test_list_agent_pools - # Create GRPC objects. - grpc_response = ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_id = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_agent_pools_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_agent_pools, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest, request - assert_equal "hello world", request["project_id"] - 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, list_agent_pools_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_agent_pools({ project_id: project_id, 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.list_agent_pools project_id: project_id, 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.list_agent_pools ::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new(project_id: project_id, 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.list_agent_pools({ project_id: project_id, 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.list_agent_pools(::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new(project_id: project_id, 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, list_agent_pools_client_stub.call_rpc_count - end - end - - def test_delete_agent_pool - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_agent_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_agent_pool, name - assert_kind_of ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_agent_pool_client_stub do - # Create client - client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_agent_pool({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_agent_pool name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_agent_pool ::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_agent_pool({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_agent_pool(::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new(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_agent_pool_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::StorageTransfer::V1::StorageTransferService::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::StorageTransfer::V1::StorageTransferService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-storage_transfer-v1/test/helper.rb b/owl-bot-staging/google-cloud-storage_transfer-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-storage_transfer-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-support-v2/.gitignore b/owl-bot-staging/google-cloud-support-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-support-v2/.repo-metadata.json deleted file mode 100644 index 45909623163b..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "cloudsupport.googleapis.com", - "api_shortname": "cloudsupport", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest", - "distribution_name": "google-cloud-support-v2", - "is_cloud": true, - "language": "ruby", - "name": "cloudsupport", - "name_pretty": "Google Cloud Support V2 API", - "product_documentation": "https://cloud.google.com/support/docs/reference/support-api", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Manages Google Cloud technical support cases for Customer Care support offerings. Note that google-cloud-support-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-support instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/support/docs/reference/support-api", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-support-v2/.rubocop.yml b/owl-bot-staging/google-cloud-support-v2/.rubocop.yml deleted file mode 100644 index 5a0822d3f7fc..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-support-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-support-v2.rb" diff --git a/owl-bot-staging/google-cloud-support-v2/.toys.rb b/owl-bot-staging/google-cloud-support-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2/.yardopts b/owl-bot-staging/google-cloud-support-v2/.yardopts deleted file mode 100644 index ecd96483ad7d..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Google Cloud Support 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-support-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-support-v2/AUTHENTICATION.md deleted file mode 100644 index f0b98d5c4ee4..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-support-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-support-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/support/v2" - -client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/support/v2" - -::Google::Cloud::Support::V2::CaseAttachmentService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Support::V2::CaseAttachmentService::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-support-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/support/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Support::V2::CaseAttachmentService::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-support-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-support-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-support-v2/Gemfile b/owl-bot-staging/google-cloud-support-v2/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-support-v2/LICENSE.md b/owl-bot-staging/google-cloud-support-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2/README.md b/owl-bot-staging/google-cloud-support-v2/README.md deleted file mode 100644 index a95e292a84b0..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Google Cloud Support V2 API - -Manages Google Cloud technical support cases for Customer Care support offerings. - -Manages Google Cloud technical support cases for Customer Care support offerings. - -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 Support V2 API. Most users should consider using -the main client gem, -[google-cloud-support](https://rubygems.org/gems/google-cloud-support). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-support-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/cloudsupport.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/support/v2" - -client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new -request = ::Google::Cloud::Support::V2::ListAttachmentsRequest.new # (request fields as keyword arguments...) -response = client.list_attachments request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/support/docs/reference/support-api) -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/support/v2" -require "logger" - -client = ::Google::Cloud::Support::V2::CaseAttachmentService::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-support`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-support-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-support`. -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-support-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-support-v2/Rakefile b/owl-bot-staging/google-cloud-support-v2/Rakefile deleted file mode 100644 index dc5bafbc41cf..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2 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/support/v2/case_attachment_service/credentials" - ::Google::Cloud::Support::V2::CaseAttachmentService::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-support-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-support-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-support-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-support-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-support-v2" - header "google-cloud-support-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-support-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-support-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-support-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-support-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-support-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-support-v2/gapic_metadata.json deleted file mode 100644 index f357ef041882..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/gapic_metadata.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.support.v2", - "libraryPackage": "::Google::Cloud::Support::V2", - "services": { - "CaseAttachmentService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Support::V2::CaseAttachmentService::Client", - "rpcs": { - "ListAttachments": { - "methods": [ - "list_attachments" - ] - } - } - } - } - }, - "CaseService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Support::V2::CaseService::Client", - "rpcs": { - "GetCase": { - "methods": [ - "get_case" - ] - }, - "ListCases": { - "methods": [ - "list_cases" - ] - }, - "SearchCases": { - "methods": [ - "search_cases" - ] - }, - "CreateCase": { - "methods": [ - "create_case" - ] - }, - "UpdateCase": { - "methods": [ - "update_case" - ] - }, - "EscalateCase": { - "methods": [ - "escalate_case" - ] - }, - "CloseCase": { - "methods": [ - "close_case" - ] - }, - "SearchCaseClassifications": { - "methods": [ - "search_case_classifications" - ] - } - } - } - } - }, - "CommentService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Support::V2::CommentService::Client", - "rpcs": { - "ListComments": { - "methods": [ - "list_comments" - ] - }, - "CreateComment": { - "methods": [ - "create_comment" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support-v2/google-cloud-support-v2.gemspec b/owl-bot-staging/google-cloud-support-v2/google-cloud-support-v2.gemspec deleted file mode 100644 index 1269fcd23887..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/google-cloud-support-v2.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/support/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-support-v2" - gem.version = Google::Cloud::Support::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Manages Google Cloud technical support cases for Customer Care support offerings. Note that google-cloud-support-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-support instead. See the readme for more details." - gem.summary = "Manages Google Cloud technical support cases for Customer Care support offerings." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google-cloud-support-v2.rb b/owl-bot-staging/google-cloud-support-v2/lib/google-cloud-support-v2.rb deleted file mode 100644 index 622f07997b34..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google-cloud-support-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/support/v2" diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2.rb deleted file mode 100644 index ee50b139824f..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/support/v2/case_attachment_service" -require "google/cloud/support/v2/case_service" -require "google/cloud/support/v2/comment_service" -require "google/cloud/support/v2/version" - -module Google - module Cloud - module Support - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/support/v2" - # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new - # - module V2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/support/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/actor_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/actor_pb.rb deleted file mode 100644 index 8f6f1bfef27f..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/actor_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2/actor.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n#google/cloud/support/v2/actor.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\"d\n\x05\x41\x63tor\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x11\n\x05\x65mail\x18\x02 \x01(\tB\x02\x18\x01\x12\x1b\n\x0egoogle_support\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12\x15\n\x08username\x18\x05 \x01(\tB\x03\xe0\x41\x03\x42\xb3\x01\n\x1b\x63om.google.cloud.support.v2B\nActorProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2 - Actor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Actor").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_pb.rb deleted file mode 100644 index c0b946752509..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2/attachment.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/support/v2/actor_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n(google/cloud/support/v2/attachment.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/support/v2/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x84\x03\n\nAttachment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\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\x07\x63reator\x18\x03 \x01(\x0b\x32\x1e.google.cloud.support.v2.ActorB\x03\xe0\x41\x03\x12\x10\n\x08\x66ilename\x18\x04 \x01(\t\x12\x16\n\tmime_type\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03:\xb0\x01\xea\x41\xac\x01\n&cloudsupport.googleapis.com/Attachment\x12\x45organizations/{organization}/cases/{case}/attachments/{attachment_id}\x12;projects/{project}/cases/{case}/attachments/{attachment_id}B\xb8\x01\n\x1b\x63om.google.cloud.support.v2B\x0f\x41ttachmentProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2 - Attachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Attachment").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_pb.rb deleted file mode 100644 index 03ee8f0dc82d..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2/attachment_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/support/v2/attachment_pb' - - -descriptor_data = "\n0google/cloud/support/v2/attachment_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/support/v2/attachment.proto\"y\n\x16ListAttachmentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"l\n\x17ListAttachmentsResponse\x12\x38\n\x0b\x61ttachments\x18\x01 \x03(\x0b\x32#.google.cloud.support.v2.Attachment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xd1\x02\n\x15\x43\x61seAttachmentService\x12\xe6\x01\n\x0fListAttachments\x12/.google.cloud.support.v2.ListAttachmentsRequest\x1a\x30.google.cloud.support.v2.ListAttachmentsResponse\"p\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x61\x12+/v2/{parent=projects/*/cases/*}/attachmentsZ2\x12\x30/v2/{parent=organizations/*/cases/*}/attachments\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbf\x01\n\x1b\x63om.google.cloud.support.v2B\x16\x41ttachmentServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2 - ListAttachmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListAttachmentsRequest").msgclass - ListAttachmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListAttachmentsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_services_pb.rb deleted file mode 100644 index 4b76cbce1e0c..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/attachment_service_services_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/support/v2/attachment_service.proto for package 'Google.Cloud.Support.V2' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/support/v2/attachment_service_pb' - -module Google - module Cloud - module Support - module V2 - module CaseAttachmentService - # A service to manage file attachments for Google Cloud support cases. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.support.v2.CaseAttachmentService' - - # List all the attachments associated with a support case. - rpc :ListAttachments, ::Google::Cloud::Support::V2::ListAttachmentsRequest, ::Google::Cloud::Support::V2::ListAttachmentsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service.rb deleted file mode 100644 index b15fabbaa7bb..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_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/support/v2/version" - -require "google/cloud/support/v2/case_attachment_service/credentials" -require "google/cloud/support/v2/case_attachment_service/paths" -require "google/cloud/support/v2/case_attachment_service/client" - -module Google - module Cloud - module Support - module V2 - ## - # A service to manage file attachments for Google Cloud support cases. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/support/v2/case_attachment_service" - # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new - # - module CaseAttachmentService - end - end - end - end -end - -helper_path = ::File.join __dir__, "case_attachment_service", "helpers.rb" -require "google/cloud/support/v2/case_attachment_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/client.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/client.rb deleted file mode 100644 index 7e377c01b267..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/client.rb +++ /dev/null @@ -1,497 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/support/v2/attachment_service_pb" - -module Google - module Cloud - module Support - module V2 - module CaseAttachmentService - ## - # Client for the CaseAttachmentService service. - # - # A service to manage file attachments for Google Cloud support cases. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :case_attachment_service_stub - - ## - # Configure the CaseAttachmentService Client class. - # - # See {::Google::Cloud::Support::V2::CaseAttachmentService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CaseAttachmentService clients - # ::Google::Cloud::Support::V2::CaseAttachmentService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Support", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_attachments.timeout = 60.0 - default_config.rpcs.list_attachments.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 CaseAttachmentService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Support::V2::CaseAttachmentService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @case_attachment_service_stub.universe_domain - end - - ## - # Create a new CaseAttachmentService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CaseAttachmentService 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/support/v2/attachment_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 - - @case_attachment_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Support::V2::CaseAttachmentService::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 - ) - - @case_attachment_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 - @case_attachment_service_stub.logger - end - - # Service calls - - ## - # List all the attachments associated with a support case. - # - # @overload list_attachments(request, options = nil) - # Pass arguments to `list_attachments` via a request object, either of type - # {::Google::Cloud::Support::V2::ListAttachmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::ListAttachmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_attachments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_attachments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 case for which attachments should be listed. - # @param page_size [::Integer] - # The maximum number of attachments fetched with each request. - # - # If not provided, the default is 10. The maximum page size that will be - # returned is 100. - # - # The size of each page can be smaller than the requested page size and can - # include zero. For example, you could request 100 attachments on one page, - # receive 0, and then on the next page, receive 90. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Attachment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Attachment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CaseAttachmentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::ListAttachmentsRequest.new - # - # # Call the list_attachments method. - # result = client.list_attachments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2::Attachment. - # p item - # end - # - def list_attachments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListAttachmentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_attachments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_attachments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_attachments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_attachment_service_stub.call_rpc :list_attachments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @case_attachment_service_stub, :list_attachments, request, response, 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 CaseAttachmentService API. - # - # This class represents the configuration for CaseAttachmentService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2::CaseAttachmentService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_attachments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2::CaseAttachmentService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_attachments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_attachments.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Support::V2::CaseAttachmentService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CaseAttachmentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_attachments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_attachments - - # @private - def initialize parent_rpcs = nil - list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments - @list_attachments = ::Gapic::Config::Method.new list_attachments_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/credentials.rb deleted file mode 100644 index 580b6657fd60..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/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 Support - module V2 - module CaseAttachmentService - # Credentials for the CaseAttachmentService 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-support-v2/lib/google/cloud/support/v2/case_attachment_service/paths.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/paths.rb deleted file mode 100644 index 145e0085399c..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_attachment_service/paths.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2 - module CaseAttachmentService - # Path helper methods for the CaseAttachmentService API. - module Paths - ## - # Create a fully-qualified Case resource string. - # - # @overload case_path(organization:, case:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}` - # - # @param organization [String] - # @param case [String] - # - # @overload case_path(project:, case:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}` - # - # @param project [String] - # @param case [String] - # - # @return [::String] - def case_path **args - resources = { - "case:organization" => (proc do |organization:, case:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}" - end), - "case:project" => (proc do |project:, case:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}" - 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-support-v2/lib/google/cloud/support/v2/case_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_pb.rb deleted file mode 100644 index 9e9e18a721b3..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2/case.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/support/v2/actor_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\"google/cloud/support/v2/case.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/support/v2/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6\x06\n\x04\x43\x61se\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x43\n\x0e\x63lassification\x18\x04 \x01(\x0b\x32+.google.cloud.support.v2.CaseClassification\x12\x11\n\ttime_zone\x18\x08 \x01(\t\x12\"\n\x1asubscriber_email_addresses\x18\t \x03(\t\x12\x37\n\x05state\x18\x0c \x01(\x0e\x32#.google.cloud.support.v2.Case.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12/\n\x07\x63reator\x18\x0f \x01(\x0b\x32\x1e.google.cloud.support.v2.Actor\x12\x15\n\rcontact_email\x18# \x01(\t\x12\x11\n\tescalated\x18\x11 \x01(\x08\x12\x11\n\ttest_case\x18\x13 \x01(\x08\x12\x15\n\rlanguage_code\x18\x17 \x01(\t\x12\x38\n\x08priority\x18 \x01(\x0e\x32&.google.cloud.support.v2.Case.Priority\"\x7f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x1e\n\x1aIN_PROGRESS_GOOGLE_SUPPORT\x10\x02\x12\x13\n\x0f\x41\x43TION_REQUIRED\x10\x03\x12\x15\n\x11SOLUTION_PROVIDED\x10\x04\x12\n\n\x06\x43LOSED\x10\x05\"L\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x06\n\x02P0\x10\x01\x12\x06\n\x02P1\x10\x02\x12\x06\n\x02P2\x10\x03\x12\x06\n\x02P3\x10\x04\x12\x06\n\x02P4\x10\x05:q\xea\x41n\n cloudsupport.googleapis.com/Case\x12)organizations/{organization}/cases/{case}\x12\x1fprojects/{project}/cases/{case}\"6\n\x12\x43\x61seClassification\x12\n\n\x02id\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\tB\xb2\x01\n\x1b\x63om.google.cloud.support.v2B\tCaseProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2 - Case = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Case").msgclass - Case::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Case.State").enummodule - Case::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Case.Priority").enummodule - CaseClassification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CaseClassification").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service.rb deleted file mode 100644 index f77ef0cfc926..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_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/support/v2/version" - -require "google/cloud/support/v2/case_service/credentials" -require "google/cloud/support/v2/case_service/paths" -require "google/cloud/support/v2/case_service/client" - -module Google - module Cloud - module Support - module V2 - ## - # A service to manage Google Cloud support cases. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/support/v2/case_service" - # client = ::Google::Cloud::Support::V2::CaseService::Client.new - # - module CaseService - end - end - end - end -end - -helper_path = ::File.join __dir__, "case_service", "helpers.rb" -require "google/cloud/support/v2/case_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/client.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/client.rb deleted file mode 100644 index 2d53752a256a..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/client.rb +++ /dev/null @@ -1,1264 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/support/v2/case_service_pb" - -module Google - module Cloud - module Support - module V2 - module CaseService - ## - # Client for the CaseService service. - # - # A service to manage Google Cloud support cases. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :case_service_stub - - ## - # Configure the CaseService Client class. - # - # See {::Google::Cloud::Support::V2::CaseService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CaseService clients - # ::Google::Cloud::Support::V2::CaseService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Support", "V2"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.get_case.timeout = 60.0 - default_config.rpcs.get_case.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_cases.timeout = 60.0 - default_config.rpcs.list_cases.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_cases.timeout = 60.0 - default_config.rpcs.search_cases.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_case.timeout = 60.0 - - default_config.rpcs.update_case.timeout = 60.0 - - default_config.rpcs.escalate_case.timeout = 60.0 - - default_config.rpcs.close_case.timeout = 60.0 - - default_config.rpcs.search_case_classifications.timeout = 60.0 - default_config.rpcs.search_case_classifications.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 CaseService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Support::V2::CaseService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @case_service_stub.universe_domain - end - - ## - # Create a new CaseService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Support::V2::CaseService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CaseService 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/support/v2/case_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 - - @case_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Support::V2::CaseService::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 - ) - - @case_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 - @case_service_stub.logger - end - - # Service calls - - ## - # Retrieve a case. - # - # @overload get_case(request, options = nil) - # Pass arguments to `get_case` via a request object, either of type - # {::Google::Cloud::Support::V2::GetCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::GetCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_case(name: nil) - # Pass arguments to `get_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The full name of a case to be retrieved. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::GetCaseRequest.new - # - # # Call the get_case method. - # result = client.get_case request - # - # # The returned object is of type Google::Cloud::Support::V2::Case. - # p result - # - def get_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::GetCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :get_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve all cases under a parent, but not its children. - # - # For example, listing cases under an organization only returns the cases - # that are directly parented by that organization. To retrieve cases - # under an organization and its projects, use `cases.search`. - # - # @overload list_cases(request, options = nil) - # Pass arguments to `list_cases` via a request object, either of type - # {::Google::Cloud::Support::V2::ListCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::ListCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_cases(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 a parent to list cases under. - # @param filter [::String] - # An expression used to filter cases. - # - # If it's an empty string, then no filtering happens. Otherwise, the endpoint - # returns the cases that match the filter. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # EXAMPLES: - # - # - `state=CLOSED` - # - `state=OPEN AND creator.email="tester@example.com"` - # - `state=OPEN AND (priority=P0 OR priority=P1)` - # @param page_size [::Integer] - # The maximum number of cases fetched with each request. Defaults to 10. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::ListCasesRequest.new - # - # # Call the list_cases method. - # result = client.list_cases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2::Case. - # p item - # end - # - def list_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListCasesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_cases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :list_cases, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @case_service_stub, :list_cases, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Search for cases using a query. - # - # @overload search_cases(request, options = nil) - # Pass arguments to `search_cases` via a request object, either of type - # {::Google::Cloud::Support::V2::SearchCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::SearchCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cases(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # The name of the parent resource to search for cases under. - # @param query [::String] - # An expression used to filter cases. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `organization`: An organization name in the form - # `organizations/`. - # - `project`: A project name in the form `projects/`. - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # You must specify either `organization` or `project`. - # - # To search across `displayName`, `description`, and comments, use a global - # restriction with no keyword or operator. For example, `"my search"`. - # - # To search only cases updated after a certain date, use `update_time` - # restricted with that particular date, time, and timezone in ISO datetime - # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - # `update_time` only supports the greater than operator (`>`). - # - # Examples: - # - # - `organization="organizations/123456789"` - # - `project="projects/my-project-id"` - # - `project="projects/123456789"` - # - `organization="organizations/123456789" AND state=CLOSED` - # - `project="projects/my-project-id" AND creator.email="tester@example.com"` - # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - # @param page_size [::Integer] - # The maximum number of cases fetched with each request. The default page - # size is 10. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::SearchCasesRequest.new - # - # # Call the search_cases method. - # result = client.search_cases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2::Case. - # p item - # end - # - def search_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::SearchCasesRequest - - # Converts hash and nil to 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_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_cases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :search_cases, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_cases, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new case and associate it with a parent. - # - # It must have the following fields set: `display_name`, `description`, - # `classification`, and `priority`. If you're just testing the API and don't - # want to route your case to an agent, set `testCase=true`. - # - # @overload create_case(request, options = nil) - # Pass arguments to `create_case` via a request object, either of type - # {::Google::Cloud::Support::V2::CreateCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::CreateCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_case(parent: nil, case: nil) - # Pass arguments to `create_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent under which the case should be created. - # @param case [::Google::Cloud::Support::V2::Case, ::Hash] - # Required. The case to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::CreateCaseRequest.new - # - # # Call the create_case method. - # result = client.create_case request - # - # # The returned object is of type Google::Cloud::Support::V2::Case. - # p result - # - def create_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CreateCaseRequest - - # Converts hash and nil to 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_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :create_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a case. Only some fields can be updated. - # - # @overload update_case(request, options = nil) - # Pass arguments to `update_case` via a request object, either of type - # {::Google::Cloud::Support::V2::UpdateCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::UpdateCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_case(case: nil, update_mask: nil) - # Pass arguments to `update_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param case [::Google::Cloud::Support::V2::Case, ::Hash] - # Required. The case to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A list of attributes of the case that should be updated. Supported values - # are `priority`, `display_name`, and `subscriber_email_addresses`. If no - # fields are specified, all supported fields are updated. - # - # Be careful - if you do not provide a field mask, then you might - # accidentally clear some fields. For example, if you leave the field mask - # empty and do not provide a value for `subscriber_email_addresses`, then - # `subscriber_email_addresses` is updated to empty. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::UpdateCaseRequest.new - # - # # Call the update_case method. - # result = client.update_case request - # - # # The returned object is of type Google::Cloud::Support::V2::Case. - # p result - # - def update_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::UpdateCaseRequest - - # Converts hash and nil to 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_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.case&.name - header_params["case.name"] = request.case.name - end - - request_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_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :update_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Escalate a case, starting the Google Cloud Support escalation management - # process. - # - # This operation is only available for some support services. Go to - # https://cloud.google.com/support and look for 'Technical support - # escalations' in the feature list to find out which ones let you - # do that. - # - # @overload escalate_case(request, options = nil) - # Pass arguments to `escalate_case` via a request object, either of type - # {::Google::Cloud::Support::V2::EscalateCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::EscalateCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload escalate_case(name: nil, escalation: nil) - # Pass arguments to `escalate_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 case to be escalated. - # @param escalation [::Google::Cloud::Support::V2::Escalation, ::Hash] - # The escalation information to be sent with the escalation request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::EscalateCaseRequest.new - # - # # Call the escalate_case method. - # result = client.escalate_case request - # - # # The returned object is of type Google::Cloud::Support::V2::Case. - # p result - # - def escalate_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::EscalateCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.escalate_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.escalate_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.escalate_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :escalate_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Close a case. - # - # @overload close_case(request, options = nil) - # Pass arguments to `close_case` via a request object, either of type - # {::Google::Cloud::Support::V2::CloseCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::CloseCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload close_case(name: nil) - # Pass arguments to `close_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 case to close. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::CloseCaseRequest.new - # - # # Call the close_case method. - # result = client.close_case request - # - # # The returned object is of type Google::Cloud::Support::V2::Case. - # p result - # - def close_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CloseCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.close_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.close_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.close_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :close_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve valid classifications to use when creating a support case. - # - # Classifications are hierarchical. Each classification is a string - # containing all levels of the hierarchy separated by `" > "`. For example, - # `"Technical Issue > Compute > Compute Engine"`. - # - # Classification IDs returned by this endpoint are valid for at least six - # months. When a classification is deactivated, this endpoint immediately - # stops returning it. After six months, `case.create` requests using the - # classification will fail. - # - # @overload search_case_classifications(request, options = nil) - # Pass arguments to `search_case_classifications` via a request object, either of type - # {::Google::Cloud::Support::V2::SearchCaseClassificationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::SearchCaseClassificationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_case_classifications(query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_case_classifications` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param query [::String] - # An expression used to filter case classifications. - # - # If it's an empty string, then no filtering happens. Otherwise, case - # classifications will be returned that match the filter. - # @param page_size [::Integer] - # The maximum number of classifications fetched with each request. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new - # - # # Call the search_case_classifications method. - # result = client.search_case_classifications request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2::CaseClassification. - # p item - # end - # - def search_case_classifications request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::SearchCaseClassificationsRequest - - # Converts hash and nil to 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_case_classifications.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.search_case_classifications.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_case_classifications.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :search_case_classifications, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_case_classifications, request, response, 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 CaseService API. - # - # This class represents the configuration for CaseService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2::CaseService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_case to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2::CaseService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_case.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_case.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Support::V2::CaseService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CaseService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_case` - # @return [::Gapic::Config::Method] - # - attr_reader :get_case - ## - # RPC-specific configuration for `list_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_cases - ## - # RPC-specific configuration for `search_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :search_cases - ## - # RPC-specific configuration for `create_case` - # @return [::Gapic::Config::Method] - # - attr_reader :create_case - ## - # RPC-specific configuration for `update_case` - # @return [::Gapic::Config::Method] - # - attr_reader :update_case - ## - # RPC-specific configuration for `escalate_case` - # @return [::Gapic::Config::Method] - # - attr_reader :escalate_case - ## - # RPC-specific configuration for `close_case` - # @return [::Gapic::Config::Method] - # - attr_reader :close_case - ## - # RPC-specific configuration for `search_case_classifications` - # @return [::Gapic::Config::Method] - # - attr_reader :search_case_classifications - - # @private - def initialize parent_rpcs = nil - get_case_config = parent_rpcs.get_case if parent_rpcs.respond_to? :get_case - @get_case = ::Gapic::Config::Method.new get_case_config - list_cases_config = parent_rpcs.list_cases if parent_rpcs.respond_to? :list_cases - @list_cases = ::Gapic::Config::Method.new list_cases_config - search_cases_config = parent_rpcs.search_cases if parent_rpcs.respond_to? :search_cases - @search_cases = ::Gapic::Config::Method.new search_cases_config - create_case_config = parent_rpcs.create_case if parent_rpcs.respond_to? :create_case - @create_case = ::Gapic::Config::Method.new create_case_config - update_case_config = parent_rpcs.update_case if parent_rpcs.respond_to? :update_case - @update_case = ::Gapic::Config::Method.new update_case_config - escalate_case_config = parent_rpcs.escalate_case if parent_rpcs.respond_to? :escalate_case - @escalate_case = ::Gapic::Config::Method.new escalate_case_config - close_case_config = parent_rpcs.close_case if parent_rpcs.respond_to? :close_case - @close_case = ::Gapic::Config::Method.new close_case_config - search_case_classifications_config = parent_rpcs.search_case_classifications if parent_rpcs.respond_to? :search_case_classifications - @search_case_classifications = ::Gapic::Config::Method.new search_case_classifications_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/credentials.rb deleted file mode 100644 index 244a84668482..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/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 Support - module V2 - module CaseService - # Credentials for the CaseService 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-support-v2/lib/google/cloud/support/v2/case_service/paths.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/paths.rb deleted file mode 100644 index da8eb12016cf..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service/paths.rb +++ /dev/null @@ -1,100 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2 - module CaseService - # Path helper methods for the CaseService API. - module Paths - ## - # Create a fully-qualified Case resource string. - # - # @overload case_path(organization:, case:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}` - # - # @param organization [String] - # @param case [String] - # - # @overload case_path(project:, case:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}` - # - # @param project [String] - # @param case [String] - # - # @return [::String] - def case_path **args - resources = { - "case:organization" => (proc do |organization:, case:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}" - end), - "case:project" => (proc do |project:, case:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Organization resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}` - # - # @param organization [String] - # - # @return [::String] - def organization_path organization: - "organizations/#{organization}" - end - - ## - # Create a fully-qualified 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-support-v2/lib/google/cloud/support/v2/case_service_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_pb.rb deleted file mode 100644 index 2b7cc3c1a52b..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_pb.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2/case_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/support/v2/case_pb' -require 'google/cloud/support/v2/escalation_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n*google/cloud/support/v2/case_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/support/v2/case.proto\x1a(google/cloud/support/v2/escalation.proto\x1a google/protobuf/field_mask.proto\"H\n\x0eGetCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\"\x7f\n\x11\x43reateCaseRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 cloudsupport.googleapis.com/Case\x12\x30\n\x04\x63\x61se\x18\x02 \x01(\x0b\x32\x1d.google.cloud.support.v2.CaseB\x03\xe0\x41\x02\"\x83\x01\n\x10ListCasesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 cloudsupport.googleapis.com/Case\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"Z\n\x11ListCasesResponse\x12,\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32\x1d.google.cloud.support.v2.Case\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Z\n\x12SearchCasesRequest\x12\x0e\n\x06parent\x18\x04 \x01(\t\x12\r\n\x05query\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\\\n\x13SearchCasesResponse\x12,\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32\x1d.google.cloud.support.v2.Case\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x86\x01\n\x13\x45scalateCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x37\n\nescalation\x18\x02 \x01(\x0b\x32#.google.cloud.support.v2.Escalation\"v\n\x11UpdateCaseRequest\x12\x30\n\x04\x63\x61se\x18\x01 \x01(\x0b\x32\x1d.google.cloud.support.v2.CaseB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"J\n\x10\x43loseCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\"X\n SearchCaseClassificationsRequest\x12\r\n\x05query\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x87\x01\n!SearchCaseClassificationsResponse\x12I\n\x14\x63\x61se_classifications\x18\x01 \x03(\x0b\x32+.google.cloud.support.v2.CaseClassification\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xcf\x0c\n\x0b\x43\x61seService\x12\xa5\x01\n\x07GetCase\x12\'.google.cloud.support.v2.GetCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\x12\x1d/v2/{name=projects/*/cases/*}Z$\x12\"/v2/{name=organizations/*/cases/*}\x12\xb8\x01\n\tListCases\x12).google.cloud.support.v2.ListCasesRequest\x1a*.google.cloud.support.v2.ListCasesResponse\"T\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x45\x12\x1d/v2/{parent=projects/*}/casesZ$\x12\"/v2/{parent=organizations/*}/cases\x12\xc3\x01\n\x0bSearchCases\x12+.google.cloud.support.v2.SearchCasesRequest\x1a,.google.cloud.support.v2.SearchCasesResponse\"Y\x82\xd3\xe4\x93\x02S\x12$/v2/{parent=projects/*}/cases:searchZ+\x12)/v2/{parent=organizations/*}/cases:search\x12\xbe\x01\n\nCreateCase\x12*.google.cloud.support.v2.CreateCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"e\xda\x41\x0bparent,case\x82\xd3\xe4\x93\x02Q\"\x1d/v2/{parent=projects/*}/cases:\x04\x63\x61seZ*\"\"/v2/{parent=organizations/*}/cases:\x04\x63\x61se\x12\xcd\x01\n\nUpdateCase\x12*.google.cloud.support.v2.UpdateCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"t\xda\x41\x10\x63\x61se,update_mask\x82\xd3\xe4\x93\x02[2\"/v2/{case.name=projects/*/cases/*}:\x04\x63\x61seZ/2\'/v2/{case.name=organizations/*/cases/*}:\x04\x63\x61se\x12\xc0\x01\n\x0c\x45scalateCase\x12,.google.cloud.support.v2.EscalateCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"c\x82\xd3\xe4\x93\x02]\"&/v2/{name=projects/*/cases/*}:escalate:\x01*Z0\"+/v2/{name=organizations/*/cases/*}:escalate:\x01*\x12\xb4\x01\n\tCloseCase\x12).google.cloud.support.v2.CloseCaseRequest\x1a\x1d.google.cloud.support.v2.Case\"]\x82\xd3\xe4\x93\x02W\"#/v2/{name=projects/*/cases/*}:close:\x01*Z-\"(/v2/{name=organizations/*/cases/*}:close:\x01*\x12\xba\x01\n\x19SearchCaseClassifications\x12\x39.google.cloud.support.v2.SearchCaseClassificationsRequest\x1a:.google.cloud.support.v2.SearchCaseClassificationsResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/v2/caseClassifications:search\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb9\x01\n\x1b\x63om.google.cloud.support.v2B\x10\x43\x61seServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2 - GetCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.GetCaseRequest").msgclass - CreateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CreateCaseRequest").msgclass - ListCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCasesRequest").msgclass - ListCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCasesResponse").msgclass - SearchCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.SearchCasesRequest").msgclass - SearchCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.SearchCasesResponse").msgclass - EscalateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.EscalateCaseRequest").msgclass - UpdateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.UpdateCaseRequest").msgclass - CloseCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CloseCaseRequest").msgclass - SearchCaseClassificationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.SearchCaseClassificationsRequest").msgclass - SearchCaseClassificationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.SearchCaseClassificationsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_services_pb.rb deleted file mode 100644 index 0b249ccd8e55..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/case_service_services_pb.rb +++ /dev/null @@ -1,82 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/support/v2/case_service.proto for package 'Google.Cloud.Support.V2' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/support/v2/case_service_pb' - -module Google - module Cloud - module Support - module V2 - module CaseService - # A service to manage Google Cloud support cases. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.support.v2.CaseService' - - # Retrieve a case. - rpc :GetCase, ::Google::Cloud::Support::V2::GetCaseRequest, ::Google::Cloud::Support::V2::Case - # Retrieve all cases under a parent, but not its children. - # - # For example, listing cases under an organization only returns the cases - # that are directly parented by that organization. To retrieve cases - # under an organization and its projects, use `cases.search`. - rpc :ListCases, ::Google::Cloud::Support::V2::ListCasesRequest, ::Google::Cloud::Support::V2::ListCasesResponse - # Search for cases using a query. - rpc :SearchCases, ::Google::Cloud::Support::V2::SearchCasesRequest, ::Google::Cloud::Support::V2::SearchCasesResponse - # Create a new case and associate it with a parent. - # - # It must have the following fields set: `display_name`, `description`, - # `classification`, and `priority`. If you're just testing the API and don't - # want to route your case to an agent, set `testCase=true`. - rpc :CreateCase, ::Google::Cloud::Support::V2::CreateCaseRequest, ::Google::Cloud::Support::V2::Case - # Update a case. Only some fields can be updated. - rpc :UpdateCase, ::Google::Cloud::Support::V2::UpdateCaseRequest, ::Google::Cloud::Support::V2::Case - # Escalate a case, starting the Google Cloud Support escalation management - # process. - # - # This operation is only available for some support services. Go to - # https://cloud.google.com/support and look for 'Technical support - # escalations' in the feature list to find out which ones let you - # do that. - rpc :EscalateCase, ::Google::Cloud::Support::V2::EscalateCaseRequest, ::Google::Cloud::Support::V2::Case - # Close a case. - rpc :CloseCase, ::Google::Cloud::Support::V2::CloseCaseRequest, ::Google::Cloud::Support::V2::Case - # Retrieve valid classifications to use when creating a support case. - # - # Classifications are hierarchical. Each classification is a string - # containing all levels of the hierarchy separated by `" > "`. For example, - # `"Technical Issue > Compute > Compute Engine"`. - # - # Classification IDs returned by this endpoint are valid for at least six - # months. When a classification is deactivated, this endpoint immediately - # stops returning it. After six months, `case.create` requests using the - # classification will fail. - rpc :SearchCaseClassifications, ::Google::Cloud::Support::V2::SearchCaseClassificationsRequest, ::Google::Cloud::Support::V2::SearchCaseClassificationsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_pb.rb deleted file mode 100644 index d4ba7d9084c2..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2/comment.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/support/v2/actor_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n%google/cloud/support/v2/comment.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/support/v2/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd7\x02\n\x07\x43omment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x07\x63reator\x18\x03 \x01(\x0b\x32\x1e.google.cloud.support.v2.ActorB\x03\xe0\x41\x03\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\x1e\n\x0fplain_text_body\x18\x05 \x01(\tB\x05\x18\x01\xe0\x41\x03:\x9b\x01\xea\x41\x97\x01\n#cloudsupport.googleapis.com/Comment\x12] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Comment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CommentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::ListCommentsRequest.new - # - # # Call the list_comments method. - # result = client.list_comments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2::Comment. - # p item - # end - # - def list_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListCommentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_comments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_comments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @comment_service_stub.call_rpc :list_comments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @comment_service_stub, :list_comments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Add a new comment to a case. - # - # The comment must have the following fields set: `body`. - # - # @overload create_comment(request, options = nil) - # Pass arguments to `create_comment` via a request object, either of type - # {::Google::Cloud::Support::V2::CreateCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2::CreateCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_comment(parent: nil, comment: nil) - # Pass arguments to `create_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the case to which the comment should be added. - # @param comment [::Google::Cloud::Support::V2::Comment, ::Hash] - # Required. The comment to be added. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2::Comment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2::Comment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2::CommentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2::CreateCommentRequest.new - # - # # Call the create_comment method. - # result = client.create_comment request - # - # # The returned object is of type Google::Cloud::Support::V2::Comment. - # p result - # - def create_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CreateCommentRequest - - # Converts hash and nil to 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_comment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @comment_service_stub.call_rpc :create_comment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CommentService API. - # - # This class represents the configuration for CommentService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2::CommentService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_comments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2::CommentService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_comments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_comments.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Support::V2::CommentService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CommentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_comments - ## - # RPC-specific configuration for `create_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_comment - - # @private - def initialize parent_rpcs = nil - list_comments_config = parent_rpcs.list_comments if parent_rpcs.respond_to? :list_comments - @list_comments = ::Gapic::Config::Method.new list_comments_config - create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment - @create_comment = ::Gapic::Config::Method.new create_comment_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/credentials.rb deleted file mode 100644 index ed38892036e6..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/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 Support - module V2 - module CommentService - # Credentials for the CommentService 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-support-v2/lib/google/cloud/support/v2/comment_service/paths.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/paths.rb deleted file mode 100644 index abbe1eeac559..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service/paths.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! - - -module Google - module Cloud - module Support - module V2 - module CommentService - # Path helper methods for the CommentService API. - module Paths - ## - # Create a fully-qualified Case resource string. - # - # @overload case_path(organization:, case:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}` - # - # @param organization [String] - # @param case [String] - # - # @overload case_path(project:, case:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}` - # - # @param project [String] - # @param case [String] - # - # @return [::String] - def case_path **args - resources = { - "case:organization" => (proc do |organization:, case:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}" - end), - "case:project" => (proc do |project:, case:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}" - 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 Comment resource string. - # - # @overload comment_path(organization:, case:, comment:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}/comments/{comment}` - # - # @param organization [String] - # @param case [String] - # @param comment [String] - # - # @overload comment_path(project:, case:, comment:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}/comments/{comment}` - # - # @param project [String] - # @param case [String] - # @param comment [String] - # - # @return [::String] - def comment_path **args - resources = { - "case:comment:organization" => (proc do |organization:, case:, comment:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}/comments/#{comment}" - end), - "case:comment:project" => (proc do |project:, case:, comment:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}/comments/#{comment}" - 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-support-v2/lib/google/cloud/support/v2/comment_service_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_pb.rb deleted file mode 100644 index 771570302466..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2/comment_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/support/v2/comment_pb' - - -descriptor_data = "\n-google/cloud/support/v2/comment_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/support/v2/comment.proto\"v\n\x13ListCommentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"c\n\x14ListCommentsResponse\x12\x32\n\x08\x63omments\x18\x01 \x03(\x0b\x32 .google.cloud.support.v2.Comment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x88\x01\n\x14\x43reateCommentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x36\n\x07\x63omment\x18\x02 \x01(\x0b\x32 .google.cloud.support.v2.CommentB\x03\xe0\x41\x02\x32\xa5\x04\n\x0e\x43ommentService\x12\xd7\x01\n\x0cListComments\x12,.google.cloud.support.v2.ListCommentsRequest\x1a-.google.cloud.support.v2.ListCommentsResponse\"j\xda\x41\x06parent\x82\xd3\xe4\x93\x02[\x12(/v2/{parent=projects/*/cases/*}/commentsZ/\x12-/v2/{parent=organizations/*/cases/*}/comments\x12\xe7\x01\n\rCreateComment\x12-.google.cloud.support.v2.CreateCommentRequest\x1a .google.cloud.support.v2.Comment\"\x84\x01\xda\x41\x0eparent,comment\x82\xd3\xe4\x93\x02m\"(/v2/{parent=projects/*/cases/*}/comments:\x07\x63ommentZ8\"-/v2/{parent=organizations/*/cases/*}/comments:\x07\x63omment\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbc\x01\n\x1b\x63om.google.cloud.support.v2B\x13\x43ommentServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2 - ListCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCommentsRequest").msgclass - ListCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCommentsResponse").msgclass - CreateCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CreateCommentRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_services_pb.rb deleted file mode 100644 index d615c07c5af3..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/comment_service_services_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/support/v2/comment_service.proto for package 'Google.Cloud.Support.V2' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/support/v2/comment_service_pb' - -module Google - module Cloud - module Support - module V2 - module CommentService - # A service to manage comments on cases. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.support.v2.CommentService' - - # List all the comments associated with a case. - rpc :ListComments, ::Google::Cloud::Support::V2::ListCommentsRequest, ::Google::Cloud::Support::V2::ListCommentsResponse - # Add a new comment to a case. - # - # The comment must have the following fields set: `body`. - rpc :CreateComment, ::Google::Cloud::Support::V2::CreateCommentRequest, ::Google::Cloud::Support::V2::Comment - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/escalation_pb.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/escalation_pb.rb deleted file mode 100644 index 9cb0c3ecaff6..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/escalation_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2/escalation.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n(google/cloud/support/v2/escalation.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\"\xce\x01\n\nEscalation\x12?\n\x06reason\x18\x04 \x01(\x0e\x32*.google.cloud.support.v2.Escalation.ReasonB\x03\xe0\x41\x02\x12\x1a\n\rjustification\x18\x05 \x01(\tB\x03\xe0\x41\x02\"c\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x13\n\x0fRESOLUTION_TIME\x10\x01\x12\x17\n\x13TECHNICAL_EXPERTISE\x10\x02\x12\x13\n\x0f\x42USINESS_IMPACT\x10\x03\x42\xb8\x01\n\x1b\x63om.google.cloud.support.v2B\x0f\x45scalationProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2 - Escalation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Escalation").msgclass - Escalation::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Escalation.Reason").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/version.rb b/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/v2/version.rb deleted file mode 100644 index 770b6ddbfa98..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/lib/google/cloud/support/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 Support - module V2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-support-v2/proto_docs/README.md deleted file mode 100644 index f0b44daa43c5..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Google Cloud Support 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-support-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/cloud/support/v2/actor.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/actor.rb deleted file mode 100644 index 060fa58e361b..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/actor.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! - - -module Google - module Cloud - module Support - module V2 - # An Actor represents an entity that performed an action. For example, an actor - # could be a user who posted a comment on a support case, a user who - # uploaded an attachment, or a service account that created a support case. - # @!attribute [rw] display_name - # @return [::String] - # The name to display for the actor. If not provided, it is inferred from - # credentials supplied during case creation. When an email is provided, a - # display name must also be provided. This will be obfuscated if the user - # is a Google Support agent. - # @!attribute [rw] email - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # The email address of the actor. If not provided, it is inferred from the - # credentials supplied during case creation. When a name is provided, an - # email must also be provided. If the user is a Google Support agent, this is - # obfuscated. - # - # This field is deprecated. Use `username` instead. - # @!attribute [r] google_support - # @return [::Boolean] - # Output only. Whether the actor is a Google support actor. - # @!attribute [r] username - # @return [::String] - # Output only. The username of the actor. It may look like an email or other - # format provided by the identity provider. If not provided, it is inferred - # from the credentials supplied. When a name is provided, a username must - # also be provided. If the user is a Google Support agent, this will not be - # set. - class Actor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment.rb deleted file mode 100644 index 3c5c4b415a91..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2 - # An Attachment contains metadata about a file that was uploaded to a - # case - it is NOT a file itself. That being said, the name of an Attachment - # object can be used to download its accompanying file through the - # `media.download` endpoint. - # - # While attachments can be uploaded in the console at the - # same time as a comment, they're associated on a "case" level, not a - # "comment" level. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the attachment. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the attachment was created. - # @!attribute [r] creator - # @return [::Google::Cloud::Support::V2::Actor] - # Output only. The user who uploaded the attachment. Note, the name and email - # will be obfuscated if the attachment was uploaded by Google support. - # @!attribute [rw] filename - # @return [::String] - # The filename of the attachment (e.g. `"graph.jpg"`). - # @!attribute [r] mime_type - # @return [::String] - # Output only. The MIME type of the attachment (e.g. text/plain). - # @!attribute [r] size_bytes - # @return [::Integer] - # Output only. The size of the attachment in bytes. - class Attachment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment_service.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment_service.rb deleted file mode 100644 index f9b6c90d997d..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/attachment_service.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 Support - module V2 - # The request message for the ListAttachments endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the case for which attachments should be listed. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of attachments fetched with each request. - # - # If not provided, the default is 10. The maximum page size that will be - # returned is 100. - # - # The size of each page can be smaller than the requested page size and can - # include zero. For example, you could request 100 attachments on one page, - # receive 0, and then on the next page, receive 90. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - class ListAttachmentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for the ListAttachments endpoint. - # @!attribute [rw] attachments - # @return [::Array<::Google::Cloud::Support::V2::Attachment>] - # The list of attachments associated with a case. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the `page_token` - # field of subsequent `cases.attachments.list` requests. If unspecified, - # there are no more results to retrieve. - class ListAttachmentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case.rb deleted file mode 100644 index 28de7f2b7bb9..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case.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 Support - module V2 - # A Case is an object that contains the details of a support case. It - # contains fields for the time it was created, its priority, its - # classification, and more. Cases can also have comments and attachments that - # get added over time. - # - # A case is parented by a Google Cloud organization or project. - # - # Organizations are identified by a number, so the name of a case parented by - # an organization would look like this: - # - # ``` - # organizations/123/cases/456 - # ``` - # - # Projects have two unique identifiers, an ID and a number, and they look like - # this: - # - # ``` - # projects/abc/cases/456 - # ``` - # - # ``` - # projects/123/cases/456 - # ``` - # - # You can use either of them when calling the API. To learn more - # about project identifiers, see [AIP-2510](https://google.aip.dev/cloud/2510). - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for the case. - # @!attribute [rw] display_name - # @return [::String] - # The short summary of the issue reported in this case. - # @!attribute [rw] description - # @return [::String] - # A broad description of the issue. - # @!attribute [rw] classification - # @return [::Google::Cloud::Support::V2::CaseClassification] - # The issue classification applicable to this case. - # @!attribute [rw] time_zone - # @return [::String] - # The timezone of the user who created the support case. - # It should be in a format IANA recognizes: https://www.iana.org/time-zones. - # There is no additional validation done by the API. - # @!attribute [rw] subscriber_email_addresses - # @return [::Array<::String>] - # The email addresses to receive updates on this case. - # @!attribute [r] state - # @return [::Google::Cloud::Support::V2::Case::State] - # Output only. The current status of the support case. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this case was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this case was last updated. - # @!attribute [rw] creator - # @return [::Google::Cloud::Support::V2::Actor] - # The user who created the case. - # - # Note: The name and email will be obfuscated if the case was created by - # Google Support. - # @!attribute [rw] contact_email - # @return [::String] - # A user-supplied email address to send case update notifications for. This - # should only be used in BYOID flows, where we cannot infer the user's email - # address directly from their EUCs. - # @!attribute [rw] escalated - # @return [::Boolean] - # Whether the case is currently escalated. - # @!attribute [rw] test_case - # @return [::Boolean] - # Whether this case was created for internal API testing and should not be - # acted on by the support team. - # @!attribute [rw] language_code - # @return [::String] - # The language the user has requested to receive support in. This should be a - # BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). - # If no language or an unsupported language is specified, this field defaults - # to English (en). - # - # Language selection during case creation may affect your available support - # options. For a list of supported languages and their support working hours, - # see: https://cloud.google.com/support/docs/language-working-hours - # @!attribute [rw] priority - # @return [::Google::Cloud::Support::V2::Case::Priority] - # The priority of this case. - class Case - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of a support case. - module State - # Case is in an unknown state. - STATE_UNSPECIFIED = 0 - - # The case has been created but no one is assigned to work on it yet. - NEW = 1 - - # The case is currently being handled by Google support. - IN_PROGRESS_GOOGLE_SUPPORT = 2 - - # Google is waiting for a response. - ACTION_REQUIRED = 3 - - # A solution has been offered for the case, but it isn't yet closed. - SOLUTION_PROVIDED = 4 - - # The case has been resolved. - CLOSED = 5 - end - - # The case Priority. P0 is most urgent and P4 the least. - module Priority - # Priority is undefined or has not been set yet. - PRIORITY_UNSPECIFIED = 0 - - # Extreme impact on a production service. Service is hard down. - P0 = 1 - - # Critical impact on a production service. Service is currently unusable. - P1 = 2 - - # Severe impact on a production service. Service is usable but greatly - # impaired. - P2 = 3 - - # Medium impact on a production service. Service is available, but - # moderately impaired. - P3 = 4 - - # General questions or minor issues. Production service is fully - # available. - P4 = 5 - end - end - - # A Case Classification represents the topic that a case is about. It's very - # important to use accurate classifications, because they're - # used to route your cases to specialists who can help you. - # - # A classification always has an ID that is its unique identifier. - # A valid ID is required when creating a case. - # @!attribute [rw] id - # @return [::String] - # The unique ID for a classification. Must be specified for case creation. - # - # To retrieve valid classification IDs for case creation, use - # `caseClassifications.search`. - # - # Classification IDs returned by `caseClassifications.search` are guaranteed - # to be valid for at least 6 months. If a given classification is - # deactiveated, it will immediately stop being returned. After 6 months, - # `case.create` requests using the classification ID will fail. - # @!attribute [rw] display_name - # @return [::String] - # A display name for the classification. - # - # The display name is not static and can change. To uniquely and consistently - # identify classifications, use the `CaseClassification.id` field. - class CaseClassification - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case_service.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case_service.rb deleted file mode 100644 index cbca116de661..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/case_service.rb +++ /dev/null @@ -1,238 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2 - # The request message for the GetCase endpoint. - # @!attribute [rw] name - # @return [::String] - # Required. The full name of a case to be retrieved. - class GetCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the CreateCase endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent under which the case should be created. - # @!attribute [rw] case - # @return [::Google::Cloud::Support::V2::Case] - # Required. The case to be created. - class CreateCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the ListCases endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of a parent to list cases under. - # @!attribute [rw] filter - # @return [::String] - # An expression used to filter cases. - # - # If it's an empty string, then no filtering happens. Otherwise, the endpoint - # returns the cases that match the filter. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # EXAMPLES: - # - # - `state=CLOSED` - # - `state=OPEN AND creator.email="tester@example.com"` - # - `state=OPEN AND (priority=P0 OR priority=P1)` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of cases fetched with each request. Defaults to 10. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - class ListCasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for the ListCases endpoint. - # @!attribute [rw] cases - # @return [::Array<::Google::Cloud::Support::V2::Case>] - # The list of cases associated with the parent after any - # filters have been applied. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the `page_token` - # field of subsequent `cases.list` requests. If unspecified, there are no - # more results to retrieve. - class ListCasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the SearchCases endpoint. - # @!attribute [rw] parent - # @return [::String] - # The name of the parent resource to search for cases under. - # @!attribute [rw] query - # @return [::String] - # An expression used to filter cases. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `organization`: An organization name in the form - # `organizations/`. - # - `project`: A project name in the form `projects/`. - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # You must specify either `organization` or `project`. - # - # To search across `displayName`, `description`, and comments, use a global - # restriction with no keyword or operator. For example, `"my search"`. - # - # To search only cases updated after a certain date, use `update_time` - # restricted with that particular date, time, and timezone in ISO datetime - # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - # `update_time` only supports the greater than operator (`>`). - # - # Examples: - # - # - `organization="organizations/123456789"` - # - `project="projects/my-project-id"` - # - `project="projects/123456789"` - # - `organization="organizations/123456789" AND state=CLOSED` - # - `project="projects/my-project-id" AND creator.email="tester@example.com"` - # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of cases fetched with each request. The default page - # size is 10. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - class SearchCasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for the SearchCases endpoint. - # @!attribute [rw] cases - # @return [::Array<::Google::Cloud::Support::V2::Case>] - # The list of cases associated with the parent after any - # filters have been applied. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the - # `page_token` field of subsequent `cases.search` requests. If unspecified, - # there are no more results to retrieve. - class SearchCasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the EscalateCase endpoint. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the case to be escalated. - # @!attribute [rw] escalation - # @return [::Google::Cloud::Support::V2::Escalation] - # The escalation information to be sent with the escalation request. - class EscalateCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the UpdateCase endpoint - # @!attribute [rw] case - # @return [::Google::Cloud::Support::V2::Case] - # Required. The case to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A list of attributes of the case that should be updated. Supported values - # are `priority`, `display_name`, and `subscriber_email_addresses`. If no - # fields are specified, all supported fields are updated. - # - # Be careful - if you do not provide a field mask, then you might - # accidentally clear some fields. For example, if you leave the field mask - # empty and do not provide a value for `subscriber_email_addresses`, then - # `subscriber_email_addresses` is updated to empty. - class UpdateCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the CloseCase endpoint. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the case to close. - class CloseCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the SearchCaseClassifications endpoint. - # @!attribute [rw] query - # @return [::String] - # An expression used to filter case classifications. - # - # If it's an empty string, then no filtering happens. Otherwise, case - # classifications will be returned that match the filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of classifications fetched with each request. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - class SearchCaseClassificationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for SearchCaseClassifications endpoint. - # @!attribute [rw] case_classifications - # @return [::Array<::Google::Cloud::Support::V2::CaseClassification>] - # The classifications retrieved. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the `page_token` - # field of subsequent `caseClassifications.list` requests. If unspecified, - # there are no more results to retrieve. - class SearchCaseClassificationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment.rb deleted file mode 100644 index 13196465f608..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2 - # A comment associated with a support case. - # - # Case comments are the primary way for Google Support to communicate with a - # user who has opened a case. When a user responds to Google Support, the - # user's responses also appear as comments. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the comment. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the comment was created. - # @!attribute [r] creator - # @return [::Google::Cloud::Support::V2::Actor] - # Output only. The user or Google Support agent who created the comment. - # @!attribute [rw] body - # @return [::String] - # The full comment body. - # - # Maximum of 12800 characters. - # @!attribute [r] plain_text_body - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Output only. DEPRECATED. DO NOT USE. - # - # A duplicate of the `body` field. - # - # This field is only present for legacy reasons. - class Comment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment_service.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment_service.rb deleted file mode 100644 index 4c60007a828b..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/comment_service.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2 - # The request message for the ListComments endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the case for which to list comments. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of comments to fetch. Defaults to 10. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is returned. - class ListCommentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for the ListComments endpoint. - # @!attribute [rw] comments - # @return [::Array<::Google::Cloud::Support::V2::Comment>] - # List of the comments associated with the case. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the `page_token` - # field of subsequent `cases.comments.list` requests. If unspecified, there - # are no more results to retrieve. - class ListCommentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the CreateComment endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the case to which the comment should be added. - # @!attribute [rw] comment - # @return [::Google::Cloud::Support::V2::Comment] - # Required. The comment to be added. - class CreateCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/escalation.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/escalation.rb deleted file mode 100644 index 58f5e6bef053..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/cloud/support/v2/escalation.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2 - # An escalation of a support case. - # @!attribute [rw] reason - # @return [::Google::Cloud::Support::V2::Escalation::Reason] - # Required. The reason why the Case is being escalated. - # @!attribute [rw] justification - # @return [::String] - # Required. A free text description to accompany the `reason` field above. - # Provides additional context on why the case is being escalated. - class Escalation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enum detailing the possible reasons a case may be escalated. - module Reason - # The escalation reason is in an unknown state or has not been specified. - REASON_UNSPECIFIED = 0 - - # The case is taking too long to resolve. - RESOLUTION_TIME = 1 - - # The support agent does not have the expertise required to successfully - # resolve the issue. - TECHNICAL_EXPERTISE = 2 - - # The issue is having a significant business impact. - BUSINESS_IMPACT = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-support-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-support-v2/snippets/Gemfile deleted file mode 100644 index 92a51fab661b..000000000000 --- a/owl-bot-staging/google-cloud-support-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-support-v2", path: "../" -else - gem "google-cloud-support-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-support-v2/snippets/case_attachment_service/list_attachments.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_attachment_service/list_attachments.rb deleted file mode 100644 index e1c0245885c9..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/case_attachment_service/list_attachments.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 cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_sync] -require "google/cloud/support/v2" - -## -# Snippet for the list_attachments call in the CaseAttachmentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CaseAttachmentService::Client#list_attachments. -# -def list_attachments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CaseAttachmentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::ListAttachmentsRequest.new - - # Call the list_attachments method. - result = client.list_attachments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2::Attachment. - p item - end -end -# [END cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/close_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/close_case.rb deleted file mode 100644 index ae0b3bf209b0..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/close_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2_generated_CaseService_CloseCase_sync] -require "google/cloud/support/v2" - -## -# Snippet for the close_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CaseService::Client#close_case. -# -def close_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::CloseCaseRequest.new - - # Call the close_case method. - result = client.close_case request - - # The returned object is of type Google::Cloud::Support::V2::Case. - p result -end -# [END cloudsupport_v2_generated_CaseService_CloseCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/create_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/create_case.rb deleted file mode 100644 index baf321e8aa51..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/create_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2_generated_CaseService_CreateCase_sync] -require "google/cloud/support/v2" - -## -# Snippet for the create_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CaseService::Client#create_case. -# -def create_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::CreateCaseRequest.new - - # Call the create_case method. - result = client.create_case request - - # The returned object is of type Google::Cloud::Support::V2::Case. - p result -end -# [END cloudsupport_v2_generated_CaseService_CreateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/escalate_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/escalate_case.rb deleted file mode 100644 index 1bc21d02b003..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/escalate_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2_generated_CaseService_EscalateCase_sync] -require "google/cloud/support/v2" - -## -# Snippet for the escalate_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CaseService::Client#escalate_case. -# -def escalate_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::EscalateCaseRequest.new - - # Call the escalate_case method. - result = client.escalate_case request - - # The returned object is of type Google::Cloud::Support::V2::Case. - p result -end -# [END cloudsupport_v2_generated_CaseService_EscalateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/get_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/get_case.rb deleted file mode 100644 index 54ec20712e4d..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/get_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2_generated_CaseService_GetCase_sync] -require "google/cloud/support/v2" - -## -# Snippet for the get_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CaseService::Client#get_case. -# -def get_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::GetCaseRequest.new - - # Call the get_case method. - result = client.get_case request - - # The returned object is of type Google::Cloud::Support::V2::Case. - p result -end -# [END cloudsupport_v2_generated_CaseService_GetCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/list_cases.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/list_cases.rb deleted file mode 100644 index 7bb33c377b63..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/list_cases.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 cloudsupport_v2_generated_CaseService_ListCases_sync] -require "google/cloud/support/v2" - -## -# Snippet for the list_cases call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CaseService::Client#list_cases. -# -def list_cases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::ListCasesRequest.new - - # Call the list_cases method. - result = client.list_cases request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2::Case. - p item - end -end -# [END cloudsupport_v2_generated_CaseService_ListCases_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_case_classifications.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_case_classifications.rb deleted file mode 100644 index d8efef380e35..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_case_classifications.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 cloudsupport_v2_generated_CaseService_SearchCaseClassifications_sync] -require "google/cloud/support/v2" - -## -# Snippet for the search_case_classifications call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CaseService::Client#search_case_classifications. -# -def search_case_classifications - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new - - # Call the search_case_classifications method. - result = client.search_case_classifications request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2::CaseClassification. - p item - end -end -# [END cloudsupport_v2_generated_CaseService_SearchCaseClassifications_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_cases.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_cases.rb deleted file mode 100644 index 48a49399a4d0..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/search_cases.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 cloudsupport_v2_generated_CaseService_SearchCases_sync] -require "google/cloud/support/v2" - -## -# Snippet for the search_cases call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CaseService::Client#search_cases. -# -def search_cases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::SearchCasesRequest.new - - # Call the search_cases method. - result = client.search_cases request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2::Case. - p item - end -end -# [END cloudsupport_v2_generated_CaseService_SearchCases_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/update_case.rb b/owl-bot-staging/google-cloud-support-v2/snippets/case_service/update_case.rb deleted file mode 100644 index e7add57657b8..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/case_service/update_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2_generated_CaseService_UpdateCase_sync] -require "google/cloud/support/v2" - -## -# Snippet for the update_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CaseService::Client#update_case. -# -def update_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::UpdateCaseRequest.new - - # Call the update_case method. - result = client.update_case request - - # The returned object is of type Google::Cloud::Support::V2::Case. - p result -end -# [END cloudsupport_v2_generated_CaseService_UpdateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/create_comment.rb b/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/create_comment.rb deleted file mode 100644 index 1638273dd227..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/create_comment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2_generated_CommentService_CreateComment_sync] -require "google/cloud/support/v2" - -## -# Snippet for the create_comment call in the CommentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CommentService::Client#create_comment. -# -def create_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CommentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::CreateCommentRequest.new - - # Call the create_comment method. - result = client.create_comment request - - # The returned object is of type Google::Cloud::Support::V2::Comment. - p result -end -# [END cloudsupport_v2_generated_CommentService_CreateComment_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/list_comments.rb b/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/list_comments.rb deleted file mode 100644 index 6d0c3cd56994..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/comment_service/list_comments.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2_generated_CommentService_ListComments_sync] -require "google/cloud/support/v2" - -## -# Snippet for the list_comments call in the CommentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2::CommentService::Client#list_comments. -# -def list_comments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2::CommentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2::ListCommentsRequest.new - - # Call the list_comments method. - result = client.list_comments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2::Comment. - p item - end -end -# [END cloudsupport_v2_generated_CommentService_ListComments_sync] diff --git a/owl-bot-staging/google-cloud-support-v2/snippets/snippet_metadata_google.cloud.support.v2.json b/owl-bot-staging/google-cloud-support-v2/snippets/snippet_metadata_google.cloud.support.v2.json deleted file mode 100644 index 59cd6bfc8a14..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/snippets/snippet_metadata_google.cloud.support.v2.json +++ /dev/null @@ -1,455 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-support-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.support.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_sync", - "title": "Snippet for the list_attachments call in the CaseAttachmentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseAttachmentService::Client#list_attachments.", - "file": "case_attachment_service/list_attachments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_attachments", - "full_name": "::Google::Cloud::Support::V2::CaseAttachmentService::Client#list_attachments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::ListAttachmentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::ListAttachmentsResponse", - "client": { - "short_name": "CaseAttachmentService::Client", - "full_name": "::Google::Cloud::Support::V2::CaseAttachmentService::Client" - }, - "method": { - "short_name": "ListAttachments", - "full_name": "google.cloud.support.v2.CaseAttachmentService.ListAttachments", - "service": { - "short_name": "CaseAttachmentService", - "full_name": "google.cloud.support.v2.CaseAttachmentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CaseService_GetCase_sync", - "title": "Snippet for the get_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#get_case.", - "file": "case_service/get_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_case", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client#get_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::GetCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client" - }, - "method": { - "short_name": "GetCase", - "full_name": "google.cloud.support.v2.CaseService.GetCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CaseService_ListCases_sync", - "title": "Snippet for the list_cases call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#list_cases.", - "file": "case_service/list_cases.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_cases", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client#list_cases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::ListCasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::ListCasesResponse", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client" - }, - "method": { - "short_name": "ListCases", - "full_name": "google.cloud.support.v2.CaseService.ListCases", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CaseService_SearchCases_sync", - "title": "Snippet for the search_cases call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#search_cases.", - "file": "case_service/search_cases.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_cases", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client#search_cases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::SearchCasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::SearchCasesResponse", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client" - }, - "method": { - "short_name": "SearchCases", - "full_name": "google.cloud.support.v2.CaseService.SearchCases", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CaseService_CreateCase_sync", - "title": "Snippet for the create_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#create_case.", - "file": "case_service/create_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_case", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client#create_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::CreateCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client" - }, - "method": { - "short_name": "CreateCase", - "full_name": "google.cloud.support.v2.CaseService.CreateCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CaseService_UpdateCase_sync", - "title": "Snippet for the update_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#update_case.", - "file": "case_service/update_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_case", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client#update_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::UpdateCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client" - }, - "method": { - "short_name": "UpdateCase", - "full_name": "google.cloud.support.v2.CaseService.UpdateCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CaseService_EscalateCase_sync", - "title": "Snippet for the escalate_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#escalate_case.", - "file": "case_service/escalate_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "escalate_case", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client#escalate_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::EscalateCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client" - }, - "method": { - "short_name": "EscalateCase", - "full_name": "google.cloud.support.v2.CaseService.EscalateCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CaseService_CloseCase_sync", - "title": "Snippet for the close_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#close_case.", - "file": "case_service/close_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "close_case", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client#close_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::CloseCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client" - }, - "method": { - "short_name": "CloseCase", - "full_name": "google.cloud.support.v2.CaseService.CloseCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CaseService_SearchCaseClassifications_sync", - "title": "Snippet for the search_case_classifications call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CaseService::Client#search_case_classifications.", - "file": "case_service/search_case_classifications.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_case_classifications", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client#search_case_classifications", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::SearchCaseClassificationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::SearchCaseClassificationsResponse", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2::CaseService::Client" - }, - "method": { - "short_name": "SearchCaseClassifications", - "full_name": "google.cloud.support.v2.CaseService.SearchCaseClassifications", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CommentService_ListComments_sync", - "title": "Snippet for the list_comments call in the CommentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CommentService::Client#list_comments.", - "file": "comment_service/list_comments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_comments", - "full_name": "::Google::Cloud::Support::V2::CommentService::Client#list_comments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::ListCommentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::ListCommentsResponse", - "client": { - "short_name": "CommentService::Client", - "full_name": "::Google::Cloud::Support::V2::CommentService::Client" - }, - "method": { - "short_name": "ListComments", - "full_name": "google.cloud.support.v2.CommentService.ListComments", - "service": { - "short_name": "CommentService", - "full_name": "google.cloud.support.v2.CommentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2_generated_CommentService_CreateComment_sync", - "title": "Snippet for the create_comment call in the CommentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2::CommentService::Client#create_comment.", - "file": "comment_service/create_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_comment", - "full_name": "::Google::Cloud::Support::V2::CommentService::Client#create_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2::CreateCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2::Comment", - "client": { - "short_name": "CommentService::Client", - "full_name": "::Google::Cloud::Support::V2::CommentService::Client" - }, - "method": { - "short_name": "CreateComment", - "full_name": "google.cloud.support.v2.CommentService.CreateComment", - "service": { - "short_name": "CommentService", - "full_name": "google.cloud.support.v2.CommentService" - } - } - }, - "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-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb deleted file mode 100644 index cd9ca5b77a48..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2/case_attachment_service" - -class ::Google::Cloud::Support::V2::CaseAttachmentService::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_case_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.case_path organization: "value0", case: "value1" - assert_equal "organizations/value0/cases/value1", path - - path = client.case_path project: "value0", case: "value1" - assert_equal "projects/value0/cases/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb deleted file mode 100644 index 440b94b3230a..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_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/cloud/support/v2/attachment_service_pb" -require "google/cloud/support/v2/case_attachment_service" - -class ::Google::Cloud::Support::V2::CaseAttachmentService::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_attachments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::ListAttachmentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_attachments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_attachments, name - assert_kind_of ::Google::Cloud::Support::V2::ListAttachmentsRequest, 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_attachments_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_attachments({ parent: parent, page_size: page_size, page_token: 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_attachments parent: parent, page_size: page_size, page_token: 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_attachments ::Google::Cloud::Support::V2::ListAttachmentsRequest.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_attachments({ parent: parent, page_size: page_size, page_token: page_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_attachments(::Google::Cloud::Support::V2::ListAttachmentsRequest.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_attachments_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2::CaseAttachmentService::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::Support::V2::CaseAttachmentService::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::Support::V2::CaseAttachmentService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Support::V2::CaseAttachmentService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb deleted file mode 100644 index 026b2a358c1c..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2/case_service" - -class ::Google::Cloud::Support::V2::CaseService::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_case_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.case_path organization: "value0", case: "value1" - assert_equal "organizations/value0/cases/value1", path - - path = client.case_path project: "value0", case: "value1" - assert_equal "projects/value0/cases/value1", path - end - end - - def test_organization_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_path organization: "value0" - assert_equal "organizations/value0", 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::Support::V2::CaseService::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-support-v2/test/google/cloud/support/v2/case_service_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb deleted file mode 100644 index 9535315ce943..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb +++ /dev/null @@ -1,605 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2/case_service_pb" -require "google/cloud/support/v2/case_service" - -class ::Google::Cloud::Support::V2::CaseService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_case, name - assert_kind_of ::Google::Cloud::Support::V2::GetCaseRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_case({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_case name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_case ::Google::Cloud::Support::V2::GetCaseRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_case({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_case(::Google::Cloud::Support::V2::GetCaseRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_case_client_stub.call_rpc_count - end - end - - def test_list_cases - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::ListCasesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_cases, name - assert_kind_of ::Google::Cloud::Support::V2::ListCasesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_cases_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_cases({ parent: parent, 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.list_cases parent: parent, 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.list_cases ::Google::Cloud::Support::V2::ListCasesRequest.new(parent: parent, 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.list_cases({ parent: parent, 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.list_cases(::Google::Cloud::Support::V2::ListCasesRequest.new(parent: parent, 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, list_cases_client_stub.call_rpc_count - end - end - - def test_search_cases - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::SearchCasesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_cases, name - assert_kind_of ::Google::Cloud::Support::V2::SearchCasesRequest, request - assert_equal "hello world", request["parent"] - 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_cases_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_cases({ parent: parent, 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_cases parent: parent, 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_cases ::Google::Cloud::Support::V2::SearchCasesRequest.new(parent: parent, 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_cases({ parent: parent, 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_cases(::Google::Cloud::Support::V2::SearchCasesRequest.new(parent: parent, 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_cases_client_stub.call_rpc_count - end - end - - def test_create_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - case_param = {} - - create_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_case, name - assert_kind_of ::Google::Cloud::Support::V2::CreateCaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2::Case), request["case"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_case({ parent: parent, case: case_param }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_case parent: parent, case: case_param do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_case ::Google::Cloud::Support::V2::CreateCaseRequest.new(parent: parent, case: case_param) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_case({ parent: parent, case: case_param }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_case(::Google::Cloud::Support::V2::CreateCaseRequest.new(parent: parent, case: case_param), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_case_client_stub.call_rpc_count - end - end - - def test_update_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - case_param = {} - update_mask = {} - - update_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_case, name - assert_kind_of ::Google::Cloud::Support::V2::UpdateCaseRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2::Case), request["case"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_case({ case: case_param, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_case case: case_param, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_case ::Google::Cloud::Support::V2::UpdateCaseRequest.new(case: case_param, 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_case({ case: case_param, 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_case(::Google::Cloud::Support::V2::UpdateCaseRequest.new(case: case_param, 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_case_client_stub.call_rpc_count - end - end - - def test_escalate_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - escalation = {} - - escalate_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :escalate_case, name - assert_kind_of ::Google::Cloud::Support::V2::EscalateCaseRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2::Escalation), request["escalation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, escalate_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.escalate_case({ name: name, escalation: escalation }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.escalate_case name: name, escalation: escalation do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.escalate_case ::Google::Cloud::Support::V2::EscalateCaseRequest.new(name: name, escalation: escalation) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.escalate_case({ name: name, escalation: escalation }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.escalate_case(::Google::Cloud::Support::V2::EscalateCaseRequest.new(name: name, escalation: escalation), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, escalate_case_client_stub.call_rpc_count - end - end - - def test_close_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - close_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :close_case, name - assert_kind_of ::Google::Cloud::Support::V2::CloseCaseRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, close_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.close_case({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.close_case name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.close_case ::Google::Cloud::Support::V2::CloseCaseRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.close_case({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.close_case(::Google::Cloud::Support::V2::CloseCaseRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, close_case_client_stub.call_rpc_count - end - end - - def test_search_case_classifications - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::SearchCaseClassificationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_case_classifications_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_case_classifications, name - assert_kind_of ::Google::Cloud::Support::V2::SearchCaseClassificationsRequest, request - 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_case_classifications_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_case_classifications({ 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_case_classifications 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_case_classifications ::Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new(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_case_classifications({ 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_case_classifications(::Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new(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_case_classifications_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2::CaseService::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::Support::V2::CaseService::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::Support::V2::CaseService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Support::V2::CaseService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb deleted file mode 100644 index 450f7d03ec69..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2/comment_service" - -class ::Google::Cloud::Support::V2::CommentService::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_case_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.case_path organization: "value0", case: "value1" - assert_equal "organizations/value0/cases/value1", path - - path = client.case_path project: "value0", case: "value1" - assert_equal "projects/value0/cases/value1", path - end - end - - def test_comment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.comment_path organization: "value0", case: "value1", comment: "value2" - assert_equal "organizations/value0/cases/value1/comments/value2", path - - path = client.comment_path project: "value0", case: "value1", comment: "value2" - assert_equal "projects/value0/cases/value1/comments/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb b/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb deleted file mode 100644 index 9be457b5eb11..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2/comment_service_pb" -require "google/cloud/support/v2/comment_service" - -class ::Google::Cloud::Support::V2::CommentService::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_comments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::ListCommentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_comments, name - assert_kind_of ::Google::Cloud::Support::V2::ListCommentsRequest, 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_comments_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_comments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_comments parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_comments ::Google::Cloud::Support::V2::ListCommentsRequest.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_comments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_comments(::Google::Cloud::Support::V2::ListCommentsRequest.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_comments_client_stub.call_rpc_count - end - end - - def test_create_comment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2::Comment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - comment = {} - - create_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_comment, name - assert_kind_of ::Google::Cloud::Support::V2::CreateCommentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2::Comment), request["comment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_comment_client_stub do - # Create client - client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_comment({ parent: parent, comment: comment }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_comment parent: parent, comment: comment do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_comment ::Google::Cloud::Support::V2::CreateCommentRequest.new(parent: parent, comment: comment) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_comment({ parent: parent, comment: comment }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_comment(::Google::Cloud::Support::V2::CreateCommentRequest.new(parent: parent, comment: comment), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_comment_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Support::V2::CommentService::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::Support::V2::CommentService::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::Support::V2::CommentService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Support::V2::CommentService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2/test/helper.rb b/owl-bot-staging/google-cloud-support-v2/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-support-v2/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-support-v2beta/.gitignore b/owl-bot-staging/google-cloud-support-v2beta/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/.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-support-v2beta/.repo-metadata.json b/owl-bot-staging/google-cloud-support-v2beta/.repo-metadata.json deleted file mode 100644 index 0f3f042ac11a..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "cloudsupport.googleapis.com", - "api_shortname": "cloudsupport", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest", - "distribution_name": "google-cloud-support-v2beta", - "is_cloud": true, - "language": "ruby", - "name": "cloudsupport", - "name_pretty": "Google Cloud Support V2BETA API", - "product_documentation": "https://cloud.google.com/support/docs/reference/support-api", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Manages Google Cloud technical support cases for Customer Care support offerings. Note that google-cloud-support-v2beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-support instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/support/docs/reference/support-api", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-support-v2beta/.rubocop.yml b/owl-bot-staging/google-cloud-support-v2beta/.rubocop.yml deleted file mode 100644 index d73c43a5cd40..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-support-v2beta.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-support-v2beta.rb" diff --git a/owl-bot-staging/google-cloud-support-v2beta/.toys.rb b/owl-bot-staging/google-cloud-support-v2beta/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/.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-support-v2beta/.yardopts b/owl-bot-staging/google-cloud-support-v2beta/.yardopts deleted file mode 100644 index 1fedee129067..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Google Cloud Support V2BETA 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-support-v2beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-support-v2beta/AUTHENTICATION.md deleted file mode 100644 index 770c4a0708c0..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-support-v2beta 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-support-v2beta 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/support/v2beta" - -client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/support/v2beta" - -::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::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-support-v2beta -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/support/v2beta" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::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-support-v2beta/CHANGELOG.md b/owl-bot-staging/google-cloud-support-v2beta/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-support-v2beta/Gemfile b/owl-bot-staging/google-cloud-support-v2beta/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-support-v2beta/LICENSE.md b/owl-bot-staging/google-cloud-support-v2beta/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/README.md b/owl-bot-staging/google-cloud-support-v2beta/README.md deleted file mode 100644 index 3df8b2fc0c45..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Google Cloud Support V2BETA API - -Manages Google Cloud technical support cases for Customer Care support offerings. - -Manages Google Cloud technical support cases for Customer Care support offerings. - -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 Support V2BETA API. Most users should consider using -the main client gem, -[google-cloud-support](https://rubygems.org/gems/google-cloud-support). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-support-v2beta -``` - -## 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/cloudsupport.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/support/v2beta" - -client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new -request = ::Google::Cloud::Support::V2beta::ListAttachmentsRequest.new # (request fields as keyword arguments...) -response = client.list_attachments request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/support/docs/reference/support-api) -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/support/v2beta" -require "logger" - -client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::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-support`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-support-v2beta`. -_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-support`. -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-support-v2beta`. - -### 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-support-v2beta/Rakefile b/owl-bot-staging/google-cloud-support-v2beta/Rakefile deleted file mode 100644 index 1b495941debf..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta 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/support/v2beta/case_attachment_service/credentials" - ::Google::Cloud::Support::V2beta::CaseAttachmentService::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-support-v2beta 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-support-v2beta 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-support-v2beta 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-support-v2beta gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-support-v2beta" - header "google-cloud-support-v2beta rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-support-v2beta yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-support-v2beta 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-support-v2beta 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-support-v2beta 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-support-v2beta/gapic_metadata.json b/owl-bot-staging/google-cloud-support-v2beta/gapic_metadata.json deleted file mode 100644 index f0433f8ac593..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/gapic_metadata.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.support.v2beta", - "libraryPackage": "::Google::Cloud::Support::V2beta", - "services": { - "CaseAttachmentService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client", - "rpcs": { - "ListAttachments": { - "methods": [ - "list_attachments" - ] - }, - "GetAttachment": { - "methods": [ - "get_attachment" - ] - } - } - } - } - }, - "CaseService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Support::V2beta::CaseService::Client", - "rpcs": { - "GetCase": { - "methods": [ - "get_case" - ] - }, - "ListCases": { - "methods": [ - "list_cases" - ] - }, - "SearchCases": { - "methods": [ - "search_cases" - ] - }, - "CreateCase": { - "methods": [ - "create_case" - ] - }, - "UpdateCase": { - "methods": [ - "update_case" - ] - }, - "EscalateCase": { - "methods": [ - "escalate_case" - ] - }, - "CloseCase": { - "methods": [ - "close_case" - ] - }, - "SearchCaseClassifications": { - "methods": [ - "search_case_classifications" - ] - } - } - } - } - }, - "CommentService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Support::V2beta::CommentService::Client", - "rpcs": { - "ListComments": { - "methods": [ - "list_comments" - ] - }, - "CreateComment": { - "methods": [ - "create_comment" - ] - }, - "GetComment": { - "methods": [ - "get_comment" - ] - } - } - } - } - }, - "FeedService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Support::V2beta::FeedService::Client", - "rpcs": { - "ShowFeed": { - "methods": [ - "show_feed" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support-v2beta/google-cloud-support-v2beta.gemspec b/owl-bot-staging/google-cloud-support-v2beta/google-cloud-support-v2beta.gemspec deleted file mode 100644 index ecf5b134ae69..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/google-cloud-support-v2beta.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/support/v2beta/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-support-v2beta" - gem.version = Google::Cloud::Support::V2beta::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Manages Google Cloud technical support cases for Customer Care support offerings. Note that google-cloud-support-v2beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-support instead. See the readme for more details." - gem.summary = "Manages Google Cloud technical support cases for Customer Care support offerings." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google-cloud-support-v2beta.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google-cloud-support-v2beta.rb deleted file mode 100644 index c57d878c0330..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google-cloud-support-v2beta.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/support/v2beta" diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta.rb deleted file mode 100644 index ee84d3390c47..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta.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/support/v2beta/case_attachment_service" -require "google/cloud/support/v2beta/case_service" -require "google/cloud/support/v2beta/comment_service" -require "google/cloud/support/v2beta/feed_service" -require "google/cloud/support/v2beta/version" - -module Google - module Cloud - module Support - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/support/v2beta" - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/support/v2beta" - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new - # - module V2beta - end - end - end -end - -helper_path = ::File.join __dir__, "v2beta", "_helpers.rb" -require "google/cloud/support/v2beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/actor_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/actor_pb.rb deleted file mode 100644 index fc1549e39390..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/actor_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/actor.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n\'google/cloud/support/v2beta/actor.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\"d\n\x05\x41\x63tor\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x11\n\x05\x65mail\x18\x02 \x01(\tB\x02\x18\x01\x12\x1b\n\x0egoogle_support\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12\x15\n\x08username\x18\x05 \x01(\tB\x03\xe0\x41\x03\x42\xc7\x01\n\x1f\x63om.google.cloud.support.v2betaB\nActorProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - Actor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Actor").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_pb.rb deleted file mode 100644 index 187e268326bf..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/attachment.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/support/v2beta/actor_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/support/v2beta/attachment.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x88\x03\n\nAttachment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x07\x63reator\x18\x03 \x01(\x0b\x32\".google.cloud.support.v2beta.ActorB\x03\xe0\x41\x03\x12\x10\n\x08\x66ilename\x18\x04 \x01(\t\x12\x16\n\tmime_type\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03:\xb0\x01\xea\x41\xac\x01\n&cloudsupport.googleapis.com/Attachment\x12\x45organizations/{organization}/cases/{case}/attachments/{attachment_id}\x12;projects/{project}/cases/{case}/attachments/{attachment_id}B\xcc\x01\n\x1f\x63om.google.cloud.support.v2betaB\x0f\x41ttachmentProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - Attachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Attachment").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_pb.rb deleted file mode 100644 index 25161e508ca8..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/attachment_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/support/v2beta/attachment_pb' - - -descriptor_data = "\n4google/cloud/support/v2beta/attachment_service.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/support/v2beta/attachment.proto\"y\n\x16ListAttachmentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"T\n\x14GetAttachmentRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&cloudsupport.googleapis.com/Attachment\"p\n\x17ListAttachmentsResponse\x12<\n\x0b\x61ttachments\x18\x01 \x03(\x0b\x32\'.google.cloud.support.v2beta.Attachment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x88\x04\n\x15\x43\x61seAttachmentService\x12\xf6\x01\n\x0fListAttachments\x12\x33.google.cloud.support.v2beta.ListAttachmentsRequest\x1a\x34.google.cloud.support.v2beta.ListAttachmentsResponse\"x\xda\x41\x06parent\x82\xd3\xe4\x93\x02i\x12//v2beta/{parent=projects/*/cases/*}/attachmentsZ6\x12\x34/v2beta/{parent=organizations/*/cases/*}/attachments\x12\xa4\x01\n\rGetAttachment\x12\x31.google.cloud.support.v2beta.GetAttachmentRequest\x1a\'.google.cloud.support.v2beta.Attachment\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v2beta/{name=*/*/cases/*/attachments/*}\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd3\x01\n\x1f\x63om.google.cloud.support.v2betaB\x16\x41ttachmentServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - ListAttachmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListAttachmentsRequest").msgclass - GetAttachmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.GetAttachmentRequest").msgclass - ListAttachmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListAttachmentsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb deleted file mode 100644 index e40538c6e912..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/support/v2beta/attachment_service.proto for package 'Google.Cloud.Support.V2beta' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/support/v2beta/attachment_service_pb' - -module Google - module Cloud - module Support - module V2beta - module CaseAttachmentService - # A service to manage file attachments for Google Cloud support cases. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.support.v2beta.CaseAttachmentService' - - # List all the attachments associated with a support case. - rpc :ListAttachments, ::Google::Cloud::Support::V2beta::ListAttachmentsRequest, ::Google::Cloud::Support::V2beta::ListAttachmentsResponse - # Retrieve an attachment. - rpc :GetAttachment, ::Google::Cloud::Support::V2beta::GetAttachmentRequest, ::Google::Cloud::Support::V2beta::Attachment - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service.rb deleted file mode 100644 index 0f8335bbffd4..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_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/support/v2beta/version" - -require "google/cloud/support/v2beta/case_attachment_service/credentials" -require "google/cloud/support/v2beta/case_attachment_service/paths" -require "google/cloud/support/v2beta/case_attachment_service/client" -require "google/cloud/support/v2beta/case_attachment_service/rest" - -module Google - module Cloud - module Support - module V2beta - ## - # A service to manage file attachments for Google Cloud support cases. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/support/v2beta/case_attachment_service" - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/support/v2beta/case_attachment_service/rest" - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new - # - module CaseAttachmentService - end - end - end - end -end - -helper_path = ::File.join __dir__, "case_attachment_service", "helpers.rb" -require "google/cloud/support/v2beta/case_attachment_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/client.rb deleted file mode 100644 index 6c1f17317bb3..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/support/v2beta/attachment_service_pb" - -module Google - module Cloud - module Support - module V2beta - module CaseAttachmentService - ## - # Client for the CaseAttachmentService service. - # - # A service to manage file attachments for Google Cloud support cases. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :case_attachment_service_stub - - ## - # Configure the CaseAttachmentService Client class. - # - # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CaseAttachmentService clients - # ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Support", "V2beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_attachments.timeout = 60.0 - default_config.rpcs.list_attachments.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 CaseAttachmentService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @case_attachment_service_stub.universe_domain - end - - ## - # Create a new CaseAttachmentService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CaseAttachmentService 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/support/v2beta/attachment_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 - - @case_attachment_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Support::V2beta::CaseAttachmentService::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 - ) - - @case_attachment_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 - @case_attachment_service_stub.logger - end - - # Service calls - - ## - # List all the attachments associated with a support case. - # - # @overload list_attachments(request, options = nil) - # Pass arguments to `list_attachments` via a request object, either of type - # {::Google::Cloud::Support::V2beta::ListAttachmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::ListAttachmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_attachments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_attachments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 case for which attachments should be listed. - # @param page_size [::Integer] - # The maximum number of attachments fetched with each request. - # - # If not provided, the default is 10. The maximum page size that will be - # returned is 100. - # - # The size of each page can be smaller than the requested page size and can - # include zero. For example, you could request 100 attachments on one page, - # receive 0, and then on the next page, receive 90. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::ListAttachmentsRequest.new - # - # # Call the list_attachments method. - # result = client.list_attachments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::Attachment. - # p item - # end - # - def list_attachments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListAttachmentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_attachments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_attachments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_attachments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_attachment_service_stub.call_rpc :list_attachments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @case_attachment_service_stub, :list_attachments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve an attachment. - # - # @overload get_attachment(request, options = nil) - # Pass arguments to `get_attachment` via a request object, either of type - # {::Google::Cloud::Support::V2beta::GetAttachmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::GetAttachmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_attachment(name: nil) - # Pass arguments to `get_attachment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 attachment to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2beta::Attachment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2beta::Attachment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::GetAttachmentRequest.new - # - # # Call the get_attachment method. - # result = client.get_attachment request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Attachment. - # p result - # - def get_attachment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetAttachmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_attachment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_attachment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_attachment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_attachment_service_stub.call_rpc :get_attachment, request, 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 CaseAttachmentService API. - # - # This class represents the configuration for CaseAttachmentService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2beta::CaseAttachmentService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_attachments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_attachments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_attachments.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Support::V2beta::CaseAttachmentService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CaseAttachmentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_attachments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_attachments - ## - # RPC-specific configuration for `get_attachment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_attachment - - # @private - def initialize parent_rpcs = nil - list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments - @list_attachments = ::Gapic::Config::Method.new list_attachments_config - get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment - @get_attachment = ::Gapic::Config::Method.new get_attachment_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/credentials.rb deleted file mode 100644 index 0987e86d29a9..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/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 Support - module V2beta - module CaseAttachmentService - # Credentials for the CaseAttachmentService 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-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/paths.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/paths.rb deleted file mode 100644 index 0b3f043eed9c..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/paths.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! - - -module Google - module Cloud - module Support - module V2beta - module CaseAttachmentService - # Path helper methods for the CaseAttachmentService API. - module Paths - ## - # Create a fully-qualified Attachment resource string. - # - # @overload attachment_path(organization:, case:, attachment_id:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}/attachments/{attachment_id}` - # - # @param organization [String] - # @param case [String] - # @param attachment_id [String] - # - # @overload attachment_path(project:, case:, attachment_id:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}/attachments/{attachment_id}` - # - # @param project [String] - # @param case [String] - # @param attachment_id [String] - # - # @return [::String] - def attachment_path **args - resources = { - "attachment_id:case:organization" => (proc do |organization:, case:, attachment_id:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}/attachments/#{attachment_id}" - end), - "attachment_id:case:project" => (proc do |project:, case:, attachment_id:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}/attachments/#{attachment_id}" - 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 Case resource string. - # - # @overload case_path(organization:, case:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}` - # - # @param organization [String] - # @param case [String] - # - # @overload case_path(project:, case:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}` - # - # @param project [String] - # @param case [String] - # - # @return [::String] - def case_path **args - resources = { - "case:organization" => (proc do |organization:, case:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}" - end), - "case:project" => (proc do |project:, case:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}" - 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-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest.rb deleted file mode 100644 index 78b37c71bd8b..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_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/support/v2beta/version" - -require "google/cloud/support/v2beta/case_attachment_service/credentials" -require "google/cloud/support/v2beta/case_attachment_service/paths" -require "google/cloud/support/v2beta/case_attachment_service/rest/client" - -module Google - module Cloud - module Support - module V2beta - ## - # A service to manage file attachments for Google Cloud support cases. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/support/v2beta/case_attachment_service/rest" - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new - # - module CaseAttachmentService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/support/v2beta/case_attachment_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb deleted file mode 100644 index 2da77557559d..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb +++ /dev/null @@ -1,532 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/support/v2beta/attachment_service_pb" -require "google/cloud/support/v2beta/case_attachment_service/rest/service_stub" - -module Google - module Cloud - module Support - module V2beta - module CaseAttachmentService - module Rest - ## - # REST client for the CaseAttachmentService service. - # - # A service to manage file attachments for Google Cloud support cases. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :case_attachment_service_stub - - ## - # Configure the CaseAttachmentService Client class. - # - # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CaseAttachmentService clients - # ::Google::Cloud::Support::V2beta::CaseAttachmentService::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", "Support", "V2beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_attachments.timeout = 60.0 - default_config.rpcs.list_attachments.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 CaseAttachmentService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::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 - @case_attachment_service_stub.universe_domain - end - - ## - # Create a new CaseAttachmentService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CaseAttachmentService 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 - - @case_attachment_service_stub = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @case_attachment_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 - @case_attachment_service_stub.logger - end - - # Service calls - - ## - # List all the attachments associated with a support case. - # - # @overload list_attachments(request, options = nil) - # Pass arguments to `list_attachments` via a request object, either of type - # {::Google::Cloud::Support::V2beta::ListAttachmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::ListAttachmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_attachments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_attachments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 case for which attachments should be listed. - # @param page_size [::Integer] - # The maximum number of attachments fetched with each request. - # - # If not provided, the default is 10. The maximum page size that will be - # returned is 100. - # - # The size of each page can be smaller than the requested page size and can - # include zero. For example, you could request 100 attachments on one page, - # receive 0, and then on the next page, receive 90. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::ListAttachmentsRequest.new - # - # # Call the list_attachments method. - # result = client.list_attachments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::Attachment. - # p item - # end - # - def list_attachments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListAttachmentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_attachments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_attachments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_attachments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_attachment_service_stub.list_attachments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @case_attachment_service_stub, :list_attachments, "attachments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve an attachment. - # - # @overload get_attachment(request, options = nil) - # Pass arguments to `get_attachment` via a request object, either of type - # {::Google::Cloud::Support::V2beta::GetAttachmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::GetAttachmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_attachment(name: nil) - # Pass arguments to `get_attachment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 attachment to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Attachment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Attachment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::GetAttachmentRequest.new - # - # # Call the get_attachment method. - # result = client.get_attachment request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Attachment. - # p result - # - def get_attachment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetAttachmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_attachment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_attachment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_attachment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_attachment_service_stub.get_attachment request, 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 CaseAttachmentService REST API. - # - # This class represents the configuration for CaseAttachmentService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_attachments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_attachments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_attachments.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CaseAttachmentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_attachments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_attachments - ## - # RPC-specific configuration for `get_attachment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_attachment - - # @private - def initialize parent_rpcs = nil - list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments - @list_attachments = ::Gapic::Config::Method.new list_attachments_config - get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment - @get_attachment = ::Gapic::Config::Method.new get_attachment_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb deleted file mode 100644 index 390917e1e045..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb +++ /dev/null @@ -1,210 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/support/v2beta/attachment_service_pb" - -module Google - module Cloud - module Support - module V2beta - module CaseAttachmentService - module Rest - ## - # REST service stub for the CaseAttachmentService 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_attachments REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::ListAttachmentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::ListAttachmentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::ListAttachmentsResponse] - # A result object deserialized from the server's reply - def list_attachments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_attachments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_attachments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::ListAttachmentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_attachment REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::GetAttachmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Attachment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Attachment] - # A result object deserialized from the server's reply - def get_attachment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_attachment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_attachment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::Attachment.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_attachments REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::ListAttachmentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_attachments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}/attachments", - matches: [ - ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}/attachments", - matches: [ - ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_attachment REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::GetAttachmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_attachment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{name}", - matches: [ - ["name", %r{^[^/]+/[^/]+/cases/[^/]+/attachments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_pb.rb deleted file mode 100644 index f3e615f1d303..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_pb.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/case.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/support/v2beta/actor_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n&google/cloud/support/v2beta/case.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf6\x06\n\x04\x43\x61se\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12G\n\x0e\x63lassification\x18\x04 \x01(\x0b\x32/.google.cloud.support.v2beta.CaseClassification\x12\x11\n\ttime_zone\x18\x08 \x01(\t\x12\"\n\x1asubscriber_email_addresses\x18\t \x03(\t\x12;\n\x05state\x18\x0c \x01(\x0e\x32\'.google.cloud.support.v2beta.Case.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\x07\x63reator\x18\x0f \x01(\x0b\x32\".google.cloud.support.v2beta.Actor\x12\x15\n\rcontact_email\x18# \x01(\t\x12\x11\n\tescalated\x18\x11 \x01(\x08\x12\x11\n\ttest_case\x18\x13 \x01(\x08\x12\x15\n\rlanguage_code\x18\x17 \x01(\t\x12<\n\x08priority\x18 \x01(\x0e\x32*.google.cloud.support.v2beta.Case.Priority\"\x7f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x1e\n\x1aIN_PROGRESS_GOOGLE_SUPPORT\x10\x02\x12\x13\n\x0f\x41\x43TION_REQUIRED\x10\x03\x12\x15\n\x11SOLUTION_PROVIDED\x10\x04\x12\n\n\x06\x43LOSED\x10\x05\"L\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x06\n\x02P0\x10\x01\x12\x06\n\x02P1\x10\x02\x12\x06\n\x02P2\x10\x03\x12\x06\n\x02P3\x10\x04\x12\x06\n\x02P4\x10\x05:q\xea\x41n\n cloudsupport.googleapis.com/Case\x12)organizations/{organization}/cases/{case}\x12\x1fprojects/{project}/cases/{case}\"m\n\x12\x43\x61seClassification\x12\n\n\x02id\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12\x35\n\x07product\x18\n \x01(\x0b\x32$.google.cloud.support.v2beta.Product\"I\n\x07Product\x12>\n\x0cproduct_line\x18\x01 \x01(\x0e\x32(.google.cloud.support.v2beta.ProductLine*N\n\x0bProductLine\x12\x1c\n\x18PRODUCT_LINE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGOOGLE_CLOUD\x10\x01\x12\x0f\n\x0bGOOGLE_MAPS\x10\x02\x42\xc6\x01\n\x1f\x63om.google.cloud.support.v2betaB\tCaseProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - Case = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Case").msgclass - Case::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Case.State").enummodule - Case::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Case.Priority").enummodule - CaseClassification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.CaseClassification").msgclass - Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Product").msgclass - ProductLine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ProductLine").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service.rb deleted file mode 100644 index 7d78746c547f..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_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/support/v2beta/version" - -require "google/cloud/support/v2beta/case_service/credentials" -require "google/cloud/support/v2beta/case_service/paths" -require "google/cloud/support/v2beta/case_service/client" -require "google/cloud/support/v2beta/case_service/rest" - -module Google - module Cloud - module Support - module V2beta - ## - # A service to manage Google Cloud support cases. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/support/v2beta/case_service" - # client = ::Google::Cloud::Support::V2beta::CaseService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/support/v2beta/case_service/rest" - # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - module CaseService - end - end - end - end -end - -helper_path = ::File.join __dir__, "case_service", "helpers.rb" -require "google/cloud/support/v2beta/case_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/client.rb deleted file mode 100644 index 9086f4923d07..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/client.rb +++ /dev/null @@ -1,1269 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/support/v2beta/case_service_pb" - -module Google - module Cloud - module Support - module V2beta - module CaseService - ## - # Client for the CaseService service. - # - # A service to manage Google Cloud support cases. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :case_service_stub - - ## - # Configure the CaseService Client class. - # - # See {::Google::Cloud::Support::V2beta::CaseService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CaseService clients - # ::Google::Cloud::Support::V2beta::CaseService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Support", "V2beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.get_case.timeout = 60.0 - default_config.rpcs.get_case.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_cases.timeout = 60.0 - default_config.rpcs.list_cases.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_cases.timeout = 60.0 - default_config.rpcs.search_cases.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_case.timeout = 60.0 - - default_config.rpcs.update_case.timeout = 60.0 - - default_config.rpcs.escalate_case.timeout = 60.0 - - default_config.rpcs.close_case.timeout = 60.0 - - default_config.rpcs.search_case_classifications.timeout = 60.0 - default_config.rpcs.search_case_classifications.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 CaseService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Support::V2beta::CaseService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @case_service_stub.universe_domain - end - - ## - # Create a new CaseService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Support::V2beta::CaseService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CaseService 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/support/v2beta/case_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 - - @case_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Support::V2beta::CaseService::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 - ) - - @case_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 - @case_service_stub.logger - end - - # Service calls - - ## - # Retrieve a case. - # - # @overload get_case(request, options = nil) - # Pass arguments to `get_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::GetCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::GetCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_case(name: nil) - # Pass arguments to `get_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The full name of a case to be retrieved. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::GetCaseRequest.new - # - # # Call the get_case method. - # result = client.get_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def get_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :get_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve all cases under a parent, but not its children. - # - # For example, listing cases under an organization only returns the cases - # that are directly parented by that organization. To retrieve cases - # under an organization and its projects, use `cases.search`. - # - # @overload list_cases(request, options = nil) - # Pass arguments to `list_cases` via a request object, either of type - # {::Google::Cloud::Support::V2beta::ListCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::ListCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_cases(parent: nil, filter: nil, page_size: nil, page_token: nil, product_line: nil) - # Pass arguments to `list_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 a parent to list cases under. - # @param filter [::String] - # An expression used to filter cases. - # - # If it's an empty string, then no filtering happens. Otherwise, the endpoint - # returns the cases that match the filter. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # EXAMPLES: - # - # - `state=CLOSED` - # - `state=OPEN AND creator.email="tester@example.com"` - # - `state=OPEN AND (priority=P0 OR priority=P1)` - # @param page_size [::Integer] - # The maximum number of cases fetched with each request. Defaults to 10. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # @param product_line [::Google::Cloud::Support::V2beta::ProductLine] - # The product line to request cases for. If unspecified, only - # Google Cloud cases will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::ListCasesRequest.new - # - # # Call the list_cases method. - # result = client.list_cases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::Case. - # p item - # end - # - def list_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCasesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_cases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :list_cases, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @case_service_stub, :list_cases, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Search for cases using a query. - # - # @overload search_cases(request, options = nil) - # Pass arguments to `search_cases` via a request object, either of type - # {::Google::Cloud::Support::V2beta::SearchCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::SearchCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cases(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # The name of the parent resource to search for cases under. - # @param query [::String] - # An expression used to filter cases. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `organization`: An organization name in the form - # `organizations/`. - # - `project`: A project name in the form `projects/`. - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # You must specify either `organization` or `project`. - # - # To search across `displayName`, `description`, and comments, use a global - # restriction with no keyword or operator. For example, `"my search"`. - # - # To search only cases updated after a certain date, use `update_time` - # restricted with that particular date, time, and timezone in ISO datetime - # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - # `update_time` only supports the greater than operator (`>`). - # - # Examples: - # - # - `organization="organizations/123456789"` - # - `project="projects/my-project-id"` - # - `project="projects/123456789"` - # - `organization="organizations/123456789" AND state=CLOSED` - # - `project="projects/my-project-id" AND creator.email="tester@example.com"` - # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - # @param page_size [::Integer] - # The maximum number of cases fetched with each request. The default page - # size is 10. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::SearchCasesRequest.new - # - # # Call the search_cases method. - # result = client.search_cases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::Case. - # p item - # end - # - def search_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::SearchCasesRequest - - # Converts hash and nil to 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_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_cases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :search_cases, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_cases, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new case and associate it with a parent. - # - # It must have the following fields set: `display_name`, `description`, - # `classification`, and `priority`. If you're just testing the API and don't - # want to route your case to an agent, set `testCase=true`. - # - # @overload create_case(request, options = nil) - # Pass arguments to `create_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::CreateCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::CreateCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_case(parent: nil, case: nil) - # Pass arguments to `create_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent under which the case should be created. - # @param case [::Google::Cloud::Support::V2beta::Case, ::Hash] - # Required. The case to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::CreateCaseRequest.new - # - # # Call the create_case method. - # result = client.create_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def create_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCaseRequest - - # Converts hash and nil to 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_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :create_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a case. Only some fields can be updated. - # - # @overload update_case(request, options = nil) - # Pass arguments to `update_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::UpdateCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::UpdateCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_case(case: nil, update_mask: nil) - # Pass arguments to `update_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param case [::Google::Cloud::Support::V2beta::Case, ::Hash] - # Required. The case to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A list of attributes of the case that should be updated. Supported values - # are `priority`, `display_name`, and `subscriber_email_addresses`. If no - # fields are specified, all supported fields are updated. - # - # Be careful - if you do not provide a field mask, then you might - # accidentally clear some fields. For example, if you leave the field mask - # empty and do not provide a value for `subscriber_email_addresses`, then - # `subscriber_email_addresses` is updated to empty. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::UpdateCaseRequest.new - # - # # Call the update_case method. - # result = client.update_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def update_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::UpdateCaseRequest - - # Converts hash and nil to 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_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.case&.name - header_params["case.name"] = request.case.name - end - - request_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_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :update_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Escalate a case, starting the Google Cloud Support escalation management - # process. - # - # This operation is only available for some support services. Go to - # https://cloud.google.com/support and look for 'Technical support - # escalations' in the feature list to find out which ones let you - # do that. - # - # @overload escalate_case(request, options = nil) - # Pass arguments to `escalate_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::EscalateCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::EscalateCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload escalate_case(name: nil, escalation: nil) - # Pass arguments to `escalate_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 case to be escalated. - # @param escalation [::Google::Cloud::Support::V2beta::Escalation, ::Hash] - # The escalation information to be sent with the escalation request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::EscalateCaseRequest.new - # - # # Call the escalate_case method. - # result = client.escalate_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def escalate_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::EscalateCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.escalate_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.escalate_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.escalate_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :escalate_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Close a case. - # - # @overload close_case(request, options = nil) - # Pass arguments to `close_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::CloseCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::CloseCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload close_case(name: nil) - # Pass arguments to `close_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 case to close. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::CloseCaseRequest.new - # - # # Call the close_case method. - # result = client.close_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def close_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CloseCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.close_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.close_case.timeout, - metadata: metadata, - retry_policy: @config.rpcs.close_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :close_case, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve valid classifications to use when creating a support case. - # - # Classifications are hierarchical. Each classification is a string - # containing all levels of the hierarchy separated by `" > "`. For example, - # `"Technical Issue > Compute > Compute Engine"`. - # - # Classification IDs returned by this endpoint are valid for at least six - # months. When a classification is deactivated, this endpoint immediately - # stops returning it. After six months, `case.create` requests using the - # classification will fail. - # - # @overload search_case_classifications(request, options = nil) - # Pass arguments to `search_case_classifications` via a request object, either of type - # {::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_case_classifications(query: nil, page_size: nil, page_token: nil, product: nil) - # Pass arguments to `search_case_classifications` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param query [::String] - # An expression used to filter case classifications. - # - # If it's an empty string, then no filtering happens. Otherwise, case - # classifications will be returned that match the filter. - # @param page_size [::Integer] - # The maximum number of classifications fetched with each request. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # @param product [::Google::Cloud::Support::V2beta::Product, ::Hash] - # Optional. The product to return case classifications for. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::CaseClassification>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::CaseClassification>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new - # - # # Call the search_case_classifications method. - # result = client.search_case_classifications request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::CaseClassification. - # p item - # end - # - def search_case_classifications request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest - - # Converts hash and nil to 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_case_classifications.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.search_case_classifications.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_case_classifications.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.call_rpc :search_case_classifications, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @case_service_stub, :search_case_classifications, request, response, 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 CaseService API. - # - # This class represents the configuration for CaseService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2beta::CaseService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_case to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2beta::CaseService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_case.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_case.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Support::V2beta::CaseService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CaseService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_case` - # @return [::Gapic::Config::Method] - # - attr_reader :get_case - ## - # RPC-specific configuration for `list_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_cases - ## - # RPC-specific configuration for `search_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :search_cases - ## - # RPC-specific configuration for `create_case` - # @return [::Gapic::Config::Method] - # - attr_reader :create_case - ## - # RPC-specific configuration for `update_case` - # @return [::Gapic::Config::Method] - # - attr_reader :update_case - ## - # RPC-specific configuration for `escalate_case` - # @return [::Gapic::Config::Method] - # - attr_reader :escalate_case - ## - # RPC-specific configuration for `close_case` - # @return [::Gapic::Config::Method] - # - attr_reader :close_case - ## - # RPC-specific configuration for `search_case_classifications` - # @return [::Gapic::Config::Method] - # - attr_reader :search_case_classifications - - # @private - def initialize parent_rpcs = nil - get_case_config = parent_rpcs.get_case if parent_rpcs.respond_to? :get_case - @get_case = ::Gapic::Config::Method.new get_case_config - list_cases_config = parent_rpcs.list_cases if parent_rpcs.respond_to? :list_cases - @list_cases = ::Gapic::Config::Method.new list_cases_config - search_cases_config = parent_rpcs.search_cases if parent_rpcs.respond_to? :search_cases - @search_cases = ::Gapic::Config::Method.new search_cases_config - create_case_config = parent_rpcs.create_case if parent_rpcs.respond_to? :create_case - @create_case = ::Gapic::Config::Method.new create_case_config - update_case_config = parent_rpcs.update_case if parent_rpcs.respond_to? :update_case - @update_case = ::Gapic::Config::Method.new update_case_config - escalate_case_config = parent_rpcs.escalate_case if parent_rpcs.respond_to? :escalate_case - @escalate_case = ::Gapic::Config::Method.new escalate_case_config - close_case_config = parent_rpcs.close_case if parent_rpcs.respond_to? :close_case - @close_case = ::Gapic::Config::Method.new close_case_config - search_case_classifications_config = parent_rpcs.search_case_classifications if parent_rpcs.respond_to? :search_case_classifications - @search_case_classifications = ::Gapic::Config::Method.new search_case_classifications_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/credentials.rb deleted file mode 100644 index b2075374e3a3..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/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 Support - module V2beta - module CaseService - # Credentials for the CaseService 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-support-v2beta/lib/google/cloud/support/v2beta/case_service/paths.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/paths.rb deleted file mode 100644 index c56e32fd9485..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/paths.rb +++ /dev/null @@ -1,100 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - module CaseService - # Path helper methods for the CaseService API. - module Paths - ## - # Create a fully-qualified Case resource string. - # - # @overload case_path(organization:, case:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}` - # - # @param organization [String] - # @param case [String] - # - # @overload case_path(project:, case:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}` - # - # @param project [String] - # @param case [String] - # - # @return [::String] - def case_path **args - resources = { - "case:organization" => (proc do |organization:, case:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}" - end), - "case:project" => (proc do |project:, case:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Organization resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}` - # - # @param organization [String] - # - # @return [::String] - def organization_path organization: - "organizations/#{organization}" - end - - ## - # Create a fully-qualified 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-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest.rb deleted file mode 100644 index f1beada166f8..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_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/support/v2beta/version" - -require "google/cloud/support/v2beta/case_service/credentials" -require "google/cloud/support/v2beta/case_service/paths" -require "google/cloud/support/v2beta/case_service/rest/client" - -module Google - module Cloud - module Support - module V2beta - ## - # A service to manage Google Cloud support cases. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/support/v2beta/case_service/rest" - # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - module CaseService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/support/v2beta/case_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/client.rb deleted file mode 100644 index 837123546be5..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/client.rb +++ /dev/null @@ -1,1178 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/support/v2beta/case_service_pb" -require "google/cloud/support/v2beta/case_service/rest/service_stub" - -module Google - module Cloud - module Support - module V2beta - module CaseService - module Rest - ## - # REST client for the CaseService service. - # - # A service to manage Google Cloud support cases. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :case_service_stub - - ## - # Configure the CaseService Client class. - # - # See {::Google::Cloud::Support::V2beta::CaseService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CaseService clients - # ::Google::Cloud::Support::V2beta::CaseService::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", "Support", "V2beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.get_case.timeout = 60.0 - default_config.rpcs.get_case.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_cases.timeout = 60.0 - default_config.rpcs.list_cases.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_cases.timeout = 60.0 - default_config.rpcs.search_cases.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_case.timeout = 60.0 - - default_config.rpcs.update_case.timeout = 60.0 - - default_config.rpcs.escalate_case.timeout = 60.0 - - default_config.rpcs.close_case.timeout = 60.0 - - default_config.rpcs.search_case_classifications.timeout = 60.0 - default_config.rpcs.search_case_classifications.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 CaseService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Support::V2beta::CaseService::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 - @case_service_stub.universe_domain - end - - ## - # Create a new CaseService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CaseService 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 - - @case_service_stub = ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @case_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 - @case_service_stub.logger - end - - # Service calls - - ## - # Retrieve a case. - # - # @overload get_case(request, options = nil) - # Pass arguments to `get_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::GetCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::GetCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_case(name: nil) - # Pass arguments to `get_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The full name of a case to be retrieved. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::GetCaseRequest.new - # - # # Call the get_case method. - # result = client.get_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def get_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_case.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.get_case request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve all cases under a parent, but not its children. - # - # For example, listing cases under an organization only returns the cases - # that are directly parented by that organization. To retrieve cases - # under an organization and its projects, use `cases.search`. - # - # @overload list_cases(request, options = nil) - # Pass arguments to `list_cases` via a request object, either of type - # {::Google::Cloud::Support::V2beta::ListCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::ListCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_cases(parent: nil, filter: nil, page_size: nil, page_token: nil, product_line: nil) - # Pass arguments to `list_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 a parent to list cases under. - # @param filter [::String] - # An expression used to filter cases. - # - # If it's an empty string, then no filtering happens. Otherwise, the endpoint - # returns the cases that match the filter. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # EXAMPLES: - # - # - `state=CLOSED` - # - `state=OPEN AND creator.email="tester@example.com"` - # - `state=OPEN AND (priority=P0 OR priority=P1)` - # @param page_size [::Integer] - # The maximum number of cases fetched with each request. Defaults to 10. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # @param product_line [::Google::Cloud::Support::V2beta::ProductLine] - # The product line to request cases for. If unspecified, only - # Google Cloud cases will be returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::ListCasesRequest.new - # - # # Call the list_cases method. - # result = client.list_cases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::Case. - # p item - # end - # - def list_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCasesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_cases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.list_cases request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @case_service_stub, :list_cases, "cases", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Search for cases using a query. - # - # @overload search_cases(request, options = nil) - # Pass arguments to `search_cases` via a request object, either of type - # {::Google::Cloud::Support::V2beta::SearchCasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::SearchCasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cases(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_cases` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # The name of the parent resource to search for cases under. - # @param query [::String] - # An expression used to filter cases. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `organization`: An organization name in the form - # `organizations/`. - # - `project`: A project name in the form `projects/`. - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # You must specify either `organization` or `project`. - # - # To search across `displayName`, `description`, and comments, use a global - # restriction with no keyword or operator. For example, `"my search"`. - # - # To search only cases updated after a certain date, use `update_time` - # restricted with that particular date, time, and timezone in ISO datetime - # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - # `update_time` only supports the greater than operator (`>`). - # - # Examples: - # - # - `organization="organizations/123456789"` - # - `project="projects/my-project-id"` - # - `project="projects/123456789"` - # - `organization="organizations/123456789" AND state=CLOSED` - # - `project="projects/my-project-id" AND creator.email="tester@example.com"` - # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - # @param page_size [::Integer] - # The maximum number of cases fetched with each request. The default page - # size is 10. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Case>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::SearchCasesRequest.new - # - # # Call the search_cases method. - # result = client.search_cases request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::Case. - # p item - # end - # - def search_cases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::SearchCasesRequest - - # Converts hash and nil to an 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_cases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_cases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_cases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.search_cases request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @case_service_stub, :search_cases, "cases", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Create a new case and associate it with a parent. - # - # It must have the following fields set: `display_name`, `description`, - # `classification`, and `priority`. If you're just testing the API and don't - # want to route your case to an agent, set `testCase=true`. - # - # @overload create_case(request, options = nil) - # Pass arguments to `create_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::CreateCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::CreateCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_case(parent: nil, case: nil) - # Pass arguments to `create_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent under which the case should be created. - # @param case [::Google::Cloud::Support::V2beta::Case, ::Hash] - # Required. The case to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::CreateCaseRequest.new - # - # # Call the create_case method. - # result = client.create_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def create_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCaseRequest - - # Converts hash and nil to an 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_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_case.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.create_case request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update a case. Only some fields can be updated. - # - # @overload update_case(request, options = nil) - # Pass arguments to `update_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::UpdateCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::UpdateCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_case(case: nil, update_mask: nil) - # Pass arguments to `update_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param case [::Google::Cloud::Support::V2beta::Case, ::Hash] - # Required. The case to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A list of attributes of the case that should be updated. Supported values - # are `priority`, `display_name`, and `subscriber_email_addresses`. If no - # fields are specified, all supported fields are updated. - # - # Be careful - if you do not provide a field mask, then you might - # accidentally clear some fields. For example, if you leave the field mask - # empty and do not provide a value for `subscriber_email_addresses`, then - # `subscriber_email_addresses` is updated to empty. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::UpdateCaseRequest.new - # - # # Call the update_case method. - # result = client.update_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def update_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::UpdateCaseRequest - - # Converts hash and nil to an 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_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_case.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.update_case request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Escalate a case, starting the Google Cloud Support escalation management - # process. - # - # This operation is only available for some support services. Go to - # https://cloud.google.com/support and look for 'Technical support - # escalations' in the feature list to find out which ones let you - # do that. - # - # @overload escalate_case(request, options = nil) - # Pass arguments to `escalate_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::EscalateCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::EscalateCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload escalate_case(name: nil, escalation: nil) - # Pass arguments to `escalate_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 case to be escalated. - # @param escalation [::Google::Cloud::Support::V2beta::Escalation, ::Hash] - # The escalation information to be sent with the escalation request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::EscalateCaseRequest.new - # - # # Call the escalate_case method. - # result = client.escalate_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def escalate_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::EscalateCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.escalate_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.escalate_case.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.escalate_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.escalate_case request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Close a case. - # - # @overload close_case(request, options = nil) - # Pass arguments to `close_case` via a request object, either of type - # {::Google::Cloud::Support::V2beta::CloseCaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::CloseCaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload close_case(name: nil) - # Pass arguments to `close_case` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 case to close. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::CloseCaseRequest.new - # - # # Call the close_case method. - # result = client.close_case request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Case. - # p result - # - def close_case request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CloseCaseRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.close_case.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.close_case.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.close_case.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.close_case request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve valid classifications to use when creating a support case. - # - # Classifications are hierarchical. Each classification is a string - # containing all levels of the hierarchy separated by `" > "`. For example, - # `"Technical Issue > Compute > Compute Engine"`. - # - # Classification IDs returned by this endpoint are valid for at least six - # months. When a classification is deactivated, this endpoint immediately - # stops returning it. After six months, `case.create` requests using the - # classification will fail. - # - # @overload search_case_classifications(request, options = nil) - # Pass arguments to `search_case_classifications` via a request object, either of type - # {::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_case_classifications(query: nil, page_size: nil, page_token: nil, product: nil) - # Pass arguments to `search_case_classifications` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param query [::String] - # An expression used to filter case classifications. - # - # If it's an empty string, then no filtering happens. Otherwise, case - # classifications will be returned that match the filter. - # @param page_size [::Integer] - # The maximum number of classifications fetched with each request. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # @param product [::Google::Cloud::Support::V2beta::Product, ::Hash] - # Optional. The product to return case classifications for. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::CaseClassification>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::CaseClassification>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CaseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new - # - # # Call the search_case_classifications method. - # result = client.search_case_classifications request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::CaseClassification. - # p item - # end - # - def search_case_classifications request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest - - # Converts hash and nil to an 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_case_classifications.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_case_classifications.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_case_classifications.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @case_service_stub.search_case_classifications request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @case_service_stub, :search_case_classifications, "case_classifications", request, result, 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 CaseService REST API. - # - # This class represents the configuration for CaseService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2beta::CaseService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_case to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_case.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_case.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CaseService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_case` - # @return [::Gapic::Config::Method] - # - attr_reader :get_case - ## - # RPC-specific configuration for `list_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_cases - ## - # RPC-specific configuration for `search_cases` - # @return [::Gapic::Config::Method] - # - attr_reader :search_cases - ## - # RPC-specific configuration for `create_case` - # @return [::Gapic::Config::Method] - # - attr_reader :create_case - ## - # RPC-specific configuration for `update_case` - # @return [::Gapic::Config::Method] - # - attr_reader :update_case - ## - # RPC-specific configuration for `escalate_case` - # @return [::Gapic::Config::Method] - # - attr_reader :escalate_case - ## - # RPC-specific configuration for `close_case` - # @return [::Gapic::Config::Method] - # - attr_reader :close_case - ## - # RPC-specific configuration for `search_case_classifications` - # @return [::Gapic::Config::Method] - # - attr_reader :search_case_classifications - - # @private - def initialize parent_rpcs = nil - get_case_config = parent_rpcs.get_case if parent_rpcs.respond_to? :get_case - @get_case = ::Gapic::Config::Method.new get_case_config - list_cases_config = parent_rpcs.list_cases if parent_rpcs.respond_to? :list_cases - @list_cases = ::Gapic::Config::Method.new list_cases_config - search_cases_config = parent_rpcs.search_cases if parent_rpcs.respond_to? :search_cases - @search_cases = ::Gapic::Config::Method.new search_cases_config - create_case_config = parent_rpcs.create_case if parent_rpcs.respond_to? :create_case - @create_case = ::Gapic::Config::Method.new create_case_config - update_case_config = parent_rpcs.update_case if parent_rpcs.respond_to? :update_case - @update_case = ::Gapic::Config::Method.new update_case_config - escalate_case_config = parent_rpcs.escalate_case if parent_rpcs.respond_to? :escalate_case - @escalate_case = ::Gapic::Config::Method.new escalate_case_config - close_case_config = parent_rpcs.close_case if parent_rpcs.respond_to? :close_case - @close_case = ::Gapic::Config::Method.new close_case_config - search_case_classifications_config = parent_rpcs.search_case_classifications if parent_rpcs.respond_to? :search_case_classifications - @search_case_classifications = ::Gapic::Config::Method.new search_case_classifications_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb deleted file mode 100644 index 92b4270ff509..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb +++ /dev/null @@ -1,624 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/support/v2beta/case_service_pb" - -module Google - module Cloud - module Support - module V2beta - module CaseService - module Rest - ## - # REST service stub for the CaseService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::GetCaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # A result object deserialized from the server's reply - def get_case request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_case_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_case", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::Case.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_cases REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::ListCasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::ListCasesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::ListCasesResponse] - # A result object deserialized from the server's reply - def list_cases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_cases_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_cases", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::ListCasesResponse.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_cases REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::SearchCasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::SearchCasesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::SearchCasesResponse] - # A result object deserialized from the server's reply - def search_cases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_cases_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_cases", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::SearchCasesResponse.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_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::CreateCaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # A result object deserialized from the server's reply - def create_case request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_case_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_case", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::Case.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_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::UpdateCaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # A result object deserialized from the server's reply - def update_case request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_case_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_case", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::Case.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the escalate_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::EscalateCaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # A result object deserialized from the server's reply - def escalate_case request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_escalate_case_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "escalate_case", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::Case.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the close_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::CloseCaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Case] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Case] - # A result object deserialized from the server's reply - def close_case request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_close_case_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "close_case", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::Case.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_case_classifications REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse] - # A result object deserialized from the server's reply - def search_case_classifications request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_case_classifications_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_case_classifications", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::GetCaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_case_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/cases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_cases REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::ListCasesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_cases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}/cases", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}/cases", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_cases REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::SearchCasesRequest] - # 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_cases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}/cases:search", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}/cases:search", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::CreateCaseRequest] - # 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_case_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta/{parent}/cases", - body: "case", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2beta/{parent}/cases", - body: "case", - matches: [ - ["parent", %r{^organizations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::UpdateCaseRequest] - # 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_case_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2beta/{case.name}", - body: "case", - matches: [ - ["case.name", %r{^projects/[^/]+/cases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2beta/{case.name}", - body: "case", - matches: [ - ["case.name", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the escalate_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::EscalateCaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_escalate_case_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta/{name}:escalate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/cases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2beta/{name}:escalate", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the close_case REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::CloseCaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_close_case_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta/{name}:close", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/cases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2beta/{name}:close", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_case_classifications REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest] - # 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_case_classifications_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/caseClassifications:search", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_pb.rb deleted file mode 100644 index a3fc1c8be09f..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_pb.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/case_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/support/v2beta/case_pb' -require 'google/cloud/support/v2beta/escalation_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n.google/cloud/support/v2beta/case_service.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/support/v2beta/case.proto\x1a,google/cloud/support/v2beta/escalation.proto\x1a google/protobuf/field_mask.proto\"H\n\x0eGetCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\"\x83\x01\n\x11\x43reateCaseRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 cloudsupport.googleapis.com/Case\x12\x34\n\x04\x63\x61se\x18\x02 \x01(\x0b\x32!.google.cloud.support.v2beta.CaseB\x03\xe0\x41\x02\"\xd9\x01\n\x10ListCasesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 cloudsupport.googleapis.com/Case\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\x12\x43\n\x0cproduct_line\x18\x08 \x01(\x0e\x32(.google.cloud.support.v2beta.ProductLineH\x00\x88\x01\x01\x42\x0f\n\r_product_line\"^\n\x11ListCasesResponse\x12\x30\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32!.google.cloud.support.v2beta.Case\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Z\n\x12SearchCasesRequest\x12\x0e\n\x06parent\x18\x04 \x01(\t\x12\r\n\x05query\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"`\n\x13SearchCasesResponse\x12\x30\n\x05\x63\x61ses\x18\x01 \x03(\x0b\x32!.google.cloud.support.v2beta.Case\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8a\x01\n\x13\x45scalateCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12;\n\nescalation\x18\x02 \x01(\x0b\x32\'.google.cloud.support.v2beta.Escalation\"z\n\x11UpdateCaseRequest\x12\x34\n\x04\x63\x61se\x18\x01 \x01(\x0b\x32!.google.cloud.support.v2beta.CaseB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"J\n\x10\x43loseCaseRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\"\x94\x01\n SearchCaseClassificationsRequest\x12\r\n\x05query\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12:\n\x07product\x18\x07 \x01(\x0b\x32$.google.cloud.support.v2beta.ProductB\x03\xe0\x41\x01\"\x8b\x01\n!SearchCaseClassificationsResponse\x12M\n\x14\x63\x61se_classifications\x18\x01 \x03(\x0b\x32/.google.cloud.support.v2beta.CaseClassification\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xcb\r\n\x0b\x43\x61seService\x12\xb5\x01\n\x07GetCase\x12+.google.cloud.support.v2beta.GetCaseRequest\x1a!.google.cloud.support.v2beta.Case\"Z\xda\x41\x04name\x82\xd3\xe4\x93\x02M\x12!/v2beta/{name=projects/*/cases/*}Z(\x12&/v2beta/{name=organizations/*/cases/*}\x12\xc8\x01\n\tListCases\x12-.google.cloud.support.v2beta.ListCasesRequest\x1a..google.cloud.support.v2beta.ListCasesResponse\"\\\xda\x41\x06parent\x82\xd3\xe4\x93\x02M\x12!/v2beta/{parent=projects/*}/casesZ(\x12&/v2beta/{parent=organizations/*}/cases\x12\xd3\x01\n\x0bSearchCases\x12/.google.cloud.support.v2beta.SearchCasesRequest\x1a\x30.google.cloud.support.v2beta.SearchCasesResponse\"a\x82\xd3\xe4\x93\x02[\x12(/v2beta/{parent=projects/*}/cases:searchZ/\x12-/v2beta/{parent=organizations/*}/cases:search\x12\xce\x01\n\nCreateCase\x12..google.cloud.support.v2beta.CreateCaseRequest\x1a!.google.cloud.support.v2beta.Case\"m\xda\x41\x0bparent,case\x82\xd3\xe4\x93\x02Y\"!/v2beta/{parent=projects/*}/cases:\x04\x63\x61seZ.\"&/v2beta/{parent=organizations/*}/cases:\x04\x63\x61se\x12\xdd\x01\n\nUpdateCase\x12..google.cloud.support.v2beta.UpdateCaseRequest\x1a!.google.cloud.support.v2beta.Case\"|\xda\x41\x10\x63\x61se,update_mask\x82\xd3\xe4\x93\x02\x63\x32&/v2beta/{case.name=projects/*/cases/*}:\x04\x63\x61seZ32+/v2beta/{case.name=organizations/*/cases/*}:\x04\x63\x61se\x12\xd0\x01\n\x0c\x45scalateCase\x12\x30.google.cloud.support.v2beta.EscalateCaseRequest\x1a!.google.cloud.support.v2beta.Case\"k\x82\xd3\xe4\x93\x02\x65\"*/v2beta/{name=projects/*/cases/*}:escalate:\x01*Z4\"//v2beta/{name=organizations/*/cases/*}:escalate:\x01*\x12\xc4\x01\n\tCloseCase\x12-.google.cloud.support.v2beta.CloseCaseRequest\x1a!.google.cloud.support.v2beta.Case\"e\x82\xd3\xe4\x93\x02_\"\'/v2beta/{name=projects/*/cases/*}:close:\x01*Z1\",/v2beta/{name=organizations/*/cases/*}:close:\x01*\x12\xc6\x01\n\x19SearchCaseClassifications\x12=.google.cloud.support.v2beta.SearchCaseClassificationsRequest\x1a>.google.cloud.support.v2beta.SearchCaseClassificationsResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v2beta/caseClassifications:search\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcd\x01\n\x1f\x63om.google.cloud.support.v2betaB\x10\x43\x61seServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - GetCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.GetCaseRequest").msgclass - CreateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.CreateCaseRequest").msgclass - ListCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListCasesRequest").msgclass - ListCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListCasesResponse").msgclass - SearchCasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.SearchCasesRequest").msgclass - SearchCasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.SearchCasesResponse").msgclass - EscalateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.EscalateCaseRequest").msgclass - UpdateCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.UpdateCaseRequest").msgclass - CloseCaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.CloseCaseRequest").msgclass - SearchCaseClassificationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.SearchCaseClassificationsRequest").msgclass - SearchCaseClassificationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.SearchCaseClassificationsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_services_pb.rb deleted file mode 100644 index 9fa9f81f611b..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/case_service_services_pb.rb +++ /dev/null @@ -1,82 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/support/v2beta/case_service.proto for package 'Google.Cloud.Support.V2beta' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/support/v2beta/case_service_pb' - -module Google - module Cloud - module Support - module V2beta - module CaseService - # A service to manage Google Cloud support cases. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.support.v2beta.CaseService' - - # Retrieve a case. - rpc :GetCase, ::Google::Cloud::Support::V2beta::GetCaseRequest, ::Google::Cloud::Support::V2beta::Case - # Retrieve all cases under a parent, but not its children. - # - # For example, listing cases under an organization only returns the cases - # that are directly parented by that organization. To retrieve cases - # under an organization and its projects, use `cases.search`. - rpc :ListCases, ::Google::Cloud::Support::V2beta::ListCasesRequest, ::Google::Cloud::Support::V2beta::ListCasesResponse - # Search for cases using a query. - rpc :SearchCases, ::Google::Cloud::Support::V2beta::SearchCasesRequest, ::Google::Cloud::Support::V2beta::SearchCasesResponse - # Create a new case and associate it with a parent. - # - # It must have the following fields set: `display_name`, `description`, - # `classification`, and `priority`. If you're just testing the API and don't - # want to route your case to an agent, set `testCase=true`. - rpc :CreateCase, ::Google::Cloud::Support::V2beta::CreateCaseRequest, ::Google::Cloud::Support::V2beta::Case - # Update a case. Only some fields can be updated. - rpc :UpdateCase, ::Google::Cloud::Support::V2beta::UpdateCaseRequest, ::Google::Cloud::Support::V2beta::Case - # Escalate a case, starting the Google Cloud Support escalation management - # process. - # - # This operation is only available for some support services. Go to - # https://cloud.google.com/support and look for 'Technical support - # escalations' in the feature list to find out which ones let you - # do that. - rpc :EscalateCase, ::Google::Cloud::Support::V2beta::EscalateCaseRequest, ::Google::Cloud::Support::V2beta::Case - # Close a case. - rpc :CloseCase, ::Google::Cloud::Support::V2beta::CloseCaseRequest, ::Google::Cloud::Support::V2beta::Case - # Retrieve valid classifications to use when creating a support case. - # - # Classifications are hierarchical. Each classification is a string - # containing all levels of the hierarchy separated by `" > "`. For example, - # `"Technical Issue > Compute > Compute Engine"`. - # - # Classification IDs returned by this endpoint are valid for at least six - # months. When a classification is deactivated, this endpoint immediately - # stops returning it. After six months, `case.create` requests using the - # classification will fail. - rpc :SearchCaseClassifications, ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest, ::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_pb.rb deleted file mode 100644 index 82890699705e..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/comment.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/support/v2beta/actor_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n)google/cloud/support/v2beta/comment.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdb\x02\n\x07\x43omment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x07\x63reator\x18\x03 \x01(\x0b\x32\".google.cloud.support.v2beta.ActorB\x03\xe0\x41\x03\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\x1e\n\x0fplain_text_body\x18\x05 \x01(\tB\x05\x18\x01\xe0\x41\x03:\x9b\x01\xea\x41\x97\x01\n#cloudsupport.googleapis.com/Comment\x12] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CommentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::ListCommentsRequest.new - # - # # Call the list_comments method. - # result = client.list_comments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::Comment. - # p item - # end - # - def list_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCommentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_comments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_comments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @comment_service_stub.call_rpc :list_comments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @comment_service_stub, :list_comments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Add a new comment to a case. - # - # The comment must have the following fields set: `body`. - # - # @overload create_comment(request, options = nil) - # Pass arguments to `create_comment` via a request object, either of type - # {::Google::Cloud::Support::V2beta::CreateCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::CreateCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_comment(parent: nil, comment: nil) - # Pass arguments to `create_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the case to which the comment should be added. - # @param comment [::Google::Cloud::Support::V2beta::Comment, ::Hash] - # Required. The comment to be added. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2beta::Comment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2beta::Comment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CommentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::CreateCommentRequest.new - # - # # Call the create_comment method. - # result = client.create_comment request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Comment. - # p result - # - def create_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCommentRequest - - # Converts hash and nil to 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_comment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @comment_service_stub.call_rpc :create_comment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve a comment. - # - # @overload get_comment(request, options = nil) - # Pass arguments to `get_comment` via a request object, either of type - # {::Google::Cloud::Support::V2beta::GetCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::GetCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_comment(name: nil) - # Pass arguments to `get_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the comment to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Support::V2beta::Comment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Support::V2beta::Comment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CommentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::GetCommentRequest.new - # - # # Call the get_comment method. - # result = client.get_comment request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Comment. - # p result - # - def get_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetCommentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_comment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_comment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @comment_service_stub.call_rpc :get_comment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CommentService API. - # - # This class represents the configuration for CommentService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2beta::CommentService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_comments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2beta::CommentService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_comments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_comments.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Support::V2beta::CommentService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CommentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_comments - ## - # RPC-specific configuration for `create_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_comment - ## - # RPC-specific configuration for `get_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_comment - - # @private - def initialize parent_rpcs = nil - list_comments_config = parent_rpcs.list_comments if parent_rpcs.respond_to? :list_comments - @list_comments = ::Gapic::Config::Method.new list_comments_config - create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment - @create_comment = ::Gapic::Config::Method.new create_comment_config - get_comment_config = parent_rpcs.get_comment if parent_rpcs.respond_to? :get_comment - @get_comment = ::Gapic::Config::Method.new get_comment_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/credentials.rb deleted file mode 100644 index 31a79f1800d0..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/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 Support - module V2beta - module CommentService - # Credentials for the CommentService 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-support-v2beta/lib/google/cloud/support/v2beta/comment_service/paths.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/paths.rb deleted file mode 100644 index f82bc4f11f8c..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/paths.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! - - -module Google - module Cloud - module Support - module V2beta - module CommentService - # Path helper methods for the CommentService API. - module Paths - ## - # Create a fully-qualified Case resource string. - # - # @overload case_path(organization:, case:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}` - # - # @param organization [String] - # @param case [String] - # - # @overload case_path(project:, case:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}` - # - # @param project [String] - # @param case [String] - # - # @return [::String] - def case_path **args - resources = { - "case:organization" => (proc do |organization:, case:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}" - end), - "case:project" => (proc do |project:, case:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}" - 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 Comment resource string. - # - # @overload comment_path(organization:, case:, comment:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}/comments/{comment}` - # - # @param organization [String] - # @param case [String] - # @param comment [String] - # - # @overload comment_path(project:, case:, comment:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}/comments/{comment}` - # - # @param project [String] - # @param case [String] - # @param comment [String] - # - # @return [::String] - def comment_path **args - resources = { - "case:comment:organization" => (proc do |organization:, case:, comment:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}/comments/#{comment}" - end), - "case:comment:project" => (proc do |project:, case:, comment:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}/comments/#{comment}" - 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-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest.rb deleted file mode 100644 index 15455343c273..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_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/support/v2beta/version" - -require "google/cloud/support/v2beta/comment_service/credentials" -require "google/cloud/support/v2beta/comment_service/paths" -require "google/cloud/support/v2beta/comment_service/rest/client" - -module Google - module Cloud - module Support - module V2beta - ## - # A service to manage comments on cases. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/support/v2beta/comment_service/rest" - # client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new - # - module CommentService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/support/v2beta/comment_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/client.rb deleted file mode 100644 index 7bf24d29d1a0..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/client.rb +++ /dev/null @@ -1,616 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/support/v2beta/comment_service_pb" -require "google/cloud/support/v2beta/comment_service/rest/service_stub" - -module Google - module Cloud - module Support - module V2beta - module CommentService - module Rest - ## - # REST client for the CommentService service. - # - # A service to manage comments on cases. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :comment_service_stub - - ## - # Configure the CommentService Client class. - # - # See {::Google::Cloud::Support::V2beta::CommentService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CommentService clients - # ::Google::Cloud::Support::V2beta::CommentService::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", "Support", "V2beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_comments.timeout = 60.0 - default_config.rpcs.list_comments.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_comment.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CommentService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Support::V2beta::CommentService::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 - @comment_service_stub.universe_domain - end - - ## - # Create a new CommentService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CommentService 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 - - @comment_service_stub = ::Google::Cloud::Support::V2beta::CommentService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @comment_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 - @comment_service_stub.logger - end - - # Service calls - - ## - # List all the comments associated with a case. - # - # @overload list_comments(request, options = nil) - # Pass arguments to `list_comments` via a request object, either of type - # {::Google::Cloud::Support::V2beta::ListCommentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::ListCommentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_comments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_comments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the case for which to list comments. - # @param page_size [::Integer] - # The maximum number of comments to fetch. Defaults to 10. - # @param page_token [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CommentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::ListCommentsRequest.new - # - # # Call the list_comments method. - # result = client.list_comments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::Comment. - # p item - # end - # - def list_comments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListCommentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_comments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_comments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_comments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @comment_service_stub.list_comments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @comment_service_stub, :list_comments, "comments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Add a new comment to a case. - # - # The comment must have the following fields set: `body`. - # - # @overload create_comment(request, options = nil) - # Pass arguments to `create_comment` via a request object, either of type - # {::Google::Cloud::Support::V2beta::CreateCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::CreateCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_comment(parent: nil, comment: nil) - # Pass arguments to `create_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the case to which the comment should be added. - # @param comment [::Google::Cloud::Support::V2beta::Comment, ::Hash] - # Required. The comment to be added. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Comment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Comment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CommentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::CreateCommentRequest.new - # - # # Call the create_comment method. - # result = client.create_comment request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Comment. - # p result - # - def create_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::CreateCommentRequest - - # Converts hash and nil to an 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_comment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @comment_service_stub.create_comment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieve a comment. - # - # @overload get_comment(request, options = nil) - # Pass arguments to `get_comment` via a request object, either of type - # {::Google::Cloud::Support::V2beta::GetCommentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::GetCommentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_comment(name: nil) - # Pass arguments to `get_comment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the comment to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Comment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Comment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::CommentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::GetCommentRequest.new - # - # # Call the get_comment method. - # result = client.get_comment request - # - # # The returned object is of type Google::Cloud::Support::V2beta::Comment. - # p result - # - def get_comment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetCommentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_comment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_comment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_comment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @comment_service_stub.get_comment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CommentService REST API. - # - # This class represents the configuration for CommentService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2beta::CommentService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_comments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_comments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_comments.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CommentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_comments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_comments - ## - # RPC-specific configuration for `create_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_comment - ## - # RPC-specific configuration for `get_comment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_comment - - # @private - def initialize parent_rpcs = nil - list_comments_config = parent_rpcs.list_comments if parent_rpcs.respond_to? :list_comments - @list_comments = ::Gapic::Config::Method.new list_comments_config - create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment - @create_comment = ::Gapic::Config::Method.new create_comment_config - get_comment_config = parent_rpcs.get_comment if parent_rpcs.respond_to? :get_comment - @get_comment = ::Gapic::Config::Method.new get_comment_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb deleted file mode 100644 index f23ddfc6a74b..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb +++ /dev/null @@ -1,280 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/support/v2beta/comment_service_pb" - -module Google - module Cloud - module Support - module V2beta - module CommentService - module Rest - ## - # REST service stub for the CommentService 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_comments REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::ListCommentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::ListCommentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::ListCommentsResponse] - # A result object deserialized from the server's reply - def list_comments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_comments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_comments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::ListCommentsResponse.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_comment REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::CreateCommentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Comment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Comment] - # A result object deserialized from the server's reply - def create_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_comment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_comment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::Comment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_comment REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::GetCommentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::Comment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::Comment] - # A result object deserialized from the server's reply - def get_comment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_comment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_comment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::Comment.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_comments REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::ListCommentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_comments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}/comments", - matches: [ - ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}/comments", - matches: [ - ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_comment REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::CreateCommentRequest] - # 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_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta/{parent}/comments", - body: "comment", - matches: [ - ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2beta/{parent}/comments", - body: "comment", - matches: [ - ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_comment REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::GetCommentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_comment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{name}", - matches: [ - ["name", %r{^[^/]+/[^/]+/cases/[^/]+/comments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_pb.rb deleted file mode 100644 index f7eb35a04a9a..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/comment_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/support/v2beta/comment_pb' - - -descriptor_data = "\n1google/cloud/support/v2beta/comment_service.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/support/v2beta/comment.proto\"v\n\x13ListCommentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"g\n\x14ListCommentsResponse\x12\x36\n\x08\x63omments\x18\x01 \x03(\x0b\x32$.google.cloud.support.v2beta.Comment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8c\x01\n\x14\x43reateCommentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12:\n\x07\x63omment\x18\x02 \x01(\x0b\x32$.google.cloud.support.v2beta.CommentB\x03\xe0\x41\x02\"N\n\x11GetCommentRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#cloudsupport.googleapis.com/Comment2\xe0\x05\n\x0e\x43ommentService\x12\xe7\x01\n\x0cListComments\x12\x30.google.cloud.support.v2beta.ListCommentsRequest\x1a\x31.google.cloud.support.v2beta.ListCommentsResponse\"r\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x63\x12,/v2beta/{parent=projects/*/cases/*}/commentsZ3\x12\x31/v2beta/{parent=organizations/*/cases/*}/comments\x12\xf7\x01\n\rCreateComment\x12\x31.google.cloud.support.v2beta.CreateCommentRequest\x1a$.google.cloud.support.v2beta.Comment\"\x8c\x01\xda\x41\x0eparent,comment\x82\xd3\xe4\x93\x02u\",/v2beta/{parent=projects/*/cases/*}/comments:\x07\x63ommentZ<\"1/v2beta/{parent=organizations/*/cases/*}/comments:\x07\x63omment\x12\x98\x01\n\nGetComment\x12..google.cloud.support.v2beta.GetCommentRequest\x1a$.google.cloud.support.v2beta.Comment\"4\xda\x41\x04name\x82\xd3\xe4\x93\x02\'\x12%/v2beta/{name=*/*/cases/*/comments/*}\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd0\x01\n\x1f\x63om.google.cloud.support.v2betaB\x13\x43ommentServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - ListCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListCommentsRequest").msgclass - ListCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListCommentsResponse").msgclass - CreateCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.CreateCommentRequest").msgclass - GetCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.GetCommentRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_services_pb.rb deleted file mode 100644 index a15bd0317801..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/comment_service_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/support/v2beta/comment_service.proto for package 'Google.Cloud.Support.V2beta' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/support/v2beta/comment_service_pb' - -module Google - module Cloud - module Support - module V2beta - module CommentService - # A service to manage comments on cases. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.support.v2beta.CommentService' - - # List all the comments associated with a case. - rpc :ListComments, ::Google::Cloud::Support::V2beta::ListCommentsRequest, ::Google::Cloud::Support::V2beta::ListCommentsResponse - # Add a new comment to a case. - # - # The comment must have the following fields set: `body`. - rpc :CreateComment, ::Google::Cloud::Support::V2beta::CreateCommentRequest, ::Google::Cloud::Support::V2beta::Comment - # Retrieve a comment. - rpc :GetComment, ::Google::Cloud::Support::V2beta::GetCommentRequest, ::Google::Cloud::Support::V2beta::Comment - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/content_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/content_pb.rb deleted file mode 100644 index 5cd0bef42e12..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/content_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/content.proto - -require 'google/protobuf' - - -descriptor_data = "\n)google/cloud/support/v2beta/content.proto\x12\x1bgoogle.cloud.support.v2beta\"!\n\x0bTextContent\x12\x12\n\nplain_text\x18\x01 \x01(\tB\xc9\x01\n\x1f\x63om.google.cloud.support.v2betaB\x0c\x43ontentProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - TextContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.TextContent").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/email_message_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/email_message_pb.rb deleted file mode 100644 index bda054d8c8c8..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/email_message_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/email_message.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/support/v2beta/actor_pb' -require 'google/cloud/support/v2beta/content_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/cloud/support/v2beta/email_message.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a)google/cloud/support/v2beta/content.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x89\x04\n\x0c\x45mailMessage\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\x36\n\x05\x61\x63tor\x18\x03 \x01(\x0b\x32\".google.cloud.support.v2beta.ActorB\x03\xe0\x41\x03\x12\x14\n\x07subject\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12&\n\x19recipient_email_addresses\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12\x1f\n\x12\x63\x63_email_addresses\x18\x06 \x03(\tB\x03\xe0\x41\x03\x12\x43\n\x0c\x62ody_content\x18\x08 \x01(\x0b\x32(.google.cloud.support.v2beta.TextContentB\x03\xe0\x41\x03:\xd3\x01\xea\x41\xcf\x01\n(cloudsupport.googleapis.com/EmailMessage\x12=projects/{project}/cases/{case}/emailMessages/{email_message}\x12Gorganizations/{organization}/cases/{case}/emailMessages/{email_message}*\remailMessages2\x0c\x65mailMessageB\xce\x01\n\x1f\x63om.google.cloud.support.v2betaB\x11\x45mailMessageProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - EmailMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.EmailMessage").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/escalation_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/escalation_pb.rb deleted file mode 100644 index 5b660f6c34e9..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/escalation_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/escalation.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n,google/cloud/support/v2beta/escalation.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\"\xd2\x01\n\nEscalation\x12\x43\n\x06reason\x18\x04 \x01(\x0e\x32..google.cloud.support.v2beta.Escalation.ReasonB\x03\xe0\x41\x02\x12\x1a\n\rjustification\x18\x05 \x01(\tB\x03\xe0\x41\x02\"c\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x13\n\x0fRESOLUTION_TIME\x10\x01\x12\x17\n\x13TECHNICAL_EXPERTISE\x10\x02\x12\x13\n\x0f\x42USINESS_IMPACT\x10\x03\x42\xcc\x01\n\x1f\x63om.google.cloud.support.v2betaB\x0f\x45scalationProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - Escalation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Escalation").msgclass - Escalation::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.Escalation.Reason").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_item_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_item_pb.rb deleted file mode 100644 index e34a06b8285d..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_item_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/feed_item.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/support/v2beta/attachment_pb' -require 'google/cloud/support/v2beta/comment_pb' -require 'google/cloud/support/v2beta/email_message_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n+google/cloud/support/v2beta/feed_item.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/support/v2beta/attachment.proto\x1a)google/cloud/support/v2beta/comment.proto\x1a/google/cloud/support/v2beta/email_message.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6\x02\n\x08\x46\x65\x65\x64Item\x12<\n\x07\x63omment\x18\x64 \x01(\x0b\x32$.google.cloud.support.v2beta.CommentB\x03\xe0\x41\x03H\x00\x12\x42\n\nattachment\x18\x65 \x01(\x0b\x32\'.google.cloud.support.v2beta.AttachmentB\x03\xe0\x41\x03H\x00\x12G\n\remail_message\x18\x66 \x01(\x0b\x32).google.cloud.support.v2beta.EmailMessageB\x03\xe0\x41\x03H\x00\x12J\n\x12\x64\x65leted_attachment\x18g \x01(\x0b\x32\'.google.cloud.support.v2beta.AttachmentB\x03\xe0\x41\x03H\x00\x12\x33\n\nevent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x0e\n\x0c\x65vent_objectB\xca\x01\n\x1f\x63om.google.cloud.support.v2betaB\rFeedItemProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - FeedItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.FeedItem").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service.rb deleted file mode 100644 index 0429e129474d..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_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/support/v2beta/version" - -require "google/cloud/support/v2beta/feed_service/credentials" -require "google/cloud/support/v2beta/feed_service/paths" -require "google/cloud/support/v2beta/feed_service/client" -require "google/cloud/support/v2beta/feed_service/rest" - -module Google - module Cloud - module Support - module V2beta - ## - # A service to view case feed items. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/support/v2beta/feed_service" - # client = ::Google::Cloud::Support::V2beta::FeedService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/support/v2beta/feed_service/rest" - # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new - # - module FeedService - end - end - end - end -end - -helper_path = ::File.join __dir__, "feed_service", "helpers.rb" -require "google/cloud/support/v2beta/feed_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/client.rb deleted file mode 100644 index 1b4e29f724e0..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/client.rb +++ /dev/null @@ -1,499 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/support/v2beta/feed_service_pb" - -module Google - module Cloud - module Support - module V2beta - module FeedService - ## - # Client for the FeedService service. - # - # A service to view case feed items. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :feed_service_stub - - ## - # Configure the FeedService Client class. - # - # See {::Google::Cloud::Support::V2beta::FeedService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all FeedService clients - # ::Google::Cloud::Support::V2beta::FeedService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Support", "V2beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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.show_feed.timeout = 60.0 - default_config.rpcs.show_feed.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 FeedService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Support::V2beta::FeedService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @feed_service_stub.universe_domain - end - - ## - # Create a new FeedService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Support::V2beta::FeedService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Support::V2beta::FeedService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the FeedService 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/support/v2beta/feed_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 - - @feed_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Support::V2beta::FeedService::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 - ) - - @feed_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 - @feed_service_stub.logger - end - - # Service calls - - ## - # Show items in the feed of this case, including case emails, - # attachments, and comments. - # - # @overload show_feed(request, options = nil) - # Pass arguments to `show_feed` via a request object, either of type - # {::Google::Cloud::Support::V2beta::ShowFeedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::ShowFeedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload show_feed(parent: nil, order_by: nil, page_size: nil, page_token: nil) - # Pass arguments to `show_feed` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the case for which feed items should be - # listed. - # @param order_by [::String] - # Optional. Field to order feed items by, followed by `asc` or `desc` - # postfix. The only valid field is - # `creation_time`. This list is case-insensitive, default sorting order is - # ascending, and the redundant space characters are insignificant. - # - # Example: `creation_time desc` - # @param page_size [::Integer] - # Optional. The maximum number of feed items fetched with each request. - # @param page_token [::String] - # Optional. A token identifying the page of results to return. If - # unspecified, it retrieves the first page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::FeedItem>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::FeedItem>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::FeedService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::ShowFeedRequest.new - # - # # Call the show_feed method. - # result = client.show_feed request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::FeedItem. - # p item - # end - # - def show_feed request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ShowFeedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.show_feed.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.show_feed.timeout, - metadata: metadata, - retry_policy: @config.rpcs.show_feed.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @feed_service_stub.call_rpc :show_feed, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @feed_service_stub, :show_feed, request, response, 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 FeedService API. - # - # This class represents the configuration for FeedService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2beta::FeedService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # show_feed to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2beta::FeedService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.show_feed.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2beta::FeedService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.show_feed.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Support::V2beta::FeedService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the FeedService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `show_feed` - # @return [::Gapic::Config::Method] - # - attr_reader :show_feed - - # @private - def initialize parent_rpcs = nil - show_feed_config = parent_rpcs.show_feed if parent_rpcs.respond_to? :show_feed - @show_feed = ::Gapic::Config::Method.new show_feed_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/credentials.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/credentials.rb deleted file mode 100644 index 9e492496d8a2..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/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 Support - module V2beta - module FeedService - # Credentials for the FeedService 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-support-v2beta/lib/google/cloud/support/v2beta/feed_service/paths.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/paths.rb deleted file mode 100644 index 52cad904cef2..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/paths.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - module FeedService - # Path helper methods for the FeedService API. - module Paths - ## - # Create a fully-qualified Case resource string. - # - # @overload case_path(organization:, case:) - # The resource will be in the following format: - # - # `organizations/{organization}/cases/{case}` - # - # @param organization [String] - # @param case [String] - # - # @overload case_path(project:, case:) - # The resource will be in the following format: - # - # `projects/{project}/cases/{case}` - # - # @param project [String] - # @param case [String] - # - # @return [::String] - def case_path **args - resources = { - "case:organization" => (proc do |organization:, case:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/cases/#{binding.local_variable_get :case}" - end), - "case:project" => (proc do |project:, case:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/cases/#{binding.local_variable_get :case}" - 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-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest.rb deleted file mode 100644 index 0c9dce322c55..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_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/support/v2beta/version" - -require "google/cloud/support/v2beta/feed_service/credentials" -require "google/cloud/support/v2beta/feed_service/paths" -require "google/cloud/support/v2beta/feed_service/rest/client" - -module Google - module Cloud - module Support - module V2beta - ## - # A service to view case feed items. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/support/v2beta/feed_service/rest" - # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new - # - module FeedService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/support/v2beta/feed_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/client.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/client.rb deleted file mode 100644 index bc99077c1181..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/client.rb +++ /dev/null @@ -1,449 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/support/v2beta/feed_service_pb" -require "google/cloud/support/v2beta/feed_service/rest/service_stub" - -module Google - module Cloud - module Support - module V2beta - module FeedService - module Rest - ## - # REST client for the FeedService service. - # - # A service to view case feed items. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :feed_service_stub - - ## - # Configure the FeedService Client class. - # - # See {::Google::Cloud::Support::V2beta::FeedService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all FeedService clients - # ::Google::Cloud::Support::V2beta::FeedService::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", "Support", "V2beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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.show_feed.timeout = 60.0 - default_config.rpcs.show_feed.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 FeedService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Support::V2beta::FeedService::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 - @feed_service_stub.universe_domain - end - - ## - # Create a new FeedService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the FeedService 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 - - @feed_service_stub = ::Google::Cloud::Support::V2beta::FeedService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @feed_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 - @feed_service_stub.logger - end - - # Service calls - - ## - # Show items in the feed of this case, including case emails, - # attachments, and comments. - # - # @overload show_feed(request, options = nil) - # Pass arguments to `show_feed` via a request object, either of type - # {::Google::Cloud::Support::V2beta::ShowFeedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Support::V2beta::ShowFeedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload show_feed(parent: nil, order_by: nil, page_size: nil, page_token: nil) - # Pass arguments to `show_feed` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the case for which feed items should be - # listed. - # @param order_by [::String] - # Optional. Field to order feed items by, followed by `asc` or `desc` - # postfix. The only valid field is - # `creation_time`. This list is case-insensitive, default sorting order is - # ascending, and the redundant space characters are insignificant. - # - # Example: `creation_time desc` - # @param page_size [::Integer] - # Optional. The maximum number of feed items fetched with each request. - # @param page_token [::String] - # Optional. A token identifying the page of results to return. If - # unspecified, it retrieves the first page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::FeedItem>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::FeedItem>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/support/v2beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Support::V2beta::FeedService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Support::V2beta::ShowFeedRequest.new - # - # # Call the show_feed method. - # result = client.show_feed request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Support::V2beta::FeedItem. - # p item - # end - # - def show_feed request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ShowFeedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.show_feed.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Support::V2beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.show_feed.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.show_feed.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @feed_service_stub.show_feed request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @feed_service_stub, :show_feed, "feed_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 - - ## - # Configuration class for the FeedService REST API. - # - # This class represents the configuration for FeedService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Support::V2beta::FeedService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # show_feed to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.show_feed.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.show_feed.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudsupport.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the FeedService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `show_feed` - # @return [::Gapic::Config::Method] - # - attr_reader :show_feed - - # @private - def initialize parent_rpcs = nil - show_feed_config = parent_rpcs.show_feed if parent_rpcs.respond_to? :show_feed - @show_feed = ::Gapic::Config::Method.new show_feed_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb deleted file mode 100644 index d267a53b43d4..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb +++ /dev/null @@ -1,149 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/support/v2beta/feed_service_pb" - -module Google - module Cloud - module Support - module V2beta - module FeedService - module Rest - ## - # REST service stub for the FeedService 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 show_feed REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::ShowFeedRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Support::V2beta::ShowFeedResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Support::V2beta::ShowFeedResponse] - # A result object deserialized from the server's reply - def show_feed request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_show_feed_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "show_feed", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Support::V2beta::ShowFeedResponse.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 show_feed REST call - # - # @param request_pb [::Google::Cloud::Support::V2beta::ShowFeedRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_show_feed_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}:showFeed", - matches: [ - ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2beta/{parent}:showFeed", - matches: [ - ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_pb.rb deleted file mode 100644 index 205586a189ef..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/support/v2beta/feed_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/support/v2beta/feed_item_pb' - - -descriptor_data = "\n.google/cloud/support/v2beta/feed_service.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/support/v2beta/feed_item.proto\"\x93\x01\n\x0fShowFeedRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x15\n\x08order_by\x18\x02 \x01(\tB\x03\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\"f\n\x10ShowFeedResponse\x12\x39\n\nfeed_items\x18\x01 \x03(\x0b\x32%.google.cloud.support.v2beta.FeedItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xbc\x02\n\x0b\x46\x65\x65\x64Service\x12\xdb\x01\n\x08ShowFeed\x12,.google.cloud.support.v2beta.ShowFeedRequest\x1a-.google.cloud.support.v2beta.ShowFeedResponse\"r\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x63\x12,/v2beta/{parent=projects/*/cases/*}:showFeedZ3\x12\x31/v2beta/{parent=organizations/*/cases/*}:showFeed\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcd\x01\n\x1f\x63om.google.cloud.support.v2betaB\x10\x46\x65\x65\x64ServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Support - module V2beta - ShowFeedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ShowFeedRequest").msgclass - ShowFeedResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ShowFeedResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_services_pb.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_services_pb.rb deleted file mode 100644 index 3f9bbd080798..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/feed_service_services_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/support/v2beta/feed_service.proto for package 'Google.Cloud.Support.V2beta' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/support/v2beta/feed_service_pb' - -module Google - module Cloud - module Support - module V2beta - module FeedService - # A service to view case feed items. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.support.v2beta.FeedService' - - # Show items in the feed of this case, including case emails, - # attachments, and comments. - rpc :ShowFeed, ::Google::Cloud::Support::V2beta::ShowFeedRequest, ::Google::Cloud::Support::V2beta::ShowFeedResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/rest.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/rest.rb deleted file mode 100644 index cb15b281dfb0..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/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/support/v2beta/case_attachment_service/rest" -require "google/cloud/support/v2beta/case_service/rest" -require "google/cloud/support/v2beta/comment_service/rest" -require "google/cloud/support/v2beta/feed_service/rest" -require "google/cloud/support/v2beta/version" - -module Google - module Cloud - module Support - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/support/v2beta/rest" - # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new - # - module V2beta - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/version.rb b/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/version.rb deleted file mode 100644 index 8b242f65e38f..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/lib/google/cloud/support/v2beta/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 Support - module V2beta - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/README.md b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/README.md deleted file mode 100644 index 228a12952fed..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Google Cloud Support V2BETA 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-support-v2beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/cloud/support/v2beta/actor.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/actor.rb deleted file mode 100644 index b45ea6fc9ae8..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/actor.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! - - -module Google - module Cloud - module Support - module V2beta - # An Actor represents an entity that performed an action. For example, an actor - # could be a user who posted a comment on a support case, a user who - # uploaded an attachment, or a service account that created a support case. - # @!attribute [rw] display_name - # @return [::String] - # The name to display for the actor. If not provided, it is inferred from - # credentials supplied during case creation. When an email is provided, a - # display name must also be provided. This will be obfuscated if the user - # is a Google Support agent. - # @!attribute [rw] email - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # The email address of the actor. If not provided, it is inferred from the - # credentials supplied during case creation. When a name is provided, an - # email must also be provided. If the user is a Google Support agent, this is - # obfuscated. - # - # This field is deprecated. Use `username` instead. - # @!attribute [r] google_support - # @return [::Boolean] - # Output only. Whether the actor is a Google support actor. - # @!attribute [r] username - # @return [::String] - # Output only. The username of the actor. It may look like an email or other - # format provided by the identity provider. If not provided, it is inferred - # from the credentials supplied. When a name is provided, a username must - # also be provided. If the user is a Google Support agent, this will not be - # set. - class Actor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment.rb deleted file mode 100644 index adb9de8f353f..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - # An Attachment contains metadata about a file that was uploaded to a - # case - it is NOT a file itself. That being said, the name of an Attachment - # object can be used to download its accompanying file through the - # `media.download` endpoint. - # - # While attachments can be uploaded in the console at the - # same time as a comment, they're associated on a "case" level, not a - # "comment" level. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the attachment. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the attachment was created. - # @!attribute [r] creator - # @return [::Google::Cloud::Support::V2beta::Actor] - # Output only. The user who uploaded the attachment. Note, the name and email - # will be obfuscated if the attachment was uploaded by Google support. - # @!attribute [rw] filename - # @return [::String] - # The filename of the attachment (e.g. `"graph.jpg"`). - # @!attribute [r] mime_type - # @return [::String] - # Output only. The MIME type of the attachment (e.g. text/plain). - # @!attribute [r] size_bytes - # @return [::Integer] - # Output only. The size of the attachment in bytes. - class Attachment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment_service.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment_service.rb deleted file mode 100644 index cf9ec587b9cb..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/attachment_service.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - # The request message for the ListAttachments endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the case for which attachments should be listed. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of attachments fetched with each request. - # - # If not provided, the default is 10. The maximum page size that will be - # returned is 100. - # - # The size of each page can be smaller than the requested page size and can - # include zero. For example, you could request 100 attachments on one page, - # receive 0, and then on the next page, receive 90. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - class ListAttachmentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for getting an attachment. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the attachment to get. - class GetAttachmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for the ListAttachments endpoint. - # @!attribute [rw] attachments - # @return [::Array<::Google::Cloud::Support::V2beta::Attachment>] - # The list of attachments associated with a case. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the `page_token` - # field of subsequent `cases.attachments.list` requests. If unspecified, - # there are no more results to retrieve. - class ListAttachmentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case.rb deleted file mode 100644 index c5adc8946ab1..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case.rb +++ /dev/null @@ -1,215 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - # A Case is an object that contains the details of a support case. It - # contains fields for the time it was created, its priority, its - # classification, and more. Cases can also have comments and attachments that - # get added over time. - # - # A case is parented by a Google Cloud organization or project. - # - # Organizations are identified by a number, so the name of a case parented by - # an organization would look like this: - # - # ``` - # organizations/123/cases/456 - # ``` - # - # Projects have two unique identifiers, an ID and a number, and they look like - # this: - # - # ``` - # projects/abc/cases/456 - # ``` - # - # ``` - # projects/123/cases/456 - # ``` - # - # You can use either of them when calling the API. To learn more - # about project identifiers, see [AIP-2510](https://google.aip.dev/cloud/2510). - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for the case. - # @!attribute [rw] display_name - # @return [::String] - # The short summary of the issue reported in this case. - # @!attribute [rw] description - # @return [::String] - # A broad description of the issue. - # @!attribute [rw] classification - # @return [::Google::Cloud::Support::V2beta::CaseClassification] - # The issue classification applicable to this case. - # @!attribute [rw] time_zone - # @return [::String] - # The timezone of the user who created the support case. - # It should be in a format IANA recognizes: https://www.iana.org/time-zones. - # There is no additional validation done by the API. - # @!attribute [rw] subscriber_email_addresses - # @return [::Array<::String>] - # The email addresses to receive updates on this case. - # @!attribute [r] state - # @return [::Google::Cloud::Support::V2beta::Case::State] - # Output only. The current status of the support case. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this case was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this case was last updated. - # @!attribute [rw] creator - # @return [::Google::Cloud::Support::V2beta::Actor] - # The user who created the case. - # - # Note: The name and email will be obfuscated if the case was created by - # Google Support. - # @!attribute [rw] contact_email - # @return [::String] - # A user-supplied email address to send case update notifications for. This - # should only be used in BYOID flows, where we cannot infer the user's email - # address directly from their EUCs. - # @!attribute [rw] escalated - # @return [::Boolean] - # Whether the case is currently escalated. - # @!attribute [rw] test_case - # @return [::Boolean] - # Whether this case was created for internal API testing and should not be - # acted on by the support team. - # @!attribute [rw] language_code - # @return [::String] - # The language the user has requested to receive support in. This should be a - # BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). - # If no language or an unsupported language is specified, this field defaults - # to English (en). - # - # Language selection during case creation may affect your available support - # options. For a list of supported languages and their support working hours, - # see: https://cloud.google.com/support/docs/language-working-hours - # @!attribute [rw] priority - # @return [::Google::Cloud::Support::V2beta::Case::Priority] - # The priority of this case. - class Case - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of a support case. - module State - # Case is in an unknown state. - STATE_UNSPECIFIED = 0 - - # The case has been created but no one is assigned to work on it yet. - NEW = 1 - - # The case is currently being handled by Google support. - IN_PROGRESS_GOOGLE_SUPPORT = 2 - - # Google is waiting for a response. - ACTION_REQUIRED = 3 - - # A solution has been offered for the case, but it isn't yet closed. - SOLUTION_PROVIDED = 4 - - # The case has been resolved. - CLOSED = 5 - end - - # The case Priority. P0 is most urgent and P4 the least. - module Priority - # Priority is undefined or has not been set yet. - PRIORITY_UNSPECIFIED = 0 - - # Extreme impact on a production service. Service is hard down. - P0 = 1 - - # Critical impact on a production service. Service is currently unusable. - P1 = 2 - - # Severe impact on a production service. Service is usable but greatly - # impaired. - P2 = 3 - - # Medium impact on a production service. Service is available, but - # moderately impaired. - P3 = 4 - - # General questions or minor issues. Production service is fully - # available. - P4 = 5 - end - end - - # A Case Classification represents the topic that a case is about. It's very - # important to use accurate classifications, because they're - # used to route your cases to specialists who can help you. - # - # A classification always has an ID that is its unique identifier. - # A valid ID is required when creating a case. - # @!attribute [rw] id - # @return [::String] - # The unique ID for a classification. Must be specified for case creation. - # - # To retrieve valid classification IDs for case creation, use - # `caseClassifications.search`. - # - # Classification IDs returned by `caseClassifications.search` are guaranteed - # to be valid for at least 6 months. If a given classification is - # deactiveated, it will immediately stop being returned. After 6 months, - # `case.create` requests using the classification ID will fail. - # @!attribute [rw] display_name - # @return [::String] - # A display name for the classification. - # - # The display name is not static and can change. To uniquely and consistently - # identify classifications, use the `CaseClassification.id` field. - # @!attribute [rw] product - # @return [::Google::Cloud::Support::V2beta::Product] - # The full product the classification corresponds to. - class CaseClassification - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The product a case may be associated with. - # @!attribute [rw] product_line - # @return [::Google::Cloud::Support::V2beta::ProductLine] - # The product line of the Product. - class Product - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The product line a support case may be associated with. - module ProductLine - # Unknown product type. - PRODUCT_LINE_UNSPECIFIED = 0 - - # Google Cloud - GOOGLE_CLOUD = 1 - - # Google Maps - GOOGLE_MAPS = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case_service.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case_service.rb deleted file mode 100644 index 5b0a67b0e526..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/case_service.rb +++ /dev/null @@ -1,245 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - # The request message for the GetCase endpoint. - # @!attribute [rw] name - # @return [::String] - # Required. The full name of a case to be retrieved. - class GetCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the CreateCase endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent under which the case should be created. - # @!attribute [rw] case - # @return [::Google::Cloud::Support::V2beta::Case] - # Required. The case to be created. - class CreateCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the ListCases endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of a parent to list cases under. - # @!attribute [rw] filter - # @return [::String] - # An expression used to filter cases. - # - # If it's an empty string, then no filtering happens. Otherwise, the endpoint - # returns the cases that match the filter. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # EXAMPLES: - # - # - `state=CLOSED` - # - `state=OPEN AND creator.email="tester@example.com"` - # - `state=OPEN AND (priority=P0 OR priority=P1)` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of cases fetched with each request. Defaults to 10. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # @!attribute [rw] product_line - # @return [::Google::Cloud::Support::V2beta::ProductLine] - # The product line to request cases for. If unspecified, only - # Google Cloud cases will be returned. - class ListCasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for the ListCases endpoint. - # @!attribute [rw] cases - # @return [::Array<::Google::Cloud::Support::V2beta::Case>] - # The list of cases associated with the parent after any - # filters have been applied. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the `page_token` - # field of subsequent `cases.list` requests. If unspecified, there are no - # more results to retrieve. - class ListCasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the SearchCases endpoint. - # @!attribute [rw] parent - # @return [::String] - # The name of the parent resource to search for cases under. - # @!attribute [rw] query - # @return [::String] - # An expression used to filter cases. - # - # Expressions use the following fields separated by `AND` and specified with - # `=`: - # - # - `organization`: An organization name in the form - # `organizations/`. - # - `project`: A project name in the form `projects/`. - # - `state`: Can be `OPEN` or `CLOSED`. - # - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - # can specify multiple values for priority using the `OR` operator. For - # example, `priority=P1 OR priority=P2`. - # - `creator.email`: The email address of the case creator. - # - # You must specify either `organization` or `project`. - # - # To search across `displayName`, `description`, and comments, use a global - # restriction with no keyword or operator. For example, `"my search"`. - # - # To search only cases updated after a certain date, use `update_time` - # restricted with that particular date, time, and timezone in ISO datetime - # format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - # `update_time` only supports the greater than operator (`>`). - # - # Examples: - # - # - `organization="organizations/123456789"` - # - `project="projects/my-project-id"` - # - `project="projects/123456789"` - # - `organization="organizations/123456789" AND state=CLOSED` - # - `project="projects/my-project-id" AND creator.email="tester@example.com"` - # - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of cases fetched with each request. The default page - # size is 10. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - class SearchCasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for the SearchCases endpoint. - # @!attribute [rw] cases - # @return [::Array<::Google::Cloud::Support::V2beta::Case>] - # The list of cases associated with the parent after any - # filters have been applied. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the - # `page_token` field of subsequent `cases.search` requests. If unspecified, - # there are no more results to retrieve. - class SearchCasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the EscalateCase endpoint. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the case to be escalated. - # @!attribute [rw] escalation - # @return [::Google::Cloud::Support::V2beta::Escalation] - # The escalation information to be sent with the escalation request. - class EscalateCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the UpdateCase endpoint - # @!attribute [rw] case - # @return [::Google::Cloud::Support::V2beta::Case] - # Required. The case to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A list of attributes of the case that should be updated. Supported values - # are `priority`, `display_name`, and `subscriber_email_addresses`. If no - # fields are specified, all supported fields are updated. - # - # Be careful - if you do not provide a field mask, then you might - # accidentally clear some fields. For example, if you leave the field mask - # empty and do not provide a value for `subscriber_email_addresses`, then - # `subscriber_email_addresses` is updated to empty. - class UpdateCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the CloseCase endpoint. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the case to close. - class CloseCaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the SearchCaseClassifications endpoint. - # @!attribute [rw] query - # @return [::String] - # An expression used to filter case classifications. - # - # If it's an empty string, then no filtering happens. Otherwise, case - # classifications will be returned that match the filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of classifications fetched with each request. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is retrieved. - # @!attribute [rw] product - # @return [::Google::Cloud::Support::V2beta::Product] - # Optional. The product to return case classifications for. - class SearchCaseClassificationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for SearchCaseClassifications endpoint. - # @!attribute [rw] case_classifications - # @return [::Array<::Google::Cloud::Support::V2beta::CaseClassification>] - # The classifications retrieved. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the `page_token` - # field of subsequent `caseClassifications.list` requests. If unspecified, - # there are no more results to retrieve. - class SearchCaseClassificationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment.rb deleted file mode 100644 index 81f686cfe082..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - # A comment associated with a support case. - # - # Case comments are the primary way for Google Support to communicate with a - # user who has opened a case. When a user responds to Google Support, the - # user's responses also appear as comments. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the comment. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the comment was created. - # @!attribute [r] creator - # @return [::Google::Cloud::Support::V2beta::Actor] - # Output only. The user or Google Support agent who created the comment. - # @!attribute [rw] body - # @return [::String] - # The full comment body. - # - # Maximum of 12800 characters. - # @!attribute [r] plain_text_body - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Output only. DEPRECATED. DO NOT USE. - # - # A duplicate of the `body` field. - # - # This field is only present for legacy reasons. - class Comment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment_service.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment_service.rb deleted file mode 100644 index f2742c33f65d..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/comment_service.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 Support - module V2beta - # The request message for the ListComments endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the case for which to list comments. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of comments to fetch. Defaults to 10. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. If unspecified, the - # first page is returned. - class ListCommentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for the ListComments endpoint. - # @!attribute [rw] comments - # @return [::Array<::Google::Cloud::Support::V2beta::Comment>] - # List of the comments associated with the case. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Set this in the `page_token` - # field of subsequent `cases.comments.list` requests. If unspecified, there - # are no more results to retrieve. - class ListCommentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the CreateComment endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the case to which the comment should be added. - # @!attribute [rw] comment - # @return [::Google::Cloud::Support::V2beta::Comment] - # Required. The comment to be added. - class CreateCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the GetComment endpoint. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the comment to retrieve. - class GetCommentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/content.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/content.rb deleted file mode 100644 index 528eecc925bd..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/content.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - # Stores text attached to a support object. - # @!attribute [rw] plain_text - # @return [::String] - # Content in this field should be rendered and interpreted as-is. - class TextContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/email_message.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/email_message.rb deleted file mode 100644 index 66d6775bf201..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/email_message.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - # An email associated with a support case. - # @!attribute [rw] name - # @return [::String] - # Identifier. Resource name for the email message. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this email message object was created. - # @!attribute [r] actor - # @return [::Google::Cloud::Support::V2beta::Actor] - # Output only. The user or Google Support agent that created this email - # message. This is inferred from the headers on the email message. - # @!attribute [r] subject - # @return [::String] - # Output only. Subject of the email. - # @!attribute [r] recipient_email_addresses - # @return [::Array<::String>] - # Output only. Email addresses the email was sent to. - # @!attribute [r] cc_email_addresses - # @return [::Array<::String>] - # Output only. Email addresses CCed on the email. - # @!attribute [r] body_content - # @return [::Google::Cloud::Support::V2beta::TextContent] - # Output only. The full email message body. A best-effort attempt is made to - # remove extraneous reply threads. - class EmailMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/escalation.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/escalation.rb deleted file mode 100644 index 8c67ca0742eb..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/escalation.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - # An escalation of a support case. - # @!attribute [rw] reason - # @return [::Google::Cloud::Support::V2beta::Escalation::Reason] - # Required. The reason why the Case is being escalated. - # @!attribute [rw] justification - # @return [::String] - # Required. A free text description to accompany the `reason` field above. - # Provides additional context on why the case is being escalated. - class Escalation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enum detailing the possible reasons a case may be escalated. - module Reason - # The escalation reason is in an unknown state or has not been specified. - REASON_UNSPECIFIED = 0 - - # The case is taking too long to resolve. - RESOLUTION_TIME = 1 - - # The support agent does not have the expertise required to successfully - # resolve the issue. - TECHNICAL_EXPERTISE = 2 - - # The issue is having a significant business impact. - BUSINESS_IMPACT = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_item.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_item.rb deleted file mode 100644 index d0b449b4bb1e..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_item.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 Support - module V2beta - # A feed item associated with a support case. - # @!attribute [r] comment - # @return [::Google::Cloud::Support::V2beta::Comment] - # Output only. A comment added to the case. - # - # Note: The following fields are mutually exclusive: `comment`, `attachment`, `email_message`, `deleted_attachment`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] attachment - # @return [::Google::Cloud::Support::V2beta::Attachment] - # Output only. An attachment attached to the case. - # - # Note: The following fields are mutually exclusive: `attachment`, `comment`, `email_message`, `deleted_attachment`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] email_message - # @return [::Google::Cloud::Support::V2beta::EmailMessage] - # Output only. An email message received in reply to the case. - # - # Note: The following fields are mutually exclusive: `email_message`, `comment`, `attachment`, `deleted_attachment`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] deleted_attachment - # @return [::Google::Cloud::Support::V2beta::Attachment] - # Output only. A deleted attachment that used to be associated with the - # support case. - # - # Note: The following fields are mutually exclusive: `deleted_attachment`, `comment`, `attachment`, `email_message`. 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. Time corresponding to the event of this item. - class FeedItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_service.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_service.rb deleted file mode 100644 index d0628e30279c..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/cloud/support/v2beta/feed_service.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Support - module V2beta - # The request message for the ShowFeed endpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the case for which feed items should be - # listed. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Field to order feed items by, followed by `asc` or `desc` - # postfix. The only valid field is - # `creation_time`. This list is case-insensitive, default sorting order is - # ascending, and the redundant space characters are insignificant. - # - # Example: `creation_time desc` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of feed items fetched with each request. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying the page of results to return. If - # unspecified, it retrieves the first page. - class ShowFeedRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for the ShowFeed endpoint. - # @!attribute [rw] feed_items - # @return [::Array<::Google::Cloud::Support::V2beta::FeedItem>] - # The list of feed items associated with the given Case. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. This should be set in the - # `page_token` field of subsequent `ShowFeedRequests`. - # If unspecified, there are no more results to retrieve. - class ShowFeedResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-support-v2beta/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta/snippets/Gemfile b/owl-bot-staging/google-cloud-support-v2beta/snippets/Gemfile deleted file mode 100644 index e1812bac7937..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/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-support-v2beta", path: "../" -else - gem "google-cloud-support-v2beta" -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-support-v2beta/snippets/case_attachment_service/get_attachment.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/get_attachment.rb deleted file mode 100644 index 817c8bc8ee34..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/get_attachment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the get_attachment call in the CaseAttachmentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseAttachmentService::Client#get_attachment. -# -def get_attachment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::GetAttachmentRequest.new - - # Call the get_attachment method. - result = client.get_attachment request - - # The returned object is of type Google::Cloud::Support::V2beta::Attachment. - p result -end -# [END cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/list_attachments.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/list_attachments.rb deleted file mode 100644 index a8197899de9a..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_attachment_service/list_attachments.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 cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the list_attachments call in the CaseAttachmentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseAttachmentService::Client#list_attachments. -# -def list_attachments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::ListAttachmentsRequest.new - - # Call the list_attachments method. - result = client.list_attachments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2beta::Attachment. - p item - end -end -# [END cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/close_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/close_case.rb deleted file mode 100644 index df3698362b77..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/close_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2beta_generated_CaseService_CloseCase_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the close_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseService::Client#close_case. -# -def close_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::CloseCaseRequest.new - - # Call the close_case method. - result = client.close_case request - - # The returned object is of type Google::Cloud::Support::V2beta::Case. - p result -end -# [END cloudsupport_v2beta_generated_CaseService_CloseCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/create_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/create_case.rb deleted file mode 100644 index dd6452cd2104..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/create_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2beta_generated_CaseService_CreateCase_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the create_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseService::Client#create_case. -# -def create_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::CreateCaseRequest.new - - # Call the create_case method. - result = client.create_case request - - # The returned object is of type Google::Cloud::Support::V2beta::Case. - p result -end -# [END cloudsupport_v2beta_generated_CaseService_CreateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/escalate_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/escalate_case.rb deleted file mode 100644 index 8ab2f5e01a80..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/escalate_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2beta_generated_CaseService_EscalateCase_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the escalate_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseService::Client#escalate_case. -# -def escalate_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::EscalateCaseRequest.new - - # Call the escalate_case method. - result = client.escalate_case request - - # The returned object is of type Google::Cloud::Support::V2beta::Case. - p result -end -# [END cloudsupport_v2beta_generated_CaseService_EscalateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/get_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/get_case.rb deleted file mode 100644 index d427183e1b53..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/get_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2beta_generated_CaseService_GetCase_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the get_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseService::Client#get_case. -# -def get_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::GetCaseRequest.new - - # Call the get_case method. - result = client.get_case request - - # The returned object is of type Google::Cloud::Support::V2beta::Case. - p result -end -# [END cloudsupport_v2beta_generated_CaseService_GetCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/list_cases.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/list_cases.rb deleted file mode 100644 index 924fd42eb5cc..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/list_cases.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 cloudsupport_v2beta_generated_CaseService_ListCases_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the list_cases call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseService::Client#list_cases. -# -def list_cases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::ListCasesRequest.new - - # Call the list_cases method. - result = client.list_cases request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2beta::Case. - p item - end -end -# [END cloudsupport_v2beta_generated_CaseService_ListCases_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_case_classifications.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_case_classifications.rb deleted file mode 100644 index 113460bea7e0..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_case_classifications.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 cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the search_case_classifications call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseService::Client#search_case_classifications. -# -def search_case_classifications - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new - - # Call the search_case_classifications method. - result = client.search_case_classifications request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2beta::CaseClassification. - p item - end -end -# [END cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_cases.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_cases.rb deleted file mode 100644 index 2aeb60496c74..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/search_cases.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 cloudsupport_v2beta_generated_CaseService_SearchCases_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the search_cases call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseService::Client#search_cases. -# -def search_cases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::SearchCasesRequest.new - - # Call the search_cases method. - result = client.search_cases request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2beta::Case. - p item - end -end -# [END cloudsupport_v2beta_generated_CaseService_SearchCases_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/update_case.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/update_case.rb deleted file mode 100644 index 42cb75413921..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/case_service/update_case.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2beta_generated_CaseService_UpdateCase_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the update_case call in the CaseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CaseService::Client#update_case. -# -def update_case - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CaseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::UpdateCaseRequest.new - - # Call the update_case method. - result = client.update_case request - - # The returned object is of type Google::Cloud::Support::V2beta::Case. - p result -end -# [END cloudsupport_v2beta_generated_CaseService_UpdateCase_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/create_comment.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/create_comment.rb deleted file mode 100644 index 111763a0cd80..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/create_comment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2beta_generated_CommentService_CreateComment_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the create_comment call in the CommentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CommentService::Client#create_comment. -# -def create_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CommentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::CreateCommentRequest.new - - # Call the create_comment method. - result = client.create_comment request - - # The returned object is of type Google::Cloud::Support::V2beta::Comment. - p result -end -# [END cloudsupport_v2beta_generated_CommentService_CreateComment_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/get_comment.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/get_comment.rb deleted file mode 100644 index 40c25b1d4c91..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/get_comment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2beta_generated_CommentService_GetComment_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the get_comment call in the CommentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CommentService::Client#get_comment. -# -def get_comment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CommentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::GetCommentRequest.new - - # Call the get_comment method. - result = client.get_comment request - - # The returned object is of type Google::Cloud::Support::V2beta::Comment. - p result -end -# [END cloudsupport_v2beta_generated_CommentService_GetComment_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/list_comments.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/list_comments.rb deleted file mode 100644 index 6a6ca196fdcd..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/comment_service/list_comments.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudsupport_v2beta_generated_CommentService_ListComments_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the list_comments call in the CommentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::CommentService::Client#list_comments. -# -def list_comments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::CommentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::ListCommentsRequest.new - - # Call the list_comments method. - result = client.list_comments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2beta::Comment. - p item - end -end -# [END cloudsupport_v2beta_generated_CommentService_ListComments_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/feed_service/show_feed.rb b/owl-bot-staging/google-cloud-support-v2beta/snippets/feed_service/show_feed.rb deleted file mode 100644 index c67f13d8ae2b..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/feed_service/show_feed.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 cloudsupport_v2beta_generated_FeedService_ShowFeed_sync] -require "google/cloud/support/v2beta" - -## -# Snippet for the show_feed call in the FeedService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Support::V2beta::FeedService::Client#show_feed. -# -def show_feed - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Support::V2beta::FeedService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Support::V2beta::ShowFeedRequest.new - - # Call the show_feed method. - result = client.show_feed request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Support::V2beta::FeedItem. - p item - end -end -# [END cloudsupport_v2beta_generated_FeedService_ShowFeed_sync] diff --git a/owl-bot-staging/google-cloud-support-v2beta/snippets/snippet_metadata_google.cloud.support.v2beta.json b/owl-bot-staging/google-cloud-support-v2beta/snippets/snippet_metadata_google.cloud.support.v2beta.json deleted file mode 100644 index fd428e9168a5..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/snippets/snippet_metadata_google.cloud.support.v2beta.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-support-v2beta", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.support.v2beta", - "version": "v2beta" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_sync", - "title": "Snippet for the list_attachments call in the CaseAttachmentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseAttachmentService::Client#list_attachments.", - "file": "case_attachment_service/list_attachments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_attachments", - "full_name": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client#list_attachments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::ListAttachmentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::ListAttachmentsResponse", - "client": { - "short_name": "CaseAttachmentService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client" - }, - "method": { - "short_name": "ListAttachments", - "full_name": "google.cloud.support.v2beta.CaseAttachmentService.ListAttachments", - "service": { - "short_name": "CaseAttachmentService", - "full_name": "google.cloud.support.v2beta.CaseAttachmentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_sync", - "title": "Snippet for the get_attachment call in the CaseAttachmentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseAttachmentService::Client#get_attachment.", - "file": "case_attachment_service/get_attachment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_attachment", - "full_name": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client#get_attachment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::GetAttachmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::Attachment", - "client": { - "short_name": "CaseAttachmentService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseAttachmentService::Client" - }, - "method": { - "short_name": "GetAttachment", - "full_name": "google.cloud.support.v2beta.CaseAttachmentService.GetAttachment", - "service": { - "short_name": "CaseAttachmentService", - "full_name": "google.cloud.support.v2beta.CaseAttachmentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CaseService_GetCase_sync", - "title": "Snippet for the get_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#get_case.", - "file": "case_service/get_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_case", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#get_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::GetCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" - }, - "method": { - "short_name": "GetCase", - "full_name": "google.cloud.support.v2beta.CaseService.GetCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2beta.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CaseService_ListCases_sync", - "title": "Snippet for the list_cases call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#list_cases.", - "file": "case_service/list_cases.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_cases", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#list_cases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::ListCasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::ListCasesResponse", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" - }, - "method": { - "short_name": "ListCases", - "full_name": "google.cloud.support.v2beta.CaseService.ListCases", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2beta.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CaseService_SearchCases_sync", - "title": "Snippet for the search_cases call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#search_cases.", - "file": "case_service/search_cases.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_cases", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#search_cases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::SearchCasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::SearchCasesResponse", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" - }, - "method": { - "short_name": "SearchCases", - "full_name": "google.cloud.support.v2beta.CaseService.SearchCases", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2beta.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CaseService_CreateCase_sync", - "title": "Snippet for the create_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#create_case.", - "file": "case_service/create_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_case", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#create_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::CreateCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" - }, - "method": { - "short_name": "CreateCase", - "full_name": "google.cloud.support.v2beta.CaseService.CreateCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2beta.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CaseService_UpdateCase_sync", - "title": "Snippet for the update_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#update_case.", - "file": "case_service/update_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_case", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#update_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::UpdateCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" - }, - "method": { - "short_name": "UpdateCase", - "full_name": "google.cloud.support.v2beta.CaseService.UpdateCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2beta.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CaseService_EscalateCase_sync", - "title": "Snippet for the escalate_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#escalate_case.", - "file": "case_service/escalate_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "escalate_case", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#escalate_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::EscalateCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" - }, - "method": { - "short_name": "EscalateCase", - "full_name": "google.cloud.support.v2beta.CaseService.EscalateCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2beta.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CaseService_CloseCase_sync", - "title": "Snippet for the close_case call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#close_case.", - "file": "case_service/close_case.rb", - "language": "RUBY", - "client_method": { - "short_name": "close_case", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#close_case", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::CloseCaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::Case", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" - }, - "method": { - "short_name": "CloseCase", - "full_name": "google.cloud.support.v2beta.CaseService.CloseCase", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2beta.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_sync", - "title": "Snippet for the search_case_classifications call in the CaseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CaseService::Client#search_case_classifications.", - "file": "case_service/search_case_classifications.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_case_classifications", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client#search_case_classifications", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse", - "client": { - "short_name": "CaseService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CaseService::Client" - }, - "method": { - "short_name": "SearchCaseClassifications", - "full_name": "google.cloud.support.v2beta.CaseService.SearchCaseClassifications", - "service": { - "short_name": "CaseService", - "full_name": "google.cloud.support.v2beta.CaseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CommentService_ListComments_sync", - "title": "Snippet for the list_comments call in the CommentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CommentService::Client#list_comments.", - "file": "comment_service/list_comments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_comments", - "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client#list_comments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::ListCommentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::ListCommentsResponse", - "client": { - "short_name": "CommentService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client" - }, - "method": { - "short_name": "ListComments", - "full_name": "google.cloud.support.v2beta.CommentService.ListComments", - "service": { - "short_name": "CommentService", - "full_name": "google.cloud.support.v2beta.CommentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CommentService_CreateComment_sync", - "title": "Snippet for the create_comment call in the CommentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CommentService::Client#create_comment.", - "file": "comment_service/create_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_comment", - "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client#create_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::CreateCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::Comment", - "client": { - "short_name": "CommentService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client" - }, - "method": { - "short_name": "CreateComment", - "full_name": "google.cloud.support.v2beta.CommentService.CreateComment", - "service": { - "short_name": "CommentService", - "full_name": "google.cloud.support.v2beta.CommentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_CommentService_GetComment_sync", - "title": "Snippet for the get_comment call in the CommentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::CommentService::Client#get_comment.", - "file": "comment_service/get_comment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_comment", - "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client#get_comment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::GetCommentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::Comment", - "client": { - "short_name": "CommentService::Client", - "full_name": "::Google::Cloud::Support::V2beta::CommentService::Client" - }, - "method": { - "short_name": "GetComment", - "full_name": "google.cloud.support.v2beta.CommentService.GetComment", - "service": { - "short_name": "CommentService", - "full_name": "google.cloud.support.v2beta.CommentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudsupport_v2beta_generated_FeedService_ShowFeed_sync", - "title": "Snippet for the show_feed call in the FeedService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Support::V2beta::FeedService::Client#show_feed.", - "file": "feed_service/show_feed.rb", - "language": "RUBY", - "client_method": { - "short_name": "show_feed", - "full_name": "::Google::Cloud::Support::V2beta::FeedService::Client#show_feed", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Support::V2beta::ShowFeedRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Support::V2beta::ShowFeedResponse", - "client": { - "short_name": "FeedService::Client", - "full_name": "::Google::Cloud::Support::V2beta::FeedService::Client" - }, - "method": { - "short_name": "ShowFeed", - "full_name": "google.cloud.support.v2beta.FeedService.ShowFeed", - "service": { - "short_name": "FeedService", - "full_name": "google.cloud.support.v2beta.FeedService" - } - } - }, - "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-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_paths_test.rb deleted file mode 100644 index f4d4f4902887..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2beta/case_attachment_service" - -class ::Google::Cloud::Support::V2beta::CaseAttachmentService::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_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::Support::V2beta::CaseAttachmentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.attachment_path organization: "value0", case: "value1", attachment_id: "value2" - assert_equal "organizations/value0/cases/value1/attachments/value2", path - - path = client.attachment_path project: "value0", case: "value1", attachment_id: "value2" - assert_equal "projects/value0/cases/value1/attachments/value2", path - end - end - - def test_case_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.case_path organization: "value0", case: "value1" - assert_equal "organizations/value0/cases/value1", path - - path = client.case_path project: "value0", case: "value1" - assert_equal "projects/value0/cases/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_rest_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_rest_test.rb deleted file mode 100644 index 70430a5f3e1a..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_rest_test.rb +++ /dev/null @@ -1,209 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/support/v2beta/attachment_service_pb" -require "google/cloud/support/v2beta/case_attachment_service/rest" - - -class ::Google::Cloud::Support::V2beta::CaseAttachmentService::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_attachments - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::ListAttachmentsResponse.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_attachments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::ServiceStub.stub :transcode_list_attachments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_attachments_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_attachments({ 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_attachments 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_attachments ::Google::Cloud::Support::V2beta::ListAttachmentsRequest.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_attachments({ 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_attachments(::Google::Cloud::Support::V2beta::ListAttachmentsRequest.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_attachments_client_stub.call_count - end - end - end - - def test_get_attachment - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::Attachment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_attachment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::ServiceStub.stub :transcode_get_attachment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_attachment_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_attachment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_attachment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_attachment ::Google::Cloud::Support::V2beta::GetAttachmentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_attachment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_attachment(::Google::Cloud::Support::V2beta::GetAttachmentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_attachment_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::Support::V2beta::CaseAttachmentService::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::Support::V2beta::CaseAttachmentService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_test.rb deleted file mode 100644 index c1df673ec0a2..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_attachment_service_test.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! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2beta/attachment_service_pb" -require "google/cloud/support/v2beta/case_attachment_service" - -class ::Google::Cloud::Support::V2beta::CaseAttachmentService::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_attachments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::ListAttachmentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_attachments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_attachments, name - assert_kind_of ::Google::Cloud::Support::V2beta::ListAttachmentsRequest, 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_attachments_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_attachments({ parent: parent, page_size: page_size, page_token: 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_attachments parent: parent, page_size: page_size, page_token: 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_attachments ::Google::Cloud::Support::V2beta::ListAttachmentsRequest.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_attachments({ parent: parent, page_size: page_size, page_token: page_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_attachments(::Google::Cloud::Support::V2beta::ListAttachmentsRequest.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_attachments_client_stub.call_rpc_count - end - end - - def test_get_attachment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::Attachment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_attachment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_attachment, name - assert_kind_of ::Google::Cloud::Support::V2beta::GetAttachmentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_attachment_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_attachment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_attachment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_attachment ::Google::Cloud::Support::V2beta::GetAttachmentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_attachment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_attachment(::Google::Cloud::Support::V2beta::GetAttachmentRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_attachment_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2beta::CaseAttachmentService::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::Support::V2beta::CaseAttachmentService::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::Support::V2beta::CaseAttachmentService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Support::V2beta::CaseAttachmentService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_paths_test.rb deleted file mode 100644 index 6ec114696076..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_paths_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2beta/case_service" - -class ::Google::Cloud::Support::V2beta::CaseService::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_case_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.case_path organization: "value0", case: "value1" - assert_equal "organizations/value0/cases/value1", path - - path = client.case_path project: "value0", case: "value1" - assert_equal "projects/value0/cases/value1", path - end - end - - def test_organization_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_path organization: "value0" - assert_equal "organizations/value0", 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::Support::V2beta::CaseService::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-support-v2beta/test/google/cloud/support/v2beta/case_service_rest_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_rest_test.rb deleted file mode 100644 index 078eb2569b47..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_rest_test.rb +++ /dev/null @@ -1,544 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/support/v2beta/case_service_pb" -require "google/cloud/support/v2beta/case_service/rest" - - -class ::Google::Cloud::Support::V2beta::CaseService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_case - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::Case.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_get_case_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_case({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_case name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_case ::Google::Cloud::Support::V2beta::GetCaseRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_case({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_case(::Google::Cloud::Support::V2beta::GetCaseRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_case_client_stub.call_count - end - end - end - - def test_list_cases - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::ListCasesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - product_line = :PRODUCT_LINE_UNSPECIFIED - - list_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_list_cases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_cases_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_cases({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_cases parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_cases ::Google::Cloud::Support::V2beta::ListCasesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_cases({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_cases(::Google::Cloud::Support::V2beta::ListCasesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_cases_client_stub.call_count - end - end - end - - def test_search_cases - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::SearchCasesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_cases_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_search_cases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_cases_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_cases({ parent: parent, 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_cases parent: parent, 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_cases ::Google::Cloud::Support::V2beta::SearchCasesRequest.new(parent: parent, 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_cases({ parent: parent, 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_cases(::Google::Cloud::Support::V2beta::SearchCasesRequest.new(parent: parent, 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_cases_client_stub.call_count - end - end - end - - def test_create_case - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::Case.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - case_param = {} - - create_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_create_case_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_case({ parent: parent, case: case_param }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_case parent: parent, case: case_param do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_case ::Google::Cloud::Support::V2beta::CreateCaseRequest.new(parent: parent, case: case_param) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_case({ parent: parent, case: case_param }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_case(::Google::Cloud::Support::V2beta::CreateCaseRequest.new(parent: parent, case: case_param), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_case_client_stub.call_count - end - end - end - - def test_update_case - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::Case.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - case_param = {} - update_mask = {} - - update_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_update_case_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_case({ case: case_param, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_case case: case_param, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_case ::Google::Cloud::Support::V2beta::UpdateCaseRequest.new(case: case_param, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_case({ case: case_param, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_case(::Google::Cloud::Support::V2beta::UpdateCaseRequest.new(case: case_param, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_case_client_stub.call_count - end - end - end - - def test_escalate_case - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::Case.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - escalation = {} - - escalate_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_escalate_case_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, escalate_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.escalate_case({ name: name, escalation: escalation }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.escalate_case name: name, escalation: escalation do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.escalate_case ::Google::Cloud::Support::V2beta::EscalateCaseRequest.new(name: name, escalation: escalation) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.escalate_case({ name: name, escalation: escalation }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.escalate_case(::Google::Cloud::Support::V2beta::EscalateCaseRequest.new(name: name, escalation: escalation), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, escalate_case_client_stub.call_count - end - end - end - - def test_close_case - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::Case.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - close_case_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_close_case_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, close_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.close_case({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.close_case name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.close_case ::Google::Cloud::Support::V2beta::CloseCaseRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.close_case({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.close_case(::Google::Cloud::Support::V2beta::CloseCaseRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, close_case_client_stub.call_count - end - end - end - - def test_search_case_classifications - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - query = "hello world" - page_size = 42 - page_token = "hello world" - product = {} - - search_case_classifications_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CaseService::Rest::ServiceStub.stub :transcode_search_case_classifications_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_case_classifications_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_case_classifications({ query: query, page_size: page_size, page_token: page_token, product: product }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_case_classifications query: query, page_size: page_size, page_token: page_token, product: product do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_case_classifications ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new(query: query, page_size: page_size, page_token: page_token, product: product) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_case_classifications({ query: query, page_size: page_size, page_token: page_token, product: product }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_case_classifications(::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new(query: query, page_size: page_size, page_token: page_token, product: product), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_case_classifications_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::Support::V2beta::CaseService::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::Support::V2beta::CaseService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_test.rb deleted file mode 100644 index 802a838a7562..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/case_service_test.rb +++ /dev/null @@ -1,610 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2beta/case_service_pb" -require "google/cloud/support/v2beta/case_service" - -class ::Google::Cloud::Support::V2beta::CaseService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_case, name - assert_kind_of ::Google::Cloud::Support::V2beta::GetCaseRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_case({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_case name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_case ::Google::Cloud::Support::V2beta::GetCaseRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_case({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_case(::Google::Cloud::Support::V2beta::GetCaseRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_case_client_stub.call_rpc_count - end - end - - def test_list_cases - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::ListCasesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - product_line = :PRODUCT_LINE_UNSPECIFIED - - list_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_cases, name - assert_kind_of ::Google::Cloud::Support::V2beta::ListCasesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal :PRODUCT_LINE_UNSPECIFIED, request["product_line"] - assert request.has_product_line? - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_cases_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_cases({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_cases parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_cases ::Google::Cloud::Support::V2beta::ListCasesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_cases({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_cases(::Google::Cloud::Support::V2beta::ListCasesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, product_line: product_line), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_cases_client_stub.call_rpc_count - end - end - - def test_search_cases - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::SearchCasesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_cases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_cases, name - assert_kind_of ::Google::Cloud::Support::V2beta::SearchCasesRequest, request - assert_equal "hello world", request["parent"] - 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_cases_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_cases({ parent: parent, 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_cases parent: parent, 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_cases ::Google::Cloud::Support::V2beta::SearchCasesRequest.new(parent: parent, 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_cases({ parent: parent, 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_cases(::Google::Cloud::Support::V2beta::SearchCasesRequest.new(parent: parent, 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_cases_client_stub.call_rpc_count - end - end - - def test_create_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - case_param = {} - - create_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_case, name - assert_kind_of ::Google::Cloud::Support::V2beta::CreateCaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Case), request["case"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_case({ parent: parent, case: case_param }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_case parent: parent, case: case_param do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_case ::Google::Cloud::Support::V2beta::CreateCaseRequest.new(parent: parent, case: case_param) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_case({ parent: parent, case: case_param }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_case(::Google::Cloud::Support::V2beta::CreateCaseRequest.new(parent: parent, case: case_param), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_case_client_stub.call_rpc_count - end - end - - def test_update_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - case_param = {} - update_mask = {} - - update_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_case, name - assert_kind_of ::Google::Cloud::Support::V2beta::UpdateCaseRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Case), request["case"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_case({ case: case_param, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_case case: case_param, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_case ::Google::Cloud::Support::V2beta::UpdateCaseRequest.new(case: case_param, 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_case({ case: case_param, 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_case(::Google::Cloud::Support::V2beta::UpdateCaseRequest.new(case: case_param, 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_case_client_stub.call_rpc_count - end - end - - def test_escalate_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - escalation = {} - - escalate_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :escalate_case, name - assert_kind_of ::Google::Cloud::Support::V2beta::EscalateCaseRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Escalation), request["escalation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, escalate_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.escalate_case({ name: name, escalation: escalation }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.escalate_case name: name, escalation: escalation do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.escalate_case ::Google::Cloud::Support::V2beta::EscalateCaseRequest.new(name: name, escalation: escalation) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.escalate_case({ name: name, escalation: escalation }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.escalate_case(::Google::Cloud::Support::V2beta::EscalateCaseRequest.new(name: name, escalation: escalation), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, escalate_case_client_stub.call_rpc_count - end - end - - def test_close_case - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::Case.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - close_case_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :close_case, name - assert_kind_of ::Google::Cloud::Support::V2beta::CloseCaseRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, close_case_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.close_case({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.close_case name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.close_case ::Google::Cloud::Support::V2beta::CloseCaseRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.close_case({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.close_case(::Google::Cloud::Support::V2beta::CloseCaseRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, close_case_client_stub.call_rpc_count - end - end - - def test_search_case_classifications - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - query = "hello world" - page_size = 42 - page_token = "hello world" - product = {} - - search_case_classifications_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_case_classifications, name - assert_kind_of ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest, request - assert_equal "hello world", request["query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Product), request["product"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_case_classifications_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CaseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_case_classifications({ query: query, page_size: page_size, page_token: page_token, product: product }) do |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_case_classifications query: query, page_size: page_size, page_token: page_token, product: product do |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_case_classifications ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new(query: query, page_size: page_size, page_token: page_token, product: product) do |response, operation| - 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_case_classifications({ query: query, page_size: page_size, page_token: page_token, product: product }, grpc_options) do |response, operation| - 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_case_classifications(::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest.new(query: query, page_size: page_size, page_token: page_token, product: product), grpc_options) do |response, operation| - 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_case_classifications_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2beta::CaseService::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::Support::V2beta::CaseService::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::Support::V2beta::CaseService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Support::V2beta::CaseService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_paths_test.rb deleted file mode 100644 index 53f649553204..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2beta/comment_service" - -class ::Google::Cloud::Support::V2beta::CommentService::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_case_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.case_path organization: "value0", case: "value1" - assert_equal "organizations/value0/cases/value1", path - - path = client.case_path project: "value0", case: "value1" - assert_equal "projects/value0/cases/value1", path - end - end - - def test_comment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.comment_path organization: "value0", case: "value1", comment: "value2" - assert_equal "organizations/value0/cases/value1/comments/value2", path - - path = client.comment_path project: "value0", case: "value1", comment: "value2" - assert_equal "projects/value0/cases/value1/comments/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_rest_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_rest_test.rb deleted file mode 100644 index 066199206353..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_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/support/v2beta/comment_service_pb" -require "google/cloud/support/v2beta/comment_service/rest" - - -class ::Google::Cloud::Support::V2beta::CommentService::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_comments - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::ListCommentsResponse.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_comments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CommentService::Rest::ServiceStub.stub :transcode_list_comments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_comments_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_comments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_comments parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_comments ::Google::Cloud::Support::V2beta::ListCommentsRequest.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_comments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_comments(::Google::Cloud::Support::V2beta::ListCommentsRequest.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_comments_client_stub.call_count - end - end - end - - def test_create_comment - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::Comment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - comment = {} - - create_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CommentService::Rest::ServiceStub.stub :transcode_create_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_comment_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_comment({ parent: parent, comment: comment }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_comment parent: parent, comment: comment do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_comment ::Google::Cloud::Support::V2beta::CreateCommentRequest.new(parent: parent, comment: comment) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_comment({ parent: parent, comment: comment }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_comment(::Google::Cloud::Support::V2beta::CreateCommentRequest.new(parent: parent, comment: comment), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_comment_client_stub.call_count - end - end - end - - def test_get_comment - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::Comment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_comment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::CommentService::Rest::ServiceStub.stub :transcode_get_comment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_comment_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CommentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_comment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_comment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_comment ::Google::Cloud::Support::V2beta::GetCommentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_comment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_comment(::Google::Cloud::Support::V2beta::GetCommentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_comment_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Support::V2beta::CommentService::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::Support::V2beta::CommentService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_test.rb deleted file mode 100644 index 4de1a4b5418d..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/comment_service_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/support/v2beta/comment_service_pb" -require "google/cloud/support/v2beta/comment_service" - -class ::Google::Cloud::Support::V2beta::CommentService::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_comments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::ListCommentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_comments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_comments, name - assert_kind_of ::Google::Cloud::Support::V2beta::ListCommentsRequest, 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_comments_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_comments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_comments parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_comments ::Google::Cloud::Support::V2beta::ListCommentsRequest.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_comments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_comments(::Google::Cloud::Support::V2beta::ListCommentsRequest.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_comments_client_stub.call_rpc_count - end - end - - def test_create_comment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::Comment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - comment = {} - - create_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_comment, name - assert_kind_of ::Google::Cloud::Support::V2beta::CreateCommentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Support::V2beta::Comment), request["comment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_comment_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_comment({ parent: parent, comment: comment }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_comment parent: parent, comment: comment do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_comment ::Google::Cloud::Support::V2beta::CreateCommentRequest.new(parent: parent, comment: comment) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_comment({ parent: parent, comment: comment }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_comment(::Google::Cloud::Support::V2beta::CreateCommentRequest.new(parent: parent, comment: comment), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_comment_client_stub.call_rpc_count - end - end - - def test_get_comment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::Comment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_comment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_comment, name - assert_kind_of ::Google::Cloud::Support::V2beta::GetCommentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_comment_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_comment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_comment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_comment ::Google::Cloud::Support::V2beta::GetCommentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_comment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_comment(::Google::Cloud::Support::V2beta::GetCommentRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_comment_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Support::V2beta::CommentService::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::Support::V2beta::CommentService::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::Support::V2beta::CommentService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Support::V2beta::CommentService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_paths_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_paths_test.rb deleted file mode 100644 index 9f8927700ffe..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_paths_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2beta/feed_service" - -class ::Google::Cloud::Support::V2beta::FeedService::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_case_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Support::V2beta::FeedService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.case_path organization: "value0", case: "value1" - assert_equal "organizations/value0/cases/value1", path - - path = client.case_path project: "value0", case: "value1" - assert_equal "projects/value0/cases/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_rest_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_rest_test.rb deleted file mode 100644 index 2f9c2dd76ae8..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_rest_test.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 "helper" -require "gapic/rest" -require "google/cloud/support/v2beta/feed_service_pb" -require "google/cloud/support/v2beta/feed_service/rest" - - -class ::Google::Cloud::Support::V2beta::FeedService::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_show_feed - # Create test objects. - client_result = ::Google::Cloud::Support::V2beta::ShowFeedResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - order_by = "hello world" - page_size = 42 - page_token = "hello world" - - show_feed_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Support::V2beta::FeedService::Rest::ServiceStub.stub :transcode_show_feed_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, show_feed_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::FeedService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.show_feed({ parent: parent, order_by: order_by, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.show_feed parent: parent, order_by: order_by, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.show_feed ::Google::Cloud::Support::V2beta::ShowFeedRequest.new(parent: parent, order_by: order_by, 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.show_feed({ parent: parent, order_by: order_by, 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.show_feed(::Google::Cloud::Support::V2beta::ShowFeedRequest.new(parent: parent, order_by: order_by, 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, show_feed_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::Support::V2beta::FeedService::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::Support::V2beta::FeedService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_test.rb b/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_test.rb deleted file mode 100644 index 157da6ac9ba3..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/google/cloud/support/v2beta/feed_service_test.rb +++ /dev/null @@ -1,173 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/support/v2beta/feed_service_pb" -require "google/cloud/support/v2beta/feed_service" - -class ::Google::Cloud::Support::V2beta::FeedService::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_show_feed - # Create GRPC objects. - grpc_response = ::Google::Cloud::Support::V2beta::ShowFeedResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - order_by = "hello world" - page_size = 42 - page_token = "hello world" - - show_feed_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :show_feed, name - assert_kind_of ::Google::Cloud::Support::V2beta::ShowFeedRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["order_by"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, show_feed_client_stub do - # Create client - client = ::Google::Cloud::Support::V2beta::FeedService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.show_feed({ parent: parent, order_by: order_by, page_size: page_size, page_token: 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.show_feed parent: parent, order_by: order_by, page_size: page_size, page_token: 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.show_feed ::Google::Cloud::Support::V2beta::ShowFeedRequest.new(parent: parent, order_by: order_by, page_size: page_size, page_token: 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.show_feed({ parent: parent, order_by: order_by, page_size: page_size, page_token: page_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.show_feed(::Google::Cloud::Support::V2beta::ShowFeedRequest.new(parent: parent, order_by: order_by, page_size: page_size, page_token: page_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, show_feed_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Support::V2beta::FeedService::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::Support::V2beta::FeedService::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::Support::V2beta::FeedService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Support::V2beta::FeedService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-support-v2beta/test/helper.rb b/owl-bot-staging/google-cloud-support-v2beta/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-support-v2beta/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-talent-v4/.gitignore b/owl-bot-staging/google-cloud-talent-v4/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.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-talent-v4/.repo-metadata.json b/owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json deleted file mode 100644 index 2798805ded2c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "jobs.googleapis.com", - "api_shortname": "jobs", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest", - "distribution_name": "google-cloud-talent-v4", - "is_cloud": true, - "language": "ruby", - "name": "jobs", - "name_pretty": "Cloud Talent Solution V4 API", - "product_documentation": "https://cloud.google.com/solutions/talent-solution", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TALENT", - "ruby-cloud-product-url": "https://cloud.google.com/solutions/talent-solution", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml b/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml deleted file mode 100644 index bd272e76c0ea..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-talent-v4.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-talent-v4.rb" diff --git a/owl-bot-staging/google-cloud-talent-v4/.toys.rb b/owl-bot-staging/google-cloud-talent-v4/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.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-talent-v4/.yardopts b/owl-bot-staging/google-cloud-talent-v4/.yardopts deleted file mode 100644 index 5c7f550fa4ae..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Talent Solution V4 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-talent-v4/AUTHENTICATION.md b/owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md deleted file mode 100644 index 3ee7d3b9820d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-talent-v4 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-talent-v4 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/talent/v4" - -client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/talent/v4" - -::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Talent::V4::CompanyService::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-talent-v4 -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/talent/v4" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Talent::V4::CompanyService::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-talent-v4/CHANGELOG.md b/owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-talent-v4/Gemfile b/owl-bot-staging/google-cloud-talent-v4/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-talent-v4/LICENSE.md b/owl-bot-staging/google-cloud-talent-v4/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/README.md b/owl-bot-staging/google-cloud-talent-v4/README.md deleted file mode 100644 index dcd4f76bc132..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Talent Solution V4 API - -Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. - -Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. - -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 Talent Solution V4 API. Most users should consider using -the main client gem, -[google-cloud-talent](https://rubygems.org/gems/google-cloud-talent). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-talent-v4 -``` - -## 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/jobs.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/talent/v4" - -client = ::Google::Cloud::Talent::V4::CompanyService::Client.new -request = ::Google::Cloud::Talent::V4::CreateCompanyRequest.new # (request fields as keyword arguments...) -response = client.create_company request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/solutions/talent-solution) -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/talent/v4" -require "logger" - -client = ::Google::Cloud::Talent::V4::CompanyService::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-talent`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-talent-v4`. -_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-talent`. -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-talent-v4`. - -### 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-talent-v4/Rakefile b/owl-bot-staging/google-cloud-talent-v4/Rakefile deleted file mode 100644 index e241f71a45d3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TALENT_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TALENT_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TALENT_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 TALENT_TEST_PROJECT=test123 TALENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/talent/v4/company_service/credentials" - ::Google::Cloud::Talent::V4::CompanyService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TALENT_PROJECT"] = project - ENV["TALENT_TEST_PROJECT"] = project - ENV["TALENT_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-talent-v4 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-talent-v4 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-talent-v4 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-talent-v4 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-talent-v4" - header "google-cloud-talent-v4 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-talent-v4 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-talent-v4 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-talent-v4 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-talent-v4 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-talent-v4/gapic_metadata.json b/owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json deleted file mode 100644 index 12740756819f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.talent.v4", - "libraryPackage": "::Google::Cloud::Talent::V4", - "services": { - "CompanyService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::CompanyService::Client", - "rpcs": { - "CreateCompany": { - "methods": [ - "create_company" - ] - }, - "GetCompany": { - "methods": [ - "get_company" - ] - }, - "UpdateCompany": { - "methods": [ - "update_company" - ] - }, - "DeleteCompany": { - "methods": [ - "delete_company" - ] - }, - "ListCompanies": { - "methods": [ - "list_companies" - ] - } - } - } - } - }, - "Completion": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::Completion::Client", - "rpcs": { - "CompleteQuery": { - "methods": [ - "complete_query" - ] - } - } - } - } - }, - "EventService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::EventService::Client", - "rpcs": { - "CreateClientEvent": { - "methods": [ - "create_client_event" - ] - } - } - } - } - }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::JobService::Client", - "rpcs": { - "CreateJob": { - "methods": [ - "create_job" - ] - }, - "BatchCreateJobs": { - "methods": [ - "batch_create_jobs" - ] - }, - "GetJob": { - "methods": [ - "get_job" - ] - }, - "UpdateJob": { - "methods": [ - "update_job" - ] - }, - "BatchUpdateJobs": { - "methods": [ - "batch_update_jobs" - ] - }, - "DeleteJob": { - "methods": [ - "delete_job" - ] - }, - "BatchDeleteJobs": { - "methods": [ - "batch_delete_jobs" - ] - }, - "ListJobs": { - "methods": [ - "list_jobs" - ] - }, - "SearchJobs": { - "methods": [ - "search_jobs" - ] - }, - "SearchJobsForAlert": { - "methods": [ - "search_jobs_for_alert" - ] - } - } - } - } - }, - "TenantService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::TenantService::Client", - "rpcs": { - "CreateTenant": { - "methods": [ - "create_tenant" - ] - }, - "GetTenant": { - "methods": [ - "get_tenant" - ] - }, - "UpdateTenant": { - "methods": [ - "update_tenant" - ] - }, - "DeleteTenant": { - "methods": [ - "delete_tenant" - ] - }, - "ListTenants": { - "methods": [ - "list_tenants" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec b/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec deleted file mode 100644 index 5049db4d8c44..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/talent/v4/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-talent-v4" - gem.version = Google::Cloud::Talent::V4::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details." - gem.summary = "Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb deleted file mode 100644 index c715c2e0b79a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.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/talent/v4" diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb deleted file mode 100644 index 35c2c38a0397..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.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 "google/cloud/talent/v4/company_service" -require "google/cloud/talent/v4/completion" -require "google/cloud/talent/v4/event_service" -require "google/cloud/talent/v4/job_service" -require "google/cloud/talent/v4/tenant_service" -require "google/cloud/talent/v4/version" - -module Google - module Cloud - module Talent - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/talent/v4" - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/talent/v4" - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - module V4 - end - end - end -end - -helper_path = ::File.join __dir__, "v4", "_helpers.rb" -require "google/cloud/talent/v4/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb deleted file mode 100644 index a5e32d18e6ca..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' -require 'google/type/latlng_pb' -require 'google/type/money_pb' -require 'google/type/postal_address_pb' - - -descriptor_data = "\n#google/cloud/talent/v4/common.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x18google/type/latlng.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\"n\n\x0eTimestampRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb2\x03\n\x08Location\x12\x44\n\rlocation_type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.Location.LocationType\x12\x32\n\x0epostal_address\x18\x02 \x01(\x0b\x32\x1a.google.type.PostalAddress\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x14\n\x0cradius_miles\x18\x04 \x01(\x01\"\xef\x01\n\x0cLocationType\x12\x1d\n\x19LOCATION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43OUNTRY\x10\x01\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x02\x12\x1b\n\x17SUB_ADMINISTRATIVE_AREA\x10\x03\x12\x0c\n\x08LOCALITY\x10\x04\x12\x0f\n\x0bPOSTAL_CODE\x10\x05\x12\x10\n\x0cSUB_LOCALITY\x10\x06\x12\x12\n\x0eSUB_LOCALITY_1\x10\x07\x12\x12\n\x0eSUB_LOCALITY_2\x10\x08\x12\x10\n\x0cNEIGHBORHOOD\x10\t\x12\x12\n\x0eSTREET_ADDRESS\x10\n\"\x9a\x01\n\x0fRequestMetadata\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x12\n\nsession_id\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x19\n\x11\x61llow_missing_ids\x18\x04 \x01(\x08\x12\x37\n\x0b\x64\x65vice_info\x18\x05 \x01(\x0b\x32\".google.cloud.talent.v4.DeviceInfo\"&\n\x10ResponseMetadata\x12\x12\n\nrequest_id\x18\x01 \x01(\t\"\xca\x01\n\nDeviceInfo\x12\x42\n\x0b\x64\x65vice_type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.DeviceInfo.DeviceType\x12\n\n\x02id\x18\x02 \x01(\t\"l\n\nDeviceType\x12\x1b\n\x17\x44\x45VICE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x0e\n\nMOBILE_WEB\x10\x02\x12\x0b\n\x07\x41NDROID\x10\x03\x12\x07\n\x03IOS\x10\x04\x12\x07\n\x03\x42OT\x10\x05\x12\t\n\x05OTHER\x10\x06\"m\n\x0f\x43ustomAttribute\x12\x15\n\rstring_values\x18\x01 \x03(\t\x12\x13\n\x0blong_values\x18\x02 \x03(\x03\x12\x12\n\nfilterable\x18\x03 \x01(\x08\x12\x1a\n\x12keyword_searchable\x18\x04 \x01(\x08\"W\n\x12SpellingCorrection\x12\x11\n\tcorrected\x18\x01 \x01(\x08\x12\x16\n\x0e\x63orrected_text\x18\x02 \x01(\t\x12\x16\n\x0e\x63orrected_html\x18\x03 \x01(\t\"\x88\t\n\x10\x43ompensationInfo\x12K\n\x07\x65ntries\x18\x01 \x03(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationEntry\x12k\n\"annualized_base_compensation_range\x18\x02 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x12l\n#annualized_total_compensation_range\x18\x03 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x1a\x83\x03\n\x11\x43ompensationEntry\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationType\x12G\n\x04unit\x18\x02 \x01(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationUnit\x12$\n\x06\x61mount\x18\x03 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12K\n\x05range\x18\x04 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12=\n\x17\x65xpected_units_per_year\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValueB\x15\n\x13\x63ompensation_amount\x1ao\n\x11\x43ompensationRange\x12,\n\x10max_compensation\x18\x02 \x01(\x0b\x32\x12.google.type.Money\x12,\n\x10min_compensation\x18\x01 \x01(\x0b\x32\x12.google.type.Money\"\xb5\x01\n\x10\x43ompensationType\x12!\n\x1d\x43OMPENSATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42\x41SE\x10\x01\x12\t\n\x05\x42ONUS\x10\x02\x12\x11\n\rSIGNING_BONUS\x10\x03\x12\n\n\x06\x45QUITY\x10\x04\x12\x12\n\x0ePROFIT_SHARING\x10\x05\x12\x0f\n\x0b\x43OMMISSIONS\x10\x06\x12\x08\n\x04TIPS\x10\x07\x12\x1b\n\x17OTHER_COMPENSATION_TYPE\x10\x08\"\x9c\x01\n\x10\x43ompensationUnit\x12!\n\x1d\x43OMPENSATION_UNIT_UNSPECIFIED\x10\x00\x12\n\n\x06HOURLY\x10\x01\x12\t\n\x05\x44\x41ILY\x10\x02\x12\n\n\x06WEEKLY\x10\x03\x12\x0b\n\x07MONTHLY\x10\x04\x12\n\n\x06YEARLY\x10\x05\x12\x0c\n\x08ONE_TIME\x10\x06\x12\x1b\n\x17OTHER_COMPENSATION_UNIT\x10\x07\"\xc7\x03\n\x16\x42\x61tchOperationMetadata\x12\x43\n\x05state\x18\x01 \x01(\x0e\x32\x34.google.cloud.talent.v4.BatchOperationMetadata.State\x12\x19\n\x11state_description\x18\x02 \x01(\t\x12\x15\n\rsuccess_count\x18\x03 \x01(\x05\x12\x15\n\rfailure_count\x18\x04 \x01(\x05\x12\x13\n\x0btotal_count\x18\x05 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"z\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06*y\n\x0b\x43ompanySize\x12\x1c\n\x18\x43OMPANY_SIZE_UNSPECIFIED\x10\x00\x12\x08\n\x04MINI\x10\x01\x12\t\n\x05SMALL\x10\x02\x12\x0b\n\x07SMEDIUM\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x07\n\x03\x42IG\x10\x05\x12\n\n\x06\x42IGGER\x10\x06\x12\t\n\x05GIANT\x10\x07*\xe2\x01\n\nJobBenefit\x12\x1b\n\x17JOB_BENEFIT_UNSPECIFIED\x10\x00\x12\x0e\n\nCHILD_CARE\x10\x01\x12\n\n\x06\x44\x45NTAL\x10\x02\x12\x14\n\x10\x44OMESTIC_PARTNER\x10\x03\x12\x12\n\x0e\x46LEXIBLE_HOURS\x10\x04\x12\x0b\n\x07MEDICAL\x10\x05\x12\x12\n\x0eLIFE_INSURANCE\x10\x06\x12\x12\n\x0ePARENTAL_LEAVE\x10\x07\x12\x13\n\x0fRETIREMENT_PLAN\x10\x08\x12\r\n\tSICK_DAYS\x10\t\x12\x0c\n\x08VACATION\x10\n\x12\n\n\x06VISION\x10\x0b*\x8e\x02\n\nDegreeType\x12\x1b\n\x17\x44\x45GREE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11PRIMARY_EDUCATION\x10\x01\x12\x1d\n\x19LOWER_SECONDARY_EDUCATION\x10\x02\x12\x1d\n\x19UPPER_SECONDARY_EDUCATION\x10\x03\x12\x1c\n\x18\x41\x44ULT_REMEDIAL_EDUCATION\x10\x04\x12\x1c\n\x18\x41SSOCIATES_OR_EQUIVALENT\x10\x05\x12\x1b\n\x17\x42\x41\x43HELORS_OR_EQUIVALENT\x10\x06\x12\x19\n\x15MASTERS_OR_EQUIVALENT\x10\x07\x12\x1a\n\x16\x44OCTORAL_OR_EQUIVALENT\x10\x08*\xdc\x01\n\x0e\x45mploymentType\x12\x1f\n\x1b\x45MPLOYMENT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFULL_TIME\x10\x01\x12\r\n\tPART_TIME\x10\x02\x12\x0e\n\nCONTRACTOR\x10\x03\x12\x14\n\x10\x43ONTRACT_TO_HIRE\x10\x04\x12\r\n\tTEMPORARY\x10\x05\x12\n\n\x06INTERN\x10\x06\x12\r\n\tVOLUNTEER\x10\x07\x12\x0c\n\x08PER_DIEM\x10\x08\x12\x12\n\x0e\x46LY_IN_FLY_OUT\x10\t\x12\x19\n\x15OTHER_EMPLOYMENT_TYPE\x10\n*q\n\x08JobLevel\x12\x19\n\x15JOB_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x45NTRY_LEVEL\x10\x01\x12\x0f\n\x0b\x45XPERIENCED\x10\x02\x12\x0b\n\x07MANAGER\x10\x03\x12\x0c\n\x08\x44IRECTOR\x10\x04\x12\r\n\tEXECUTIVE\x10\x05*\xba\x06\n\x0bJobCategory\x12\x1c\n\x18JOB_CATEGORY_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x41\x43\x43OUNTING_AND_FINANCE\x10\x01\x12\x1d\n\x19\x41\x44MINISTRATIVE_AND_OFFICE\x10\x02\x12\x1d\n\x19\x41\x44VERTISING_AND_MARKETING\x10\x03\x12\x0f\n\x0b\x41NIMAL_CARE\x10\x04\x12\x1a\n\x16\x41RT_FASHION_AND_DESIGN\x10\x05\x12\x17\n\x13\x42USINESS_OPERATIONS\x10\x06\x12\x1b\n\x17\x43LEANING_AND_FACILITIES\x10\x07\x12\x13\n\x0f\x43OMPUTER_AND_IT\x10\x08\x12\x10\n\x0c\x43ONSTRUCTION\x10\t\x12\x14\n\x10\x43USTOMER_SERVICE\x10\n\x12\r\n\tEDUCATION\x10\x0b\x12\x1c\n\x18\x45NTERTAINMENT_AND_TRAVEL\x10\x0c\x12\x18\n\x14\x46\x41RMING_AND_OUTDOORS\x10\r\x12\x0e\n\nHEALTHCARE\x10\x0e\x12\x13\n\x0fHUMAN_RESOURCES\x10\x0f\x12\'\n#INSTALLATION_MAINTENANCE_AND_REPAIR\x10\x10\x12\t\n\x05LEGAL\x10\x11\x12\x0e\n\nMANAGEMENT\x10\x12\x12\x1f\n\x1bMANUFACTURING_AND_WAREHOUSE\x10\x13\x12$\n MEDIA_COMMUNICATIONS_AND_WRITING\x10\x14\x12\x16\n\x12OIL_GAS_AND_MINING\x10\x15\x12\x1e\n\x1aPERSONAL_CARE_AND_SERVICES\x10\x16\x12\x17\n\x13PROTECTIVE_SERVICES\x10\x17\x12\x0f\n\x0bREAL_ESTATE\x10\x18\x12\x1e\n\x1aRESTAURANT_AND_HOSPITALITY\x10\x19\x12\x14\n\x10SALES_AND_RETAIL\x10\x1a\x12\x1b\n\x17SCIENCE_AND_ENGINEERING\x10\x1b\x12\"\n\x1eSOCIAL_SERVICES_AND_NON_PROFIT\x10\x1c\x12!\n\x1dSPORTS_FITNESS_AND_RECREATION\x10\x1d\x12 \n\x1cTRANSPORTATION_AND_LOGISTICS\x10\x1e*e\n\rPostingRegion\x12\x1e\n\x1aPOSTING_REGION_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x01\x12\n\n\x06NATION\x10\x02\x12\x0f\n\x0bTELECOMMUTE\x10\x03*n\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x41\x43\x43OUNT_ONLY\x10\x01\x12\x16\n\x12SHARED_WITH_GOOGLE\x10\x02\x12\x16\n\x12SHARED_WITH_PUBLIC\x10\x03\x1a\x02\x18\x01*q\n\x10HtmlSanitization\x12!\n\x1dHTML_SANITIZATION_UNSPECIFIED\x10\x00\x12\x1e\n\x1aHTML_SANITIZATION_DISABLED\x10\x01\x12\x1a\n\x16SIMPLE_FORMATTING_ONLY\x10\x02*{\n\rCommuteMethod\x12\x1e\n\x1a\x43OMMUTE_METHOD_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44RIVING\x10\x01\x12\x0b\n\x07TRANSIT\x10\x02\x12\x0b\n\x07WALKING\x10\x03\x12\x0b\n\x07\x43YCLING\x10\x04\x12\x16\n\x12TRANSIT_ACCESSIBLE\x10\x05\x42\x65\n\x1a\x63om.google.cloud.talent.v4B\x0b\x43ommonProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - TimestampRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.TimestampRange").msgclass - Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Location").msgclass - Location::LocationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Location.LocationType").enummodule - RequestMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.RequestMetadata").msgclass - ResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ResponseMetadata").msgclass - DeviceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeviceInfo").msgclass - DeviceInfo::DeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeviceInfo.DeviceType").enummodule - CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CustomAttribute").msgclass - SpellingCorrection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SpellingCorrection").msgclass - CompensationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo").msgclass - CompensationInfo::CompensationEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationEntry").msgclass - CompensationInfo::CompensationRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationRange").msgclass - CompensationInfo::CompensationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationType").enummodule - CompensationInfo::CompensationUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationUnit").enummodule - BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchOperationMetadata").msgclass - BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchOperationMetadata.State").enummodule - CompanySize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompanySize").enummodule - JobBenefit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobBenefit").enummodule - DegreeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DegreeType").enummodule - EmploymentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.EmploymentType").enummodule - JobLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobLevel").enummodule - JobCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobCategory").enummodule - PostingRegion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.PostingRegion").enummodule - Visibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Visibility").enummodule - HtmlSanitization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HtmlSanitization").enummodule - CommuteMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteMethod").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb deleted file mode 100644 index db5dbb35870f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/company.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/talent/v4/common_pb' - - -descriptor_data = "\n$google/cloud/talent/v4/company.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\"\xc8\x04\n\x07\x43ompany\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x65xternal_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x04size\x18\x04 \x01(\x0e\x32#.google.cloud.talent.v4.CompanySize\x12\x1c\n\x14headquarters_address\x18\x05 \x01(\t\x12\x15\n\rhiring_agency\x18\x06 \x01(\x08\x12\x10\n\x08\x65\x65o_text\x18\x07 \x01(\t\x12\x13\n\x0bwebsite_uri\x18\x08 \x01(\t\x12\x17\n\x0f\x63\x61reer_site_uri\x18\t \x01(\t\x12\x11\n\timage_uri\x18\n \x01(\t\x12\x34\n(keyword_searchable_job_custom_attributes\x18\x0b \x03(\tB\x02\x18\x01\x12\x46\n\x0c\x64\x65rived_info\x18\x0c \x01(\x0b\x32+.google.cloud.talent.v4.Company.DerivedInfoB\x03\xe0\x41\x03\x12\x16\n\tsuspended\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x1aN\n\x0b\x44\x65rivedInfo\x12?\n\x15headquarters_location\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4.Location:Y\xea\x41V\n\x1bjobs.googleapis.com/Company\x12\x37projects/{project}/tenants/{tenant}/companies/{company}Bf\n\x1a\x63om.google.cloud.talent.v4B\x0c\x43ompanyProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - Company = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Company").msgclass - Company::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Company.DerivedInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb deleted file mode 100644 index 948f3a46bcd2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_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/talent/v4/version" - -require "google/cloud/talent/v4/company_service/credentials" -require "google/cloud/talent/v4/company_service/paths" -require "google/cloud/talent/v4/company_service/client" -require "google/cloud/talent/v4/company_service/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service that handles company management, including CRUD and enumeration. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/company_service" - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/company_service/rest" - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - module CompanyService - end - end - end - end -end - -helper_path = ::File.join __dir__, "company_service", "helpers.rb" -require "google/cloud/talent/v4/company_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb deleted file mode 100644 index 174536c919cc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb +++ /dev/null @@ -1,909 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/company_service_pb" - -module Google - module Cloud - module Talent - module V4 - module CompanyService - ## - # Client for the CompanyService service. - # - # A service that handles company management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :company_service_stub - - ## - # Configure the CompanyService Client class. - # - # See {::Google::Cloud::Talent::V4::CompanyService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompanyService clients - # ::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_company.timeout = 30.0 - - default_config.rpcs.get_company.timeout = 30.0 - default_config.rpcs.get_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_company.timeout = 30.0 - - default_config.rpcs.delete_company.timeout = 30.0 - default_config.rpcs.delete_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_companies.timeout = 30.0 - default_config.rpcs.list_companies.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompanyService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::CompanyService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @company_service_stub.universe_domain - end - - ## - # Create a new CompanyService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompanyService 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/talent/v4/company_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 - - @company_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::CompanyService::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 - ) - - @company_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 - @company_service_stub.logger - end - - # Service calls - - ## - # Creates a new company entity. - # - # @overload create_company(request, options = nil) - # Pass arguments to `create_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_company(parent: nil, company: nil) - # Pass arguments to `create_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] - # Required. The company to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateCompanyRequest.new - # - # # Call the create_company method. - # result = client.create_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def create_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateCompanyRequest - - # Converts hash and nil to 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_company.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :create_company, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified company. - # - # @overload get_company(request, options = nil) - # Pass arguments to `get_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_company(name: nil) - # Pass arguments to `get_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the company to be retrieved. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/api-test-project/tenants/foo/companies/bar". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetCompanyRequest.new - # - # # Call the get_company method. - # result = client.get_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def get_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetCompanyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_company.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :get_company, request, 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 specified company. - # - # @overload update_company(request, options = nil) - # Pass arguments to `update_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_company(company: nil, update_mask: nil) - # Pass arguments to `update_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] - # Required. The company resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the company fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Company Company} are - # supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new - # - # # Call the update_company method. - # result = client.update_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def update_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateCompanyRequest - - # Converts hash and nil to 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_company.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.company&.name - header_params["company.name"] = request.company.name - end - - request_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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :update_company, request, 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 specified company. - # Prerequisite: The company has no jobs associated with it. - # - # @overload delete_company(request, options = nil) - # Pass arguments to `delete_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_company(name: nil) - # Pass arguments to `delete_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the company to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new - # - # # Call the delete_company method. - # result = client.delete_company request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteCompanyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_company.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :delete_company, request, 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 companies associated with the project. - # - # @overload list_companies(request, options = nil) - # Pass arguments to `list_companies` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListCompaniesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) - # Pass arguments to `list_companies` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of companies to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @param require_open_jobs [::Boolean] - # Set to true if the companies requested must have open jobs. - # - # Defaults to false. - # - # If true, at most - # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of - # companies are fetched, among which only those with open jobs are returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListCompaniesRequest.new - # - # # Call the list_companies method. - # result = client.list_companies request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Talent::V4::Company. - # p item - # end - # - def list_companies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListCompaniesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_companies.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_companies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_companies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :list_companies, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @company_service_stub, :list_companies, request, response, 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 CompanyService API. - # - # This class represents the configuration for CompanyService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::CompanyService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_company to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Talent::V4::CompanyService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CompanyService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_company` - # @return [::Gapic::Config::Method] - # - attr_reader :create_company - ## - # RPC-specific configuration for `get_company` - # @return [::Gapic::Config::Method] - # - attr_reader :get_company - ## - # RPC-specific configuration for `update_company` - # @return [::Gapic::Config::Method] - # - attr_reader :update_company - ## - # RPC-specific configuration for `delete_company` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_company - ## - # RPC-specific configuration for `list_companies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_companies - - # @private - def initialize parent_rpcs = nil - create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company - @create_company = ::Gapic::Config::Method.new create_company_config - get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company - @get_company = ::Gapic::Config::Method.new get_company_config - update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company - @update_company = ::Gapic::Config::Method.new update_company_config - delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company - @delete_company = ::Gapic::Config::Method.new delete_company_config - list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies - @list_companies = ::Gapic::Config::Method.new list_companies_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb deleted file mode 100644 index 6cb90fd7eecb..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Talent - module V4 - module CompanyService - # Credentials for the CompanyService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb deleted file mode 100644 index c4a717b39ab8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - module CompanyService - # Path helper methods for the CompanyService API. - module Paths - ## - # Create a fully-qualified Company resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/companies/{company}` - # - # @param project [String] - # @param tenant [String] - # @param company [String] - # - # @return [::String] - def company_path project:, tenant:, company: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/companies/#{company}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb deleted file mode 100644 index 3c513e88db2d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_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/talent/v4/version" - -require "google/cloud/talent/v4/company_service/credentials" -require "google/cloud/talent/v4/company_service/paths" -require "google/cloud/talent/v4/company_service/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service that handles company management, including CRUD and enumeration. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/company_service/rest" - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - module CompanyService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/company_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb deleted file mode 100644 index f1d3ac698682..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb +++ /dev/null @@ -1,831 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/company_service_pb" -require "google/cloud/talent/v4/company_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module CompanyService - module Rest - ## - # REST client for the CompanyService service. - # - # A service that handles company management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :company_service_stub - - ## - # Configure the CompanyService Client class. - # - # See {::Google::Cloud::Talent::V4::CompanyService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompanyService clients - # ::Google::Cloud::Talent::V4::CompanyService::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", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_company.timeout = 30.0 - - default_config.rpcs.get_company.timeout = 30.0 - default_config.rpcs.get_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_company.timeout = 30.0 - - default_config.rpcs.delete_company.timeout = 30.0 - default_config.rpcs.delete_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_companies.timeout = 30.0 - default_config.rpcs.list_companies.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompanyService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::CompanyService::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 - @company_service_stub.universe_domain - end - - ## - # Create a new CompanyService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompanyService 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 - - @company_service_stub = ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @company_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 - @company_service_stub.logger - end - - # Service calls - - ## - # Creates a new company entity. - # - # @overload create_company(request, options = nil) - # Pass arguments to `create_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_company(parent: nil, company: nil) - # Pass arguments to `create_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] - # Required. The company to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateCompanyRequest.new - # - # # Call the create_company method. - # result = client.create_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def create_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateCompanyRequest - - # Converts hash and nil to an 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_company.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.create_company request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified company. - # - # @overload get_company(request, options = nil) - # Pass arguments to `get_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_company(name: nil) - # Pass arguments to `get_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the company to be retrieved. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/api-test-project/tenants/foo/companies/bar". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetCompanyRequest.new - # - # # Call the get_company method. - # result = client.get_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def get_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetCompanyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_company.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.get_company request, 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 specified company. - # - # @overload update_company(request, options = nil) - # Pass arguments to `update_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_company(company: nil, update_mask: nil) - # Pass arguments to `update_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] - # Required. The company resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the company fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Company Company} are - # supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new - # - # # Call the update_company method. - # result = client.update_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def update_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateCompanyRequest - - # Converts hash and nil to an 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_company.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.update_company request, 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 specified company. - # Prerequisite: The company has no jobs associated with it. - # - # @overload delete_company(request, options = nil) - # Pass arguments to `delete_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_company(name: nil) - # Pass arguments to `delete_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the company to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new - # - # # Call the delete_company method. - # result = client.delete_company request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteCompanyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_company.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.delete_company request, 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 companies associated with the project. - # - # @overload list_companies(request, options = nil) - # Pass arguments to `list_companies` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListCompaniesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) - # Pass arguments to `list_companies` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of companies to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @param require_open_jobs [::Boolean] - # Set to true if the companies requested must have open jobs. - # - # Defaults to false. - # - # If true, at most - # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of - # companies are fetched, among which only those with open jobs are returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListCompaniesRequest.new - # - # # Call the list_companies method. - # result = client.list_companies request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Talent::V4::Company. - # p item - # end - # - def list_companies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListCompaniesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_companies.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_companies.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_companies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.list_companies request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @company_service_stub, :list_companies, "companies", request, result, 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 CompanyService REST API. - # - # This class represents the configuration for CompanyService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::CompanyService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_company to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CompanyService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_company` - # @return [::Gapic::Config::Method] - # - attr_reader :create_company - ## - # RPC-specific configuration for `get_company` - # @return [::Gapic::Config::Method] - # - attr_reader :get_company - ## - # RPC-specific configuration for `update_company` - # @return [::Gapic::Config::Method] - # - attr_reader :update_company - ## - # RPC-specific configuration for `delete_company` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_company - ## - # RPC-specific configuration for `list_companies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_companies - - # @private - def initialize parent_rpcs = nil - create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company - @create_company = ::Gapic::Config::Method.new create_company_config - get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company - @get_company = ::Gapic::Config::Method.new get_company_config - update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company - @update_company = ::Gapic::Config::Method.new update_company_config - delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company - @delete_company = ::Gapic::Config::Method.new delete_company_config - list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies - @list_companies = ::Gapic::Config::Method.new list_companies_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb deleted file mode 100644 index c890988eb823..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb +++ /dev/null @@ -1,388 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/talent/v4/company_service_pb" - -module Google - module Cloud - module Talent - module V4 - module CompanyService - module Rest - ## - # REST service stub for the CompanyService 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_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateCompanyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # A result object deserialized from the server's reply - def create_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_company_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetCompanyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # A result object deserialized from the server's reply - def get_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_company_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Company.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_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateCompanyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # A result object deserialized from the server's reply - def update_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_company_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteCompanyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_company_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_companies REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListCompaniesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::ListCompaniesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::ListCompaniesResponse] - # A result object deserialized from the server's reply - def list_companies request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_companies_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_companies", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.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_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/companies", - body: "company", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetCompanyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v4/{company.name}", - body: "company", - matches: [ - ["company.name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteCompanyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_companies REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListCompaniesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_companies_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{parent}/companies", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb deleted file mode 100644 index f07901a1adfe..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/company_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/talent/v4/common_pb' -require 'google/cloud/talent/v4/company_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n,google/cloud/talent/v4/company_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a$google/cloud/talent/v4/company.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x81\x01\n\x14\x43reateCompanyRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x35\n\x07\x63ompany\x18\x02 \x01(\x0b\x32\x1f.google.cloud.talent.v4.CompanyB\x03\xe0\x41\x02\"F\n\x11GetCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"~\n\x14UpdateCompanyRequest\x12\x35\n\x07\x63ompany\x18\x01 \x01(\x0b\x32\x1f.google.cloud.talent.v4.CompanyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"I\n\x14\x44\x65leteCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"\x8c\x01\n\x14ListCompaniesRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x19\n\x11require_open_jobs\x18\x04 \x01(\x08\"\xa0\x01\n\x15ListCompaniesResponse\x12\x32\n\tcompanies\x18\x01 \x03(\x0b\x32\x1f.google.cloud.talent.v4.Company\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata2\xc3\x07\n\x0e\x43ompanyService\x12\xad\x01\n\rCreateCompany\x12,.google.cloud.talent.v4.CreateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"M\xda\x41\x0eparent,company\x82\xd3\xe4\x93\x02\x36\"+/v4/{parent=projects/*/tenants/*}/companies:\x07\x63ompany\x12\x94\x01\n\nGetCompany\x12).google.cloud.talent.v4.GetCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v4/{name=projects/*/tenants/*/companies/*}\x12\xba\x01\n\rUpdateCompany\x12,.google.cloud.talent.v4.UpdateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"Z\xda\x41\x13\x63ompany,update_mask\x82\xd3\xe4\x93\x02>23/v4/{company.name=projects/*/tenants/*/companies/*}:\x07\x63ompany\x12\x91\x01\n\rDeleteCompany\x12,.google.cloud.talent.v4.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v4/{name=projects/*/tenants/*/companies/*}\x12\xaa\x01\n\rListCompanies\x12,.google.cloud.talent.v4.ListCompaniesRequest\x1a-.google.cloud.talent.v4.ListCompaniesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v4/{parent=projects/*/tenants/*}/companies\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBm\n\x1a\x63om.google.cloud.talent.v4B\x13\x43ompanyServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - CreateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateCompanyRequest").msgclass - GetCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetCompanyRequest").msgclass - UpdateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateCompanyRequest").msgclass - DeleteCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteCompanyRequest").msgclass - ListCompaniesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListCompaniesRequest").msgclass - ListCompaniesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListCompaniesResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb deleted file mode 100644 index 970558173e7b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/company_service.proto for package 'google.cloud.talent.v4' -# 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/talent/v4/company_service_pb' - -module Google - module Cloud - module Talent - module V4 - module CompanyService - # A service that handles company management, including CRUD and enumeration. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.CompanyService' - - # Creates a new company entity. - rpc :CreateCompany, ::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Google::Cloud::Talent::V4::Company - # Retrieves specified company. - rpc :GetCompany, ::Google::Cloud::Talent::V4::GetCompanyRequest, ::Google::Cloud::Talent::V4::Company - # Updates specified company. - rpc :UpdateCompany, ::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Google::Cloud::Talent::V4::Company - # Deletes specified company. - # Prerequisite: The company has no jobs associated with it. - rpc :DeleteCompany, ::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Google::Protobuf::Empty - # Lists all companies associated with the project. - rpc :ListCompanies, ::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Google::Cloud::Talent::V4::ListCompaniesResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb deleted file mode 100644 index b6fa3c5a86bc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.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/talent/v4/version" - -require "google/cloud/talent/v4/completion/credentials" -require "google/cloud/talent/v4/completion/paths" -require "google/cloud/talent/v4/completion/client" -require "google/cloud/talent/v4/completion/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles auto completion. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/completion" - # client = ::Google::Cloud::Talent::V4::Completion::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/completion/rest" - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new - # - module Completion - end - end - end - end -end - -helper_path = ::File.join __dir__, "completion", "helpers.rb" -require "google/cloud/talent/v4/completion/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb deleted file mode 100644 index 94005a2e169b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb +++ /dev/null @@ -1,510 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/completion_service_pb" - -module Google - module Cloud - module Talent - module V4 - module Completion - ## - # Client for the Completion service. - # - # A service handles auto completion. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_stub - - ## - # Configure the Completion Client class. - # - # See {::Google::Cloud::Talent::V4::Completion::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Completion clients - # ::Google::Cloud::Talent::V4::Completion::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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.complete_query.timeout = 30.0 - default_config.rpcs.complete_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Completion Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::Completion::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @completion_stub.universe_domain - end - - ## - # Create a new Completion client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::Completion::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Completion 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/talent/v4/completion_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @completion_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::Completion::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @completion_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 - @completion_stub.logger - end - - # Service calls - - ## - # Completes the specified prefix with keyword suggestions. - # Intended for use by a job search auto-complete search box. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::Talent::V4::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload complete_query(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::String] - # Required. Resource name of tenant the completion is performed within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param query [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @param language_codes [::Array<::String>] - # The list of languages of the query. This is - # the BCP-47 language code, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # The maximum number of allowed characters is 255. - # @param page_size [::Integer] - # Required. Completion result count. - # - # The maximum allowed page size is 10. - # @param company [::String] - # If provided, restricts completion to specified company. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @param scope [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] - # The scope of the completion. The defaults is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. - # @param type [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] - # The completion topic. The default is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::Completion::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CompleteQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.complete_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.tenant - header_params["tenant"] = request.tenant - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.complete_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_stub.call_rpc :complete_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Completion API. - # - # This class represents the configuration for Completion, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::Completion::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::Completion::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Completion API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb deleted file mode 100644 index 7cd296fec044..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Talent - module V4 - module Completion - # Credentials for the Completion API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb deleted file mode 100644 index 76d8a7f968e1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - module Completion - # Path helper methods for the Completion API. - module Paths - ## - # Create a fully-qualified Company resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/companies/{company}` - # - # @param project [String] - # @param tenant [String] - # @param company [String] - # - # @return [::String] - def company_path project:, tenant:, company: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/companies/#{company}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb deleted file mode 100644 index 20ebc6431f70..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/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/talent/v4/version" - -require "google/cloud/talent/v4/completion/credentials" -require "google/cloud/talent/v4/completion/paths" -require "google/cloud/talent/v4/completion/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles auto completion. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/completion/rest" - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new - # - module Completion - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/completion/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb deleted file mode 100644 index 8d92314466de..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb +++ /dev/null @@ -1,460 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/completion_service_pb" -require "google/cloud/talent/v4/completion/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module Completion - module Rest - ## - # REST client for the Completion service. - # - # A service handles auto completion. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_stub - - ## - # Configure the Completion Client class. - # - # See {::Google::Cloud::Talent::V4::Completion::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Completion clients - # ::Google::Cloud::Talent::V4::Completion::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", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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.complete_query.timeout = 30.0 - default_config.rpcs.complete_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Completion Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::Completion::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @completion_stub.universe_domain - end - - ## - # Create a new Completion REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Completion 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 - - @completion_stub = ::Google::Cloud::Talent::V4::Completion::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @completion_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 - @completion_stub.logger - end - - # Service calls - - ## - # Completes the specified prefix with keyword suggestions. - # Intended for use by a job search auto-complete search box. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::Talent::V4::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload complete_query(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::String] - # Required. Resource name of tenant the completion is performed within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param query [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @param language_codes [::Array<::String>] - # The list of languages of the query. This is - # the BCP-47 language code, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # The maximum number of allowed characters is 255. - # @param page_size [::Integer] - # Required. Completion result count. - # - # The maximum allowed page size is 10. - # @param company [::String] - # If provided, restricts completion to specified company. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @param scope [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] - # The scope of the completion. The defaults is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. - # @param type [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] - # The completion topic. The default is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::Completion::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CompleteQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.complete_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.complete_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_stub.complete_query request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Completion REST API. - # - # This class represents the configuration for Completion REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::Completion::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::Completion::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Completion API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb deleted file mode 100644 index 05cfeeb2676d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/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/cloud/talent/v4/completion_service_pb" - -module Google - module Cloud - module Talent - module V4 - module Completion - module Rest - ## - # REST service stub for the Completion service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the complete_query REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CompleteQueryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # A result object deserialized from the server's reply - def complete_query request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "complete_query", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the complete_query REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CompleteQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_complete_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{tenant}:completeQuery", - matches: [ - ["tenant", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb deleted file mode 100644 index 104ea071ee7a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/completion_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/talent/v4/common_pb' - - -descriptor_data = "\n/google/cloud/talent/v4/completion_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\"\x88\x04\n\x14\x43ompleteQueryRequest\x12\x32\n\x06tenant\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x31\n\x07\x63ompany\x18\x05 \x01(\tB \xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12K\n\x05scope\x18\x06 \x01(\x0e\x32<.google.cloud.talent.v4.CompleteQueryRequest.CompletionScope\x12I\n\x04type\x18\x07 \x01(\x0e\x32;.google.cloud.talent.v4.CompleteQueryRequest.CompletionType\"K\n\x0f\x43ompletionScope\x12 \n\x1c\x43OMPLETION_SCOPE_UNSPECIFIED\x10\x00\x12\n\n\x06TENANT\x10\x01\x12\n\n\x06PUBLIC\x10\x02\"`\n\x0e\x43ompletionType\x12\x1f\n\x1b\x43OMPLETION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tJOB_TITLE\x10\x01\x12\x10\n\x0c\x43OMPANY_NAME\x10\x02\x12\x0c\n\x08\x43OMBINED\x10\x03\"\xb6\x02\n\x15\x43ompleteQueryResponse\x12Z\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32>.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult\x12:\n\x08metadata\x18\x02 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\x1a\x84\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12I\n\x04type\x18\x02 \x01(\x0e\x32;.google.cloud.talent.v4.CompleteQueryRequest.CompletionType\x12\x11\n\timage_uri\x18\x03 \x01(\t2\xa2\x02\n\nCompletion\x12\xa5\x01\n\rCompleteQuery\x12,.google.cloud.talent.v4.CompleteQueryRequest\x1a-.google.cloud.talent.v4.CompleteQueryResponse\"7\x82\xd3\xe4\x93\x02\x31\x12//v4/{tenant=projects/*/tenants/*}:completeQuery\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBp\n\x1a\x63om.google.cloud.talent.v4B\x16\x43ompletionServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest").msgclass - CompleteQueryRequest::CompletionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionScope").enummodule - CompleteQueryRequest::CompletionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionType").enummodule - CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse").msgclass - CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse.CompletionResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb deleted file mode 100644 index ee3e95861429..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/completion_service.proto for package 'google.cloud.talent.v4' -# 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/talent/v4/completion_service_pb' - -module Google - module Cloud - module Talent - module V4 - module Completion - # A service handles auto completion. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.Completion' - - # Completes the specified prefix with keyword suggestions. - # Intended for use by a job search auto-complete search box. - rpc :CompleteQuery, ::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Google::Cloud::Talent::V4::CompleteQueryResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb deleted file mode 100644 index e5ba296b8334..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/event.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\"google/cloud/talent/v4/event.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc3\x01\n\x0b\x43lientEvent\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x15\n\x08\x65vent_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x35\n\tjob_event\x18\x05 \x01(\x0b\x32 .google.cloud.talent.v4.JobEventH\x00\x12\x13\n\x0b\x65vent_notes\x18\t \x01(\tB\x07\n\x05\x65vent\"\xe0\x03\n\x08JobEvent\x12@\n\x04type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.JobEvent.JobEventTypeB\x03\xe0\x41\x02\x12\x11\n\x04jobs\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xfe\x02\n\x0cJobEventType\x12\x1e\n\x1aJOB_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nIMPRESSION\x10\x01\x12\x08\n\x04VIEW\x10\x02\x12\x11\n\rVIEW_REDIRECT\x10\x03\x12\x15\n\x11\x41PPLICATION_START\x10\x04\x12\x16\n\x12\x41PPLICATION_FINISH\x10\x05\x12 \n\x1c\x41PPLICATION_QUICK_SUBMISSION\x10\x06\x12\x18\n\x14\x41PPLICATION_REDIRECT\x10\x07\x12!\n\x1d\x41PPLICATION_START_FROM_SEARCH\x10\x08\x12$\n APPLICATION_REDIRECT_FROM_SEARCH\x10\t\x12\x1e\n\x1a\x41PPLICATION_COMPANY_SUBMIT\x10\n\x12\x0c\n\x08\x42OOKMARK\x10\x0b\x12\x10\n\x0cNOTIFICATION\x10\x0c\x12\t\n\x05HIRED\x10\r\x12\x0b\n\x07SENT_CV\x10\x0e\x12\x15\n\x11INTERVIEW_GRANTED\x10\x0f\x42\x64\n\x1a\x63om.google.cloud.talent.v4B\nEventProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - ClientEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ClientEvent").msgclass - JobEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent").msgclass - JobEvent::JobEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent.JobEventType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb deleted file mode 100644 index 3eae631b03f2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_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/talent/v4/version" - -require "google/cloud/talent/v4/event_service/credentials" -require "google/cloud/talent/v4/event_service/paths" -require "google/cloud/talent/v4/event_service/client" -require "google/cloud/talent/v4/event_service/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles client event report. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/event_service" - # client = ::Google::Cloud::Talent::V4::EventService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/event_service/rest" - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new - # - module EventService - end - end - end - end -end - -helper_path = ::File.join __dir__, "event_service", "helpers.rb" -require "google/cloud/talent/v4/event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb deleted file mode 100644 index caae115348d0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb +++ /dev/null @@ -1,488 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/event_service_pb" - -module Google - module Cloud - module Talent - module V4 - module EventService - ## - # Client for the EventService service. - # - # A service handles client event report. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :event_service_stub - - ## - # Configure the EventService Client class. - # - # See {::Google::Cloud::Talent::V4::EventService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EventService clients - # ::Google::Cloud::Talent::V4::EventService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_client_event.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EventService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::EventService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @event_service_stub.universe_domain - end - - ## - # Create a new EventService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::EventService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EventService 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/talent/v4/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 - - @event_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::EventService::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 - ) - - @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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @event_service_stub.logger - end - - # Service calls - - ## - # Report events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. You may inspect the created events in - # [self service - # tools](https://console.cloud.google.com/talent-solution/overview). - # [Learn - # more](https://cloud.google.com/talent-solution/docs/management-tools) - # about self service tools. - # - # @overload create_client_event(request, options = nil) - # Pass arguments to `create_client_event` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateClientEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_client_event(parent: nil, client_event: nil) - # Pass arguments to `create_client_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. Resource name of the tenant under which the event is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash] - # Required. Events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::ClientEvent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::ClientEvent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::EventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateClientEventRequest.new - # - # # Call the create_client_event method. - # result = client.create_client_event request - # - # # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. - # p result - # - def create_client_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateClientEventRequest - - # Converts hash and nil to 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_client_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::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_client_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_client_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @event_service_stub.call_rpc :create_client_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 - - ## - # Configuration class for the EventService API. - # - # This class represents the configuration for EventService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::EventService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_client_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::EventService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_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::Talent::V4::EventService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the EventService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_client_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_client_event - - # @private - def initialize parent_rpcs = nil - create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event - @create_client_event = ::Gapic::Config::Method.new create_client_event_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb deleted file mode 100644 index 3909062c4684..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Talent - module V4 - module EventService - # Credentials for the EventService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb deleted file mode 100644 index bdb45a8600a2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - module EventService - # Path helper methods for the EventService API. - module Paths - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb deleted file mode 100644 index b3d12ce1a69a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_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/talent/v4/version" - -require "google/cloud/talent/v4/event_service/credentials" -require "google/cloud/talent/v4/event_service/paths" -require "google/cloud/talent/v4/event_service/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles client event report. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/event_service/rest" - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new - # - module EventService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb deleted file mode 100644 index 43bd04679cc0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb +++ /dev/null @@ -1,438 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/event_service_pb" -require "google/cloud/talent/v4/event_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module EventService - module Rest - ## - # REST client for the EventService service. - # - # A service handles client event report. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :event_service_stub - - ## - # Configure the EventService Client class. - # - # See {::Google::Cloud::Talent::V4::EventService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EventService clients - # ::Google::Cloud::Talent::V4::EventService::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", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_client_event.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EventService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::EventService::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 - @event_service_stub.universe_domain - end - - ## - # Create a new EventService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EventService 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 - - @event_service_stub = ::Google::Cloud::Talent::V4::EventService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @event_service_stub.logger - end - - # Service calls - - ## - # Report events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. You may inspect the created events in - # [self service - # tools](https://console.cloud.google.com/talent-solution/overview). - # [Learn - # more](https://cloud.google.com/talent-solution/docs/management-tools) - # about self service tools. - # - # @overload create_client_event(request, options = nil) - # Pass arguments to `create_client_event` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateClientEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_client_event(parent: nil, client_event: nil) - # Pass arguments to `create_client_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. Resource name of the tenant under which the event is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash] - # Required. Events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::ClientEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::ClientEvent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::EventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateClientEventRequest.new - # - # # Call the create_client_event method. - # result = client.create_client_event request - # - # # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. - # p result - # - def create_client_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateClientEventRequest - - # Converts hash and nil to an 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_client_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::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_client_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_client_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @event_service_stub.create_client_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 - - ## - # Configuration class for the EventService REST API. - # - # This class represents the configuration for EventService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::EventService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_client_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::EventService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_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 = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the EventService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_client_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_client_event - - # @private - def initialize parent_rpcs = nil - create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event - @create_client_event = ::Gapic::Config::Method.new create_client_event_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb deleted file mode 100644 index 1df84a12be19..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_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/talent/v4/event_service_pb" - -module Google - module Cloud - module Talent - module V4 - module EventService - module Rest - ## - # REST service stub for the EventService 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_client_event REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateClientEventRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::ClientEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::ClientEvent] - # A result object deserialized from the server's reply - def create_client_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_client_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: "create_client_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ClientEvent.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_client_event REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateClientEventRequest] - # 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_client_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/clientEvents", - body: "client_event", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb deleted file mode 100644 index 3dc11df6acc1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/event_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/talent/v4/event_pb' - - -descriptor_data = "\n*google/cloud/talent/v4/event_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/talent/v4/event.proto\"\x8e\x01\n\x18\x43reateClientEventRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12>\n\x0c\x63lient_event\x18\x02 \x01(\x0b\x32#.google.cloud.talent.v4.ClientEventB\x03\xe0\x41\x02\x32\xc5\x02\n\x0c\x45ventService\x12\xc6\x01\n\x11\x43reateClientEvent\x12\x30.google.cloud.talent.v4.CreateClientEventRequest\x1a#.google.cloud.talent.v4.ClientEvent\"Z\xda\x41\x13parent,client_event\x82\xd3\xe4\x93\x02>\"./v4/{parent=projects/*/tenants/*}/clientEvents:\x0c\x63lient_event\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBk\n\x1a\x63om.google.cloud.talent.v4B\x11\x45ventServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - CreateClientEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateClientEventRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb deleted file mode 100644 index 4e21dbe2ff0e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/event_service.proto for package 'google.cloud.talent.v4' -# 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/talent/v4/event_service_pb' - -module Google - module Cloud - module Talent - module V4 - module EventService - # A service handles client event report. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.EventService' - - # Report events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. You may inspect the created events in - # [self service - # tools](https://console.cloud.google.com/talent-solution/overview). - # [Learn - # more](https://cloud.google.com/talent-solution/docs/management-tools) - # about self service tools. - rpc :CreateClientEvent, ::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Google::Cloud::Talent::V4::ClientEvent - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb deleted file mode 100644 index ee2d69c6b204..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/filters.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/talent/v4/common_pb' -require 'google/protobuf/duration_pb' -require 'google/type/latlng_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n$google/cloud/talent/v4/filters.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/cloud/talent/v4/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x18google/type/latlng.proto\x1a\x1bgoogle/type/timeofday.proto\"\xe2\x04\n\x08JobQuery\x12\r\n\x05query\x18\x01 \x01(\t\x12\x1b\n\x13query_language_code\x18\x0e \x01(\t\x12\x11\n\tcompanies\x18\x02 \x03(\t\x12@\n\x10location_filters\x18\x03 \x03(\x0b\x32&.google.cloud.talent.v4.LocationFilter\x12;\n\x0ejob_categories\x18\x04 \x03(\x0e\x32#.google.cloud.talent.v4.JobCategory\x12=\n\x0e\x63ommute_filter\x18\x05 \x01(\x0b\x32%.google.cloud.talent.v4.CommuteFilter\x12\x1d\n\x15\x63ompany_display_names\x18\x06 \x03(\t\x12G\n\x13\x63ompensation_filter\x18\x07 \x01(\x0b\x32*.google.cloud.talent.v4.CompensationFilter\x12\x1f\n\x17\x63ustom_attribute_filter\x18\x08 \x01(\t\x12\x1b\n\x13\x64isable_spell_check\x18\t \x01(\x08\x12@\n\x10\x65mployment_types\x18\n \x03(\x0e\x32&.google.cloud.talent.v4.EmploymentType\x12\x16\n\x0elanguage_codes\x18\x0b \x03(\t\x12\x42\n\x12publish_time_range\x18\x0c \x01(\x0b\x32&.google.cloud.talent.v4.TimestampRange\x12\x15\n\rexcluded_jobs\x18\r \x03(\t\"\xed\x02\n\x0eLocationFilter\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x19\n\x11\x64istance_in_miles\x18\x04 \x01(\x01\x12\\\n\x16telecommute_preference\x18\x05 \x01(\x0e\x32<.google.cloud.talent.v4.LocationFilter.TelecommutePreference\"\x95\x01\n\x15TelecommutePreference\x12&\n\"TELECOMMUTE_PREFERENCE_UNSPECIFIED\x10\x00\x12\x1c\n\x14TELECOMMUTE_EXCLUDED\x10\x01\x1a\x02\x08\x01\x12\x17\n\x13TELECOMMUTE_ALLOWED\x10\x02\x12\x1d\n\x19TELECOMMUTE_JOBS_EXCLUDED\x10\x03\"\xbb\x03\n\x12\x43ompensationFilter\x12H\n\x04type\x18\x01 \x01(\x0e\x32\x35.google.cloud.talent.v4.CompensationFilter.FilterTypeB\x03\xe0\x41\x02\x12M\n\x05units\x18\x02 \x03(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationUnitB\x03\xe0\x41\x02\x12I\n\x05range\x18\x03 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRange\x12\x38\n0include_jobs_with_unspecified_compensation_range\x18\x04 \x01(\x08\"\x86\x01\n\nFilterType\x12\x1b\n\x17\x46ILTER_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tUNIT_ONLY\x10\x01\x12\x13\n\x0fUNIT_AND_AMOUNT\x10\x02\x12\x1a\n\x16\x41NNUALIZED_BASE_AMOUNT\x10\x03\x12\x1b\n\x17\x41NNUALIZED_TOTAL_AMOUNT\x10\x04\"\xc1\x03\n\rCommuteFilter\x12\x42\n\x0e\x63ommute_method\x18\x01 \x01(\x0e\x32%.google.cloud.talent.v4.CommuteMethodB\x03\xe0\x41\x02\x12\x33\n\x11start_coordinates\x18\x02 \x01(\x0b\x32\x13.google.type.LatLngB\x03\xe0\x41\x02\x12\x37\n\x0ftravel_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12!\n\x19\x61llow_imprecise_addresses\x18\x04 \x01(\x08\x12I\n\x0croad_traffic\x18\x05 \x01(\x0e\x32\x31.google.cloud.talent.v4.CommuteFilter.RoadTrafficH\x00\x12\x30\n\x0e\x64\x65parture_time\x18\x06 \x01(\x0b\x32\x16.google.type.TimeOfDayH\x00\"L\n\x0bRoadTraffic\x12\x1c\n\x18ROAD_TRAFFIC_UNSPECIFIED\x10\x00\x12\x10\n\x0cTRAFFIC_FREE\x10\x01\x12\r\n\tBUSY_HOUR\x10\x02\x42\x10\n\x0etraffic_optionBf\n\x1a\x63om.google.cloud.talent.v4B\x0c\x46iltersProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - JobQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobQuery").msgclass - LocationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.LocationFilter").msgclass - LocationFilter::TelecommutePreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.LocationFilter.TelecommutePreference").enummodule - CompensationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationFilter").msgclass - CompensationFilter::FilterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationFilter.FilterType").enummodule - CommuteFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteFilter").msgclass - CommuteFilter::RoadTraffic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteFilter.RoadTraffic").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb deleted file mode 100644 index 185c65a73f10..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/histogram.proto - -require 'google/protobuf' - - -descriptor_data = "\n&google/cloud/talent/v4/histogram.proto\x12\x16google.cloud.talent.v4\")\n\x0eHistogramQuery\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\"\xb1\x01\n\x14HistogramQueryResult\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\x12N\n\thistogram\x18\x02 \x03(\x0b\x32;.google.cloud.talent.v4.HistogramQueryResult.HistogramEntry\x1a\x30\n\x0eHistogramEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x42h\n\x1a\x63om.google.cloud.talent.v4B\x0eHistogramProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - HistogramQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HistogramQuery").msgclass - HistogramQueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HistogramQueryResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb deleted file mode 100644 index 94a8ebe1de45..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/job.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/talent/v4/common_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n google/cloud/talent/v4/job.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf5\x0e\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x07\x63ompany\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12\x1b\n\x0erequisition_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\taddresses\x18\x06 \x03(\t\x12\x45\n\x10\x61pplication_info\x18\x07 \x01(\x0b\x32+.google.cloud.talent.v4.Job.ApplicationInfo\x12\x38\n\x0cjob_benefits\x18\x08 \x03(\x0e\x32\".google.cloud.talent.v4.JobBenefit\x12\x43\n\x11\x63ompensation_info\x18\t \x01(\x0b\x32(.google.cloud.talent.v4.CompensationInfo\x12L\n\x11\x63ustom_attributes\x18\n \x03(\x0b\x32\x31.google.cloud.talent.v4.Job.CustomAttributesEntry\x12\x38\n\x0c\x64\x65gree_types\x18\x0b \x03(\x0e\x32\".google.cloud.talent.v4.DegreeType\x12\x12\n\ndepartment\x18\x0c \x01(\t\x12@\n\x10\x65mployment_types\x18\r \x03(\x0e\x32&.google.cloud.talent.v4.EmploymentType\x12\x12\n\nincentives\x18\x0e \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12\x33\n\tjob_level\x18\x10 \x01(\x0e\x32 .google.cloud.talent.v4.JobLevel\x12\x17\n\x0fpromotion_value\x18\x11 \x01(\x05\x12\x16\n\x0equalifications\x18\x12 \x01(\t\x12\x18\n\x10responsibilities\x18\x13 \x01(\t\x12=\n\x0eposting_region\x18\x14 \x01(\x0e\x32%.google.cloud.talent.v4.PostingRegion\x12:\n\nvisibility\x18\x15 \x01(\x0e\x32\".google.cloud.talent.v4.VisibilityB\x02\x18\x01\x12\x32\n\x0ejob_start_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0cjob_end_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14posting_publish_time\x18\x18 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x13posting_expire_time\x18\x19 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x13posting_create_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13posting_update_time\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12!\n\x14\x63ompany_display_name\x18\x1c \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x0c\x64\x65rived_info\x18\x1d \x01(\x0b\x32\'.google.cloud.talent.v4.Job.DerivedInfoB\x03\xe0\x41\x03\x12I\n\x12processing_options\x18\x1e \x01(\x0b\x32-.google.cloud.talent.v4.Job.ProcessingOptions\x1a\x44\n\x0f\x41pplicationInfo\x12\x0e\n\x06\x65mails\x18\x01 \x03(\t\x12\x13\n\x0binstruction\x18\x02 \x01(\t\x12\x0c\n\x04uris\x18\x03 \x03(\t\x1a\x7f\n\x0b\x44\x65rivedInfo\x12\x33\n\tlocations\x18\x01 \x03(\x0b\x32 .google.cloud.talent.v4.Location\x12;\n\x0ejob_categories\x18\x03 \x03(\x0e\x32#.google.cloud.talent.v4.JobCategory\x1a\x83\x01\n\x11ProcessingOptions\x12)\n!disable_street_address_resolution\x18\x01 \x01(\x08\x12\x43\n\x11html_sanitization\x18\x02 \x01(\x0e\x32(.google.cloud.talent.v4.HtmlSanitization\x1a`\n\x15\x43ustomAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.talent.v4.CustomAttribute:\x02\x38\x01:L\xea\x41I\n\x17jobs.googleapis.com/Job\x12.projects/{project}/tenants/{tenant}/jobs/{job}Bb\n\x1a\x63om.google.cloud.talent.v4B\x08JobProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job").msgclass - Job::ApplicationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.ApplicationInfo").msgclass - Job::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.DerivedInfo").msgclass - Job::ProcessingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.ProcessingOptions").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb deleted file mode 100644 index 72fd641b46a0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_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/talent/v4/version" - -require "google/cloud/talent/v4/job_service/credentials" -require "google/cloud/talent/v4/job_service/paths" -require "google/cloud/talent/v4/job_service/operations" -require "google/cloud/talent/v4/job_service/client" -require "google/cloud/talent/v4/job_service/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles job management, including job CRUD, enumeration and search. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/job_service" - # client = ::Google::Cloud::Talent::V4::JobService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/job_service/rest" - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - module JobService - end - end - end - end -end - -helper_path = ::File.join __dir__, "job_service", "helpers.rb" -require "google/cloud/talent/v4/job_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb deleted file mode 100644 index 0c49b93e652d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb +++ /dev/null @@ -1,2062 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/job_service_pb" - -module Google - module Cloud - module Talent - module V4 - module JobService - ## - # Client for the JobService service. - # - # A service handles job management, including job CRUD, enumeration and search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :job_service_stub - - ## - # Configure the JobService Client class. - # - # See {::Google::Cloud::Talent::V4::JobService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all JobService clients - # ::Google::Cloud::Talent::V4::JobService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_job.timeout = 30.0 - - default_config.rpcs.batch_create_jobs.timeout = 30.0 - - default_config.rpcs.get_job.timeout = 30.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_job.timeout = 30.0 - - default_config.rpcs.batch_update_jobs.timeout = 30.0 - - default_config.rpcs.delete_job.timeout = 30.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.batch_delete_jobs.timeout = 30.0 - - default_config.rpcs.list_jobs.timeout = 30.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_jobs.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the JobService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::JobService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @job_service_stub.universe_domain - end - - ## - # Create a new JobService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the JobService 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/talent/v4/job_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 - - @job_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::JobService::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 - ) - - @job_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::Talent::V4::JobService::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @job_service_stub.logger - end - - # Service calls - - ## - # Creates a new job. - # - # Typically, the job becomes searchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_job(parent: nil, job: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] - # Required. The Job to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :create_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch create jobs operation. - # - # @overload batch_create_jobs(request, options = nil) - # Pass arguments to `batch_create_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchCreateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_create_jobs(parent: nil, jobs: nil) - # Pass arguments to `batch_create_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] - # Required. The jobs to be created. - # A maximum of 200 jobs can be created in a batch. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new - # - # # Call the batch_create_jobs method. - # result = client.batch_create_jobs request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_create_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchCreateJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_create_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_create_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :batch_create_jobs, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves the specified job, whose status is OPEN or recently EXPIRED - # within the last 90 days. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the job to retrieve. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :get_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified job. - # - # Typically, updated contents become visible in search results within 10 - # seconds, but it may take up to 5 minutes. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_job(job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] - # Required. The Job to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise - # all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.job&.name - header_params["job.name"] = request.job.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :update_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch update jobs operation. - # - # @overload batch_update_jobs(request, options = nil) - # Pass arguments to `batch_update_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) - # Pass arguments to `batch_update_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] - # Required. The jobs to be updated. - # A maximum of 200 jobs can be updated in a batch. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. Be aware that it will - # also increase latency when checking the status of a batch operation. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} - # are updated. Otherwise all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside - # {::Google::Cloud::Talent::V4::JobResult JobResult} - # will only contains fields that is updated, plus the Id of the Job. - # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, - # which can yield a very large response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new - # - # # Call the batch_update_jobs method. - # result = client.batch_update_jobs request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_update_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_update_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_update_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_update_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :batch_update_jobs, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 the specified job. - # - # Typically, the job becomes unsearchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_job(name: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the job to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :delete_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch delete jobs operation. - # - # @overload batch_delete_jobs(request, options = nil) - # Pass arguments to `batch_delete_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchDeleteJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_delete_jobs(parent: nil, names: nil) - # Pass arguments to `batch_delete_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # - # The parent of all of the jobs specified in `names` must match this field. - # @param names [::Array<::String>] - # The names of the jobs to delete. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". - # For example, "projects/foo/tenants/bar/jobs/baz". - # - # A maximum of 200 jobs can be deleted in a batch. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new - # - # # Call the batch_delete_jobs method. - # result = client.batch_delete_jobs request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_delete_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_delete_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_delete_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_delete_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :batch_delete_jobs, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 jobs by filter. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_jobs(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param filter [::String] - # Required. The filter string specifies the jobs to be enumerated. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` - # * `requisitionId` - # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - # OPEN if no value is specified. - # - # At least one of `companyName` and `requisitionId` must present or an - # INVALID_ARGUMENT error is thrown. - # - # Sample Query: - # - # * companyName = "projects/foo/tenants/bar/companies/baz" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # requisitionId = "req-1" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # status = "EXPIRED" - # * requisitionId = "req-1" - # * requisitionId = "req-1" AND status = "EXPIRED" - # @param page_token [::String] - # The starting point of a query result. - # @param page_size [::Integer] - # The maximum number of jobs to be returned per page of results. - # - # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, - # the maximum allowed page size is 1000. Otherwise, the maximum allowed page - # size is 100. - # - # Default is 100 if empty or a number < 1 is specified. - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the - # search response. Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no - # value is specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Talent::V4::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :list_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_jobs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # - # This call constrains the - # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the - # database, and only returns jobs that the caller has permission to search - # against. - # - # @overload search_jobs(request, options = nil) - # Pass arguments to `search_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param max_page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::SearchJobsRequest.new - # - # # Call the search_jobs method. - # result = client.search_jobs request - # - # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - # p result - # - def search_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest - - # Converts hash and nil to 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_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :search_jobs, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # - # This API call is intended for the use case of targeting passive job - # seekers (for example, job seekers who have signed up to receive email - # alerts about potential job opportunities), it has different algorithmic - # adjustments that are designed to specifically target passive job seekers. - # - # This call constrains the - # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the - # database, and only returns jobs the caller has permission to search - # against. - # - # @overload search_jobs_for_alert(request, options = nil) - # Pass arguments to `search_jobs_for_alert` via a request object, either of type - # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param max_page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::SearchJobsRequest.new - # - # # Call the search_jobs_for_alert method. - # result = client.search_jobs_for_alert request - # - # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - # p result - # - def search_jobs_for_alert request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest - - # Converts hash and nil to 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_jobs_for_alert.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_jobs_for_alert.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :search_jobs_for_alert, request, 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 JobService API. - # - # This class represents the configuration for JobService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::JobService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::JobService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Talent::V4::JobService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the JobService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `batch_create_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `batch_update_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_jobs - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `batch_delete_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_jobs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `search_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs - ## - # RPC-specific configuration for `search_jobs_for_alert` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs_for_alert - - # @private - def initialize parent_rpcs = nil - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs - @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs - @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs - @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs - @search_jobs = ::Gapic::Config::Method.new search_jobs_config - search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert - @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb deleted file mode 100644 index 8264c8770c63..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Talent - module V4 - module JobService - # Credentials for the JobService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb deleted file mode 100644 index 7519b6ebba50..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_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 Talent - module V4 - module JobService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the JobService 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 JobService 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::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::Talent::V4::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 = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb deleted file mode 100644 index b40f2cddc538..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/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 Talent - module V4 - module JobService - # Path helper methods for the JobService API. - module Paths - ## - # Create a fully-qualified Company resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/companies/{company}` - # - # @param project [String] - # @param tenant [String] - # @param company [String] - # - # @return [::String] - def company_path project:, tenant:, company: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/companies/#{company}" - end - - ## - # Create a fully-qualified Job resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/jobs/{job}` - # - # @param project [String] - # @param tenant [String] - # @param job [String] - # - # @return [::String] - def job_path project:, tenant:, job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/jobs/#{job}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb deleted file mode 100644 index 2155d4710be6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_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/talent/v4/version" - -require "google/cloud/talent/v4/job_service/credentials" -require "google/cloud/talent/v4/job_service/paths" -require "google/cloud/talent/v4/job_service/rest/operations" -require "google/cloud/talent/v4/job_service/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles job management, including job CRUD, enumeration and search. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/job_service/rest" - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - module JobService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/job_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb deleted file mode 100644 index 88db35d75db8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb +++ /dev/null @@ -1,1949 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/job_service_pb" -require "google/cloud/talent/v4/job_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module JobService - module Rest - ## - # REST client for the JobService service. - # - # A service handles job management, including job CRUD, enumeration and search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :job_service_stub - - ## - # Configure the JobService Client class. - # - # See {::Google::Cloud::Talent::V4::JobService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all JobService clients - # ::Google::Cloud::Talent::V4::JobService::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", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_job.timeout = 30.0 - - default_config.rpcs.batch_create_jobs.timeout = 30.0 - - default_config.rpcs.get_job.timeout = 30.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_job.timeout = 30.0 - - default_config.rpcs.batch_update_jobs.timeout = 30.0 - - default_config.rpcs.delete_job.timeout = 30.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.batch_delete_jobs.timeout = 30.0 - - default_config.rpcs.list_jobs.timeout = 30.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_jobs.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the JobService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::JobService::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 - @job_service_stub.universe_domain - end - - ## - # Create a new JobService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the JobService 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::Talent::V4::JobService::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 - - @job_service_stub = ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @job_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::Talent::V4::JobService::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @job_service_stub.logger - end - - # Service calls - - ## - # Creates a new job. - # - # Typically, the job becomes searchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_job(parent: nil, job: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] - # Required. The Job to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.create_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch create jobs operation. - # - # @overload batch_create_jobs(request, options = nil) - # Pass arguments to `batch_create_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchCreateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_create_jobs(parent: nil, jobs: nil) - # Pass arguments to `batch_create_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] - # Required. The jobs to be created. - # A maximum of 200 jobs can be created in a batch. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new - # - # # Call the batch_create_jobs method. - # result = client.batch_create_jobs request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_create_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchCreateJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_create_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_create_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_create_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.batch_create_jobs request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves the specified job, whose status is OPEN or recently EXPIRED - # within the last 90 days. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the job to retrieve. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.get_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified job. - # - # Typically, updated contents become visible in search results within 10 - # seconds, but it may take up to 5 minutes. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_job(job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] - # Required. The Job to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise - # all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.update_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch update jobs operation. - # - # @overload batch_update_jobs(request, options = nil) - # Pass arguments to `batch_update_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) - # Pass arguments to `batch_update_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] - # Required. The jobs to be updated. - # A maximum of 200 jobs can be updated in a batch. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. Be aware that it will - # also increase latency when checking the status of a batch operation. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} - # are updated. Otherwise all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside - # {::Google::Cloud::Talent::V4::JobResult JobResult} - # will only contains fields that is updated, plus the Id of the Job. - # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, - # which can yield a very large response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new - # - # # Call the batch_update_jobs method. - # result = client.batch_update_jobs request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_update_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_update_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_update_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_update_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.batch_update_jobs request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 the specified job. - # - # Typically, the job becomes unsearchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_job(name: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the job to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.delete_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch delete jobs operation. - # - # @overload batch_delete_jobs(request, options = nil) - # Pass arguments to `batch_delete_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchDeleteJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_delete_jobs(parent: nil, names: nil) - # Pass arguments to `batch_delete_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # - # The parent of all of the jobs specified in `names` must match this field. - # @param names [::Array<::String>] - # The names of the jobs to delete. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". - # For example, "projects/foo/tenants/bar/jobs/baz". - # - # A maximum of 200 jobs can be deleted in a batch. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new - # - # # Call the batch_delete_jobs method. - # result = client.batch_delete_jobs request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_delete_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_delete_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_delete_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_delete_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.batch_delete_jobs request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 jobs by filter. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_jobs(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param filter [::String] - # Required. The filter string specifies the jobs to be enumerated. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` - # * `requisitionId` - # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - # OPEN if no value is specified. - # - # At least one of `companyName` and `requisitionId` must present or an - # INVALID_ARGUMENT error is thrown. - # - # Sample Query: - # - # * companyName = "projects/foo/tenants/bar/companies/baz" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # requisitionId = "req-1" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # status = "EXPIRED" - # * requisitionId = "req-1" - # * requisitionId = "req-1" AND status = "EXPIRED" - # @param page_token [::String] - # The starting point of a query result. - # @param page_size [::Integer] - # The maximum number of jobs to be returned per page of results. - # - # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, - # the maximum allowed page size is 1000. Otherwise, the maximum allowed page - # size is 100. - # - # Default is 100 if empty or a number < 1 is specified. - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the - # search response. Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no - # value is specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Talent::V4::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.list_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_jobs, "jobs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # - # This call constrains the - # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the - # database, and only returns jobs that the caller has permission to search - # against. - # - # @overload search_jobs(request, options = nil) - # Pass arguments to `search_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param max_page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::SearchJobsRequest.new - # - # # Call the search_jobs method. - # result = client.search_jobs request - # - # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - # p result - # - def search_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest - - # Converts hash and nil to an 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_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.search_jobs request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # - # This API call is intended for the use case of targeting passive job - # seekers (for example, job seekers who have signed up to receive email - # alerts about potential job opportunities), it has different algorithmic - # adjustments that are designed to specifically target passive job seekers. - # - # This call constrains the - # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the - # database, and only returns jobs the caller has permission to search - # against. - # - # @overload search_jobs_for_alert(request, options = nil) - # Pass arguments to `search_jobs_for_alert` via a request object, either of type - # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param max_page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::SearchJobsRequest.new - # - # # Call the search_jobs_for_alert method. - # result = client.search_jobs_for_alert request - # - # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - # p result - # - def search_jobs_for_alert request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest - - # Converts hash and nil to an 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_jobs_for_alert.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_jobs_for_alert.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.search_jobs_for_alert request, 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 JobService REST API. - # - # This class represents the configuration for JobService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::JobService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::JobService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the JobService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `batch_create_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `batch_update_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_jobs - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `batch_delete_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_jobs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `search_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs - ## - # RPC-specific configuration for `search_jobs_for_alert` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs_for_alert - - # @private - def initialize parent_rpcs = nil - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs - @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs - @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs - @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs - @search_jobs = ::Gapic::Config::Method.new search_jobs_config - search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert - @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb deleted file mode 100644 index 2a2c90d09cf1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/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 Talent - module V4 - module JobService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the JobService 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 JobService 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::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb deleted file mode 100644 index 634719f7c02e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb +++ /dev/null @@ -1,698 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/talent/v4/job_service_pb" - -module Google - module Cloud - module Talent - module V4 - module JobService - module Rest - ## - # REST service stub for the JobService 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_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # A result object deserialized from the server's reply - def create_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_create_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchCreateJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_create_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_create_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # A result object deserialized from the server's reply - def get_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # A result object deserialized from the server's reply - def update_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_update_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_update_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_update_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_delete_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_delete_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_delete_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::ListJobsResponse] - # A result object deserialized from the server's reply - def list_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # A result object deserialized from the server's reply - def search_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "search_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::SearchJobsResponse.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_jobs_for_alert REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # A result object deserialized from the server's reply - def search_jobs_for_alert request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_jobs_for_alert_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_jobs_for_alert", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::SearchJobsResponse.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_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs", - body: "job", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_create_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchCreateJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_create_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:batchCreate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v4/{job.name}", - body: "job", - matches: [ - ["job.name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_update_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_update_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_delete_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_delete_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{parent}/jobs", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] - # 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_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:search", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_jobs_for_alert REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] - # 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_jobs_for_alert_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:searchForAlert", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb deleted file mode 100644 index 58b385ae54bc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/job_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/talent/v4/common_pb' -require 'google/cloud/talent/v4/filters_pb' -require 'google/cloud/talent/v4/histogram_pb' -require 'google/cloud/talent/v4/job_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n(google/cloud/talent/v4/job_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a$google/cloud/talent/v4/filters.proto\x1a&google/cloud/talent/v4/histogram.proto\x1a google/cloud/talent/v4/job.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"r\n\x10\x43reateJobRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12-\n\x03job\x18\x02 \x01(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\">\n\rGetJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"r\n\x10UpdateJobRequest\x12-\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"A\n\x10\x44\x65leteJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"\xb1\x01\n\x0fListJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x31\n\x08job_view\x18\x05 \x01(\x0e\x32\x1f.google.cloud.talent.v4.JobView\"\x92\x01\n\x10ListJobsResponse\x12)\n\x04jobs\x18\x01 \x03(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\"\x9d\r\n\x11SearchJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12I\n\x0bsearch_mode\x18\x02 \x01(\x0e\x32\x34.google.cloud.talent.v4.SearchJobsRequest.SearchMode\x12\x46\n\x10request_metadata\x18\x03 \x01(\x0b\x32\'.google.cloud.talent.v4.RequestMetadataB\x03\xe0\x41\x02\x12\x33\n\tjob_query\x18\x04 \x01(\x0b\x32 .google.cloud.talent.v4.JobQuery\x12\x19\n\x11\x65nable_broadening\x18\x05 \x01(\x08\x12\x41\n\x11histogram_queries\x18\x07 \x03(\x0b\x32&.google.cloud.talent.v4.HistogramQuery\x12\x31\n\x08job_view\x18\x08 \x01(\x0e\x32\x1f.google.cloud.talent.v4.JobView\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x15\n\rmax_page_size\x18\n \x01(\x05\x12\x12\n\npage_token\x18\x0b \x01(\t\x12\x10\n\x08order_by\x18\x0c \x01(\t\x12]\n\x15\x64iversification_level\x18\r \x01(\x0e\x32>.google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel\x12X\n\x13\x63ustom_ranking_info\x18\x0e \x01(\x0b\x32;.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo\x12!\n\x15\x64isable_keyword_match\x18\x10 \x01(\x08\x42\x02\x18\x01\x12V\n\x12keyword_match_mode\x18\x12 \x01(\x0e\x32:.google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode\x12^\n\x13relevance_threshold\x18\x13 \x01(\x0e\x32<.google.cloud.talent.v4.SearchJobsRequest.RelevanceThresholdB\x03\xe0\x41\x01\x1a\x95\x02\n\x11\x43ustomRankingInfo\x12j\n\x10importance_level\x18\x01 \x01(\x0e\x32K.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevelB\x03\xe0\x41\x02\x12\x1f\n\x12ranking_expression\x18\x02 \x01(\tB\x03\xe0\x41\x02\"s\n\x0fImportanceLevel\x12 \n\x1cIMPORTANCE_LEVEL_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\x08\n\x04MILD\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\x0b\n\x07\x45XTREME\x10\x06\"R\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nJOB_SEARCH\x10\x01\x12\x17\n\x13\x46\x45\x41TURED_JOB_SEARCH\x10\x02\"\xc0\x01\n\x14\x44iversificationLevel\x12%\n!DIVERSIFICATION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\n\n\x06SIMPLE\x10\x02\x12\x13\n\x0fONE_PER_COMPANY\x10\x03\x12\x13\n\x0fTWO_PER_COMPANY\x10\x04\x12\x19\n\x15MAX_THREE_PER_COMPANY\x10\x06\x12\"\n\x1e\x44IVERSIFY_BY_LOOSER_SIMILARITY\x10\x05\"\x87\x01\n\x10KeywordMatchMode\x12\"\n\x1eKEYWORD_MATCH_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16KEYWORD_MATCH_DISABLED\x10\x01\x12\x15\n\x11KEYWORD_MATCH_ALL\x10\x02\x12\x1c\n\x18KEYWORD_MATCH_TITLE_ONLY\x10\x03\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\x91\x06\n\x12SearchJobsResponse\x12M\n\rmatching_jobs\x18\x01 \x03(\x0b\x32\x36.google.cloud.talent.v4.SearchJobsResponse.MatchingJob\x12M\n\x17histogram_query_results\x18\x02 \x03(\x0b\x32,.google.cloud.talent.v4.HistogramQueryResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12:\n\x10location_filters\x18\x04 \x03(\x0b\x32 .google.cloud.talent.v4.Location\x12\x12\n\ntotal_size\x18\x06 \x01(\x05\x12:\n\x08metadata\x18\x07 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\x12\"\n\x1a\x62roadened_query_jobs_count\x18\x08 \x01(\x05\x12\x44\n\x10spell_correction\x18\t \x01(\x0b\x32*.google.cloud.talent.v4.SpellingCorrection\x1a\xd2\x01\n\x0bMatchingJob\x12(\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\x13\n\x0bjob_summary\x18\x02 \x01(\t\x12\x19\n\x11job_title_snippet\x18\x03 \x01(\t\x12\x1b\n\x13search_text_snippet\x18\x04 \x01(\t\x12L\n\x0c\x63ommute_info\x18\x05 \x01(\x0b\x32\x36.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo\x1ay\n\x0b\x43ommuteInfo\x12\x36\n\x0cjob_location\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4.Location\x12\x32\n\x0ftravel_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"y\n\x16\x42\x61tchCreateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12.\n\x04jobs\x18\x02 \x03(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\"\xaa\x01\n\x16\x42\x61tchUpdateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12.\n\x04jobs\x18\x02 \x03(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"y\n\x16\x42\x61tchDeleteJobsRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12+\n\x05names\x18\x02 \x03(\tB\x1c\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"Y\n\tJobResult\x12(\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"Q\n\x17\x42\x61tchCreateJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult\"Q\n\x17\x42\x61tchUpdateJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult\"Q\n\x17\x42\x61tchDeleteJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult*v\n\x07JobView\x12\x18\n\x14JOB_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10JOB_VIEW_ID_ONLY\x10\x01\x12\x14\n\x10JOB_VIEW_MINIMAL\x10\x02\x12\x12\n\x0eJOB_VIEW_SMALL\x10\x03\x12\x11\n\rJOB_VIEW_FULL\x10\x04\x32\xdc\x0e\n\nJobService\x12\x94\x01\n\tCreateJob\x12(.google.cloud.talent.v4.CreateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"@\xda\x41\nparent,job\x82\xd3\xe4\x93\x02-\"&/v4/{parent=projects/*/tenants/*}/jobs:\x03job\x12\xe1\x01\n\x0f\x42\x61tchCreateJobs\x12..google.cloud.talent.v4.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x31\n\x17\x42\x61tchCreateJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*\x12\x83\x01\n\x06GetJob\x12%.google.cloud.talent.v4.GetJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"5\xda\x41\x04name\x82\xd3\xe4\x93\x02(\x12&/v4/{name=projects/*/tenants/*/jobs/*}\x12\x9d\x01\n\tUpdateJob\x12(.google.cloud.talent.v4.UpdateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"I\xda\x41\x0fjob,update_mask\x82\xd3\xe4\x93\x02\x31\x32*/v4/{job.name=projects/*/tenants/*/jobs/*}:\x03job\x12\xe1\x01\n\x0f\x42\x61tchUpdateJobs\x12..google.cloud.talent.v4.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x31\n\x17\x42\x61tchUpdateJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*\x12\x84\x01\n\tDeleteJob\x12(.google.cloud.talent.v4.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"5\xda\x41\x04name\x82\xd3\xe4\x93\x02(*&/v4/{name=projects/*/tenants/*/jobs/*}\x12\xe3\x01\n\x0f\x42\x61tchDeleteJobs\x12..google.cloud.talent.v4.BatchDeleteJobsRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x31\n\x17\x42\x61tchDeleteJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*\x12\x9d\x01\n\x08ListJobs\x12\'.google.cloud.talent.v4.ListJobsRequest\x1a(.google.cloud.talent.v4.ListJobsResponse\">\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02(\x12&/v4/{parent=projects/*/tenants/*}/jobs\x12\x9d\x01\n\nSearchJobs\x12).google.cloud.talent.v4.SearchJobsRequest\x1a*.google.cloud.talent.v4.SearchJobsResponse\"8\x82\xd3\xe4\x93\x02\x32\"-/v4/{parent=projects/*/tenants/*}/jobs:search:\x01*\x12\xad\x01\n\x12SearchJobsForAlert\x12).google.cloud.talent.v4.SearchJobsRequest\x1a*.google.cloud.talent.v4.SearchJobsResponse\"@\x82\xd3\xe4\x93\x02:\"5/v4/{parent=projects/*/tenants/*}/jobs:searchForAlert:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBi\n\x1a\x63om.google.cloud.talent.v4B\x0fJobServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateJobRequest").msgclass - GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetJobRequest").msgclass - UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateJobRequest").msgclass - DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteJobRequest").msgclass - ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsRequest").msgclass - ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsResponse").msgclass - SearchJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest").msgclass - SearchJobsRequest::CustomRankingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo").msgclass - SearchJobsRequest::CustomRankingInfo::ImportanceLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel").enummodule - SearchJobsRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.SearchMode").enummodule - SearchJobsRequest::DiversificationLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel").enummodule - SearchJobsRequest::KeywordMatchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode").enummodule - SearchJobsRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.RelevanceThreshold").enummodule - SearchJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse").msgclass - SearchJobsResponse::MatchingJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.MatchingJob").msgclass - SearchJobsResponse::CommuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.CommuteInfo").msgclass - BatchCreateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsRequest").msgclass - BatchUpdateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsRequest").msgclass - BatchDeleteJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsRequest").msgclass - JobResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobResult").msgclass - BatchCreateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsResponse").msgclass - BatchUpdateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsResponse").msgclass - BatchDeleteJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsResponse").msgclass - JobView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobView").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb deleted file mode 100644 index e1a90f630e33..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb +++ /dev/null @@ -1,90 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/job_service.proto for package 'google.cloud.talent.v4' -# 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/talent/v4/job_service_pb' - -module Google - module Cloud - module Talent - module V4 - module JobService - # A service handles job management, including job CRUD, enumeration and search. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.JobService' - - # Creates a new job. - # - # Typically, the job becomes searchable within 10 seconds, but it may take - # up to 5 minutes. - rpc :CreateJob, ::Google::Cloud::Talent::V4::CreateJobRequest, ::Google::Cloud::Talent::V4::Job - # Begins executing a batch create jobs operation. - rpc :BatchCreateJobs, ::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Google::Longrunning::Operation - # Retrieves the specified job, whose status is OPEN or recently EXPIRED - # within the last 90 days. - rpc :GetJob, ::Google::Cloud::Talent::V4::GetJobRequest, ::Google::Cloud::Talent::V4::Job - # Updates specified job. - # - # Typically, updated contents become visible in search results within 10 - # seconds, but it may take up to 5 minutes. - rpc :UpdateJob, ::Google::Cloud::Talent::V4::UpdateJobRequest, ::Google::Cloud::Talent::V4::Job - # Begins executing a batch update jobs operation. - rpc :BatchUpdateJobs, ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Google::Longrunning::Operation - # Deletes the specified job. - # - # Typically, the job becomes unsearchable within 10 seconds, but it may take - # up to 5 minutes. - rpc :DeleteJob, ::Google::Cloud::Talent::V4::DeleteJobRequest, ::Google::Protobuf::Empty - # Begins executing a batch delete jobs operation. - rpc :BatchDeleteJobs, ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Google::Longrunning::Operation - # Lists jobs by filter. - rpc :ListJobs, ::Google::Cloud::Talent::V4::ListJobsRequest, ::Google::Cloud::Talent::V4::ListJobsResponse - # Searches for jobs using the provided - # [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. - # - # This call constrains the - # [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the - # database, and only returns jobs that the caller has permission to search - # against. - rpc :SearchJobs, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse - # Searches for jobs using the provided - # [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. - # - # This API call is intended for the use case of targeting passive job - # seekers (for example, job seekers who have signed up to receive email - # alerts about potential job opportunities), it has different algorithmic - # adjustments that are designed to specifically target passive job seekers. - # - # This call constrains the - # [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the - # database, and only returns jobs the caller has permission to search - # against. - rpc :SearchJobsForAlert, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb deleted file mode 100644 index e29f66d86a27..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/talent/v4/company_service/rest" -require "google/cloud/talent/v4/completion/rest" -require "google/cloud/talent/v4/event_service/rest" -require "google/cloud/talent/v4/job_service/rest" -require "google/cloud/talent/v4/tenant_service/rest" -require "google/cloud/talent/v4/version" - -module Google - module Cloud - module Talent - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/talent/v4/rest" - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - module V4 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb deleted file mode 100644 index f154e089bf71..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/tenant.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n#google/cloud/talent/v4/tenant.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"v\n\x06Tenant\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x65xternal_id\x18\x02 \x01(\tB\x03\xe0\x41\x02:D\xea\x41\x41\n\x1ajobs.googleapis.com/Tenant\x12#projects/{project}/tenants/{tenant}Be\n\x1a\x63om.google.cloud.talent.v4B\x0bTenantProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Tenant").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb deleted file mode 100644 index ee4160331939..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_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/talent/v4/version" - -require "google/cloud/talent/v4/tenant_service/credentials" -require "google/cloud/talent/v4/tenant_service/paths" -require "google/cloud/talent/v4/tenant_service/client" -require "google/cloud/talent/v4/tenant_service/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service that handles tenant management, including CRUD and enumeration. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/tenant_service" - # client = ::Google::Cloud::Talent::V4::TenantService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/tenant_service/rest" - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - module TenantService - end - end - end - end -end - -helper_path = ::File.join __dir__, "tenant_service", "helpers.rb" -require "google/cloud/talent/v4/tenant_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb deleted file mode 100644 index fc1db7f8bdb3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb +++ /dev/null @@ -1,897 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/tenant_service_pb" - -module Google - module Cloud - module Talent - module V4 - module TenantService - ## - # Client for the TenantService service. - # - # A service that handles tenant management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tenant_service_stub - - ## - # Configure the TenantService Client class. - # - # See {::Google::Cloud::Talent::V4::TenantService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TenantService clients - # ::Google::Cloud::Talent::V4::TenantService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_tenant.timeout = 30.0 - - default_config.rpcs.get_tenant.timeout = 30.0 - default_config.rpcs.get_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_tenant.timeout = 30.0 - - default_config.rpcs.delete_tenant.timeout = 30.0 - default_config.rpcs.delete_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tenants.timeout = 30.0 - default_config.rpcs.list_tenants.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TenantService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::TenantService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @tenant_service_stub.universe_domain - end - - ## - # Create a new TenantService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TenantService 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/talent/v4/tenant_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 - - @tenant_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::TenantService::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 - ) - - @tenant_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 - @tenant_service_stub.logger - end - - # Service calls - - ## - # Creates a new tenant entity. - # - # @overload create_tenant(request, options = nil) - # Pass arguments to `create_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_tenant(parent: nil, tenant: nil) - # Pass arguments to `create_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] - # Required. The tenant to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateTenantRequest.new - # - # # Call the create_tenant method. - # result = client.create_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def create_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_tenant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :create_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified tenant. - # - # @overload get_tenant(request, options = nil) - # Pass arguments to `get_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_tenant(name: nil) - # Pass arguments to `get_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the tenant to be retrieved. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetTenantRequest.new - # - # # Call the get_tenant method. - # result = client.get_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def get_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_tenant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :get_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified tenant. - # - # @overload update_tenant(request, options = nil) - # Pass arguments to `update_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_tenant(tenant: nil, update_mask: nil) - # Pass arguments to `update_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] - # Required. The tenant resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the tenant fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateTenantRequest.new - # - # # Call the update_tenant method. - # result = client.update_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def update_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_tenant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.tenant&.name - header_params["tenant.name"] = request.tenant.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :update_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified tenant. - # - # @overload delete_tenant(request, options = nil) - # Pass arguments to `delete_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_tenant(name: nil) - # Pass arguments to `delete_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the tenant to be deleted. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteTenantRequest.new - # - # # Call the delete_tenant method. - # result = client.delete_tenant request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_tenant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :delete_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all tenants associated with the project. - # - # @overload list_tenants(request, options = nil) - # Pass arguments to `list_tenants` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_tenants(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_tenants` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of tenants to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListTenantsRequest.new - # - # # Call the list_tenants method. - # result = client.list_tenants request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Talent::V4::Tenant. - # p item - # end - # - def list_tenants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_tenants.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_tenants.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tenants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :list_tenants, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tenant_service_stub, :list_tenants, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TenantService API. - # - # This class represents the configuration for TenantService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::TenantService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_tenant to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::TenantService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::Talent::V4::TenantService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the TenantService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tenant - ## - # RPC-specific configuration for `get_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tenant - ## - # RPC-specific configuration for `update_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tenant - ## - # RPC-specific configuration for `delete_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tenant - ## - # RPC-specific configuration for `list_tenants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tenants - - # @private - def initialize parent_rpcs = nil - create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant - @create_tenant = ::Gapic::Config::Method.new create_tenant_config - get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant - @get_tenant = ::Gapic::Config::Method.new get_tenant_config - update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant - @update_tenant = ::Gapic::Config::Method.new update_tenant_config - delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant - @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config - list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants - @list_tenants = ::Gapic::Config::Method.new list_tenants_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb deleted file mode 100644 index daf2d0afbeef..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Talent - module V4 - module TenantService - # Credentials for the TenantService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb deleted file mode 100644 index ce93b2ff685b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_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 Talent - module V4 - module TenantService - # Path helper methods for the TenantService API. - module Paths - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb deleted file mode 100644 index 6edaf614d38d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_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/talent/v4/version" - -require "google/cloud/talent/v4/tenant_service/credentials" -require "google/cloud/talent/v4/tenant_service/paths" -require "google/cloud/talent/v4/tenant_service/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service that handles tenant management, including CRUD and enumeration. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/tenant_service/rest" - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - module TenantService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/tenant_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb deleted file mode 100644 index 009b23f72ad2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb +++ /dev/null @@ -1,819 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/talent/v4/tenant_service_pb" -require "google/cloud/talent/v4/tenant_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module TenantService - module Rest - ## - # REST client for the TenantService service. - # - # A service that handles tenant management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tenant_service_stub - - ## - # Configure the TenantService Client class. - # - # See {::Google::Cloud::Talent::V4::TenantService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TenantService clients - # ::Google::Cloud::Talent::V4::TenantService::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", "Talent", "V4"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_tenant.timeout = 30.0 - - default_config.rpcs.get_tenant.timeout = 30.0 - default_config.rpcs.get_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_tenant.timeout = 30.0 - - default_config.rpcs.delete_tenant.timeout = 30.0 - default_config.rpcs.delete_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tenants.timeout = 30.0 - default_config.rpcs.list_tenants.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TenantService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Talent::V4::TenantService::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 - @tenant_service_stub.universe_domain - end - - ## - # Create a new TenantService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TenantService 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 - - @tenant_service_stub = ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @tenant_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 - @tenant_service_stub.logger - end - - # Service calls - - ## - # Creates a new tenant entity. - # - # @overload create_tenant(request, options = nil) - # Pass arguments to `create_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_tenant(parent: nil, tenant: nil) - # Pass arguments to `create_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] - # Required. The tenant to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateTenantRequest.new - # - # # Call the create_tenant method. - # result = client.create_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def create_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_tenant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.create_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified tenant. - # - # @overload get_tenant(request, options = nil) - # Pass arguments to `get_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_tenant(name: nil) - # Pass arguments to `get_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the tenant to be retrieved. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetTenantRequest.new - # - # # Call the get_tenant method. - # result = client.get_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def get_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_tenant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.get_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified tenant. - # - # @overload update_tenant(request, options = nil) - # Pass arguments to `update_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_tenant(tenant: nil, update_mask: nil) - # Pass arguments to `update_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] - # Required. The tenant resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the tenant fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateTenantRequest.new - # - # # Call the update_tenant method. - # result = client.update_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def update_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_tenant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.update_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified tenant. - # - # @overload delete_tenant(request, options = nil) - # Pass arguments to `delete_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_tenant(name: nil) - # Pass arguments to `delete_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the tenant to be deleted. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteTenantRequest.new - # - # # Call the delete_tenant method. - # result = client.delete_tenant request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_tenant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.delete_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all tenants associated with the project. - # - # @overload list_tenants(request, options = nil) - # Pass arguments to `list_tenants` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_tenants(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_tenants` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of tenants to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListTenantsRequest.new - # - # # Call the list_tenants method. - # result = client.list_tenants request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Talent::V4::Tenant. - # p item - # end - # - def list_tenants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_tenants.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Talent::V4::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_tenants.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tenants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.list_tenants request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @tenant_service_stub, :list_tenants, "tenants", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TenantService REST API. - # - # This class represents the configuration for TenantService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Talent::V4::TenantService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_tenant to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::TenantService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the TenantService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*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_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tenant - ## - # RPC-specific configuration for `get_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tenant - ## - # RPC-specific configuration for `update_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tenant - ## - # RPC-specific configuration for `delete_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tenant - ## - # RPC-specific configuration for `list_tenants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tenants - - # @private - def initialize parent_rpcs = nil - create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant - @create_tenant = ::Gapic::Config::Method.new create_tenant_config - get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant - @get_tenant = ::Gapic::Config::Method.new get_tenant_config - update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant - @update_tenant = ::Gapic::Config::Method.new update_tenant_config - delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant - @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config - list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants - @list_tenants = ::Gapic::Config::Method.new list_tenants_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb deleted file mode 100644 index cc7ba8e861ad..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb +++ /dev/null @@ -1,388 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/talent/v4/tenant_service_pb" - -module Google - module Cloud - module Talent - module V4 - module TenantService - module Rest - ## - # REST service stub for the TenantService 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_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateTenantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # A result object deserialized from the server's reply - def create_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_tenant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetTenantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # A result object deserialized from the server's reply - def get_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_tenant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateTenantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # A result object deserialized from the server's reply - def update_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_tenant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteTenantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_tenant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_tenants REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListTenantsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::ListTenantsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::ListTenantsResponse] - # A result object deserialized from the server's reply - def list_tenants request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tenants_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_tenants", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ListTenantsResponse.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_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateTenantRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/tenants", - body: "tenant", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetTenantRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateTenantRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v4/{tenant.name}", - body: "tenant", - matches: [ - ["tenant.name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteTenantRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tenants REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListTenantsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_tenants_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{parent}/tenants", - 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-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb deleted file mode 100644 index d747e3225cb0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/tenant_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/talent/v4/common_pb' -require 'google/cloud/talent/v4/tenant_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n+google/cloud/talent/v4/tenant_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a#google/cloud/talent/v4/tenant.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x8f\x01\n\x13\x43reateTenantRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x33\n\x06tenant\x18\x02 \x01(\x0b\x32\x1e.google.cloud.talent.v4.TenantB\x03\xe0\x41\x02\"D\n\x10GetTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"{\n\x13UpdateTenantRequest\x12\x33\n\x06tenant\x18\x01 \x01(\x0b\x32\x1e.google.cloud.talent.v4.TenantB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x13\x44\x65leteTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"\x80\x01\n\x12ListTenantsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x9b\x01\n\x13ListTenantsResponse\x12/\n\x07tenants\x18\x01 \x03(\x0b\x32\x1e.google.cloud.talent.v4.Tenant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata2\xf0\x06\n\rTenantService\x12\x9c\x01\n\x0c\x43reateTenant\x12+.google.cloud.talent.v4.CreateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"?\xda\x41\rparent,tenant\x82\xd3\xe4\x93\x02)\"\x1f/v4/{parent=projects/*}/tenants:\x06tenant\x12\x85\x01\n\tGetTenant\x12(.google.cloud.talent.v4.GetTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{name=projects/*/tenants/*}\x12\xa8\x01\n\x0cUpdateTenant\x12+.google.cloud.talent.v4.UpdateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"K\xda\x41\x12tenant,update_mask\x82\xd3\xe4\x93\x02\x30\x32&/v4/{tenant.name=projects/*/tenants/*}:\x06tenant\x12\x83\x01\n\x0c\x44\x65leteTenant\x12+.google.cloud.talent.v4.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!*\x1f/v4/{name=projects/*/tenants/*}\x12\x98\x01\n\x0bListTenants\x12*.google.cloud.talent.v4.ListTenantsRequest\x1a+.google.cloud.talent.v4.ListTenantsResponse\"0\xda\x41\x06parent\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{parent=projects/*}/tenants\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBl\n\x1a\x63om.google.cloud.talent.v4B\x12TenantServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Talent - module V4 - CreateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateTenantRequest").msgclass - GetTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetTenantRequest").msgclass - UpdateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateTenantRequest").msgclass - DeleteTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteTenantRequest").msgclass - ListTenantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListTenantsRequest").msgclass - ListTenantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListTenantsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb deleted file mode 100644 index 1761f0653df7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/tenant_service.proto for package 'google.cloud.talent.v4' -# 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/talent/v4/tenant_service_pb' - -module Google - module Cloud - module Talent - module V4 - module TenantService - # A service that handles tenant management, including CRUD and enumeration. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.TenantService' - - # Creates a new tenant entity. - rpc :CreateTenant, ::Google::Cloud::Talent::V4::CreateTenantRequest, ::Google::Cloud::Talent::V4::Tenant - # Retrieves specified tenant. - rpc :GetTenant, ::Google::Cloud::Talent::V4::GetTenantRequest, ::Google::Cloud::Talent::V4::Tenant - # Updates specified tenant. - rpc :UpdateTenant, ::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Google::Cloud::Talent::V4::Tenant - # Deletes specified tenant. - rpc :DeleteTenant, ::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Google::Protobuf::Empty - # Lists all tenants associated with the project. - rpc :ListTenants, ::Google::Cloud::Talent::V4::ListTenantsRequest, ::Google::Cloud::Talent::V4::ListTenantsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb deleted file mode 100644 index c14911f7ba77..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/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 Talent - module V4 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md b/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md deleted file mode 100644 index 4583e024e1f4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Talent Solution V4 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-talent-v4/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb deleted file mode 100644 index 5089551e9ea4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb +++ /dev/null @@ -1,589 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/cloud/talent/v4/common.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb deleted file mode 100644 index 4a754f4d0ab3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb +++ /dev/null @@ -1,959 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # Message representing a period of time between two timestamps. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Begin of the period (inclusive). - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End of the period (exclusive). - class TimestampRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A resource that represents a location with full geographic information. - # @!attribute [rw] location_type - # @return [::Google::Cloud::Talent::V4::Location::LocationType] - # The type of a location, which corresponds to the address lines field of - # {::Google::Type::PostalAddress google.type.PostalAddress}. For example, - # "Downtown, Atlanta, GA, USA" has a type of - # {::Google::Cloud::Talent::V4::Location::LocationType::NEIGHBORHOOD LocationType.NEIGHBORHOOD}, - # and "Kansas City, KS, USA" has a type of - # {::Google::Cloud::Talent::V4::Location::LocationType::LOCALITY LocationType.LOCALITY}. - # @!attribute [rw] postal_address - # @return [::Google::Type::PostalAddress] - # Postal address of the location that includes human readable information, - # such as postal delivery and payments addresses. Given a postal address, - # a postal service can deliver items to a premises, P.O. Box, or other - # delivery location. - # @!attribute [rw] lat_lng - # @return [::Google::Type::LatLng] - # An object representing a latitude/longitude pair. - # @!attribute [rw] radius_miles - # @return [::Float] - # Radius in miles of the job location. This value is derived from the - # location bounding box in which a circle with the specified radius - # centered from {::Google::Type::LatLng google.type.LatLng} covers the area - # associated with the job location. For example, currently, "Mountain View, - # CA, USA" has a radius of 6.17 miles. - class Location - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enum which represents the type of a location. - module LocationType - # Default value if the type isn't specified. - LOCATION_TYPE_UNSPECIFIED = 0 - - # A country level location. - COUNTRY = 1 - - # A state or equivalent level location. - ADMINISTRATIVE_AREA = 2 - - # A county or equivalent level location. - SUB_ADMINISTRATIVE_AREA = 3 - - # A city or equivalent level location. - LOCALITY = 4 - - # A postal code level location. - POSTAL_CODE = 5 - - # A sublocality is a subdivision of a locality, for example a city borough, - # ward, or arrondissement. Sublocalities are usually recognized by a local - # political authority. For example, Manhattan and Brooklyn are recognized - # as boroughs by the City of New York, and are therefore modeled as - # sublocalities. - SUB_LOCALITY = 6 - - # A district or equivalent level location. - SUB_LOCALITY_1 = 7 - - # A smaller district or equivalent level display. - SUB_LOCALITY_2 = 8 - - # A neighborhood level location. - NEIGHBORHOOD = 9 - - # A street address level location. - STREET_ADDRESS = 10 - end - end - - # Meta information related to the job searcher or entity - # conducting the job search. This information is used to improve the - # performance of the service. - # @!attribute [rw] domain - # @return [::String] - # Required if - # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} - # is unset or `false`. - # - # The client-defined scope or source of the service call, which typically - # is the domain on - # which the service has been implemented and is currently being run. - # - # For example, if the service is being run by client Foo, Inc., on - # job board www.foo.com and career site www.bar.com, then this field is - # set to "foo.com" for use on the job board, and "bar.com" for use on the - # career site. - # - # Note that any improvements to the model for a particular tenant site rely - # on this field being set correctly to a unique domain. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] session_id - # @return [::String] - # Required if - # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} - # is unset or `false`. - # - # A unique session identification string. A session is defined as the - # duration of an end user's interaction with the service over a certain - # period. - # Obfuscate this field for privacy concerns before - # providing it to the service. - # - # Note that any improvements to the model for a particular tenant site rely - # on this field being set correctly to a unique session ID. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] user_id - # @return [::String] - # Required if - # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} - # is unset or `false`. - # - # A unique user identification string, as determined by the client. - # To have the strongest positive impact on search quality - # make sure the client-level is unique. - # Obfuscate this field for privacy concerns before - # providing it to the service. - # - # Note that any improvements to the model for a particular tenant site rely - # on this field being set correctly to a unique user ID. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] allow_missing_ids - # @return [::Boolean] - # Only set when any of - # {::Google::Cloud::Talent::V4::RequestMetadata#domain domain}, - # {::Google::Cloud::Talent::V4::RequestMetadata#session_id session_id} and - # {::Google::Cloud::Talent::V4::RequestMetadata#user_id user_id} isn't available - # for some reason. It is highly recommended not to set this field and provide - # accurate {::Google::Cloud::Talent::V4::RequestMetadata#domain domain}, - # {::Google::Cloud::Talent::V4::RequestMetadata#session_id session_id} and - # {::Google::Cloud::Talent::V4::RequestMetadata#user_id user_id} for the best - # service experience. - # @!attribute [rw] device_info - # @return [::Google::Cloud::Talent::V4::DeviceInfo] - # The type of device used by the job seeker at the time of the call to the - # service. - class RequestMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional information returned to client, such as debugging information. - # @!attribute [rw] request_id - # @return [::String] - # A unique id associated with this call. - # This id is logged for tracking purposes. - class ResponseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Device information collected from the job seeker, candidate, or - # other entity conducting the job search. Providing this information improves - # the quality of the search results across devices. - # @!attribute [rw] device_type - # @return [::Google::Cloud::Talent::V4::DeviceInfo::DeviceType] - # Type of the device. - # @!attribute [rw] id - # @return [::String] - # A device-specific ID. The ID must be a unique identifier that - # distinguishes the device from other devices. - class DeviceInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enumeration describing an API access portal and exposure mechanism. - module DeviceType - # The device type isn't specified. - DEVICE_TYPE_UNSPECIFIED = 0 - - # A desktop web browser, such as, Chrome, Firefox, Safari, or Internet - # Explorer) - WEB = 1 - - # A mobile device web browser, such as a phone or tablet with a Chrome - # browser. - MOBILE_WEB = 2 - - # An Android device native application. - ANDROID = 3 - - # An iOS device native application. - IOS = 4 - - # A bot, as opposed to a device operated by human beings, such as a web - # crawler. - BOT = 5 - - # Other devices types. - OTHER = 6 - end - end - - # Custom attribute values that are either filterable or non-filterable. - # @!attribute [rw] string_values - # @return [::Array<::String>] - # Exactly one of - # {::Google::Cloud::Talent::V4::CustomAttribute#string_values string_values} or - # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} must be - # specified. - # - # This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or - # `CASE_INSENSITIVE_MATCH`) search. - # For filterable `string_value`s, a maximum total number of 200 values - # is allowed, with each `string_value` has a byte size of no more than - # 500B. For unfilterable `string_values`, the maximum total byte size of - # unfilterable `string_values` is 50KB. - # - # Empty string isn't allowed. - # @!attribute [rw] long_values - # @return [::Array<::Integer>] - # Exactly one of - # {::Google::Cloud::Talent::V4::CustomAttribute#string_values string_values} or - # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} must be - # specified. - # - # This field is used to perform number range search. - # (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. - # - # Currently at most 1 - # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} is - # supported. - # @!attribute [rw] filterable - # @return [::Boolean] - # If the `filterable` flag is true, the custom field values may be used for - # custom attribute filters - # {::Google::Cloud::Talent::V4::JobQuery#custom_attribute_filter JobQuery.custom_attribute_filter}. - # If false, these values may not be used for custom attribute filters. - # - # Default is false. - # @!attribute [rw] keyword_searchable - # @return [::Boolean] - # If the `keyword_searchable` flag is true, the keywords in custom fields are - # searchable by keyword match. - # If false, the values are not searchable by keyword match. - # - # Default is false. - class CustomAttribute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Spell check result. - # @!attribute [rw] corrected - # @return [::Boolean] - # Indicates if the query was corrected by the spell checker. - # @!attribute [rw] corrected_text - # @return [::String] - # Correction output consisting of the corrected keyword string. - # @!attribute [rw] corrected_html - # @return [::String] - # Corrected output with html tags to highlight the corrected words. - # Corrected words are called out with the "..." html tags. - # - # For example, the user input query is "software enginear", where the second - # word, "enginear," is incorrect. It should be "engineer". When spelling - # correction is enabled, this value is - # "software engineer". - class SpellingCorrection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Job compensation details. - # @!attribute [rw] entries - # @return [::Array<::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry>] - # Job compensation information. - # - # At most one entry can be of type - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationType::BASE CompensationInfo.CompensationType.BASE}, - # which is referred as **base compensation entry** for the job. - # @!attribute [r] annualized_base_compensation_range - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] - # Output only. Annualized base compensation range. Computed as base - # compensation entry's - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # times - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. - # - # See - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationEntry} - # for explanation on compensation annualization. - # @!attribute [r] annualized_total_compensation_range - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] - # Output only. Annualized total compensation range. Computed as all - # compensation entries' - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # times - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. - # - # See - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationEntry} - # for explanation on compensation annualization. - class CompensationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A compensation entry that represents one component of compensation, such - # as base pay, bonus, or other compensation type. - # - # Annualization: One compensation entry can be annualized if - # - it contains valid - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount amount} - # or - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range range}. - # - and its - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year} - # is set or can be derived. Its annualized range is determined as - # ({::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount amount} - # or - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range range}) - # times - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year}. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationType] - # Compensation type. - # - # Default is - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationType::COMPENSATION_TYPE_UNSPECIFIED CompensationType.COMPENSATION_TYPE_UNSPECIFIED}. - # @!attribute [rw] unit - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit] - # Frequency of the specified amount. - # - # Default is - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED}. - # @!attribute [rw] amount - # @return [::Google::Type::Money] - # Compensation amount. - # - # Note: The following fields are mutually exclusive: `amount`, `range`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] range - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] - # Compensation range. - # - # Note: The following fields are mutually exclusive: `range`, `amount`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] description - # @return [::String] - # Compensation description. For example, could - # indicate equity terms or provide additional context to an estimated - # bonus. - # @!attribute [rw] expected_units_per_year - # @return [::Google::Protobuf::DoubleValue] - # Expected number of units paid each year. If not specified, when - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types} is - # FULLTIME, a default value is inferred based on - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#unit unit}. - # Default values: - # - HOURLY: 2080 - # - DAILY: 260 - # - WEEKLY: 52 - # - MONTHLY: 12 - # - ANNUAL: 1 - class CompensationEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Compensation range. - # @!attribute [rw] max_compensation - # @return [::Google::Type::Money] - # The maximum amount of compensation. If left empty, the value is set - # to a maximal compensation value and the currency code is set to - # match the {::Google::Type::Money#currency_code currency code} of - # min_compensation. - # @!attribute [rw] min_compensation - # @return [::Google::Type::Money] - # The minimum amount of compensation. If left empty, the value is set - # to zero and the currency code is set to match the - # {::Google::Type::Money#currency_code currency code} of max_compensation. - class CompensationRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of compensation. - # - # For compensation amounts specified in non-monetary amounts, - # describe the compensation scheme in the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description}. - # - # For example, tipping format is described in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} - # (for example, "expect 15-20% tips based on customer bill.") and an estimate - # of the tips provided in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # or - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range CompensationEntry.range} - # ($10 per hour). - # - # For example, equity is described in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} - # (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and - # value estimated in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # or - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range CompensationEntry.range}. - # If no value estimate is possible, units are - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED} - # and then further clarified in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} - # field. - module CompensationType - # Default value. - COMPENSATION_TYPE_UNSPECIFIED = 0 - - # Base compensation: Refers to the fixed amount of money paid to an - # employee by an employer in return for work performed. Base compensation - # does not include benefits, bonuses or any other potential compensation - # from an employer. - BASE = 1 - - # Bonus. - BONUS = 2 - - # Signing bonus. - SIGNING_BONUS = 3 - - # Equity. - EQUITY = 4 - - # Profit sharing. - PROFIT_SHARING = 5 - - # Commission. - COMMISSIONS = 6 - - # Tips. - TIPS = 7 - - # Other compensation type. - OTHER_COMPENSATION_TYPE = 8 - end - - # Pay frequency. - module CompensationUnit - # Default value. - COMPENSATION_UNIT_UNSPECIFIED = 0 - - # Hourly. - HOURLY = 1 - - # Daily. - DAILY = 2 - - # Weekly - WEEKLY = 3 - - # Monthly. - MONTHLY = 4 - - # Yearly. - YEARLY = 5 - - # One time. - ONE_TIME = 6 - - # Other compensation units. - OTHER_COMPENSATION_UNIT = 7 - end - end - - # Metadata used for long running operations returned by CTS batch APIs. - # It's used to replace - # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata}. - # @!attribute [rw] state - # @return [::Google::Cloud::Talent::V4::BatchOperationMetadata::State] - # The state of a long running operation. - # @!attribute [rw] state_description - # @return [::String] - # More detailed information about operation state. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of successful item(s) inside an operation. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of failed item(s) inside an operation. - # @!attribute [rw] total_count - # @return [::Integer] - # Count of total item(s) inside an operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch operation is created. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch operation status is updated. The metadata and the - # {::Google::Cloud::Talent::V4::BatchOperationMetadata#update_time update_time} is - # refreshed every minute otherwise cached data is returned. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch operation is finished and - # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is - # set to `true`. - class BatchOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - module State - # Default value. - STATE_UNSPECIFIED = 0 - - # The batch operation is being prepared for processing. - INITIALIZING = 1 - - # The batch operation is actively being processed. - PROCESSING = 2 - - # The batch operation is processed, and at least one item has been - # successfully processed. - SUCCEEDED = 3 - - # The batch operation is done and no item has been successfully processed. - FAILED = 4 - - # The batch operation is in the process of cancelling after - # google.longrunning.Operations.CancelOperation - # is called. - CANCELLING = 5 - - # The batch operation is done after - # google.longrunning.Operations.CancelOperation - # is called. Any items processed before cancelling are returned in the - # response. - CANCELLED = 6 - end - end - - # An enum that represents the size of the company. - module CompanySize - # Default value if the size isn't specified. - COMPANY_SIZE_UNSPECIFIED = 0 - - # The company has less than 50 employees. - MINI = 1 - - # The company has between 50 and 99 employees. - SMALL = 2 - - # The company has between 100 and 499 employees. - SMEDIUM = 3 - - # The company has between 500 and 999 employees. - MEDIUM = 4 - - # The company has between 1,000 and 4,999 employees. - BIG = 5 - - # The company has between 5,000 and 9,999 employees. - BIGGER = 6 - - # The company has 10,000 or more employees. - GIANT = 7 - end - - # An enum that represents employee benefits included with the job. - module JobBenefit - # Default value if the type isn't specified. - JOB_BENEFIT_UNSPECIFIED = 0 - - # The job includes access to programs that support child care, such - # as daycare. - CHILD_CARE = 1 - - # The job includes dental services covered by a dental - # insurance plan. - DENTAL = 2 - - # The job offers specific benefits to domestic partners. - DOMESTIC_PARTNER = 3 - - # The job allows for a flexible work schedule. - FLEXIBLE_HOURS = 4 - - # The job includes health services covered by a medical insurance plan. - MEDICAL = 5 - - # The job includes a life insurance plan provided by the employer or - # available for purchase by the employee. - LIFE_INSURANCE = 6 - - # The job allows for a leave of absence to a parent to care for a newborn - # child. - PARENTAL_LEAVE = 7 - - # The job includes a workplace retirement plan provided by the - # employer or available for purchase by the employee. - RETIREMENT_PLAN = 8 - - # The job allows for paid time off due to illness. - SICK_DAYS = 9 - - # The job includes paid time off for vacation. - VACATION = 10 - - # The job includes vision services covered by a vision - # insurance plan. - VISION = 11 - end - - # Educational degree level defined in International Standard Classification - # of Education (ISCED). - module DegreeType - # Default value. Represents no degree, or early childhood education. - # Maps to ISCED code 0. - # Ex) Kindergarten - DEGREE_TYPE_UNSPECIFIED = 0 - - # Primary education which is typically the first stage of compulsory - # education. ISCED code 1. - # Ex) Elementary school - PRIMARY_EDUCATION = 1 - - # Lower secondary education; First stage of secondary education building on - # primary education, typically with a more subject-oriented curriculum. - # ISCED code 2. - # Ex) Middle school - LOWER_SECONDARY_EDUCATION = 2 - - # Middle education; Second/final stage of secondary education preparing for - # tertiary education and/or providing skills relevant to employment. - # Usually with an increased range of subject options and streams. ISCED - # code 3. - # Ex) High school - UPPER_SECONDARY_EDUCATION = 3 - - # Adult Remedial Education; Programmes providing learning experiences that - # build on secondary education and prepare for labour market entry and/or - # tertiary education. The content is broader than secondary but not as - # complex as tertiary education. ISCED code 4. - ADULT_REMEDIAL_EDUCATION = 4 - - # Associate's or equivalent; Short first tertiary programmes that are - # typically practically-based, occupationally-specific and prepare for - # labour market entry. These programmes may also provide a pathway to other - # tertiary programmes. ISCED code 5. - ASSOCIATES_OR_EQUIVALENT = 5 - - # Bachelor's or equivalent; Programmes designed to provide intermediate - # academic and/or professional knowledge, skills and competencies leading - # to a first tertiary degree or equivalent qualification. ISCED code 6. - BACHELORS_OR_EQUIVALENT = 6 - - # Master's or equivalent; Programmes designed to provide advanced academic - # and/or professional knowledge, skills and competencies leading to a - # second tertiary degree or equivalent qualification. ISCED code 7. - MASTERS_OR_EQUIVALENT = 7 - - # Doctoral or equivalent; Programmes designed primarily to lead to an - # advanced research qualification, usually concluding with the submission - # and defense of a substantive dissertation of publishable quality based on - # original research. ISCED code 8. - DOCTORAL_OR_EQUIVALENT = 8 - end - - # An enum that represents the employment type of a job. - module EmploymentType - # The default value if the employment type isn't specified. - EMPLOYMENT_TYPE_UNSPECIFIED = 0 - - # The job requires working a number of hours that constitute full - # time employment, typically 40 or more hours per week. - FULL_TIME = 1 - - # The job entails working fewer hours than a full time job, - # typically less than 40 hours a week. - PART_TIME = 2 - - # The job is offered as a contracted, as opposed to a salaried employee, - # position. - CONTRACTOR = 3 - - # The job is offered as a contracted position with the understanding - # that it's converted into a full-time position at the end of the - # contract. Jobs of this type are also returned by a search for - # {::Google::Cloud::Talent::V4::EmploymentType::CONTRACTOR EmploymentType.CONTRACTOR} - # jobs. - CONTRACT_TO_HIRE = 4 - - # The job is offered as a temporary employment opportunity, usually - # a short-term engagement. - TEMPORARY = 5 - - # The job is a fixed-term opportunity for students or entry-level job - # seekers to obtain on-the-job training, typically offered as a summer - # position. - INTERN = 6 - - # The is an opportunity for an individual to volunteer, where there's no - # expectation of compensation for the provided services. - VOLUNTEER = 7 - - # The job requires an employee to work on an as-needed basis with a - # flexible schedule. - PER_DIEM = 8 - - # The job involves employing people in remote areas and flying them - # temporarily to the work site instead of relocating employees and their - # families permanently. - FLY_IN_FLY_OUT = 9 - - # The job does not fit any of the other listed types. - OTHER_EMPLOYMENT_TYPE = 10 - end - - # An enum that represents the required experience level required for the job. - module JobLevel - # The default value if the level isn't specified. - JOB_LEVEL_UNSPECIFIED = 0 - - # Entry-level individual contributors, typically with less than 2 years of - # experience in a similar role. Includes interns. - ENTRY_LEVEL = 1 - - # Experienced individual contributors, typically with 2+ years of - # experience in a similar role. - EXPERIENCED = 2 - - # Entry- to mid-level managers responsible for managing a team of people. - MANAGER = 3 - - # Senior-level managers responsible for managing teams of managers. - DIRECTOR = 4 - - # Executive-level managers and above, including C-level positions. - EXECUTIVE = 5 - end - - # An enum that represents the categorization or primary focus of specific - # role. This value is different than the "industry" associated with a role, - # which is related to the categorization of the company listing the job. - module JobCategory - # The default value if the category isn't specified. - JOB_CATEGORY_UNSPECIFIED = 0 - - # An accounting and finance job, such as an Accountant. - ACCOUNTING_AND_FINANCE = 1 - - # An administrative and office job, such as an Administrative Assistant. - ADMINISTRATIVE_AND_OFFICE = 2 - - # An advertising and marketing job, such as Marketing Manager. - ADVERTISING_AND_MARKETING = 3 - - # An animal care job, such as Veterinarian. - ANIMAL_CARE = 4 - - # An art, fashion, or design job, such as Designer. - ART_FASHION_AND_DESIGN = 5 - - # A business operations job, such as Business Operations Manager. - BUSINESS_OPERATIONS = 6 - - # A cleaning and facilities job, such as Custodial Staff. - CLEANING_AND_FACILITIES = 7 - - # A computer and IT job, such as Systems Administrator. - COMPUTER_AND_IT = 8 - - # A construction job, such as General Laborer. - CONSTRUCTION = 9 - - # A customer service job, such s Cashier. - CUSTOMER_SERVICE = 10 - - # An education job, such as School Teacher. - EDUCATION = 11 - - # An entertainment and travel job, such as Flight Attendant. - ENTERTAINMENT_AND_TRAVEL = 12 - - # A farming or outdoor job, such as Park Ranger. - FARMING_AND_OUTDOORS = 13 - - # A healthcare job, such as Registered Nurse. - HEALTHCARE = 14 - - # A human resources job, such as Human Resources Director. - HUMAN_RESOURCES = 15 - - # An installation, maintenance, or repair job, such as Electrician. - INSTALLATION_MAINTENANCE_AND_REPAIR = 16 - - # A legal job, such as Law Clerk. - LEGAL = 17 - - # A management job, often used in conjunction with another category, - # such as Store Manager. - MANAGEMENT = 18 - - # A manufacturing or warehouse job, such as Assembly Technician. - MANUFACTURING_AND_WAREHOUSE = 19 - - # A media, communications, or writing job, such as Media Relations. - MEDIA_COMMUNICATIONS_AND_WRITING = 20 - - # An oil, gas or mining job, such as Offshore Driller. - OIL_GAS_AND_MINING = 21 - - # A personal care and services job, such as Hair Stylist. - PERSONAL_CARE_AND_SERVICES = 22 - - # A protective services job, such as Security Guard. - PROTECTIVE_SERVICES = 23 - - # A real estate job, such as Buyer's Agent. - REAL_ESTATE = 24 - - # A restaurant and hospitality job, such as Restaurant Server. - RESTAURANT_AND_HOSPITALITY = 25 - - # A sales and/or retail job, such Sales Associate. - SALES_AND_RETAIL = 26 - - # A science and engineering job, such as Lab Technician. - SCIENCE_AND_ENGINEERING = 27 - - # A social services or non-profit job, such as Case Worker. - SOCIAL_SERVICES_AND_NON_PROFIT = 28 - - # A sports, fitness, or recreation job, such as Personal Trainer. - SPORTS_FITNESS_AND_RECREATION = 29 - - # A transportation or logistics job, such as Truck Driver. - TRANSPORTATION_AND_LOGISTICS = 30 - end - - # An enum that represents the job posting region. In most cases, job postings - # don't need to specify a region. If a region is given, jobs are - # eligible for searches in the specified region. - module PostingRegion - # If the region is unspecified, the job is only returned if it - # matches the {::Google::Cloud::Talent::V4::LocationFilter LocationFilter}. - POSTING_REGION_UNSPECIFIED = 0 - - # In addition to exact location matching, job posting is returned when the - # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in the search query - # is in the same administrative area as the returned job posting. For - # example, if a `ADMINISTRATIVE_AREA` job is posted in "CA, USA", it's - # returned if {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} has - # "Mountain View". - # - # Administrative area refers to top-level administrative subdivision of this - # country. For example, US state, IT region, UK constituent nation and - # JP prefecture. - ADMINISTRATIVE_AREA = 1 - - # In addition to exact location matching, job is returned when - # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in search query is - # in the same country as this job. For example, if a `NATION_WIDE` job is - # posted in "USA", it's returned if - # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} has 'Mountain - # View'. - NATION = 2 - - # Job allows employees to work remotely (telecommute). - # If locations are provided with this value, the job is - # considered as having a location, but telecommuting is allowed. - TELECOMMUTE = 3 - end - - # Deprecated. All resources are only visible to the owner. - # - # An enum that represents who has view access to the resource. - # @deprecated This enum is deprecated and may be removed in the next major version update. - module Visibility - # Default value. - VISIBILITY_UNSPECIFIED = 0 - - # The resource is only visible to the GCP account who owns it. - ACCOUNT_ONLY = 1 - - # The resource is visible to the owner and may be visible to other - # applications and processes at Google. - SHARED_WITH_GOOGLE = 2 - - # The resource is visible to the owner and may be visible to all other API - # clients. - SHARED_WITH_PUBLIC = 3 - end - - # Option for HTML content sanitization on user input fields, for example, job - # description. By setting this option, user can determine whether and how - # sanitization is performed on these fields. - module HtmlSanitization - # Default value. - HTML_SANITIZATION_UNSPECIFIED = 0 - - # Disables sanitization on HTML input. - HTML_SANITIZATION_DISABLED = 1 - - # Sanitizes HTML input, only accepts bold, italic, ordered list, and - # unordered list markup tags. - SIMPLE_FORMATTING_ONLY = 2 - end - - # Method for commute. Walking, biking and wheelchair accessible transit is - # still in the Preview stage. - module CommuteMethod - # Commute method isn't specified. - COMMUTE_METHOD_UNSPECIFIED = 0 - - # Commute time is calculated based on driving time. - DRIVING = 1 - - # Commute time is calculated based on public transit including bus, metro, - # subway, and so on. - TRANSIT = 2 - - # Commute time is calculated based on walking time. - WALKING = 3 - - # Commute time is calculated based on biking time. - CYCLING = 4 - - # Commute time is calculated based on public transit that is wheelchair - # accessible. - TRANSIT_ACCESSIBLE = 5 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb deleted file mode 100644 index 26cd543627a2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # A Company resource represents a company in the service. A company is the - # entity that owns job postings, that is, the hiring entity responsible for - # employing applicants for the job position. - # @!attribute [rw] name - # @return [::String] - # Required during company update. - # - # The resource name for a company. This is generated by the service when a - # company is created. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @!attribute [rw] display_name - # @return [::String] - # Required. The display name of the company, for example, "Google LLC". - # @!attribute [rw] external_id - # @return [::String] - # Required. Client side company identifier, used to uniquely identify the - # company. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] size - # @return [::Google::Cloud::Talent::V4::CompanySize] - # The employer's company size. - # @!attribute [rw] headquarters_address - # @return [::String] - # The street address of the company's main headquarters, which may be - # different from the job location. The service attempts - # to geolocate the provided address, and populates a more specific - # location wherever possible in - # {::Google::Cloud::Talent::V4::Company::DerivedInfo#headquarters_location DerivedInfo.headquarters_location}. - # @!attribute [rw] hiring_agency - # @return [::Boolean] - # Set to true if it is the hiring agency that post jobs for other - # employers. - # - # Defaults to false if not provided. - # @!attribute [rw] eeo_text - # @return [::String] - # Equal Employment Opportunity legal disclaimer text to be - # associated with all jobs, and typically to be displayed in all - # roles. - # - # The maximum number of allowed characters is 500. - # @!attribute [rw] website_uri - # @return [::String] - # The URI representing the company's primary web site or home page, - # for example, "https://www.google.com". - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] career_site_uri - # @return [::String] - # The URI to employer's career site or careers page on the employer's web - # site, for example, "https://careers.google.com". - # @!attribute [rw] image_uri - # @return [::String] - # A URI that hosts the employer's company logo. - # @!attribute [rw] keyword_searchable_job_custom_attributes - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # This field is deprecated. Please set the searchability of the custom - # attribute in the - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} going - # forward. - # - # A list of keys of filterable - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}, - # whose corresponding `string_values` are used in keyword searches. Jobs with - # `string_values` under these specified field keys are returned if any - # of the values match the search keyword. Custom field values with - # parenthesis, brackets and special symbols are not searchable as-is, - # and those keyword queries must be surrounded by quotes. - # @!attribute [r] derived_info - # @return [::Google::Cloud::Talent::V4::Company::DerivedInfo] - # Output only. Derived details about the company. - # @!attribute [r] suspended - # @return [::Boolean] - # Output only. Indicates whether a company is flagged to be suspended from - # public availability by the service when job content appears suspicious, - # abusive, or spammy. - class Company - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Derived details about the company. - # @!attribute [rw] headquarters_location - # @return [::Google::Cloud::Talent::V4::Location] - # A structured headquarters location of the company, resolved from - # {::Google::Cloud::Talent::V4::Company#headquarters_address Company.headquarters_address} - # if provided. - class DerivedInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb deleted file mode 100644 index bc326d893eab..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb +++ /dev/null @@ -1,133 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # The Request of the CreateCompany method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] company - # @return [::Google::Cloud::Talent::V4::Company] - # Required. The company to be created. - class CreateCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for getting a company by name. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the company to be retrieved. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/api-test-project/tenants/foo/companies/bar". - class GetCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for updating a specified company. - # @!attribute [rw] company - # @return [::Google::Cloud::Talent::V4::Company] - # Required. The company resource to replace the current resource in the - # system. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the company fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Company Company} are - # supported. - class UpdateCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to delete a company. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the company to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - class DeleteCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List companies for which the client has ACL visibility. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] page_token - # @return [::String] - # The starting indicator from which to return results. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of companies to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @!attribute [rw] require_open_jobs - # @return [::Boolean] - # Set to true if the companies requested must have open jobs. - # - # Defaults to false. - # - # If true, at most - # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of - # companies are fetched, among which only those with open jobs are returned. - class ListCompaniesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The List companies response object. - # @!attribute [rw] companies - # @return [::Array<::Google::Cloud::Talent::V4::Company>] - # Companies for the current client. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class ListCompaniesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb deleted file mode 100644 index 0cad28742065..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # Auto-complete parameters. - # @!attribute [rw] tenant - # @return [::String] - # Required. Resource name of tenant the completion is performed within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] query - # @return [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # The list of languages of the query. This is - # the BCP-47 language code, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] page_size - # @return [::Integer] - # Required. Completion result count. - # - # The maximum allowed page size is 10. - # @!attribute [rw] company - # @return [::String] - # If provided, restricts completion to specified company. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @!attribute [rw] scope - # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] - # The scope of the completion. The defaults is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] - # The completion topic. The default is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. - class CompleteQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to specify the scope of completion. - module CompletionScope - # Default value. - COMPLETION_SCOPE_UNSPECIFIED = 0 - - # Suggestions are based only on the data provided by the client. - TENANT = 1 - - # Suggestions are based on all jobs data in the system that's visible to - # the client - PUBLIC = 2 - end - - # Enum to specify auto-completion topics. - module CompletionType - # Default value. - COMPLETION_TYPE_UNSPECIFIED = 0 - - # Suggest job titles for jobs autocomplete. - # - # For - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::JOB_TITLE CompletionType.JOB_TITLE} - # type, only open jobs with the same - # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} - # are returned. - JOB_TITLE = 1 - - # Suggest company names for jobs autocomplete. - # - # For - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMPANY_NAME CompletionType.COMPANY_NAME} - # type, only companies having open jobs with the same - # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} - # are returned. - COMPANY_NAME = 2 - - # Suggest both job titles and company names for jobs autocomplete. - # - # For - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED} - # type, only open jobs with the same - # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} - # or companies having open jobs with the same - # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} - # are returned. - COMBINED = 3 - end - end - - # Response of auto-complete query. - # @!attribute [rw] completion_results - # @return [::Array<::Google::Cloud::Talent::V4::CompleteQueryResponse::CompletionResult>] - # Results of the matching job/company candidates. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class CompleteQueryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Resource that represents completion results. - # @!attribute [rw] suggestion - # @return [::String] - # The suggestion for the query. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] - # The completion topic. - # @!attribute [rw] image_uri - # @return [::String] - # The URI of the company image for - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMPANY_NAME COMPANY_NAME}. - class CompletionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb deleted file mode 100644 index aaead09d2855..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb +++ /dev/null @@ -1,179 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # An event issued when an end user interacts with the application that - # implements Cloud Talent Solution. Providing this information improves the - # quality of results for the API clients, enabling the - # service to perform optimally. The number of events sent must be consistent - # with other calls, such as job searches, issued to the service by the client. - # @!attribute [rw] request_id - # @return [::String] - # Strongly recommended for the best service experience. - # - # A unique ID generated in the API responses. It can be found in - # {::Google::Cloud::Talent::V4::ResponseMetadata#request_id ResponseMetadata.request_id}. - # @!attribute [rw] event_id - # @return [::String] - # Required. A unique identifier, generated by the client application. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Required. The timestamp of the event. - # @!attribute [rw] job_event - # @return [::Google::Cloud::Talent::V4::JobEvent] - # An event issued when a job seeker interacts with the application that - # implements Cloud Talent Solution. - # @!attribute [rw] event_notes - # @return [::String] - # Notes about the event provided by recruiters or other users, for example, - # feedback on why a job was bookmarked. - class ClientEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event issued when a job seeker interacts with the application that - # implements Cloud Talent Solution. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::JobEvent::JobEventType] - # Required. The type of the event (see - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType JobEventType}). - # @!attribute [rw] jobs - # @return [::Array<::String>] - # Required. The [job name(s)][google.cloud.talent.v4.Job.name] associated - # with this event. For example, if this is an - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::IMPRESSION impression} - # event, this field contains the identifiers of all jobs shown to the job - # seeker. If this was a - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::VIEW view} event, this field - # contains the identifier of the viewed job. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}", for - # example, "projects/foo/tenants/bar/jobs/baz". - class JobEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enumeration of an event attributed to the behavior of the end user, - # such as a job seeker. - module JobEventType - # The event is unspecified by other provided values. - JOB_EVENT_TYPE_UNSPECIFIED = 0 - - # The job seeker or other entity interacting with the service has - # had a job rendered in their view, such as in a list of search results in - # a compressed or clipped format. This event is typically associated with - # the viewing of a jobs list on a single page by a job seeker. - IMPRESSION = 1 - - # The job seeker, or other entity interacting with the service, has - # viewed the details of a job, including the full description. This - # event doesn't apply to the viewing a snippet of a job appearing as a - # part of the job search results. Viewing a snippet is associated with an - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::IMPRESSION impression}). - VIEW = 2 - - # The job seeker or other entity interacting with the service - # performed an action to view a job and was redirected to a different - # website for job. - VIEW_REDIRECT = 3 - - # The job seeker or other entity interacting with the service - # began the process or demonstrated the intention of applying for a job. - APPLICATION_START = 4 - - # The job seeker or other entity interacting with the service - # submitted an application for a job. - APPLICATION_FINISH = 5 - - # The job seeker or other entity interacting with the service - # submitted an application for a job with a single click without - # entering information. If a job seeker performs this action, send only - # this event to the service. Do not also send - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START} - # or - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} - # events. - APPLICATION_QUICK_SUBMISSION = 6 - - # The job seeker or other entity interacting with the service - # performed an action to apply to a job and was redirected to a different - # website to complete the application. - APPLICATION_REDIRECT = 7 - - # The job seeker or other entity interacting with the service began the - # process or demonstrated the intention of applying for a job from the - # search results page without viewing the details of the job posting. - # If sending this event, JobEventType.VIEW event shouldn't be sent. - APPLICATION_START_FROM_SEARCH = 8 - - # The job seeker, or other entity interacting with the service, performs an - # action with a single click from the search results page to apply to a job - # (without viewing the details of the job posting), and is redirected - # to a different website to complete the application. If a candidate - # performs this action, send only this event to the service. Do not also - # send - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START}, - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} - # or {::Google::Cloud::Talent::V4::JobEvent::JobEventType::VIEW JobEventType.VIEW} - # events. - APPLICATION_REDIRECT_FROM_SEARCH = 9 - - # This event should be used when a company submits an application - # on behalf of a job seeker. This event is intended for use by staffing - # agencies attempting to place candidates. - APPLICATION_COMPANY_SUBMIT = 10 - - # The job seeker or other entity interacting with the service demonstrated - # an interest in a job by bookmarking or saving it. - BOOKMARK = 11 - - # The job seeker or other entity interacting with the service was - # sent a notification, such as an email alert or device notification, - # containing one or more jobs listings generated by the service. - NOTIFICATION = 12 - - # The job seeker or other entity interacting with the service was - # employed by the hiring entity (employer). Send this event - # only if the job seeker was hired through an application that was - # initiated by a search conducted through the Cloud Talent Solution - # service. - HIRED = 13 - - # A recruiter or staffing agency submitted an application on behalf of the - # candidate after interacting with the service to identify a suitable job - # posting. - SENT_CV = 14 - - # The entity interacting with the service (for example, the job seeker), - # was granted an initial interview by the hiring entity (employer). This - # event should only be sent if the job seeker was granted an interview as - # part of an application that was initiated by a search conducted through / - # recommendation provided by the Cloud Talent Solution service. - INTERVIEW_GRANTED = 15 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb deleted file mode 100644 index 284850e682bb..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # The report event request. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the tenant under which the event is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] client_event - # @return [::Google::Cloud::Talent::V4::ClientEvent] - # Required. Events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. - class CreateClientEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb deleted file mode 100644 index 65be9377eb17..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb +++ /dev/null @@ -1,392 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # The query required to perform a search query. - # @!attribute [rw] query - # @return [::String] - # The query string that matches against the job title, description, and - # location fields. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] query_language_code - # @return [::String] - # The language code of {::Google::Cloud::Talent::V4::JobQuery#query query}. For - # example, "en-US". This field helps to better interpret the query. - # - # If a value isn't specified, the query language code is automatically - # detected, which may not be accurate. - # - # Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # @!attribute [rw] companies - # @return [::Array<::String>] - # This filter specifies the company entities to search against. - # - # If a value isn't specified, jobs are searched for against all - # companies. - # - # If multiple values are specified, jobs are searched against the - # companies specified. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For - # example, "projects/foo/tenants/bar/companies/baz". - # - # At most 20 company filters are allowed. - # @!attribute [rw] location_filters - # @return [::Array<::Google::Cloud::Talent::V4::LocationFilter>] - # The location filter specifies geo-regions containing the jobs to - # search against. See {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} - # for more information. - # - # If a location value isn't specified, jobs fitting the other search - # criteria are retrieved regardless of where they're located. - # - # If multiple values are specified, jobs are retrieved from any of the - # specified locations. If different values are specified for the - # {::Google::Cloud::Talent::V4::LocationFilter#distance_in_miles LocationFilter.distance_in_miles} - # parameter, the maximum provided distance is used for all locations. - # - # At most 5 location filters are allowed. - # @!attribute [rw] job_categories - # @return [::Array<::Google::Cloud::Talent::V4::JobCategory>] - # The category filter specifies the categories of jobs to search against. - # See {::Google::Cloud::Talent::V4::JobCategory JobCategory} for more information. - # - # If a value isn't specified, jobs from any category are searched against. - # - # If multiple values are specified, jobs from any of the specified - # categories are searched against. - # @!attribute [rw] commute_filter - # @return [::Google::Cloud::Talent::V4::CommuteFilter] - # Allows filtering jobs by commute time with different travel methods (for - # example, driving or public transit). - # - # Note: This only works when you specify a - # {::Google::Cloud::Talent::V4::CommuteMethod CommuteMethod}. In this case, - # {::Google::Cloud::Talent::V4::JobQuery#location_filters location_filters} is - # ignored. - # - # Currently we don't support sorting by commute time. - # @!attribute [rw] company_display_names - # @return [::Array<::String>] - # This filter specifies the company - # {::Google::Cloud::Talent::V4::Company#display_name Company.display_name} of the - # jobs to search against. The company name must match the value exactly. - # - # Alternatively, the value being searched for can be wrapped in different - # match operators. - # `SUBSTRING_MATCH([value])` - # The company name must contain a case insensitive substring match of the - # value. Using this function may increase latency. - # - # Sample Value: `SUBSTRING_MATCH(google)` - # - # `MULTI_WORD_TOKEN_MATCH([value])` - # The value will be treated as a multi word token and the company name must - # contain a case insensitive match of the value. Using this function may - # increase latency. - # - # Sample Value: `MULTI_WORD_TOKEN_MATCH(google)` - # - # If a value isn't specified, jobs within the search results are - # associated with any company. - # - # If multiple values are specified, jobs within the search results may be - # associated with any of the specified companies. - # - # At most 20 company display name filters are allowed. - # @!attribute [rw] compensation_filter - # @return [::Google::Cloud::Talent::V4::CompensationFilter] - # This search filter is applied only to - # {::Google::Cloud::Talent::V4::Job#compensation_info Job.compensation_info}. For - # example, if the filter is specified as "Hourly job with per-hour - # compensation > $15", only jobs meeting these criteria are searched. If a - # filter isn't defined, all open jobs are searched. - # @!attribute [rw] custom_attribute_filter - # @return [::String] - # This filter specifies a structured syntax to match against the - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} - # marked as `filterable`. - # - # The syntax for this expression is a subset of SQL syntax. - # - # Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the - # left of the operator is a custom field key and the right of the operator - # is a number or a quoted string. You must escape backslash (\\) and - # quote (\") characters. - # - # Supported functions are `LOWER([field_name])` to - # perform a case insensitive match and `EMPTY([field_name])` to filter on the - # existence of a key. - # - # Boolean expressions (AND/OR/NOT) are supported up to 3 levels of - # nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 - # comparisons or functions are allowed in the expression. The expression - # must be < 10000 bytes in length. - # - # Sample Query: - # `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND - # driving_years > 10` - # @!attribute [rw] disable_spell_check - # @return [::Boolean] - # This flag controls the spell-check feature. If false, the - # service attempts to correct a misspelled query, - # for example, "enginee" is corrected to "engineer". - # - # Defaults to false: a spell check is performed. - # @!attribute [rw] employment_types - # @return [::Array<::Google::Cloud::Talent::V4::EmploymentType>] - # The employment type filter specifies the employment type of jobs to - # search against, such as - # {::Google::Cloud::Talent::V4::EmploymentType::FULL_TIME EmploymentType.FULL_TIME}. - # - # If a value isn't specified, jobs in the search results includes any - # employment type. - # - # If multiple values are specified, jobs in the search results include - # any of the specified employment types. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # This filter specifies the locale of jobs to search against, - # for example, "en-US". - # - # If a value isn't specified, the search results can contain jobs in any - # locale. - # - # - # Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # At most 10 language code filters are allowed. - # @!attribute [rw] publish_time_range - # @return [::Google::Cloud::Talent::V4::TimestampRange] - # Jobs published within a range specified by this filter are searched - # against. - # @!attribute [rw] excluded_jobs - # @return [::Array<::String>] - # This filter specifies a list of job names to be excluded during search. - # - # At most 400 excluded job names are allowed. - class JobQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Geographic region of the search. - # @!attribute [rw] address - # @return [::String] - # The address name, such as "Mountain View" or "Bay Area". - # @!attribute [rw] region_code - # @return [::String] - # CLDR region code of the country/region. This field may be used in two ways: - # - # 1) If telecommute preference is not set, this field is used address - # ambiguity of the user-input address. For example, "Liverpool" may refer to - # "Liverpool, NY, US" or "Liverpool, UK". This region code biases the - # address resolution toward a specific country or territory. If this field is - # not set, address resolution is biased toward the United States by default. - # - # 2) If telecommute preference is set to TELECOMMUTE_ALLOWED, the - # telecommute location filter will be limited to the region specified in this - # field. If this field is not set, the telecommute job locations will not be - # - # See - # https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html - # for details. Example: "CH" for Switzerland. - # @!attribute [rw] lat_lng - # @return [::Google::Type::LatLng] - # The latitude and longitude of the geographic center to search from. This - # field is ignored if `address` is provided. - # @!attribute [rw] distance_in_miles - # @return [::Float] - # The distance_in_miles is applied when the location being searched for is - # identified as a city or smaller. This field is ignored if the location - # being searched for is a state or larger. - # @!attribute [rw] telecommute_preference - # @return [::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference] - # Allows the client to return jobs without a - # set location, specifically, telecommuting jobs (telecommuting is considered - # by the service as a special location). - # {::Google::Cloud::Talent::V4::Job#posting_region Job.posting_region} indicates - # if a job permits telecommuting. If this field is set to - # {::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference::TELECOMMUTE_ALLOWED TelecommutePreference.TELECOMMUTE_ALLOWED}, - # telecommuting jobs are searched, and - # {::Google::Cloud::Talent::V4::LocationFilter#address address} and - # {::Google::Cloud::Talent::V4::LocationFilter#lat_lng lat_lng} are ignored. If - # not set or set to - # {::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference::TELECOMMUTE_EXCLUDED TelecommutePreference.TELECOMMUTE_EXCLUDED}, - # the telecommute status of the jobs is ignored. Jobs that have - # {::Google::Cloud::Talent::V4::PostingRegion::TELECOMMUTE PostingRegion.TELECOMMUTE} - # and have additional {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} - # may still be matched based on other location filters using - # {::Google::Cloud::Talent::V4::LocationFilter#address address} or - # {::Google::Cloud::Talent::V4::LocationFilter#lat_lng lat_lng}. - # - # This filter can be used by itself to search exclusively for telecommuting - # jobs, or it can be combined with another location - # filter to search for a combination of job locations, - # such as "Mountain View" or "telecommuting" jobs. However, when used in - # combination with other location filters, telecommuting jobs can be - # treated as less relevant than other jobs in the search response. - # - # This field is only used for job search requests. - class LocationFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specify whether to include telecommute jobs. - module TelecommutePreference - # Default value if the telecommute preference isn't specified. - TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0 - - # Deprecated: Ignore telecommute status of jobs. Use - # TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs. - TELECOMMUTE_EXCLUDED = 1 - - # Allow telecommute jobs. - TELECOMMUTE_ALLOWED = 2 - - # Exclude telecommute jobs. - TELECOMMUTE_JOBS_EXCLUDED = 3 - end - end - - # Filter on job compensation type and amount. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::CompensationFilter::FilterType] - # Required. Type of filter. - # @!attribute [rw] units - # @return [::Array<::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit>] - # Required. Specify desired `base compensation entry's` - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit}. - # @!attribute [rw] range - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] - # Compensation range. - # @!attribute [rw] include_jobs_with_unspecified_compensation_range - # @return [::Boolean] - # If set to true, jobs with unspecified compensation range fields are - # included. - class CompensationFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specify the type of filtering. - module FilterType - # Filter type unspecified. Position holder, INVALID, should never be used. - FILTER_TYPE_UNSPECIFIED = 0 - - # Filter by `base compensation entry's` unit. A job is a match if and - # only if the job contains a base CompensationEntry and the base - # CompensationEntry's unit matches provided - # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. Populate one or - # more {::Google::Cloud::Talent::V4::CompensationFilter#units units}. - # - # See - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} - # for definition of base compensation entry. - UNIT_ONLY = 1 - - # Filter by `base compensation entry's` unit and amount / range. A job - # is a match if and only if the job contains a base CompensationEntry, and - # the base entry's unit matches provided - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationUnit} - # and amount or range overlaps with provided - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange CompensationRange}. - # - # See - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} - # for definition of base compensation entry. - # - # Set exactly one {::Google::Cloud::Talent::V4::CompensationFilter#units units} - # and populate {::Google::Cloud::Talent::V4::CompensationFilter#range range}. - UNIT_AND_AMOUNT = 2 - - # Filter by annualized base compensation amount and `base compensation - # entry's` unit. Populate - # {::Google::Cloud::Talent::V4::CompensationFilter#range range} and zero or more - # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. - ANNUALIZED_BASE_AMOUNT = 3 - - # Filter by annualized total compensation amount and `base compensation - # entry's` unit . Populate - # {::Google::Cloud::Talent::V4::CompensationFilter#range range} and zero or more - # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. - ANNUALIZED_TOTAL_AMOUNT = 4 - end - end - - # Parameters needed for commute search. - # @!attribute [rw] commute_method - # @return [::Google::Cloud::Talent::V4::CommuteMethod] - # Required. The method of transportation to calculate the commute time for. - # @!attribute [rw] start_coordinates - # @return [::Google::Type::LatLng] - # Required. The latitude and longitude of the location to calculate the - # commute time from. - # @!attribute [rw] travel_duration - # @return [::Google::Protobuf::Duration] - # Required. The maximum travel time in seconds. The maximum allowed value is - # `3600s` (one hour). Format is `123s`. - # @!attribute [rw] allow_imprecise_addresses - # @return [::Boolean] - # If `true`, jobs without street level addresses may also be returned. - # For city level addresses, the city center is used. For state and coarser - # level addresses, text matching is used. - # If this field is set to `false` or isn't specified, only jobs that include - # street level addresses will be returned by commute search. - # @!attribute [rw] road_traffic - # @return [::Google::Cloud::Talent::V4::CommuteFilter::RoadTraffic] - # Specifies the traffic density to use when calculating commute time. - # - # Note: The following fields are mutually exclusive: `road_traffic`, `departure_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] departure_time - # @return [::Google::Type::TimeOfDay] - # The departure time used to calculate traffic impact, represented as - # {::Google::Type::TimeOfDay google.type.TimeOfDay} in local time zone. - # - # Currently traffic model is restricted to hour level resolution. - # - # Note: The following fields are mutually exclusive: `departure_time`, `road_traffic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class CommuteFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The traffic density to use when calculating commute time. - module RoadTraffic - # Road traffic situation isn't specified. - ROAD_TRAFFIC_UNSPECIFIED = 0 - - # Optimal commute time without considering any traffic impact. - TRAFFIC_FREE = 1 - - # Commute time calculation takes in account the peak traffic impact. - BUSY_HOUR = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb deleted file mode 100644 index 486c5466ca9e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # The histogram request. - # @!attribute [rw] histogram_query - # @return [::String] - # An expression specifies a histogram request against matching jobs for - # searches. - # - # See - # {::Google::Cloud::Talent::V4::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries} - # for details about syntax. - class HistogramQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Histogram result that matches - # {::Google::Cloud::Talent::V4::HistogramQuery HistogramQuery} specified in - # searches. - # @!attribute [rw] histogram_query - # @return [::String] - # Requested histogram expression. - # @!attribute [rw] histogram - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # A map from the values of the facet associated with distinct values to the - # number of matching entries with corresponding value. - # - # The key format is: - # - # * (for string histogram) string values stored in the field. - # * (for named numeric bucket) name specified in `bucket()` function, like - # for `bucket(0, MAX, "non-negative")`, the key will be `non-negative`. - # * (for anonymous numeric bucket) range formatted as `-`, for - # example, `0-1000`, `MIN-0`, and `0-MAX`. - class HistogramQueryResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class HistogramEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb deleted file mode 100644 index bf21f608f3bf..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb +++ /dev/null @@ -1,392 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # A Job resource represents a job posting (also referred to as a "job listing" - # or "job requisition"). A job belongs to a - # {::Google::Cloud::Talent::V4::Company Company}, which is the hiring entity - # responsible for the job. - # @!attribute [rw] name - # @return [::String] - # Required during job update. - # - # The resource name for the job. This is generated by the service when a - # job is created. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # Use of this field in job queries and API calls is preferred over the use of - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} since this - # value is unique. - # @!attribute [rw] company - # @return [::String] - # Required. The resource name of the company listing the job. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For - # example, "projects/foo/tenants/bar/companies/baz". - # @!attribute [rw] requisition_id - # @return [::String] - # Required. The requisition ID, also referred to as the posting ID, is - # assigned by the client to identify a job. This field is intended to be used - # by clients for client identification and tracking of postings. A job isn't - # allowed to be created if there is another job with the same - # {::Google::Cloud::Talent::V4::Job#name company}, - # {::Google::Cloud::Talent::V4::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] title - # @return [::String] - # Required. The title of the job, such as "Software Engineer" - # - # The maximum number of allowed characters is 500. - # @!attribute [rw] description - # @return [::String] - # Required. The description of the job, which typically includes a - # multi-paragraph description of the company and related information. - # Separate fields are provided on the job object for - # {::Google::Cloud::Talent::V4::Job#responsibilities responsibilities}, - # {::Google::Cloud::Talent::V4::Job#qualifications qualifications}, and other job - # characteristics. Use of these separate job fields is recommended. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 100,000. - # @!attribute [rw] addresses - # @return [::Array<::String>] - # Strongly recommended for the best service experience. - # - # Location(s) where the employer is looking to hire for this job posting. - # - # Specifying the full street address(es) of the hiring location enables - # better API results, especially job searches by commute time. - # - # At most 50 locations are allowed for best search performance. If a job has - # more locations, it is suggested to split it into multiple jobs with unique - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}s (e.g. 'ReqA' - # becomes 'ReqA-1', 'ReqA-2', and so on.) as multiple jobs with the same - # {::Google::Cloud::Talent::V4::Job#company company}, - # {::Google::Cloud::Talent::V4::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} are not - # allowed. If the original - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} must be - # preserved, a custom field should be used for storage. It is also suggested - # to group the locations that close to each other in the same job for better - # search experience. - # - # Jobs with multiple addresses must have their addresses with the same - # {::Google::Cloud::Talent::V4::Location::LocationType LocationType} to allow - # location filtering to work properly. (For example, a Job with addresses - # "1600 Amphitheatre Parkway, Mountain View, CA, USA" and "London, UK" may - # not have location filters applied correctly at search time since the first - # is a - # {::Google::Cloud::Talent::V4::Location::LocationType::STREET_ADDRESS LocationType.STREET_ADDRESS} - # and the second is a - # {::Google::Cloud::Talent::V4::Location::LocationType::LOCALITY LocationType.LOCALITY}.) - # If a job needs to have multiple addresses, it is suggested to split it into - # multiple jobs with same LocationTypes. - # - # The maximum number of allowed characters is 500. - # @!attribute [rw] application_info - # @return [::Google::Cloud::Talent::V4::Job::ApplicationInfo] - # Job application information. - # @!attribute [rw] job_benefits - # @return [::Array<::Google::Cloud::Talent::V4::JobBenefit>] - # The benefits included with the job. - # @!attribute [rw] compensation_info - # @return [::Google::Cloud::Talent::V4::CompensationInfo] - # Job compensation information (a.k.a. "pay rate") i.e., the compensation - # that will paid to the employee. - # @!attribute [rw] custom_attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Talent::V4::CustomAttribute}] - # A map of fields to hold both filterable and non-filterable custom job - # attributes that are not covered by the provided structured fields. - # - # The keys of the map are strings up to 64 bytes and must match the - # pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, key0LikeThis or - # KEY_1_LIKE_THIS. - # - # At most 100 filterable and at most 100 unfilterable keys are supported. - # For filterable `string_values`, across all keys at most 200 values are - # allowed, with each string no more than 255 characters. For unfilterable - # `string_values`, the maximum total size of `string_values` across all keys - # is 50KB. - # @!attribute [rw] degree_types - # @return [::Array<::Google::Cloud::Talent::V4::DegreeType>] - # The desired education degrees for the job, such as Bachelors, Masters. - # @!attribute [rw] department - # @return [::String] - # The department or functional area within the company with the open - # position. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] employment_types - # @return [::Array<::Google::Cloud::Talent::V4::EmploymentType>] - # The employment type(s) of a job, for example, - # {::Google::Cloud::Talent::V4::EmploymentType::FULL_TIME full time} or - # {::Google::Cloud::Talent::V4::EmploymentType::PART_TIME part time}. - # @!attribute [rw] incentives - # @return [::String] - # A description of bonus, commission, and other compensation - # incentives associated with the job not including salary or pay. - # - # The maximum number of allowed characters is 10,000. - # @!attribute [rw] language_code - # @return [::String] - # The language of the posting. This field is distinct from - # any requirements for fluency that are associated with the job. - # - # Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: - # class="external" target="_blank" }. - # - # If this field is unspecified and - # {::Google::Cloud::Talent::V4::Job#description Job.description} is present, - # detected language code based on - # {::Google::Cloud::Talent::V4::Job#description Job.description} is assigned, - # otherwise defaults to 'en_US'. - # @!attribute [rw] job_level - # @return [::Google::Cloud::Talent::V4::JobLevel] - # The experience level associated with the job, such as "Entry Level". - # @!attribute [rw] promotion_value - # @return [::Integer] - # A promotion value of the job, as determined by the client. - # The value determines the sort order of the jobs returned when searching for - # jobs using the featured jobs search call, with higher promotional values - # being returned first and ties being resolved by relevance sort. Only the - # jobs with a promotionValue >0 are returned in a FEATURED_JOB_SEARCH. - # - # Default value is 0, and negative values are treated as 0. - # @!attribute [rw] qualifications - # @return [::String] - # A description of the qualifications required to perform the - # job. The use of this field is recommended - # as an alternative to using the more general - # {::Google::Cloud::Talent::V4::Job#description description} field. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 10,000. - # @!attribute [rw] responsibilities - # @return [::String] - # A description of job responsibilities. The use of this field is - # recommended as an alternative to using the more general - # {::Google::Cloud::Talent::V4::Job#description description} field. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 10,000. - # @!attribute [rw] posting_region - # @return [::Google::Cloud::Talent::V4::PostingRegion] - # The job {::Google::Cloud::Talent::V4::PostingRegion PostingRegion} (for example, - # state, country) throughout which the job is available. If this field is - # set, a {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in a search - # query within the job region finds this job posting if an exact location - # match isn't specified. If this field is set to - # {::Google::Cloud::Talent::V4::PostingRegion::NATION PostingRegion.NATION} or - # {::Google::Cloud::Talent::V4::PostingRegion::ADMINISTRATIVE_AREA PostingRegion.ADMINISTRATIVE_AREA}, - # setting job {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} to the - # same location level as this field is strongly recommended. - # @!attribute [rw] visibility - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Talent::V4::Visibility] - # Deprecated. The job is only visible to the owner. - # - # The visibility of the job. - # - # Defaults to - # {::Google::Cloud::Talent::V4::Visibility::ACCOUNT_ONLY Visibility.ACCOUNT_ONLY} - # if not specified. - # @!attribute [rw] job_start_time - # @return [::Google::Protobuf::Timestamp] - # The start timestamp of the job in UTC time zone. Typically this field - # is used for contracting engagements. Invalid timestamps are ignored. - # @!attribute [rw] job_end_time - # @return [::Google::Protobuf::Timestamp] - # The end timestamp of the job. Typically this field is used for contracting - # engagements. Invalid timestamps are ignored. - # @!attribute [rw] posting_publish_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp this job posting was most recently published. The default - # value is the time the request arrives at the server. Invalid timestamps are - # ignored. - # @!attribute [rw] posting_expire_time - # @return [::Google::Protobuf::Timestamp] - # Strongly recommended for the best service experience. - # - # The expiration timestamp of the job. After this timestamp, the - # job is marked as expired, and it no longer appears in search results. The - # expired job can't be listed by the - # {::Google::Cloud::Talent::V4::JobService::Client#list_jobs ListJobs} API, but it can be - # retrieved with the {::Google::Cloud::Talent::V4::JobService::Client#get_job GetJob} API - # or updated with the - # {::Google::Cloud::Talent::V4::JobService::Client#update_job UpdateJob} API or deleted - # with the {::Google::Cloud::Talent::V4::JobService::Client#delete_job DeleteJob} API. An - # expired job can be updated and opened again by using a future expiration - # timestamp. Updating an expired job fails if there is another existing open - # job with same {::Google::Cloud::Talent::V4::Job#company company}, - # {::Google::Cloud::Talent::V4::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}. - # - # The expired jobs are retained in our system for 90 days. However, the - # overall expired job count cannot exceed 3 times the maximum number of - # open jobs over previous 7 days. If this threshold is exceeded, - # expired jobs are cleaned out in order of earliest expire time. - # Expired jobs are no longer accessible after they are cleaned - # out. - # - # Invalid timestamps are ignored, and treated as expire time not provided. - # - # If the timestamp is before the instant request is made, the job - # is treated as expired immediately on creation. This kind of job can - # not be updated. And when creating a job with past timestamp, the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time posting_publish_time} - # must be set before - # {::Google::Cloud::Talent::V4::Job#posting_expire_time posting_expire_time}. The - # purpose of this feature is to allow other objects, such as - # {::Google::Cloud::Talent::V4::Job::ApplicationInfo ApplicationInfo}, to refer a - # job that didn't exist in the system prior to becoming expired. If you want - # to modify a job that was expired on creation, delete it and create a new - # one. - # - # If this value isn't provided at the time of job creation or is invalid, - # the job posting expires after 30 days from the job's creation time. For - # example, if the job was created on 2017/01/01 13:00AM UTC with an - # unspecified expiration date, the job expires after 2017/01/31 13:00AM UTC. - # - # If this value isn't provided on job update, it depends on the field masks - # set by - # {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask UpdateJobRequest.update_mask}. - # If the field masks include - # {::Google::Cloud::Talent::V4::Job#job_end_time job_end_time}, or the masks are - # empty meaning that every field is updated, the job posting expires after 30 - # days from the job's last update time. Otherwise the expiration date isn't - # updated. - # @!attribute [r] posting_create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when this job posting was created. - # @!attribute [r] posting_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when this job posting was last updated. - # @!attribute [r] company_display_name - # @return [::String] - # Output only. Display name of the company listing the job. - # @!attribute [r] derived_info - # @return [::Google::Cloud::Talent::V4::Job::DerivedInfo] - # Output only. Derived details about the job posting. - # @!attribute [rw] processing_options - # @return [::Google::Cloud::Talent::V4::Job::ProcessingOptions] - # Options for job processing. - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Application related details of a job posting. - # @!attribute [rw] emails - # @return [::Array<::String>] - # Use this field to specify email address(es) to which resumes or - # applications can be sent. - # - # The maximum number of allowed characters for each entry is 255. - # @!attribute [rw] instruction - # @return [::String] - # Use this field to provide instructions, such as "Mail your application - # to ...", that a candidate can follow to apply for the job. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 3,000. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Use this URI field to direct an applicant to a website, for example to - # link to an online application form. - # - # The maximum number of allowed characters for each entry is 2,000. - class ApplicationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Derived details about the job posting. - # @!attribute [rw] locations - # @return [::Array<::Google::Cloud::Talent::V4::Location>] - # Structured locations of the job, resolved from - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}. - # - # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations locations} are exactly - # matched to {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} in the - # same order. - # @!attribute [rw] job_categories - # @return [::Array<::Google::Cloud::Talent::V4::JobCategory>] - # Job categories derived from {::Google::Cloud::Talent::V4::Job#title Job.title} - # and {::Google::Cloud::Talent::V4::Job#description Job.description}. - class DerivedInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options for job processing. - # @!attribute [rw] disable_street_address_resolution - # @return [::Boolean] - # If set to `true`, the service does not attempt to resolve a - # more precise address for the job. - # @!attribute [rw] html_sanitization - # @return [::Google::Cloud::Talent::V4::HtmlSanitization] - # Option for job HTML content sanitization. Applied fields are: - # - # * description - # * applicationInfo.instruction - # * incentives - # * qualifications - # * responsibilities - # - # HTML tags in these fields may be stripped if sanitiazation isn't - # disabled. - # - # Defaults to - # {::Google::Cloud::Talent::V4::HtmlSanitization::SIMPLE_FORMATTING_ONLY HtmlSanitization.SIMPLE_FORMATTING_ONLY}. - class ProcessingOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Talent::V4::CustomAttribute] - class CustomAttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb deleted file mode 100644 index 8f673511ad12..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb +++ /dev/null @@ -1,929 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # Create job request. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4::Job] - # Required. The Job to be created. - class CreateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Get job request. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the job to retrieve. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - class GetJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Update job request. - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4::Job] - # Required. The Job to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise - # all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - class UpdateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Delete job request. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the job to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - class DeleteJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List jobs request. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] filter - # @return [::String] - # Required. The filter string specifies the jobs to be enumerated. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` - # * `requisitionId` - # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - # OPEN if no value is specified. - # - # At least one of `companyName` and `requisitionId` must present or an - # INVALID_ARGUMENT error is thrown. - # - # Sample Query: - # - # * companyName = "projects/foo/tenants/bar/companies/baz" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # requisitionId = "req-1" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # status = "EXPIRED" - # * requisitionId = "req-1" - # * requisitionId = "req-1" AND status = "EXPIRED" - # @!attribute [rw] page_token - # @return [::String] - # The starting point of a query result. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of jobs to be returned per page of results. - # - # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, - # the maximum allowed page size is 1000. Otherwise, the maximum allowed page - # size is 100. - # - # Default is 100 if empty or a number < 1 is specified. - # @!attribute [rw] job_view - # @return [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the - # search response. Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no - # value is specified. - class ListJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List jobs response. - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Talent::V4::Job>] - # The Jobs for a given company. - # - # The maximum number of items returned is based on the limit field - # provided in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class ListJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Request body of the `SearchJobs` call. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] search_mode - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @!attribute [rw] request_metadata - # @return [::Google::Cloud::Talent::V4::RequestMetadata] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @!attribute [rw] job_query - # @return [::Google::Cloud::Talent::V4::JobQuery] - # Query used to search against jobs, such as keyword, location filters, etc. - # @!attribute [rw] enable_broadening - # @return [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @!attribute [rw] histogram_queries - # @return [::Array<::Google::Cloud::Talent::V4::HistogramQuery>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @!attribute [rw] job_view - # @return [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @!attribute [rw] offset - # @return [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @!attribute [rw] max_page_size - # @return [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @!attribute [rw] page_token - # @return [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @!attribute [rw] order_by - # @return [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @!attribute [rw] diversification_level - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @!attribute [rw] custom_ranking_info - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @!attribute [rw] disable_keyword_match - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @!attribute [rw] keyword_match_mode - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @!attribute [rw] relevance_threshold - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - class SearchJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Custom ranking information for - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # @!attribute [rw] importance_level - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo::ImportanceLevel] - # Required. Controls over how important the score of - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression} - # gets applied to job's final ranking position. - # - # An error is thrown if not specified. - # @!attribute [rw] ranking_expression - # @return [::String] - # Required. Controls over how job documents get ranked on top of existing - # relevance score (determined by API algorithm). A combination of the - # ranking expression and relevance score is used to determine job's final - # ranking position. - # - # The syntax for this expression is a subset of Google SQL syntax. - # - # Supported operators are: +, -, *, /, where the left and right side of - # the operator is either a numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} - # key, integer/double value or an expression that can be evaluated to a - # number. - # - # Parenthesis are supported to adjust calculation precedence. The - # expression must be < 200 characters in length. - # - # The expression is considered invalid for a job if the expression - # references custom attributes that are not populated on the job or if the - # expression results in a divide by zero. If an expression is invalid for a - # job, that job is demoted to the end of the results. - # - # Sample ranking expression - # (year + 25) * 0.25 - (freshness / 0.5) - class CustomRankingInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The importance level for - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression}. - module ImportanceLevel - # Default value if the importance level isn't specified. - IMPORTANCE_LEVEL_UNSPECIFIED = 0 - - # The given ranking expression is of None importance, existing relevance - # score (determined by API algorithm) dominates job's final ranking - # position. - NONE = 1 - - # The given ranking expression is of Low importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - LOW = 2 - - # The given ranking expression is of Mild importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - MILD = 3 - - # The given ranking expression is of Medium importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - MEDIUM = 4 - - # The given ranking expression is of High importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - HIGH = 5 - - # The given ranking expression is of Extreme importance, and dominates - # job's final ranking position with existing relevance - # score (determined by API algorithm) ignored. - EXTREME = 6 - end - end - - # A string-represented enumeration of the job search mode. The service - # operate differently for different modes of service. - module SearchMode - # The mode of the search method isn't specified. The default search - # behavior is identical to JOB_SEARCH search behavior. - SEARCH_MODE_UNSPECIFIED = 0 - - # The job search matches against all jobs, and featured jobs - # (jobs with promotionValue > 0) are not specially handled. - JOB_SEARCH = 1 - - # The job search matches only against featured jobs (jobs with a - # promotionValue > 0). This method doesn't return any jobs having a - # promotionValue <= 0. The search results order is determined by the - # promotionValue (jobs with a higher promotionValue are returned higher up - # in the search results), with relevance being used as a tiebreaker. - FEATURED_JOB_SEARCH = 2 - end - - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # If you are using pageToken to page through the result set, - # latency might be lower but we can't guarantee that all results are - # returned. If you are using page offset, latency might be higher but all - # results are returned. - module DiversificationLevel - # The diversification level isn't specified. - DIVERSIFICATION_LEVEL_UNSPECIFIED = 0 - - # Disables diversification. Jobs that would normally be pushed to the last - # page would not have their positions altered. This may result in highly - # similar jobs appearing in sequence in the search results. - DISABLED = 1 - - # Default diversifying behavior. The result list is ordered so that - # highly similar results are pushed to the end of the last page of search - # results. - SIMPLE = 2 - - # Only one job from the same company will be shown at once, other jobs - # under same company are pushed to the end of the last page of search - # result. - ONE_PER_COMPANY = 3 - - # Similar to ONE_PER_COMPANY, but it allows at most two jobs in the - # same company to be shown at once, the other jobs under same company are - # pushed to the end of the last page of search result. - TWO_PER_COMPANY = 4 - - # Similar to ONE_PER_COMPANY, but it allows at most three jobs in the - # same company to be shown at once, the other jobs under same company are - # dropped. - MAX_THREE_PER_COMPANY = 6 - - # The result list is ordered such that somewhat similar results are pushed - # to the end of the last page of the search results. This option is - # recommended if SIMPLE diversification does not diversify enough. - DIVERSIFY_BY_LOOSER_SIMILARITY = 5 - end - - # Controls what keyword matching behavior the search has. When keyword - # matching is enabled, a keyword match returns jobs that may not match given - # category filters when there are matching keywords. For example, for the - # query "program manager" with KeywordMatchMode set to KEYWORD_MATCH_ALL, a - # job posting with the title "software developer," which doesn't fall into - # "program manager" ontology, and "program manager" appearing in its - # description will be surfaced. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this enum's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - module KeywordMatchMode - # The keyword match option isn't specified. Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # behavior. - KEYWORD_MATCH_MODE_UNSPECIFIED = 0 - - # Disables keyword matching. - KEYWORD_MATCH_DISABLED = 1 - - # Enable keyword matching over - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}, and - # keyword searchable - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} - # fields. - KEYWORD_MATCH_ALL = 2 - - # Only enable keyword matching over - # {::Google::Cloud::Talent::V4::Job#title Job.title}. - KEYWORD_MATCH_TITLE_ONLY = 3 - end - - # The relevance threshold of the search results. The higher relevance - # threshold is, the higher relevant results are shown and the less number of - # results are returned. - module RelevanceThreshold - # Default value. In this case, server behavior defaults to Google defined - # threshold. - RELEVANCE_THRESHOLD_UNSPECIFIED = 0 - - # Lowest relevance threshold. - LOWEST = 1 - - # Low relevance threshold. - LOW = 2 - - # Medium relevance threshold. - MEDIUM = 3 - - # High relevance threshold. - HIGH = 4 - end - end - - # Response for SearchJob method. - # @!attribute [rw] matching_jobs - # @return [::Array<::Google::Cloud::Talent::V4::SearchJobsResponse::MatchingJob>] - # The Job entities that match the specified - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # @!attribute [rw] histogram_query_results - # @return [::Array<::Google::Cloud::Talent::V4::HistogramQueryResult>] - # The histogram results that match with specified - # {::Google::Cloud::Talent::V4::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries}. - # @!attribute [rw] next_page_token - # @return [::String] - # The token that specifies the starting position of the next page of results. - # This field is empty if there are no more results. - # @!attribute [rw] location_filters - # @return [::Array<::Google::Cloud::Talent::V4::Location>] - # The location filters that the service applied to the specified query. If - # any filters are lat-lng based, the - # {::Google::Cloud::Talent::V4::Location#location_type Location.location_type} is - # {::Google::Cloud::Talent::V4::Location::LocationType::LOCATION_TYPE_UNSPECIFIED Location.LocationType.LOCATION_TYPE_UNSPECIFIED}. - # @!attribute [rw] total_size - # @return [::Integer] - # Number of jobs that match the specified query. - # - # Note: This size is precise only if the total is less than 100,000. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - # @!attribute [rw] broadened_query_jobs_count - # @return [::Integer] - # If query broadening is enabled, we may append additional results from the - # broadened query. This number indicates how many of the jobs returned in the - # jobs field are from the broadened query. These results are always at the - # end of the jobs list. In particular, a value of 0, or if the field isn't - # set, all the jobs in the jobs list are from the original - # (without broadening) query. If this field is non-zero, subsequent requests - # with offset after this result set should contain all broadened results. - # @!attribute [rw] spell_correction - # @return [::Google::Cloud::Talent::V4::SpellingCorrection] - # The spell checking result, and correction. - class SearchJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Job entry with metadata inside - # {::Google::Cloud::Talent::V4::SearchJobsResponse SearchJobsResponse}. - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4::Job] - # Job resource that matches the specified - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # @!attribute [rw] job_summary - # @return [::String] - # A summary of the job with core information that's displayed on the search - # results listing page. - # @!attribute [rw] job_title_snippet - # @return [::String] - # Contains snippets of text from the - # {::Google::Cloud::Talent::V4::Job#title Job.title} field most closely matching - # a search query's keywords, if available. The matching query keywords are - # enclosed in HTML bold tags. - # @!attribute [rw] search_text_snippet - # @return [::String] - # Contains snippets of text from the - # {::Google::Cloud::Talent::V4::Job#description Job.description} and similar - # fields that most closely match a search query's keywords, if available. - # All HTML tags in the original fields are stripped when returned in this - # field, and matching query keywords are enclosed in HTML bold tags. - # @!attribute [rw] commute_info - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse::CommuteInfo] - # Commute information which is generated based on specified - # {::Google::Cloud::Talent::V4::CommuteFilter CommuteFilter}. - class MatchingJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Commute details related to this job. - # @!attribute [rw] job_location - # @return [::Google::Cloud::Talent::V4::Location] - # Location used as the destination in the commute calculation. - # @!attribute [rw] travel_duration - # @return [::Google::Protobuf::Duration] - # The number of seconds required to travel to the job location from the - # query location. A duration of 0 seconds indicates that the job isn't - # reachable within the requested duration, but was returned as part of an - # expanded query. - class CommuteInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request to create a batch of jobs. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Talent::V4::Job>] - # Required. The jobs to be created. - # A maximum of 200 jobs can be created in a batch. - class BatchCreateJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to update a batch of jobs. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Talent::V4::Job>] - # Required. The jobs to be updated. - # A maximum of 200 jobs can be updated in a batch. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. Be aware that it will - # also increase latency when checking the status of a batch operation. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} - # are updated. Otherwise all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside - # {::Google::Cloud::Talent::V4::JobResult JobResult} - # will only contains fields that is updated, plus the Id of the Job. - # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, - # which can yield a very large response. - class BatchUpdateJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to delete a batch of jobs. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # - # The parent of all of the jobs specified in `names` must match this field. - # @!attribute [rw] names - # @return [::Array<::String>] - # The names of the jobs to delete. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". - # For example, "projects/foo/tenants/bar/jobs/baz". - # - # A maximum of 200 jobs can be deleted in a batch. - class BatchDeleteJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Mutation result of a job from a batch operation. - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4::Job] - # Here {::Google::Cloud::Talent::V4::Job Job} only contains basic information - # including {::Google::Cloud::Talent::V4::Job#name name}, - # {::Google::Cloud::Talent::V4::Job#company company}, - # {::Google::Cloud::Talent::V4::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}, use getJob - # method to retrieve detailed information of the created/updated job. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status of the job processed. This field is populated if the - # processing of the {::Google::Cloud::Talent::V4::JobResult#job job} fails. - class JobResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The result of - # {::Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs JobService.BatchCreateJobs}. - # It's used to replace - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # in case of success. - # @!attribute [rw] job_results - # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] - # List of job mutation results from a batch create operation. It can change - # until operation status is FINISHED, FAILED or CANCELLED. - class BatchCreateJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The result of - # {::Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs JobService.BatchUpdateJobs}. - # It's used to replace - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # in case of success. - # @!attribute [rw] job_results - # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] - # List of job mutation results from a batch update operation. It can change - # until operation status is FINISHED, FAILED or CANCELLED. - class BatchUpdateJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The result of - # {::Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs JobService.BatchDeleteJobs}. - # It's used to replace - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # in case of success. - # @!attribute [rw] job_results - # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] - # List of job mutation results from a batch delete operation. It can change - # until operation status is FINISHED, FAILED or CANCELLED. - class BatchDeleteJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An enum that specifies the job attributes that are returned in the - # {::Google::Cloud::Talent::V4::SearchJobsResponse::MatchingJob#job MatchingJob.job} - # or {::Google::Cloud::Talent::V4::ListJobsResponse#jobs ListJobsResponse.jobs} - # fields. - module JobView - # Default value. - JOB_VIEW_UNSPECIFIED = 0 - - # A ID only view of job, with following attributes: - # {::Google::Cloud::Talent::V4::Job#name Job.name}, - # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}. - JOB_VIEW_ID_ONLY = 1 - - # A minimal view of the job, with the following attributes: - # {::Google::Cloud::Talent::V4::Job#name Job.name}, - # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#company Job.company}, - # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations Job.DerivedInfo.locations}, - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}. - JOB_VIEW_MINIMAL = 2 - - # A small view of the job, with the following attributes in the search - # results: {::Google::Cloud::Talent::V4::Job#name Job.name}, - # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#company Job.company}, - # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations Job.DerivedInfo.locations}, - # {::Google::Cloud::Talent::V4::Job#visibility Job.visibility}, - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}. - JOB_VIEW_SMALL = 3 - - # All available attributes are included in the search results. - JOB_VIEW_FULL = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb deleted file mode 100644 index 75689dcc538b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # A Tenant resource represents a tenant in the service. A tenant is a group or - # entity that shares common access with specific privileges for resources like - # jobs. Customer may create multiple tenants to provide data isolation for - # different groups. - # @!attribute [rw] name - # @return [::String] - # Required during tenant update. - # - # The resource name for a tenant. This is generated by the service when a - # tenant is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] external_id - # @return [::String] - # Required. Client side tenant identifier, used to uniquely identify the - # tenant. - # - # The maximum number of allowed characters is 255. - class Tenant - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb deleted file mode 100644 index 69e01584823c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Talent - module V4 - # The Request of the CreateTenant method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @!attribute [rw] tenant - # @return [::Google::Cloud::Talent::V4::Tenant] - # Required. The tenant to be created. - class CreateTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for getting a tenant by name. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the tenant to be retrieved. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - class GetTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for updating a specified tenant. - # @!attribute [rw] tenant - # @return [::Google::Cloud::Talent::V4::Tenant] - # Required. The tenant resource to replace the current resource in the - # system. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the tenant fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. - class UpdateTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to delete a tenant. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the tenant to be deleted. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - class DeleteTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List tenants for which the client has ACL visibility. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @!attribute [rw] page_token - # @return [::String] - # The starting indicator from which to return results. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of tenants to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - class ListTenantsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The List tenants response object. - # @!attribute [rw] tenants - # @return [::Array<::Google::Cloud::Talent::V4::Tenant>] - # Tenants for the current client. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class ListTenantsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 9a7c0269fa42..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb deleted file mode 100644 index c15e78a39a56..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.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! - - -module Google - module Type - # An object that represents a latitude/longitude pair. This is expressed as a - # pair of doubles to represent degrees latitude and degrees longitude. Unless - # specified otherwise, this must conform to the - # WGS84 - # standard. Values must be within normalized ranges. - # @!attribute [rw] latitude - # @return [::Float] - # The latitude in degrees. It must be in the range [-90.0, +90.0]. - # @!attribute [rw] longitude - # @return [::Float] - # The longitude in degrees. It must be in the range [-180.0, +180.0]. - class LatLng - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb deleted file mode 100644 index 56a32eee300d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb deleted file mode 100644 index 9cd0c16495dd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 postal address, e.g. for postal delivery or payments addresses. - # Given a postal address, a postal service can deliver items to a premise, P.O. - # Box or similar. - # It is not intended to model geographical locations (roads, towns, - # mountains). - # - # In typical usage an address would be created via user input or from importing - # existing data, depending on the type of process. - # - # Advice on address input / editing: - # - Use an i18n-ready address widget such as - # https://github.com/google/libaddressinput) - # - Users should not be presented with UI elements for input or editing of - # fields outside countries where that field is used. - # - # For more guidance on how to use this schema, please see: - # https://support.google.com/business/answer/6397478 - # @!attribute [rw] revision - # @return [::Integer] - # The schema revision of the `PostalAddress`. This must be set to 0, which is - # the latest revision. - # - # All new revisions **must** be backward compatible with old revisions. - # @!attribute [rw] region_code - # @return [::String] - # Required. CLDR region code of the country/region of the address. This - # is never inferred and it is up to the user to ensure the value is - # correct. See http://cldr.unicode.org/ and - # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html - # for details. Example: "CH" for Switzerland. - # @!attribute [rw] language_code - # @return [::String] - # Optional. BCP-47 language code of the contents of this address (if - # known). This is often the UI language of the input form or is expected - # to match one of the languages used in the address' country/region, or their - # transliterated equivalents. - # This can affect formatting in certain countries, but is not critical - # to the correctness of the data and will never affect any validation or - # other non-formatting related operations. - # - # If this value is not known, it should be omitted (rather than specifying a - # possibly incorrect default). - # - # Examples: "zh-Hant", "ja", "ja-Latn", "en". - # @!attribute [rw] postal_code - # @return [::String] - # Optional. Postal code of the address. Not all countries use or require - # postal codes to be present, but where they are used, they may trigger - # additional validation with other parts of the address (e.g. state/zip - # validation in the U.S.A.). - # @!attribute [rw] sorting_code - # @return [::String] - # Optional. Additional, country-specific, sorting code. This is not used - # in most regions. Where it is used, the value is either a string like - # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number - # alone, representing the "sector code" (Jamaica), "delivery area indicator" - # (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). - # @!attribute [rw] administrative_area - # @return [::String] - # Optional. Highest administrative subdivision which is used for postal - # addresses of a country or region. - # For example, this can be a state, a province, an oblast, or a prefecture. - # Specifically, for Spain this is the province and not the autonomous - # community (e.g. "Barcelona" and not "Catalonia"). - # Many countries don't use an administrative area in postal addresses. E.g. - # in Switzerland this should be left unpopulated. - # @!attribute [rw] locality - # @return [::String] - # Optional. Generally refers to the city/town portion of the address. - # Examples: US city, IT comune, UK post town. - # In regions of the world where localities are not well defined or do not fit - # into this structure well, leave locality empty and use address_lines. - # @!attribute [rw] sublocality - # @return [::String] - # Optional. Sublocality of the address. - # For example, this can be neighborhoods, boroughs, districts. - # @!attribute [rw] address_lines - # @return [::Array<::String>] - # Unstructured address lines describing the lower levels of an address. - # - # Because values in address_lines do not have type information and may - # sometimes contain multiple values in a single field (e.g. - # "Austin, TX"), it is important that the line order is clear. The order of - # address lines should be "envelope order" for the country/region of the - # address. In places where this can vary (e.g. Japan), address_language is - # used to make it explicit (e.g. "ja" for large-to-small ordering and - # "ja-Latn" or "en" for small-to-large). This way, the most specific line of - # an address can be selected based on the language. - # - # The minimum permitted structural representation of an address consists - # of a region_code with all remaining information placed in the - # address_lines. It would be possible to format such an address very - # approximately without geocoding, but no semantic reasoning could be - # made about any of the address components until it was at least - # partially resolved. - # - # Creating an address only containing a region_code and address_lines, and - # then geocoding is the recommended way to handle completely unstructured - # addresses (as opposed to guessing which parts of the address should be - # localities or administrative areas). - # @!attribute [rw] recipients - # @return [::Array<::String>] - # Optional. The recipient at the address. - # This field may, under certain circumstances, contain multiline information. - # For example, it might contain "care of" information. - # @!attribute [rw] organization - # @return [::String] - # Optional. The name of the organization at the address. - class PostalAddress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb deleted file mode 100644 index 8372dad8beb8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/snippets/Gemfile b/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile deleted file mode 100644 index b3bffd08bc08..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4", path: "../" -else - gem "google-cloud-talent-v4" -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-talent-v4/snippets/company_service/create_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb deleted file mode 100644 index e56a55c05094..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_CompanyService_CreateCompany_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the create_company call in the CompanyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::CompanyService::Client#create_company. -# -def create_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CreateCompanyRequest.new - - # Call the create_company method. - result = client.create_company request - - # The returned object is of type Google::Cloud::Talent::V4::Company. - p result -end -# [END jobs_v4_generated_CompanyService_CreateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb deleted file mode 100644 index 40fdb75b8cc4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_CompanyService_DeleteCompany_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the delete_company call in the CompanyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::CompanyService::Client#delete_company. -# -def delete_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new - - # Call the delete_company method. - result = client.delete_company request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END jobs_v4_generated_CompanyService_DeleteCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb deleted file mode 100644 index 9c22acb2386a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_CompanyService_GetCompany_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the get_company call in the CompanyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::CompanyService::Client#get_company. -# -def get_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::GetCompanyRequest.new - - # Call the get_company method. - result = client.get_company request - - # The returned object is of type Google::Cloud::Talent::V4::Company. - p result -end -# [END jobs_v4_generated_CompanyService_GetCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb deleted file mode 100644 index 020a9f51d83c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.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 jobs_v4_generated_CompanyService_ListCompanies_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the list_companies call in the CompanyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::CompanyService::Client#list_companies. -# -def list_companies - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::ListCompaniesRequest.new - - # Call the list_companies method. - result = client.list_companies request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Talent::V4::Company. - p item - end -end -# [END jobs_v4_generated_CompanyService_ListCompanies_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb deleted file mode 100644 index 8b646272a21b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_CompanyService_UpdateCompany_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the update_company call in the CompanyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::CompanyService::Client#update_company. -# -def update_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new - - # Call the update_company method. - result = client.update_company request - - # The returned object is of type Google::Cloud::Talent::V4::Company. - p result -end -# [END jobs_v4_generated_CompanyService_UpdateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb deleted file mode 100644 index 43f84207b6e0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_Completion_CompleteQuery_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the complete_query call in the Completion service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::Completion::Client#complete_query. -# -def complete_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::Completion::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CompleteQueryRequest.new - - # Call the complete_query method. - result = client.complete_query request - - # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. - p result -end -# [END jobs_v4_generated_Completion_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb deleted file mode 100644 index ade74776472e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_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 jobs_v4_generated_EventService_CreateClientEvent_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the create_client_event call in the EventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::EventService::Client#create_client_event. -# -def create_client_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::EventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CreateClientEventRequest.new - - # Call the create_client_event method. - result = client.create_client_event request - - # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. - p result -end -# [END jobs_v4_generated_EventService_CreateClientEvent_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb deleted file mode 100644 index 21835b11ffce..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_BatchCreateJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the batch_create_jobs call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs. -# -def batch_create_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new - - # Call the batch_create_jobs method. - result = client.batch_create_jobs request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END jobs_v4_generated_JobService_BatchCreateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb deleted file mode 100644 index 0cb9e4d13b0b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_BatchDeleteJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the batch_delete_jobs call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs. -# -def batch_delete_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new - - # Call the batch_delete_jobs method. - result = client.batch_delete_jobs request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END jobs_v4_generated_JobService_BatchDeleteJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb deleted file mode 100644 index bb184ab697d5..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_BatchUpdateJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the batch_update_jobs call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs. -# -def batch_update_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new - - # Call the batch_update_jobs method. - result = client.batch_update_jobs request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END jobs_v4_generated_JobService_BatchUpdateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb deleted file mode 100644 index aba1bba6ca7b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_CreateJob_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the create_job call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#create_job. -# -def create_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CreateJobRequest.new - - # Call the create_job method. - result = client.create_job request - - # The returned object is of type Google::Cloud::Talent::V4::Job. - p result -end -# [END jobs_v4_generated_JobService_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb deleted file mode 100644 index 1391253de76b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_DeleteJob_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the delete_job call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#delete_job. -# -def delete_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::DeleteJobRequest.new - - # Call the delete_job method. - result = client.delete_job request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END jobs_v4_generated_JobService_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb deleted file mode 100644 index 16f9c7382f55..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_GetJob_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the get_job call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#get_job. -# -def get_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::GetJobRequest.new - - # Call the get_job method. - result = client.get_job request - - # The returned object is of type Google::Cloud::Talent::V4::Job. - p result -end -# [END jobs_v4_generated_JobService_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb deleted file mode 100644 index 2445a495de35..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_ListJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the list_jobs call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#list_jobs. -# -def list_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::ListJobsRequest.new - - # Call the list_jobs method. - result = client.list_jobs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Talent::V4::Job. - p item - end -end -# [END jobs_v4_generated_JobService_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb deleted file mode 100644 index 6b29ad36b790..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_SearchJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the search_jobs call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#search_jobs. -# -def search_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::SearchJobsRequest.new - - # Call the search_jobs method. - result = client.search_jobs request - - # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - p result -end -# [END jobs_v4_generated_JobService_SearchJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb deleted file mode 100644 index 3e422ee69d93..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_SearchJobsForAlert_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the search_jobs_for_alert call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert. -# -def search_jobs_for_alert - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::SearchJobsRequest.new - - # Call the search_jobs_for_alert method. - result = client.search_jobs_for_alert request - - # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - p result -end -# [END jobs_v4_generated_JobService_SearchJobsForAlert_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb deleted file mode 100644 index 7be182860d89..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_JobService_UpdateJob_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the update_job call in the JobService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::JobService::Client#update_job. -# -def update_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::UpdateJobRequest.new - - # Call the update_job method. - result = client.update_job request - - # The returned object is of type Google::Cloud::Talent::V4::Job. - p result -end -# [END jobs_v4_generated_JobService_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json b/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json deleted file mode 100644 index 282652fed372..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json +++ /dev/null @@ -1,895 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-talent-v4", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.talent.v4", - "version": "v4" - } - ] - }, - "snippets": [ - { - "region_tag": "jobs_v4_generated_CompanyService_CreateCompany_sync", - "title": "Snippet for the create_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#create_company.", - "file": "company_service/create_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_company", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#create_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CreateCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Company", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "CreateCompany", - "full_name": "google.cloud.talent.v4.CompanyService.CreateCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_CompanyService_GetCompany_sync", - "title": "Snippet for the get_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#get_company.", - "file": "company_service/get_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_company", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#get_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::GetCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Company", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "GetCompany", - "full_name": "google.cloud.talent.v4.CompanyService.GetCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_CompanyService_UpdateCompany_sync", - "title": "Snippet for the update_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#update_company.", - "file": "company_service/update_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_company", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#update_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::UpdateCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Company", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "UpdateCompany", - "full_name": "google.cloud.talent.v4.CompanyService.UpdateCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_CompanyService_DeleteCompany_sync", - "title": "Snippet for the delete_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#delete_company.", - "file": "company_service/delete_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_company", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#delete_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::DeleteCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "DeleteCompany", - "full_name": "google.cloud.talent.v4.CompanyService.DeleteCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_CompanyService_ListCompanies_sync", - "title": "Snippet for the list_companies call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#list_companies.", - "file": "company_service/list_companies.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_companies", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#list_companies", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::ListCompaniesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::ListCompaniesResponse", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "ListCompanies", - "full_name": "google.cloud.talent.v4.CompanyService.ListCompanies", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_Completion_CompleteQuery_sync", - "title": "Snippet for the complete_query call in the Completion service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::Completion::Client#complete_query.", - "file": "completion/complete_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "complete_query", - "full_name": "::Google::Cloud::Talent::V4::Completion::Client#complete_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CompleteQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::CompleteQueryResponse", - "client": { - "short_name": "Completion::Client", - "full_name": "::Google::Cloud::Talent::V4::Completion::Client" - }, - "method": { - "short_name": "CompleteQuery", - "full_name": "google.cloud.talent.v4.Completion.CompleteQuery", - "service": { - "short_name": "Completion", - "full_name": "google.cloud.talent.v4.Completion" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_EventService_CreateClientEvent_sync", - "title": "Snippet for the create_client_event call in the EventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::EventService::Client#create_client_event.", - "file": "event_service/create_client_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_client_event", - "full_name": "::Google::Cloud::Talent::V4::EventService::Client#create_client_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CreateClientEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::ClientEvent", - "client": { - "short_name": "EventService::Client", - "full_name": "::Google::Cloud::Talent::V4::EventService::Client" - }, - "method": { - "short_name": "CreateClientEvent", - "full_name": "google.cloud.talent.v4.EventService.CreateClientEvent", - "service": { - "short_name": "EventService", - "full_name": "google.cloud.talent.v4.EventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_CreateJob_sync", - "title": "Snippet for the create_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#create_job.", - "file": "job_service/create_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_job", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#create_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CreateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Job", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "CreateJob", - "full_name": "google.cloud.talent.v4.JobService.CreateJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_BatchCreateJobs_sync", - "title": "Snippet for the batch_create_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs.", - "file": "job_service/batch_create_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::BatchCreateJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "BatchCreateJobs", - "full_name": "google.cloud.talent.v4.JobService.BatchCreateJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_GetJob_sync", - "title": "Snippet for the get_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#get_job.", - "file": "job_service/get_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_job", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#get_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::GetJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Job", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "GetJob", - "full_name": "google.cloud.talent.v4.JobService.GetJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_UpdateJob_sync", - "title": "Snippet for the update_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#update_job.", - "file": "job_service/update_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_job", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#update_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::UpdateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Job", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "UpdateJob", - "full_name": "google.cloud.talent.v4.JobService.UpdateJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_BatchUpdateJobs_sync", - "title": "Snippet for the batch_update_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs.", - "file": "job_service/batch_update_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_update_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::BatchUpdateJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "BatchUpdateJobs", - "full_name": "google.cloud.talent.v4.JobService.BatchUpdateJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_DeleteJob_sync", - "title": "Snippet for the delete_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#delete_job.", - "file": "job_service/delete_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_job", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#delete_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::DeleteJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "DeleteJob", - "full_name": "google.cloud.talent.v4.JobService.DeleteJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_BatchDeleteJobs_sync", - "title": "Snippet for the batch_delete_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs.", - "file": "job_service/batch_delete_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_delete_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::BatchDeleteJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "BatchDeleteJobs", - "full_name": "google.cloud.talent.v4.JobService.BatchDeleteJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_ListJobs_sync", - "title": "Snippet for the list_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#list_jobs.", - "file": "job_service/list_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#list_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::ListJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::ListJobsResponse", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "ListJobs", - "full_name": "google.cloud.talent.v4.JobService.ListJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_SearchJobs_sync", - "title": "Snippet for the search_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#search_jobs.", - "file": "job_service/search_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#search_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::SearchJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::SearchJobsResponse", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "SearchJobs", - "full_name": "google.cloud.talent.v4.JobService.SearchJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_SearchJobsForAlert_sync", - "title": "Snippet for the search_jobs_for_alert call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert.", - "file": "job_service/search_jobs_for_alert.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_jobs_for_alert", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::SearchJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::SearchJobsResponse", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "SearchJobsForAlert", - "full_name": "google.cloud.talent.v4.JobService.SearchJobsForAlert", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_CreateTenant_sync", - "title": "Snippet for the create_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#create_tenant.", - "file": "tenant_service/create_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tenant", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#create_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CreateTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Tenant", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "CreateTenant", - "full_name": "google.cloud.talent.v4.TenantService.CreateTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_GetTenant_sync", - "title": "Snippet for the get_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#get_tenant.", - "file": "tenant_service/get_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tenant", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#get_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::GetTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Tenant", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "GetTenant", - "full_name": "google.cloud.talent.v4.TenantService.GetTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_UpdateTenant_sync", - "title": "Snippet for the update_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#update_tenant.", - "file": "tenant_service/update_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_tenant", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#update_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::UpdateTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Tenant", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "UpdateTenant", - "full_name": "google.cloud.talent.v4.TenantService.UpdateTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_DeleteTenant_sync", - "title": "Snippet for the delete_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#delete_tenant.", - "file": "tenant_service/delete_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tenant", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#delete_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::DeleteTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "DeleteTenant", - "full_name": "google.cloud.talent.v4.TenantService.DeleteTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_ListTenants_sync", - "title": "Snippet for the list_tenants call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#list_tenants.", - "file": "tenant_service/list_tenants.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tenants", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#list_tenants", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::ListTenantsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::ListTenantsResponse", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "ListTenants", - "full_name": "google.cloud.talent.v4.TenantService.ListTenants", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "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-talent-v4/snippets/tenant_service/create_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb deleted file mode 100644 index 665aba99974d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_TenantService_CreateTenant_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the create_tenant call in the TenantService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::TenantService::Client#create_tenant. -# -def create_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CreateTenantRequest.new - - # Call the create_tenant method. - result = client.create_tenant request - - # The returned object is of type Google::Cloud::Talent::V4::Tenant. - p result -end -# [END jobs_v4_generated_TenantService_CreateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb deleted file mode 100644 index f0ee2dc8605a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_TenantService_DeleteTenant_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the delete_tenant call in the TenantService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::TenantService::Client#delete_tenant. -# -def delete_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::DeleteTenantRequest.new - - # Call the delete_tenant method. - result = client.delete_tenant request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END jobs_v4_generated_TenantService_DeleteTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb deleted file mode 100644 index 92928f5b47d7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_TenantService_GetTenant_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the get_tenant call in the TenantService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::TenantService::Client#get_tenant. -# -def get_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::GetTenantRequest.new - - # Call the get_tenant method. - result = client.get_tenant request - - # The returned object is of type Google::Cloud::Talent::V4::Tenant. - p result -end -# [END jobs_v4_generated_TenantService_GetTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb deleted file mode 100644 index 4cfc79e6fc24..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_TenantService_ListTenants_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the list_tenants call in the TenantService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::TenantService::Client#list_tenants. -# -def list_tenants - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::ListTenantsRequest.new - - # Call the list_tenants method. - result = client.list_tenants request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Talent::V4::Tenant. - p item - end -end -# [END jobs_v4_generated_TenantService_ListTenants_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb deleted file mode 100644 index 19154714e44b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START jobs_v4_generated_TenantService_UpdateTenant_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the update_tenant call in the TenantService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Talent::V4::TenantService::Client#update_tenant. -# -def update_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::UpdateTenantRequest.new - - # Call the update_tenant method. - result = client.update_tenant request - - # The returned object is of type Google::Cloud::Talent::V4::Tenant. - p result -end -# [END jobs_v4_generated_TenantService_UpdateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb deleted file mode 100644 index 51d748c725d6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_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/talent/v4/company_service" - -class ::Google::Cloud::Talent::V4::CompanyService::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_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.company_path project: "value0", tenant: "value1", company: "value2" - assert_equal "projects/value0/tenants/value1/companies/value2", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb deleted file mode 100644 index 55e30df49147..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb +++ /dev/null @@ -1,374 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/talent/v4/company_service_pb" -require "google/cloud/talent/v4/company_service/rest" - - -class ::Google::Cloud::Talent::V4::CompanyService::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_company - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Company.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - company = {} - - create_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_create_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_company({ parent: parent, company: company }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_company parent: parent, company: company do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_company ::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_company({ parent: parent, company: company }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_company(::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_company_client_stub.call_count - end - end - end - - def test_get_company - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Company.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_get_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_company({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_company name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_company ::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_company({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_company(::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_company_client_stub.call_count - end - end - end - - def test_update_company - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Company.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - company = {} - update_mask = {} - - update_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_update_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_company({ company: company, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_company company: company, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_company ::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_company({ company: company, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_company(::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_company_client_stub.call_count - end - end - end - - def test_delete_company - # 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_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_delete_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_company({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_company name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_company ::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_company({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_company(::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_company_client_stub.call_count - end - end - end - - def test_list_companies - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - require_open_jobs = true - - list_companies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_list_companies_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_companies_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_companies ::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_companies(::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_companies_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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb deleted file mode 100644 index e4827e8d8ef9..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb +++ /dev/null @@ -1,409 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/company_service_pb" -require "google/cloud/talent/v4/company_service" - -class ::Google::Cloud::Talent::V4::CompanyService::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_company - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Company.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - company = {} - - create_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_company, name - assert_kind_of ::Google::Cloud::Talent::V4::CreateCompanyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Company), request["company"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_company({ parent: parent, company: company }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_company parent: parent, company: company do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_company ::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_company({ parent: parent, company: company }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_company(::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_company_client_stub.call_rpc_count - end - end - - def test_get_company - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Company.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_company, name - assert_kind_of ::Google::Cloud::Talent::V4::GetCompanyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_company({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_company name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_company ::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_company({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_company(::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_company_client_stub.call_rpc_count - end - end - - def test_update_company - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Company.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - company = {} - update_mask = {} - - update_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_company, name - assert_kind_of ::Google::Cloud::Talent::V4::UpdateCompanyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Company), request["company"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_company({ company: company, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_company company: company, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_company ::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, 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_company({ company: company, 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_company(::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, 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_company_client_stub.call_rpc_count - end - end - - def test_delete_company - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_company, name - assert_kind_of ::Google::Cloud::Talent::V4::DeleteCompanyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_company({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_company name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_company ::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_company({ 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_company(::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(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_company_client_stub.call_rpc_count - end - end - - def test_list_companies - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::ListCompaniesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - require_open_jobs = true - - list_companies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_companies, name - assert_kind_of ::Google::Cloud::Talent::V4::ListCompaniesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal true, request["require_open_jobs"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_companies_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_companies ::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_companies(::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_companies_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::CompanyService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb deleted file mode 100644 index aeb6b9d2f969..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_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/talent/v4/completion" - -class ::Google::Cloud::Talent::V4::Completion::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_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.company_path project: "value0", tenant: "value1", company: "value2" - assert_equal "projects/value0/tenants/value1/companies/value2", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb deleted file mode 100644 index 4a17510d2b0d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.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 "helper" -require "gapic/rest" -require "google/cloud/talent/v4/completion_service_pb" -require "google/cloud/talent/v4/completion/rest" - - -class ::Google::Cloud::Talent::V4::Completion::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_complete_query - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - tenant = "hello world" - query = "hello world" - language_codes = ["hello world"] - page_size = 42 - company = "hello world" - scope = :COMPLETION_SCOPE_UNSPECIFIED - type = :COMPLETION_TYPE_UNSPECIFIED - - complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::Completion::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.complete_query tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.complete_query ::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, complete_query_client_stub.call_count - end - end - end - - def test_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::Talent::V4::Completion::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::Talent::V4::Completion::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb deleted file mode 100644 index 1099c4c1ade7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb +++ /dev/null @@ -1,174 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/completion_service_pb" -require "google/cloud/talent/v4/completion" - -class ::Google::Cloud::Talent::V4::Completion::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_complete_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::CompleteQueryResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - tenant = "hello world" - query = "hello world" - language_codes = ["hello world"] - page_size = 42 - company = "hello world" - scope = :COMPLETION_SCOPE_UNSPECIFIED - type = :COMPLETION_TYPE_UNSPECIFIED - - complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :complete_query, name - assert_kind_of ::Google::Cloud::Talent::V4::CompleteQueryRequest, request - assert_equal "hello world", request["tenant"] - assert_equal "hello world", request["query"] - assert_equal ["hello world"], request["language_codes"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["company"] - assert_equal :COMPLETION_SCOPE_UNSPECIFIED, request["scope"] - assert_equal :COMPLETION_TYPE_UNSPECIFIED, request["type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.complete_query tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.complete_query ::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, complete_query_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::Completion::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::Talent::V4::Completion::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::Talent::V4::Completion::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::Completion::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb deleted file mode 100644 index 9812de9567dd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/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/talent/v4/event_service" - -class ::Google::Cloud::Talent::V4::EventService::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_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb deleted file mode 100644 index 9d149f603fb8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/talent/v4/event_service_pb" -require "google/cloud/talent/v4/event_service/rest" - - -class ::Google::Cloud::Talent::V4::EventService::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_client_event - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::ClientEvent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - client_event = {} - - create_client_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::Talent::V4::EventService::Rest::ServiceStub.stub :transcode_create_client_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_client_event_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_client_event({ parent: parent, client_event: client_event }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_client_event parent: parent, client_event: client_event do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_client_event ::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_client_event({ parent: parent, client_event: client_event }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_client_event(::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_client_event_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::Talent::V4::EventService::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::Talent::V4::EventService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb deleted file mode 100644 index 90ae40a15d96..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/event_service_pb" -require "google/cloud/talent/v4/event_service" - -class ::Google::Cloud::Talent::V4::EventService::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_client_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::ClientEvent.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - client_event = {} - - create_client_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_client_event, name - assert_kind_of ::Google::Cloud::Talent::V4::CreateClientEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::ClientEvent), request["client_event"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_client_event_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_client_event({ parent: parent, client_event: client_event }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_client_event parent: parent, client_event: client_event do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_client_event ::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_client_event({ parent: parent, client_event: client_event }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_client_event(::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_client_event_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::EventService::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::Talent::V4::EventService::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::Talent::V4::EventService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::EventService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb deleted file mode 100644 index 21555365b3e2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_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/talent/v4/job_service_pb" -require "google/cloud/talent/v4/job_service_services_pb" -require "google/cloud/talent/v4/job_service" - -class ::Google::Cloud::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb deleted file mode 100644 index c7a1a286edc7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/job_service" - -class ::Google::Cloud::Talent::V4::JobService::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_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.company_path project: "value0", tenant: "value1", company: "value2" - assert_equal "projects/value0/tenants/value1/companies/value2", path - end - end - - def test_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.job_path project: "value0", tenant: "value1", job: "value2" - assert_equal "projects/value0/tenants/value1/jobs/value2", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb deleted file mode 100644 index f898410562ca..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb +++ /dev/null @@ -1,679 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/talent/v4/job_service_pb" -require "google/cloud/talent/v4/job_service/rest" - - -class ::Google::Cloud::Talent::V4::JobService::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_job - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_job parent: parent, job: job do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_job ::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_count - end - end - end - - def test_batch_create_jobs - # Create test objects. - 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" - jobs = [{}] - - batch_create_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_create_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_create_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_create_jobs({ parent: parent, jobs: jobs }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_create_jobs parent: parent, jobs: jobs do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_create_jobs ::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_create_jobs({ parent: parent, jobs: jobs }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_create_jobs(::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_create_jobs_client_stub.call_count - end - end - end - - def test_get_job - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_job ::Google::Cloud::Talent::V4::GetJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Talent::V4::GetJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_count - end - end - end - - def test_update_job - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_job job: job, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_job ::Google::Cloud::Talent::V4::UpdateJobRequest.new(job: job, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_job({ job: job, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Talent::V4::UpdateJobRequest.new(job: job, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_count - end - end - end - - def test_batch_update_jobs - # Create test objects. - 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" - jobs = [{}] - update_mask = {} - - batch_update_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_update_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_update_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_update_jobs ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_update_jobs(::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_update_jobs_client_stub.call_count - end - end - end - - def test_delete_job - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_count - end - end - end - - def test_batch_delete_jobs - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - names = ["hello world"] - - batch_delete_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_delete_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_delete_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_delete_jobs({ parent: parent, names: names }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_delete_jobs parent: parent, names: names do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_delete_jobs ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_delete_jobs({ parent: parent, names: names }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_delete_jobs(::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_delete_jobs_client_stub.call_count - end - end - end - - def test_list_jobs - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::ListJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - job_view = :JOB_VIEW_UNSPECIFIED - - list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_jobs parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_count - end - end - end - - def test_search_jobs - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::SearchJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - max_page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_search_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_jobs ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_jobs(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_jobs_client_stub.call_count - end - end - end - - def test_search_jobs_for_alert - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::SearchJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - max_page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_search_jobs_for_alert_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_jobs_for_alert_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_jobs_for_alert ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_jobs_for_alert(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_jobs_for_alert_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::Talent::V4::JobService::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::Talent::V4::JobService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb deleted file mode 100644 index d450c7816e63..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb +++ /dev/null @@ -1,798 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/job_service_pb" -require "google/cloud/talent/v4/job_service" - -class ::Google::Cloud::Talent::V4::JobService::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_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_job, name - assert_kind_of ::Google::Cloud::Talent::V4::CreateJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Job), request["job"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_job parent: parent, job: job do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_job ::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_rpc_count - end - end - - def test_batch_create_jobs - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - jobs = [{}] - - batch_create_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::BatchCreateJobsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Talent::V4::Job, request["jobs"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_jobs({ parent: parent, jobs: jobs }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_create_jobs parent: parent, jobs: jobs do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_create_jobs ::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_create_jobs({ parent: parent, jobs: jobs }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_create_jobs(::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_create_jobs_client_stub.call_rpc_count - end - end - - def test_get_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_job, name - assert_kind_of ::Google::Cloud::Talent::V4::GetJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_job ::Google::Cloud::Talent::V4::GetJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Talent::V4::GetJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_rpc_count - end - end - - def test_update_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_job, name - assert_kind_of ::Google::Cloud::Talent::V4::UpdateJobRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Job), request["job"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_job job: job, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_job ::Google::Cloud::Talent::V4::UpdateJobRequest.new(job: job, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_job({ job: job, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Talent::V4::UpdateJobRequest.new(job: job, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_rpc_count - end - end - - def test_batch_update_jobs - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - jobs = [{}] - update_mask = {} - - batch_update_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_update_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Talent::V4::Job, request["jobs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_update_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_update_jobs({ parent: parent, jobs: jobs, 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.batch_update_jobs parent: parent, jobs: jobs, 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.batch_update_jobs ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, 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.batch_update_jobs({ parent: parent, jobs: jobs, 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.batch_update_jobs(::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, 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, batch_update_jobs_client_stub.call_rpc_count - end - end - - def test_delete_job - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_job, name - assert_kind_of ::Google::Cloud::Talent::V4::DeleteJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_rpc_count - end - end - - def test_batch_delete_jobs - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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"] - - batch_delete_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_delete_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["names"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_delete_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_delete_jobs({ parent: parent, names: names }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_delete_jobs parent: parent, names: names do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_delete_jobs ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_delete_jobs({ parent: parent, names: names }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_delete_jobs(::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_delete_jobs_client_stub.call_rpc_count - end - end - - def test_list_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::ListJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - job_view = :JOB_VIEW_UNSPECIFIED - - list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::ListJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_jobs parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_rpc_count - end - end - - def test_search_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::SearchJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - max_page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::SearchJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::RequestMetadata), request["request_metadata"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::JobQuery), request["job_query"] - assert_equal true, request["enable_broadening"] - assert_kind_of ::Google::Cloud::Talent::V4::HistogramQuery, request["histogram_queries"].first - assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] - assert_equal 42, request["offset"] - assert_equal 42, request["max_page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["order_by"] - assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] - assert_equal true, request["disable_keyword_match"] - assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] - assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_jobs ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_jobs(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_jobs_client_stub.call_rpc_count - end - end - - def test_search_jobs_for_alert - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::SearchJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - max_page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_for_alert_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_jobs_for_alert, name - assert_kind_of ::Google::Cloud::Talent::V4::SearchJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::RequestMetadata), request["request_metadata"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::JobQuery), request["job_query"] - assert_equal true, request["enable_broadening"] - assert_kind_of ::Google::Cloud::Talent::V4::HistogramQuery, request["histogram_queries"].first - assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] - assert_equal 42, request["offset"] - assert_equal 42, request["max_page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["order_by"] - assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] - assert_equal true, request["disable_keyword_match"] - assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] - assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_jobs_for_alert_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_jobs_for_alert ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_jobs_for_alert(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_jobs_for_alert_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::JobService::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::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Talent::V4::JobService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb deleted file mode 100644 index 0b082784d6bd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_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/talent/v4/tenant_service" - -class ::Google::Cloud::Talent::V4::TenantService::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::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb deleted file mode 100644 index ea21ef440774..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb +++ /dev/null @@ -1,373 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/talent/v4/tenant_service_pb" -require "google/cloud/talent/v4/tenant_service/rest" - - -class ::Google::Cloud::Talent::V4::TenantService::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_tenant - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - tenant = {} - - create_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_create_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_tenant({ parent: parent, tenant: tenant }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_tenant parent: parent, tenant: tenant do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_tenant ::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_tenant({ parent: parent, tenant: tenant }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_tenant(::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_tenant_client_stub.call_count - end - end - end - - def test_get_tenant - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_get_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_tenant({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_tenant name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_tenant ::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_tenant({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_tenant(::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_tenant_client_stub.call_count - end - end - end - - def test_update_tenant - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - tenant = {} - update_mask = {} - - update_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_update_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_tenant tenant: tenant, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_tenant ::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_tenant({ tenant: tenant, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_tenant(::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_tenant_client_stub.call_count - end - end - end - - def test_delete_tenant - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_delete_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_tenant({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_tenant name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_tenant ::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_tenant({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_tenant(::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_tenant_client_stub.call_count - end - end - end - - def test_list_tenants - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::ListTenantsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_tenants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_list_tenants_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tenants_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_tenants parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_tenants ::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_tenants(::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_tenants_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::Talent::V4::TenantService::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::Talent::V4::TenantService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb deleted file mode 100644 index 9f48a5264f89..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb +++ /dev/null @@ -1,407 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/tenant_service_pb" -require "google/cloud/talent/v4/tenant_service" - -class ::Google::Cloud::Talent::V4::TenantService::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_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Tenant.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - tenant = {} - - create_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4::CreateTenantRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Tenant), request["tenant"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_tenant({ parent: parent, tenant: tenant }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_tenant parent: parent, tenant: tenant do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_tenant ::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_tenant({ parent: parent, tenant: tenant }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_tenant(::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_tenant_client_stub.call_rpc_count - end - end - - def test_get_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Tenant.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4::GetTenantRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_tenant({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_tenant name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_tenant ::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_tenant({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_tenant(::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_tenant_client_stub.call_rpc_count - end - end - - def test_update_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Tenant.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - tenant = {} - update_mask = {} - - update_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4::UpdateTenantRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Tenant), request["tenant"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_tenant tenant: tenant, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_tenant ::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_tenant({ tenant: tenant, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_tenant(::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_tenant_client_stub.call_rpc_count - end - end - - def test_delete_tenant - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4::DeleteTenantRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_tenant({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_tenant name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_tenant ::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_tenant({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_tenant(::Google::Cloud::Talent::V4::DeleteTenantRequest.new(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_tenant_client_stub.call_rpc_count - end - end - - def test_list_tenants - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::ListTenantsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_tenants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tenants, name - assert_kind_of ::Google::Cloud::Talent::V4::ListTenantsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_tenants_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_tenants parent: parent, page_token: page_token, page_size: page_size do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_tenants ::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_tenants(::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_tenants_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :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::Talent::V4::TenantService::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::Talent::V4::TenantService::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::Talent::V4::TenantService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::TenantService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/helper.rb b/owl-bot-staging/google-cloud-talent-v4/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct"